2016-04-30 15:50:04 +02:00
|
|
|
#include <stdlib.h>
|
2007-10-15 11:42:17 +02:00
|
|
|
#include <stdio.h>
|
2016-05-14 10:56:15 +02:00
|
|
|
#include <conio.h>
|
2016-05-19 14:15:22 +02:00
|
|
|
#include <stdarg.h>
|
2007-10-15 11:42:17 +02:00
|
|
|
|
2016-05-14 10:56:15 +02:00
|
|
|
int printf(const char *format, ...)
|
2016-05-19 14:15:22 +02:00
|
|
|
{
|
|
|
|
va_list arg;
|
|
|
|
va_start(arg, format);
|
|
|
|
|
|
|
|
return vprintf(format, arg);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int vprintf ( const char * format, va_list arg )
|
2007-10-15 11:42:17 +02:00
|
|
|
{
|
2016-05-11 16:53:54 +02:00
|
|
|
int i = 0;
|
2016-05-14 10:56:15 +02:00
|
|
|
int printed_simbols = 0;
|
2007-10-15 11:42:17 +02:00
|
|
|
char *s;
|
|
|
|
|
2016-05-14 10:56:15 +02:00
|
|
|
i=con_init_console_dll();
|
2007-10-15 11:42:17 +02:00
|
|
|
|
2016-05-19 14:15:22 +02:00
|
|
|
if (i == 0)
|
2007-10-15 11:42:17 +02:00
|
|
|
{
|
2016-05-19 14:15:22 +02:00
|
|
|
s = malloc(4096);
|
|
|
|
printed_simbols = format_print(s, 4096, format, arg);
|
2016-05-14 10:56:15 +02:00
|
|
|
con_write_string(s, printed_simbols);
|
2007-10-15 11:42:17 +02:00
|
|
|
free(s);
|
|
|
|
}
|
2016-05-19 14:15:22 +02:00
|
|
|
|
2007-10-15 11:42:17 +02:00
|
|
|
return(printed_simbols);
|
|
|
|
}
|