vxBoot/src/terminal/write.c

30 lines
575 B
C

#include "vxBoot/terminal.h"
#include <gint/display.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
/* terminal_write() - printf wrapper for the terminal device */
int terminal_write(const char *format, ...)
{
char buffer[1024];
va_list ap;
int nb;
/* process the format */
va_start(ap, format);
nb = vsnprintf(buffer, 1024, format, ap);
va_end(ap);
/* update the internal buffer */
terminal_buffer_insert(buffer, nb);
/* display the internal buffer */
dclear(terminal.private.color.bg);
terminal_buffer_display();
dupdate();
return (nb);
}