Z-file.h

/*** Various system-specific fixes ***/ /* * Use POSIX file control where we can, otherwise help out other platforms */ /* * Several systems have no "O_BINARY" flag */ /* * Hack -- force definitions -- see fd_lock  XXX */ /*** Functions provided in the package ***/ extern errr path_parse(char *buf, size_t max, cptr file); extern errr path_build(char *buf, size_t max, cptr path, cptr file); extern FILE *my_fopen(cptr file, cptr mode); extern FILE *my_fopen_temp(char *buf, size_t max); extern errr my_fclose(FILE *fff); extern errr my_fgets(FILE *fff, char *buf, size_t n); extern errr my_fputs(FILE *fff, cptr buf, size_t n); extern bool my_fexists(const char *fname); extern errr fd_kill(cptr file); extern errr fd_move(cptr file, cptr what); extern int fd_make(cptr file, int mode); extern int fd_open(cptr file, int flags); extern errr fd_lock(int fd, int what); extern errr fd_seek(int fd, long n); extern errr fd_read(int fd, char *buf, size_t n); extern errr fd_write(int fd, cptr buf, size_t n); extern errr fd_close(int fd); extern errr check_modification_date(int fd, cptr template_file); typedef struct ang_dir ang_dir; ang_dir *my_dopen(const char *dirname); bool my_dread(ang_dir *dir, char *fname, size_t len); void my_dclose(ang_dir *dir);
 * 1) ifndef INCLUDED_Z_FILE_H
 * 2) define INCLUDED_Z_FILE_H
 * 1) ifdef HAVE_FCNTL_H
 * 2) include 
 * 3) else
 * 4) define O_RDONLY   0
 * 5) define O_WRONLY   1
 * 6) define O_RDWR     2
 * 7) endif
 * 1) ifndef O_BINARY
 * 2) define O_BINARY 0
 * 3) endif /* O_BINARY */
 * 1) ifndef F_UNLCK
 * 2) define F_UNLCK    0
 * 3) endif
 * 4) ifndef F_RDLCK
 * 5) define F_RDLCK    1
 * 6) endif
 * 7) ifndef F_WRLCK
 * 8) define F_WRLCK    2
 * 9) endif
 * 1) endif