src/tar_type.h
author smatz
Wed, 25 Jun 2008 17:45:05 +0000
changeset 11074 ec51c609170c
parent 11061 f5806d84e7a9
child 11180 982e9f814f97
permissions -rw-r--r--
(svn r13631) -Fix (r13618): forgot #define avoiding multiple inclusions
11061
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
     1
/* $Id$ */
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
     2
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
     3
#ifndef TAR_TYPE_H
11074
ec51c609170c (svn r13631) -Fix (r13618): forgot #define avoiding multiple inclusions
smatz
parents: 11061
diff changeset
     4
#define TAR_TYPE_H
11061
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
     5
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
     6
/** @file tar_type.h Structs, typedefs and macros used for TAR file handling. */
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
     7
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
     8
#include <map>
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
     9
#include <string>
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    10
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    11
/** The define of a TarList. */
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    12
struct TarListEntry {
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    13
	const char *filename;
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    14
};
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    15
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    16
struct TarFileListEntry {
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    17
	TarListEntry *tar;
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    18
	size_t size;
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    19
	size_t position;
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    20
};
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    21
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    22
typedef std::map<std::string, TarListEntry *> TarList;
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    23
typedef std::map<std::string, TarFileListEntry> TarFileList;
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    24
extern TarList _tar_list;
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    25
extern TarFileList _tar_filelist;
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    26
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    27
#define FOR_ALL_TARS(tar) for (tar = _tar_filelist.begin(); tar != _tar_filelist.end(); tar++)
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    28
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    29
typedef bool FioTarFileListCallback(const char *filename, int size, void *userdata);
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    30
FILE *FioTarFileList(const char *tar, const char *mode, size_t *filesize, FioTarFileListCallback *callback, void *userdata);
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    31
f5806d84e7a9 (svn r13618) -Codechange: move tar-specific declarations to separate file
smatz
parents:
diff changeset
    32
#endif /* TAR_TYPE_H */