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