
/*
   Revamped stdio.h, for streamoids
*/

/* files are really pointers to something, but that isn't visible to standard
   code */
#ifndef FILE
#define	FILE	long
#endif
#define	EOF	-1
#define TRUE	1
#define FALSE	0

#ifndef NULL
#define NULL	(void *)0
#endif

/* standard files */
extern FILE * stdin, * stdout, * stderr;

/* and code to hack them */
extern FILE *	fopen	(char * path, char * mode);
extern FILE *	freopen	(char * path, char * mode, FILE * f);
extern FILE *	fdopen	(int handle, char * mode);
extern int	fgetc	(FILE * f);
extern int	fputc	(int ch, FILE * f);
extern char * 	fgets	(char * buf, int nbytes, FILE * f);
extern char *	gets	(char * buf, int nbytes);
extern int	fputs	(char * s, FILE * f);
extern int 	feof	(FILE * f);
extern int	ferror	(FILE * f);
extern int	fileno	(FILE * f);
extern int	fungetc	(int c, FILE * f);
extern int	fread	(char * buf, int how_big, int how_many, FILE * f);
extern int	fwrite	(char * buf, int how_big, int how_many, FILE * f);
extern long	fseek	(FILE * f, long pos, int mode);
extern long 	ftell	(FILE * f);
extern int	fflush	(FILE * f);
extern int	fclose	(FILE * f);
extern int	setbuf	(FILE * f, int bufferedness);
extern int	setbuffer (FILE * f, char * buf, int nbytes);

/* more eunuchs compatibility brain damage... */
#ifndef putc
#define putc	fputc
#endif
#ifndef getc
#define	getc	fgetc
#endif
#ifndef ungetc
#define ungetc	fungetc
#endif
#ifndef putchar
#define putchar(c)	fputc(c, stdout)
#endif
#ifndef getchar
#define getchar()	fgetc(stdin)
#endif

/* this is so unbelievably brain-dead I can't think of an epithet
   that accurately describes it.  No, it has no use at all, other
   than to support eunuchs code that doesn't believe in modularity
   or functional boundaries.  That is, most of it.... */
#define BUFSIZ	512
