X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flib%2Fstdio.h;h=31be6d8353df7df90e3bde34c6860d1c6c24ad1b;hb=f2e18d716109879cefc489049a0d8bef072bdd40;hp=4609fb3be1e1cca30ebb13498c5c62cc78ae428e;hpb=6916b246f3be8c72d6e77fd98c4a1447fd2c1de7;p=pintos-anon diff --git a/src/lib/stdio.h b/src/lib/stdio.h index 4609fb3..31be6d8 100644 --- a/src/lib/stdio.h +++ b/src/lib/stdio.h @@ -2,20 +2,32 @@ #define __LIB_STDIO_H #include +#include #include #include -#include +#include + +/* Predefined file handles. */ +#define STDIN_FILENO 0 +#define STDOUT_FILENO 1 /* Standard functions. */ -int vsnprintf (char *, size_t, const char *, va_list) PRINTF_FORMAT (3, 0); +int printf (const char *, ...) PRINTF_FORMAT (1, 2); int snprintf (char *, size_t, const char *, ...) PRINTF_FORMAT (3, 4); int vprintf (const char *, va_list) PRINTF_FORMAT (1, 0); -int printf (const char *, ...) PRINTF_FORMAT (1, 2); +int vsnprintf (char *, size_t, const char *, va_list) PRINTF_FORMAT (3, 0); int putchar (int); int puts (const char *); /* Nonstandard functions. */ -void hex_dump (const void *, size_t size, bool ascii); +#ifdef KERNEL +void putbuf (const char *, size_t); +#endif +#ifdef USER +int hprintf (int, const char *, ...) PRINTF_FORMAT (2, 3); +int vhprintf (int, const char *, va_list) PRINTF_FORMAT (2, 0); +#endif +void hex_dump (uintptr_t ofs, const void *, size_t size, bool ascii); /* Internal functions. */ void __vprintf (const char *format, va_list args,