-#ifndef ROS_INC_STDIO_H
-#define ROS_INC_STDIO_H
+#pragma once
+#include <ros/common.h>
#include <stdarg.h>
+#include <kdebug.h>
#ifndef NULL
#define NULL ((void *) 0)
#endif /* !NULL */
+//#define DEBUG
#ifdef DEBUG
#define printd(args...) cprintf(args)
#else
#endif
#define printk(args...) cprintf(args)
+#define __I_AM_HERE_GUTS "Core %d is in %s() at %s:%d\n", core_id(), \
+ __func__, __FILE__, __LINE__
+
+#define I_AM_HERE printk(__I_AM_HERE_GUTS)
+#define I_AM_HERE_x printx(__I_AM_HERE_GUTS)
+#define I_AM_HERE_t trace_printk(__I_AM_HERE_GUTS)
+#define I_AM_HERE_tx trace_printx(__I_AM_HERE_GUTS)
// lib/stdio.c
void cputchar(int c);
-void cputbuf(const char*COUNT(len) buf, int len);
+void cputbuf(const char *buf, int len);
int getchar(void);
int iscons(int fd);
// lib/printfmt.c
-#ifdef __DEPUTY__
-void printfmt(void (*putch)(int, TV(t)), TV(t) putdat, const char *NTS fmt, ...);
-void vprintfmt(void (*putch)(int, TV(t)), TV(t) putdat, const char *NTS fmt, va_list);
-#else
-void printfmt(void (*putch)(int, void**), void **putdat, const char *NTS fmt, ...);
-void vprintfmt(void (*putch)(int, void**), void **putdat, const char *NTS fmt, va_list);
-#endif
+void printfmt(void (*putch)(int, void**), void **putdat, const char *fmt, ...);
+void vprintfmt(void (*putch)(int, void**), void **putdat, const char *fmt, va_list);
// lib/printf.c
-int cprintf(const char * NTS fmt, ...);
-int vcprintf(const char * NTS fmt, va_list);
+void print_lock(void);
+void print_unlock(void);
+void print_unlock_force(void);
+int ( cprintf)(const char *fmt, ...);
+int vcprintf(const char *fmt, va_list);
// lib/sprintf.c
-int snprintf(char *COUNT(size) str, int size, const char *NTS fmt, ...);
-int vsnprintf(char *COUNT(size) str, int size, const char *NTS fmt, va_list);
+
+static inline bool snprintf_error(int ret, size_t buf_len)
+{
+ return ret < 0 || ret >= buf_len;
+}
+
+int snprintf(char *str, size_t size, const char *fmt, ...);
+int vsnprintf(char *str, size_t size, const char *fmt, va_list);
// lib/fprintf.c
-int printf(const char *NTS fmt, ...);
-int fprintf(int fd, const char *NTS fmt, ...);
-int vfprintf(int fd, const char *NTS fmt, va_list);
+int printf(const char *fmt, ...);
+int fprintf(int fd, const char *fmt, ...);
+int vfprintf(int fd, const char *fmt, va_list);
// lib/readline.c
-char *NTS readline(const char *NTS prompt);
+int readline(char *buf, size_t buf_l, const char *prompt, ...);
+
+char *seprintf(char *buf, char *end, const char *fmt, ...);
+
+// kern/src/net/eipconv.c
+void printemac(void (*putch)(int, void**), void **putdat, uint8_t *mac);
+void printip(void (*putch)(int, void**), void **putdat, uint8_t *ip);
+void printipmask(void (*putch)(int, void**), void **putdat, uint8_t *ip);
+void printipv4(void (*putch)(int, void**), void **putdat, uint8_t *ip);
+
+/* #K */
+void trace_printk(const char *fmt, ...);
-#endif /* !ROS_INC_STDIO_H */
+/* vsprintf.c (linux) */
+int vsscanf(const char *buf, const char *fmt, va_list args);
+int sscanf(const char *buf, const char *fmt, ...);