Zephyr API Documentation  3.0.0
A Scalable Open Source RTOS
3.0.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 <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
33int __printf_like(1, 2) printf(const char *ZRESTRICT format, ...);
34int __printf_like(3, 4) snprintf(char *ZRESTRICT str, size_t len,
35 const char *ZRESTRICT format, ...);
36int __printf_like(2, 3) sprintf(char *ZRESTRICT str,
37 const char *ZRESTRICT format, ...);
38int __printf_like(2, 3) fprintf(FILE *ZRESTRICT stream,
39 const char *ZRESTRICT format, ...);
40
41
42int __printf_like(1, 0) vprintf(const char *ZRESTRICT format, va_list list);
43int __printf_like(3, 0) vsnprintf(char *ZRESTRICT str, size_t len,
44 const char *ZRESTRICT format,
45 va_list list);
46int __printf_like(2, 0) vsprintf(char *ZRESTRICT str,
47 const char *ZRESTRICT format, va_list list);
48int __printf_like(2, 0) vfprintf(FILE *ZRESTRICT stream,
49 const char *ZRESTRICT format,
50 va_list ap);
51
52int puts(const char *s);
53
54int fputc(int c, FILE *stream);
55int fputs(const char *ZRESTRICT s, FILE *ZRESTRICT stream);
56size_t fwrite(const void *ZRESTRICT ptr, size_t size, size_t nitems,
57 FILE *ZRESTRICT stream);
58static inline int putc(int c, FILE *stream)
59{
60 return fputc(c, stream);
61}
62static inline int putchar(int c)
63{
64 return putc(c, stdout);
65}
66
67#ifdef __cplusplus
68}
69#endif
70
71#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:31
char c
Definition: printk.c:71
void * ptr
Definition: printk.c:79
#define stdout
Definition: stdio.h:30
int vsprintf(char *ZRESTRICT str, const char *ZRESTRICT format, va_list list)
int vprintf(const char *ZRESTRICT format, va_list list)
static int putc(int c, FILE *stream)
Definition: stdio.h:58
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,...)
static int putchar(int c)
Definition: stdio.h:62
int sprintf(char *ZRESTRICT str, const char *ZRESTRICT format,...)
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.