#ifndef MAC_BF 
#define MAC_BF 1

#define EPERM		1
#define ENOENT		2
#define ENOMEM		12
#define EACCES		13
#define EFAULT		14
#define EBUSY		16
#define EEXIST		17
#define EINVAL		22

#undef feof
#define fread n_fread
#define fwrite n_fwrite
#define fprintf n_fprintf
#define fopen n_fopen
#define fgets n_fets
#define fclose n_fclose
#define feof n_feof
#define fileno n_fileno
#define ftell n_ftell
#define fflush n_fflush
#define fseek n_fseek
#define remove n_remove
#define strerror n_strerror
#define FILE N_FILE

typedef struct __FILE {
	int isbin; short ref; FSSpec fs;
	int islog;
	long at; long f_at; int eof, f_eof,readonly;
	char *bf; int bflen; int bfat; int bfdirty; int length; int f_length;
} FILE;
int fileno(FILE *f);
int flength(FILE *f);
char *strerror(int n);
int fprintf( FILE *f, const char *format,...);
FILE *fopen( const char *filename, char *mode );
int fclose(FILE *f);
size_t fread( void *buffer, size_t size, size_t count, FILE *stream );
size_t fwrite( const void *buffer, size_t size, size_t count, FILE *stream );
char *fgets( char *string, int n, FILE *stream );
int fseek( FILE *stream, long offset, int origin );
long ftell( FILE *stream );
int fflush( FILE *stream );
int feof( FILE *stream );
int remove(const char *path);
#endif