]> Git Repo - u-boot.git/blame - include/stdio.h
arm: mach-k3: am62ax: Fix typo in ROM data macro name
[u-boot.git] / include / stdio.h
CommitLineData
7fea7b1a
MY
1#ifndef __STDIO_H
2#define __STDIO_H
3
4#include <stdarg.h>
5#include <linux/compiler.h>
6
7/* stdin */
c670aeee 8int getchar(void);
7fea7b1a
MY
9int tstc(void);
10
11/* stdout */
12#if !defined(CONFIG_SPL_BUILD) || \
2a736066 13 (defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_SERIAL)) || \
7fea7b1a 14 (defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) && \
2a736066 15 defined(CONFIG_SPL_SERIAL))
7fea7b1a
MY
16void putc(const char c);
17void puts(const char *s);
974f4836
T
18#ifdef CONFIG_CONSOLE_FLUSH_SUPPORT
19void flush(void);
20#else
21static inline void flush(void) {}
22#endif
7fea7b1a
MY
23int __printf(1, 2) printf(const char *fmt, ...);
24int vprintf(const char *fmt, va_list args);
25#else
26static inline void putc(const char c)
27{
28}
29
30static inline void puts(const char *s)
31{
32}
33
974f4836
T
34static inline void flush(void)
35{
36}
37
7fea7b1a
MY
38static inline int __printf(1, 2) printf(const char *fmt, ...)
39{
40 return 0;
41}
42
43static inline int vprintf(const char *fmt, va_list args)
44{
45 return 0;
46}
47#endif
48
49/*
50 * FILE based functions (can only be used AFTER relocation!)
51 */
52#define stdin 0
53#define stdout 1
54#define stderr 2
55#define MAX_FILES 3
56
57/* stderr */
58#define eputc(c) fputc(stderr, c)
59#define eputs(s) fputs(stderr, s)
974f4836 60#define eflush() fflush(stderr)
7fea7b1a
MY
61#define eprintf(fmt, args...) fprintf(stderr, fmt, ##args)
62
63int __printf(2, 3) fprintf(int file, const char *fmt, ...);
64void fputs(int file, const char *s);
65void fputc(int file, const char c);
974f4836
T
66#ifdef CONFIG_CONSOLE_FLUSH_SUPPORT
67void fflush(int file);
68#else
69static inline void fflush(int file) {}
70#endif
7fea7b1a
MY
71int ftstc(int file);
72int fgetc(int file);
73
74#endif /* __STDIO_H */
This page took 0.26624 seconds and 4 git commands to generate.