#include <stdarg.h>
#include <stddef.h> // size_t
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* === Types === */
typedef struct sFILE FILE;
#define fopen acess_fopen
#define fdopen acess_fdopen
#define freopen acess_freopen
+#define fmemopen acess_fmemopen
+#define open_memstream acess_open_memstream
#define fdopen acess_fdopen
#define fclose acess_fclose
#define ftell acess_ftell
#define getchar acess_getchar
#define putchar acess_putchar
+#define rename acess_rename
+
#define fprintf acess_fprintf
#define vfprintf acess_vfprintf
extern FILE *fopen(const char *file, const char *mode);
extern FILE *freopen(const char *file, const char *mode, FILE *fp);
+extern FILE *fmemopen(void *buffer, size_t length, const char *mode);
+extern FILE *open_memstream(char **bufferptr, size_t *lengthptr);
extern FILE *fdopen(int fd, const char *modes);
+extern FILE *tmpfile(void);
extern int fclose(FILE *fp);
-extern void fflush(FILE *fp);
+extern int fflush(FILE *fp);
extern off_t ftell(FILE *fp);
+extern off_t ftello(FILE *fp);
extern int fseek(FILE *fp, long int amt, int whence);
+extern int fseeko(FILE *fp, off_t amt, int whence);
extern void clearerr(FILE *stream);
extern int feof(FILE *stream);
extern int ferror(FILE *stream);
extern size_t fwrite(const void *buf, size_t size, size_t n, FILE *fp);
extern int fgetc(FILE *fp);
#define getc(fp) fgetc(fp)
+extern int ungetc(int c, 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 fprintf(FILE *fp, const char *format, ...);
extern int vfprintf(FILE *fp, const char *format, va_list args);
+extern int rename(const char *oldpath, const char *newpath);
+
// scanf
extern int scanf(const char *format, ...);
extern int fscanf(FILE *stream, const char *format, ...);
extern FILE *stdout;
extern FILE *stderr;
+#if __cplusplus
+}
+#endif
+
#endif