int xmon_fputs(char *str, void *f) { int n = strlen(str); return xmon_write(f, str, n) == n? 0: -1; }
int xmon_putchar(int c) { char ch = c; if (c == '\n') xmon_putchar('\r'); return xmon_write(&ch, 1) == 1? c: -1; }
int xmon_putc(int c, void *f) { char ch = c; if (c == '\n') xmon_putc('\r', f); return xmon_write(f, &ch, 1) == 1? c: -1; }
void xmon_printf(const char *format, ...) { va_list args; int n; static char xmon_outbuf[1024]; va_start(args, format); n = vsnprintf(xmon_outbuf, sizeof(xmon_outbuf), format, args); va_end(args); xmon_write(xmon_outbuf, n); }
void xmon_printf(const char *format, ...) { va_list args; static char xmon_outbuf[1024]; int rc, n; va_start(args, format); n = vsnprintf(xmon_outbuf, sizeof(xmon_outbuf), format, args); va_end(args); rc = xmon_write(xmon_outbuf, n); if (n && rc == 0) { /* No udbg hooks, fallback to printk() - dangerous */ printk("%s", xmon_outbuf); } }
void xmon_puts(const char *str) { xmon_write(str, strlen(str)); }