#ifndef _FILE_H #define _FILE_H #include /* FILE */ #include /* struct stat */ /* file data structure */ typedef struct { char *filename; /* filename */ FILE *fp; /* file pointer */ BOOL newfile; /* newfile flag */ struct stat buf; /* status buffer */ } File; /* function prototypes */ File *stat_file(const char *filename); void open_file(File *file); void close_file(File *file); void file_error(const File *file, const char *text); /* read mode defines */ #define READ_MODE_SZ 2 #define OVERWRITE_MODE "w+" #define APPEND_MODE "r+" #endif