summaryrefslogtreecommitdiff
path: root/firmware/libc/include/stdio.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/libc/include/stdio.h')
-rw-r--r--firmware/libc/include/stdio.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/firmware/libc/include/stdio.h b/firmware/libc/include/stdio.h
new file mode 100644
index 0000000000..d9a6dce55f
--- /dev/null
+++ b/firmware/libc/include/stdio.h
@@ -0,0 +1,60 @@
1#ifndef _STDIO_H_
2#define _STDIO_H_
3
4#include <_ansi.h>
5
6#define __need_size_t
7#include <stddef.h>
8
9#define __need___va_list
10#include <stdarg.h>
11
12#ifndef NULL
13#define NULL 0
14#endif
15
16#define EOF (-1)
17
18#ifndef SEEK_SET
19#define SEEK_SET 0 /* set file offset to offset */
20#endif
21#ifndef SEEK_CUR
22#define SEEK_CUR 1 /* set file offset to current plus offset */
23#endif
24#ifndef SEEK_END
25#define SEEK_END 2 /* set file offset to EOF plus offset */
26#endif
27
28#define TMP_MAX 26
29
30#ifdef __GNUC__
31#define __VALIST __gnuc_va_list
32#else
33#define __VALIST char*
34#endif
35
36int vsnprintf (char *buf, size_t size, const char *fmt, __VALIST ap);
37
38int sprintf (char *buf, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
39
40int snprintf (char *buf, size_t size, const char *fmt, ...)
41 ATTRIBUTE_PRINTF(3, 4);
42
43/* callback function is called for every output character (byte) with userp and
44 * should return 0 when ch is a char other than '\0' that should stop printing */
45int vuprintf(int (*push)(void *userp, unsigned char data),
46 void *userp, const char *fmt, __VALIST ap);
47
48int sscanf(const char *s, const char *fmt, ...)
49 ATTRIBUTE_SCANF(2, 3);
50
51#ifdef SIMULATOR
52typedef void FILE;
53int vfprintf(FILE *stream, const char *format, __VALIST ap);
54#ifdef WIN32
55#define FILENAME_MAX 260 /* ugly hard-coded value of a limit that is set
56 in file.h */
57#endif
58#endif
59
60#endif /* _STDIO_H_ */