#define __LIB_STDIO_H
#include <debug.h>
+#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
-#include <stdarg.h>
+#include <stdint.h>
+
+/* 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,