src/tar_type.h
author translators
Thu, 18 Dec 2008 18:47:39 +0000
changeset 10437 6d64230b9fb9
parent 9703 30117a5205f4
permissions -rw-r--r--
(svn r14691) -Update: WebTranslator2 update to 2008-12-18 18:47:25
arabic_egypt - 132 fixed, 1 changed by khaloofah (133)
czech - 10 fixed, 25 changed by Hadez (35)
esperanto - 15 fixed by Athaba (15)
greek - 7 fixed by ouranogrammi (7)
indonesian - 88 changed by fanioz (88)
latvian - 117 fixed, 16 changed by peerer (83), marismols (50)
lithuanian - 15 fixed by Zogg (15)
malay - 38 fixed by tombakemas (5), Syed (33)
serbian - 39 fixed, 1 changed by Jenraux (40)
thai - 105 fixed by vetbook (105)
/* $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;

	/* MSVC goes copying around this struct after initialisation, so it tries
	 * to free filename, which isn't set at that moment... but because it
	 * initializes the variable with garbage, it's going to segfault. */
	TarListEntry() : filename(NULL) {}
	~TarListEntry() { free((void*)this->filename); }
};

struct TarFileListEntry {
	const char *tar_filename;
	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 */