vxKernel/src/display/text/render/dprint.c

40 lines
730 B
C

#include <vhex/display/text.h>
#include <vhex/display/color.h>
#include <stdarg.h>
#include <stdio.h>
//---
// User-level API
//---
/* dprint() : display formated string */
did_t dprint(int x, int y, int fg, char const * const text, ...)
{
va_list ap;
char buff[1024];
va_start(ap, text);
vsnprintf(buff, 1024, text, ap);
va_end(ap);
return (dtext_opt(x, y, fg, C_NONE, DTEXT_LEFT, DTEXT_TOP, buff, -1));
}
/* dprint_opt(): Display a string of text */
did_t dprint_opt(
int x, int y,
int fg, int bg,
int halign, int valign,
char const *text, ...
) {
va_list ap;
char buff[1024];
va_start(ap, text);
vsnprintf(buff, 1024, text, ap);
va_end(ap);
return (dtext_opt(x, y, fg, bg, halign, valign, buff, -1));
}