startup.c
35 lines
| 692 B
| text/x-c
|
CLexer
Jeandet Alexis
|
r89 | #include <stdio.h> | ||
#include <stdarg.h> | ||||
#include <streamdevices.h> | ||||
r63 | ||||
Jeandet Alexis
|
r89 | extern streamdevice* __opnfiles__[]; | ||
extern int __real_printf(const char *format,...); | ||||
int __wrap_printf(const char *format,...) | ||||
{ | ||||
char* str_buffer; | ||||
// for(int i =0;i<512;i++)str_buffer[i]='\0'; | ||||
int i; | ||||
va_list ap; | ||||
va_start(ap,format); | ||||
vasprintf(&str_buffer,format,ap); | ||||
va_end(ap); | ||||
i=strlen(str_buffer); | ||||
__opnfiles__[1]->ops->write(__opnfiles__[1],(void*)str_buffer,1,i); | ||||
} | ||||
extern int __real_puts(const char *s); | ||||
int __wrap_puts(const char *s) | ||||
{ | ||||
int i; | ||||
i=strlen(s); | ||||
__opnfiles__[1]->ops->write(__opnfiles__[1],(void*)s,1,i); | ||||
} | ||||
r63 | ||||
int main(void) | ||||
{ | ||||
bsp_init(); | ||||
r71 | libuc_main(); | |||
r63 | } | |||