2 pcboot - bootable PC demo/game kernel
3 Copyright (C) 2018-2019 John Tsiombikas <nuclear@member.fsf.org>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY, without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>.
24 typedef struct FILE FILE;
32 #define stdin ((FILE*)0)
33 #define stdout ((FILE*)1)
34 #define stderr ((FILE*)2)
37 int puts(const char *s);
39 int printf(const char *fmt, ...);
40 int vprintf(const char *fmt, va_list ap);
42 int sprintf(char *buf, const char *fmt, ...);
43 int vsprintf(char *buf, const char *fmt, va_list ap);
45 int snprintf(char *buf, size_t sz, const char *fmt, ...);
46 int vsnprintf(char *buf, size_t sz, const char *fmt, va_list ap);
49 int fprintf(FILE *fp, const char *fmt, ...);
50 int vfprintf(FILE *fp, const char *fmt, va_list ap);
53 int fscanf(FILE *fp, const char *fmt, ...);
54 int vfscanf(FILE *fp, const char *fmt, va_list ap);
56 int sscanf(const char *str, const char *fmt, ...);
57 int vsscanf(const char *ptr, const char *fmt, va_list ap);
60 /* printf to the serial port */
61 int ser_printf(const char *fmt, ...);
62 int ser_vprintf(const char *fmt, va_list ap);
64 void perror(const char *s);
68 FILE *fopen(const char *path, const char *mode);
71 long filesize(FILE *fp);
72 int fseek(FILE *fp, long offset, int from);
73 void rewind(FILE *fp);
76 size_t fread(void *buf, size_t size, size_t count, FILE *fp);
77 size_t fwrite(const void *buf, size_t size, size_t count, FILE *fp);
80 char *fgets(char *buf, int size, FILE *fp);
82 int fputc(int c, FILE *fp);
88 void clearerr(FILE *fp);