#ifndef __STDIO_H
#define __STDIO_H
-#include <stdlib.h>
+#include <sys/types.h>
#include <stdarg.h>
+#include <stddef.h> // size_t
/* === Types === */
typedef struct sFILE FILE;
#define EOF (-1)
#define BUFSIZ 1024
+#ifndef SEEK_CUR
+#define SEEK_CUR 0
+#define SEEK_SET 1
+#define SEEK_END (-1)
+#endif
+
/* --- Standard IO --- */
extern int printf(const char *format, ...);
extern int vsnprintf(char *buf, size_t __maxlen, const char *format, va_list args);
extern int fileno(FILE *stream);
extern size_t fread(void *buf, size_t size, size_t n, FILE *fp);
-extern size_t fwrite(void *buf, size_t size, size_t n, FILE *fp);
+extern size_t fwrite(const void *buf, size_t size, size_t n, FILE *fp);
extern int fgetc(FILE *fp);
+extern char *fgets(char *s, int size, FILE *fp);
extern int fputc(int ch, FILE *fp);
+extern int fputs(const char *s, FILE *fp);
extern int getchar(void);
extern int putchar(int ch);