Revise makefile structure.
[pintos-anon] / src / lib / stdio.h
1 #ifndef __LIB_STDIO_H
2 #define __LIB_STDIO_H
3
4 #include <debug.h>
5 #include <stdbool.h>
6 #include <stddef.h>
7 #include <stdarg.h>
8
9 /* Predefined file handles. */
10 #define STDIN_FILENO 0
11 #define STDOUT_FILENO 1
12
13 /* Standard functions. */
14 int printf (const char *, ...) PRINTF_FORMAT (1, 2);
15 int snprintf (char *, size_t, const char *, ...) PRINTF_FORMAT (3, 4);
16 int vprintf (const char *, va_list) PRINTF_FORMAT (1, 0);
17 int vsnprintf (char *, size_t, const char *, va_list) PRINTF_FORMAT (3, 0);
18 int putchar (int);
19 int puts (const char *);
20
21 /* Nonstandard functions. */
22 #ifndef KERNEL
23 int hprintf (int, const char *, ...) PRINTF_FORMAT (2, 3);
24 int vhprintf (int, const char *, va_list) PRINTF_FORMAT (2, 0);
25 #endif
26 void hex_dump (const void *, size_t size, bool ascii);
27
28 /* Internal functions. */
29 void __vprintf (const char *format, va_list args,
30                 void (*output) (char, void *), void *aux);
31 void __printf (const char *format,
32                void (*output) (char, void *), void *aux, ...);
33
34 /* Try to be helpful. */
35 #define sprintf dont_use_sprintf_use_snprintf
36 #define vsprintf dont_use_vsprintf_use_vsnprintf
37
38 #endif /* lib/stdio.h */