aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/include/stdio.h
blob: 8aaf4c78302fbea78e2d886ff00deb48605762d0 (plain) (blame)
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
#ifndef _STDIO_H
#define _STDIO_H

#include <stdarg.h>

// BIOS seek modes
#ifndef SEEK_SET
#define SEEK_SET	0
#endif
#ifndef SEEK_CUR
#define SEEK_CUR	1
#endif
#ifndef SEEK_END
#define SEEK_END	2		/* warning: reportedly buggy */
#endif

#ifdef __cplusplus
extern "C" {
#endif

// The following functions use the BIOS
extern void printf (const char *__format, ...);

extern int getc(int __fd);
extern int putc(int __char, int __fd);

#define fputc(__char, __fd) 	putc(__char, __fd)
#define fgetc(__char, __fd) 	getc(__char, __fd)

// Console TTY
extern void gets(char *__s);
extern void puts(const char *__s);
extern int getchar(void);
extern void putchar(int __c);

// The following functions do not use the BIOS
int vsnprintf(char *string, unsigned int size, const char *fmt, va_list ap);
int vsprintf(char *string, const char *fmt, va_list ap);
int sprintf(char *string, const char *fmt, ...);
int snprintf(char *string, unsigned int size, const char *fmt, ...);

int vsscanf(const char *str, const char *format, va_list ap);
int sscanf(const char *str, const char *fmt, ...);

#ifdef __cplusplus
}
#endif

#endif	// _STDIO_H