RegisterArc.h revision baa3858d3f5d128a5c8466b700098109edcad5f2
1baa3858d3f5d128a5c8466b700098109edcad5f2repo sync// RegisterArc.h
2baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
3baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#ifndef __REGISTER_ARC_H
4baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#define __REGISTER_ARC_H
5baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
6baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#include "../Archive/IArchive.h"
7baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
8baa3858d3f5d128a5c8466b700098109edcad5f2repo synctypedef IInArchive * (*CreateInArchiveP)();
9baa3858d3f5d128a5c8466b700098109edcad5f2repo synctypedef IOutArchive * (*CreateOutArchiveP)();
10baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
11baa3858d3f5d128a5c8466b700098109edcad5f2repo syncstruct CArcInfo
12baa3858d3f5d128a5c8466b700098109edcad5f2repo sync{
13baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  const wchar_t *Name;
14baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  const wchar_t *Ext;
15baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  const wchar_t *AddExt;
16baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  Byte ClassId;
17baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  Byte Signature[16];
18baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  int SignatureSize;
19baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  bool KeepName;
20baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  CreateInArchiveP CreateInArchive;
21baa3858d3f5d128a5c8466b700098109edcad5f2repo sync  CreateOutArchiveP CreateOutArchive;
22baa3858d3f5d128a5c8466b700098109edcad5f2repo sync};
23baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
24baa3858d3f5d128a5c8466b700098109edcad5f2repo syncvoid RegisterArc(const CArcInfo *arcInfo);
25baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
26baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#define REGISTER_ARC_NAME(x) CRegister ## x
27baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
28baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#define REGISTER_ARC(x) struct REGISTER_ARC_NAME(x) { \
29baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    REGISTER_ARC_NAME(x)() { RegisterArc(&g_ArcInfo); }}; \
30baa3858d3f5d128a5c8466b700098109edcad5f2repo sync    static REGISTER_ARC_NAME(x) g_RegisterArc;
31baa3858d3f5d128a5c8466b700098109edcad5f2repo sync
32baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#endif
33