From 080430b3bda2bec05362119447d51b6c37f1cfc1 Mon Sep 17 00:00:00 2001 From: Steven Fuller Date: Tue, 18 Dec 2001 05:08:52 +0000 Subject: Redid the most of the file loading/saving. Now uses $HOME/.avp/ and $AVP_DIR to look for files. --- src/files.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/files.h (limited to 'src/files.h') diff --git a/src/files.h b/src/files.h new file mode 100644 index 0000000..5e4aa6a --- /dev/null +++ b/src/files.h @@ -0,0 +1,34 @@ +#ifndef __FILES_H__ +#define __FILES_H__ + +#define FILEMODE_READONLY 0x01 +#define FILEMODE_WRITEONLY 0x02 +#define FILEMODE_READWRITE 0x04 +#define FILEMODE_APPEND 0x08 + +#define FILETYPE_PERM 0x10 +#define FILETYPE_OPTIONAL 0x20 +#define FILETYPE_CONFIG 0x40 + +#define FILEATTR_DIRECTORY 0x0100 +#define FILEATTR_READABLE 0x0200 +#define FILEATTR_WRITABLE 0x0400 + +typedef struct GameDirectoryFile +{ + char *filename; + int attr; + time_t timestamp; +} GameDirectoryFile; + +int SetGameDirectories(const char *local, const char *global); +FILE *OpenGameFile(const char *filename, int mode, int type); +int CloseGameFile(FILE *pfd); +int GetGameFileAttributes(const char *filename, int type); +int DeleteGameFile(const char *filename); +int CreateGameDirectory(const char *dirname); +void *OpenGameDirectory(const char *dirname, const char *pattern, int type); +GameDirectoryFile *ScanGameDirectory(void *dir); +int CloseGameDirectory(void *dir); + +#endif -- cgit v1.3