16hprintf (
int handle,
const char *format, ...)
22 retval =
vhprintf (handle, format, args);
82 if (aux->
p >= aux->
buf +
sizeof aux->
buf)
91 if (aux->
p > aux->
buf)
int vprintf(const char *format, va_list args)
The standard vprintf() function, which is like printf() but uses a va_list.
int puts(const char *s)
Writes string S to the console, followed by a new-line character.
int putchar(int c)
Writes C to the vga display and serial port.
void __vprintf(const char *format, va_list args, void(*output)(char, void *), void *aux)
Internal functions.
int write(int fd, const void *buffer, unsigned size)
static uint8_t s[256]
RC4-based pseudo-random number generator (PRNG).
#define va_start(LIST, ARG)
__builtin_va_list va_list
GCC has <stdarg.h> functionality as built-ins, so all we need is to use it.
size_t strlen(const char *string)
Returns the length of STRING.
Auxiliary data for vhprintf_helper().
char buf[64]
Character buffer.
int char_cnt
Total characters written so far.
int handle
Output file handle.
char * p
Current position in buffer.
int vhprintf(int handle, const char *format, va_list args)
Formats the printf() format specification FORMAT with arguments given in ARGS and writes the output t...
static void flush(struct vhprintf_aux *)
Flushes the buffer in AUX.
static void add_char(char, void *)
Adds C to the buffer in AUX, flushing it if the buffer fills up.
int hprintf(int handle, const char *format,...)
Like printf(), but writes output to the given HANDLE.