summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/include/stdio.h
blob: 15ed668859429dd04a587afe589d9838385a3b46 (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef _STDIO_H
#define _STDIO_H

#ifndef NULL
#define NULL	0
#endif /* NULL */

#include <sys/types.h>

int printf(const char *format, ...);
int sprintf(char *str, const char *format, ...);
int snprintf(char *str, size_t size, const char *format, ...);

#include <stdarg.h>

int vprintf(const char *format, va_list ap);
int vsprintf(char *str, const char *format, va_list ap);
int vsnprintf(char *str, size_t size, const char *format, va_list ap);
int puts(const char *s);

#if 0
/* start.S based uart console */
#include <calypso/uart.h>
#define putchar(c)	uart_putchar_wait(1, c)
int puts(const char *s);
#endif

#if 0
/* regular UART console */
#include <console.h>
#define putchar(c)	cons_putchar(c)
#define _puts(s)	cons_puts(s)
#define ARCH_HAS_CONSOLE
#endif

#if 1
/* sercomm based console */
#include <comm/sercomm_cons.h>
#define putchar(c)	sercomm_putchar(c)
#define _puts(s)	sercomm_puts(s)
#define ARCH_HAS_CONSOLE
#endif

struct __file {
};

typedef struct __file FILE;

/* non-standard */
extern void phex(unsigned int c, unsigned int len);

#endif /* _STDIO_H */