File: printf.c

package info (click to toggle)
emile 0.10-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,716 kB
  • ctags: 2,737
  • sloc: ansic: 18,908; makefile: 726; asm: 622; sh: 2
file content (28 lines) | stat: -rw-r--r-- 423 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 *
 * (c) 2004,2005 Laurent Vivier <LaurentVivier@wanadoo.fr>
 *
 */

#include <stdarg.h>
#include <stdio.h>

extern void console_putstring(const char *s);

static char __printf_buffer[2048];

int
printf(const char * format, ...)
{
	va_list				args;
	int					len;

	va_start(args, format);
	len = vsprintf(__printf_buffer, format, args);
	va_end(args);

	if (len)
		console_putstring(__printf_buffer);

	return len;		
}