void console_printf(const char *fmt, ...) { va_list ap; va_start(ap, fmt); console_vprintf(fmt, ap); va_end(ap); }
void console_message(enum console_type t, const char *s, ...) { va_list args; glue_call(console, color, COLOR_GREY); glue_call(console, putc, '['); switch (t) { case T_INF: glue_call(console, color, COLOR_BLUE); console_puts("IF"); break; case T_ERR: glue_call(console, color, COLOR_RED); console_puts("KO"); break; case T_OK: glue_call(console, color, COLOR_GREEN); console_puts("OK"); break; } glue_call(console, color, COLOR_GREY); glue_call(console, putc, ']'); glue_call(console, putc, ' '); va_start(args, s); console_vprintf(s, args); va_end(args); glue_call(console, putc, '\n'); }
void panic (const char *msg, ...) { va_list ap; va_start (ap, msg); console_puts (syscon, "\033[0;31mpanic: "); console_vprintf (syscon, msg, ap); console_putchar (syscon, '\n'); }
/** Output a formatted message to a console. * @param console Console to print to. * @param fmt Format string used to create the message. * @param ... Arguments to substitute into format. * @return Number of characters printed. */ int console_printf(console_t *console, const char *fmt, ...) { va_list args; int ret; va_start(args, fmt); ret = console_vprintf(console, fmt, args); va_end(args); return ret; }
void console_printf(const char *s, ...) { va_list args; va_start(args, s); console_vprintf(s, args); va_end(args); }
void console_printf(const char *fmt, ...) { va_list args; char buf[24]; int len; /* Prefix each line with a timestamp. */ if (!console_is_midline) { len = snprintf(buf, sizeof(buf), "%lu:", (unsigned long)os_time_get()); console_write(buf, len); } va_start(args, fmt); len = console_vprintf(fmt, args); va_end(args); }
void app_printf(int colorid, const char* format, ...) { int color; if (colorid < 0) { color = 0x0700; } else { static const uint8_t col[] = { 0x0E, 0x0F, 0x0C, 0x0A, 0x09 }; color = col[colorid % sizeof(col)] << 8; } va_list val; va_start(val, format); cursorpos = console_vprintf(cursorpos, color, format, val); va_end(val); if (CROW(cursorpos) >= 23) { cursorpos = CPOS(0, 0); } }