diff options
author | smatz <smatz@openttd.org> | 2008-06-24 09:05:24 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-06-24 09:05:24 +0000 |
commit | fee2adb299270756d44e2a4f55a3b45b0935c4c7 (patch) | |
tree | ece27358f21a7245659bc3c86c57992b89d98699 /src/tar_type.h | |
parent | 6e1dd7f719e86171f789c4f9fa0102db6f12bfca (diff) | |
download | openttd-fee2adb299270756d44e2a4f55a3b45b0935c4c7.tar.xz |
(svn r13618) -Codechange: move tar-specific declarations to separate file
Removes indirect dependency on <string> and <map> for over 40 files
Diffstat (limited to 'src/tar_type.h')
-rw-r--r-- | src/tar_type.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/tar_type.h b/src/tar_type.h new file mode 100644 index 000000000..d032a0809 --- /dev/null +++ b/src/tar_type.h @@ -0,0 +1,31 @@ +/* $Id$ */ + +#ifndef TAR_TYPE_H + +/** @file tar_type.h Structs, typedefs and macros used for TAR file handling. */ + +#include <map> +#include <string> + +/** The define of a TarList. */ +struct TarListEntry { + const char *filename; +}; + +struct TarFileListEntry { + TarListEntry *tar; + size_t size; + size_t position; +}; + +typedef std::map<std::string, TarListEntry *> TarList; +typedef std::map<std::string, TarFileListEntry> TarFileList; +extern TarList _tar_list; +extern TarFileList _tar_filelist; + +#define FOR_ALL_TARS(tar) for (tar = _tar_filelist.begin(); tar != _tar_filelist.end(); tar++) + +typedef bool FioTarFileListCallback(const char *filename, int size, void *userdata); +FILE *FioTarFileList(const char *tar, const char *mode, size_t *filesize, FioTarFileListCallback *callback, void *userdata); + +#endif /* TAR_TYPE_H */ |