Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
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 <bits/restrict.h>
15#include <stddef.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21#if !defined(__FILE_defined)
22#define __FILE_defined
23typedef int FILE;
24#endif
25
26#if !defined(EOF)
27#define EOF (-1)
28#endif
29
30#define stdin ((FILE *) 1)
31#define stdout ((FILE *) 2)
32#define stderr ((FILE *) 3)
33
34int __printf_like(1, 2) printf(const char *_MLIBC_RESTRICT format, ...);
35int __printf_like(3, 4) snprintf(char *_MLIBC_RESTRICT str, size_t len,
36 const char *_MLIBC_RESTRICT format, ...);
37int __printf_like(2, 3) sprintf(char *_MLIBC_RESTRICT str,
38 const char *_MLIBC_RESTRICT format, ...);
39int __printf_like(2, 3) fprintf(FILE * _MLIBC_RESTRICT stream,
40 const char *_MLIBC_RESTRICT format, ...);
41
42
43int __printf_like(1, 0) vprintf(const char *_MLIBC_RESTRICT format, va_list list);
44int __printf_like(3, 0) vsnprintf(char *_MLIBC_RESTRICT str, size_t len,
45 const char *_MLIBC_RESTRICT format,
46 va_list list);
47int __printf_like(2, 0) vsprintf(char *_MLIBC_RESTRICT str,
48 const char *_MLIBC_RESTRICT format, va_list list);
49int __printf_like(2, 0) vfprintf(FILE * _MLIBC_RESTRICT stream,
50 const char *_MLIBC_RESTRICT format,
51 va_list ap);
52
53int puts(const char *s);
54
55int fputc(int c, FILE *stream);
56int fputs(const char *_MLIBC_RESTRICT s, FILE *_MLIBC_RESTRICT stream);
57size_t fwrite(const void *_MLIBC_RESTRICT ptr, size_t size, size_t nitems,
58 FILE *_MLIBC_RESTRICT stream);
59static inline int putc(int c, FILE *stream)
60{
61 return fputc(c, stream);
62}
63static inline int putchar(int c)
64{
65 return putc(c, stdout);
66}
67
68#ifdef __cplusplus
69}
70#endif
71
72#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
char c
Definition: printk.c:71
void * ptr
Definition: printk.c:79
_MLIBC_RESTRICT definition
#define stdout
Definition: stdio.h:31
int fputs(const char *_MLIBC_RESTRICT s, FILE *_MLIBC_RESTRICT stream)
int vsnprintf(char *_MLIBC_RESTRICT str, size_t len, const char *_MLIBC_RESTRICT format, va_list list)
int vsprintf(char *_MLIBC_RESTRICT str, const char *_MLIBC_RESTRICT format, va_list list)
static int putc(int c, FILE *stream)
Definition: stdio.h:59
int snprintf(char *_MLIBC_RESTRICT str, size_t len, const char *_MLIBC_RESTRICT format,...)
static int putchar(int c)
Definition: stdio.h:63
int fputc(int c, FILE *stream)
int FILE
Definition: stdio.h:23
int puts(const char *s)
int fprintf(FILE *_MLIBC_RESTRICT stream, const char *_MLIBC_RESTRICT format,...)
int vfprintf(FILE *_MLIBC_RESTRICT stream, const char *_MLIBC_RESTRICT format, va_list ap)
int sprintf(char *_MLIBC_RESTRICT str, const char *_MLIBC_RESTRICT format,...)
int printf(const char *_MLIBC_RESTRICT format,...)
int vprintf(const char *_MLIBC_RESTRICT format, va_list list)
size_t fwrite(const void *_MLIBC_RESTRICT ptr, size_t size, size_t nitems, FILE *_MLIBC_RESTRICT stream)
Macros to abstract toolchain specific capabilities.