Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
stdio.h
Go to the documentation of this file.
1/* stdio.h */
2
3/*
4 * Copyright (c) 2014 Wind River Systems, Inc.
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8
9#ifndef ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_STDIO_H_
10#define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_STDIO_H_
11
12#include <zephyr/toolchain.h>
13#include <stdarg.h> /* Needed to get definition of va_list */
14#include <stddef.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#if !defined(__FILE_defined)
21#define __FILE_defined
22typedef int FILE;
23#endif
24
25#if !defined(EOF)
26#define EOF (-1)
27#endif
28
29#define stdin ((FILE *) 1)
30#define stdout ((FILE *) 2)
31#define stderr ((FILE *) 3)
32
33#define SEEK_SET 0 /* Seek from beginning of file. */
34#define SEEK_CUR 1 /* Seek from current position. */
35#define SEEK_END 2 /* Seek from end of file. */
36
37int __printf_like(1, 2) printf(const char *ZRESTRICT format, ...);
38int __printf_like(3, 4) snprintf(char *ZRESTRICT str, size_t len,
39 const char *ZRESTRICT format, ...);
40int __printf_like(2, 3) sprintf(char *ZRESTRICT str,
41 const char *ZRESTRICT format, ...);
42int __printf_like(2, 3) fprintf(FILE *ZRESTRICT stream,
43 const char *ZRESTRICT format, ...);
44
45
46int __printf_like(1, 0) vprintf(const char *ZRESTRICT format, va_list list);
47int __printf_like(3, 0) vsnprintf(char *ZRESTRICT str, size_t len,
48 const char *ZRESTRICT format,
49 va_list list);
50int __printf_like(2, 0) vsprintf(char *ZRESTRICT str,
51 const char *ZRESTRICT format, va_list list);
52int __printf_like(2, 0) vfprintf(FILE *ZRESTRICT stream,
53 const char *ZRESTRICT format,
54 va_list ap);
55
56void perror(const char *s);
57int puts(const char *s);
58
59int fputc(int c, FILE *stream);
60int fputs(const char *ZRESTRICT s, FILE *ZRESTRICT stream);
61size_t fwrite(const void *ZRESTRICT ptr, size_t size, size_t nitems,
62 FILE *ZRESTRICT stream);
63#define putc(c, stream) fputc(c, stream)
64#define putchar(c) putc(c, stdout)
65
66#ifdef __cplusplus
67}
68#endif
69
70#endif /* ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_STDIO_H_ */
irp nz macro MOVR cc s mov cc s endm endr irp aw macro LDR aa s
Definition asm-macro-32-bit-gnu.h:17
#define ZRESTRICT
Definition common.h:36
char c
Definition printk.c:169
void * ptr
Definition printk.c:177
int vsprintf(char *ZRESTRICT str, const char *ZRESTRICT format, va_list list)
int vprintf(const char *ZRESTRICT format, va_list list)
size_t fwrite(const void *ZRESTRICT ptr, size_t size, size_t nitems, FILE *ZRESTRICT stream)
int vsnprintf(char *ZRESTRICT str, size_t len, const char *ZRESTRICT format, va_list list)
int printf(const char *ZRESTRICT format,...)
int snprintf(char *ZRESTRICT str, size_t len, const char *ZRESTRICT format,...)
int sprintf(char *ZRESTRICT str, const char *ZRESTRICT format,...)
void perror(const char *s)
int fputs(const char *ZRESTRICT s, FILE *ZRESTRICT stream)
int vfprintf(FILE *ZRESTRICT stream, const char *ZRESTRICT format, va_list ap)
int fputc(int c, FILE *stream)
int FILE
Definition stdio.h:22
int puts(const char *s)
int fprintf(FILE *ZRESTRICT stream, const char *ZRESTRICT format,...)
Macros to abstract toolchain specific capabilities.