int printf(const char *fmt, ...) { // We're supposed to return the number of chars printed, but we might not // have that information (if we only use the p_syscall method), so in that // case we just return 0 (indicating success). int chars_printed = 0; if (printf_config.screen_output) { // This invokes the built-in printf function exported by NETXFER on the Evo T30. // The first two arguments mean "printf", since p_syscall also provides // other functions. NOTE: If you are porting this code to another // platform, you will probably need to disable this call. (*p_syscall)(1, 1, fmt, (&fmt)+1, NULL); } if (printf_config.serial_output) { // Output to the serial port. chars_printed = general_printf(&serial_gprintf_callback, NULL, fmt, (const int *)(&fmt + 1)); } return chars_printed; }
int sprintf(char *s, char const *control, ...) { int n = general_printf(fill_string, &s, control, (int *)(&control+1)); *s = 0; return n; }
void vfprintf(void * dummy, char const * fmt, void * ap) { (void) general_printf(kprintf_helper, NULL, fmt, ap); }
/* RTS-DEBUG */ void fprintf(void * dummy, char const * fmt, ...) { (void) general_printf(kprintf_helper, NULL, fmt, (int *)(&fmt + 1)); }