src/tar_type.h
author truebrain
Fri, 18 Jul 2008 01:00:03 +0000
branchnoai
changeset 11166 17960948c3af
parent 11126 72d4c9314c72
permissions -rw-r--r--
(svn r13724) [NoAI] -Fix r13723: in this modern world with all those checks and warnings GCC can give when ever I not ask him to, it fails to see the simplest of all, 'if (cargo_id == cargo_id)'.. makes you wonder, doesn't it? Well, such is life, wondering wondering wandering .. Status Quo, Yeah! Oh yeah, what was I doing ... ah, yes: don't compare one variable with itself, it is always true.. Obiwan by Yexo. (Yexo)
/* $Id$ */

#ifndef TAR_TYPE_H
#define 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;
	const char *dirname;
};

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 */