diff options
Diffstat (limited to 'pintos-progos/lib/stdio.h')
| -rw-r--r-- | pintos-progos/lib/stdio.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/pintos-progos/lib/stdio.h b/pintos-progos/lib/stdio.h new file mode 100644 index 0000000..2739c0a --- /dev/null +++ b/pintos-progos/lib/stdio.h | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | #ifndef __LIB_STDIO_H | ||
| 2 | #define __LIB_STDIO_H | ||
| 3 | |||
| 4 | #include <debug.h> | ||
| 5 | #include <stdarg.h> | ||
| 6 | #include <stdbool.h> | ||
| 7 | #include <stddef.h> | ||
| 8 | #include <stdint.h> | ||
| 9 | |||
| 10 | /* Include lib/user/stdio.h or lib/kernel/stdio.h, as | ||
| 11 | appropriate. */ | ||
| 12 | #include_next <stdio.h> | ||
| 13 | |||
| 14 | /* Predefined file handles. */ | ||
| 15 | #define STDIN_FILENO 0 | ||
| 16 | #define STDOUT_FILENO 1 | ||
| 17 | |||
| 18 | /* Standard functions. */ | ||
| 19 | int printf (const char *, ...) PRINTF_FORMAT (1, 2); | ||
| 20 | int snprintf (char *, size_t, const char *, ...) PRINTF_FORMAT (3, 4); | ||
| 21 | int vprintf (const char *, va_list) PRINTF_FORMAT (1, 0); | ||
| 22 | int vsnprintf (char *, size_t, const char *, va_list) PRINTF_FORMAT (3, 0); | ||
| 23 | int putchar (int); | ||
| 24 | int puts (const char *); | ||
| 25 | |||
| 26 | /* Nonstandard functions. */ | ||
| 27 | void hex_dump (uintptr_t ofs, const void *, size_t size, bool ascii); | ||
| 28 | void print_human_readable_size (uint64_t sz); | ||
| 29 | |||
| 30 | /* Internal functions. */ | ||
| 31 | void __vprintf (const char *format, va_list args, | ||
| 32 | void (*output) (char, void *), void *aux); | ||
| 33 | void __printf (const char *format, | ||
| 34 | void (*output) (char, void *), void *aux, ...); | ||
| 35 | |||
| 36 | /* Try to be helpful. */ | ||
| 37 | #define sprintf dont_use_sprintf_use_snprintf | ||
| 38 | #define vsprintf dont_use_vsprintf_use_vsnprintf | ||
| 39 | |||
| 40 | #endif /* lib/stdio.h */ | ||
