home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703A.ISO / OLS / Os2 / LHA2P205 / LHA2P205.LZH / lha2-2.05pre / source.lzh / src / header.h < prev    next >
C/C++ Source or Header  |  1996-02-25  |  2KB  |  123 lines

  1. /*
  2.  * header.h
  3.  *   Copyright (C) 1988-1994, Haruyasu YOSHIZAKI
  4.  *   Copyright (C) 1991-1996, Satoshi HIRAMATSU
  5.  *
  6.  * $Log$
  7.  */
  8.  
  9. #ifndef __INCLUDED_HEADER_H__
  10. #define __INCLUDED_HEADER_H__
  11.  
  12. typedef struct head
  13. {
  14.   word headersize;
  15.   char method[6];
  16.   word packed;
  17.   word skip;
  18.   word original;
  19.   STAMP dostime;
  20.   time_t mtime;
  21.   uint attr;
  22.   uint level;
  23.   hword filecrc;
  24.   hword headercrc;
  25.   char *pathname;
  26.   char *filename;
  27.   int creator;
  28.   int pathlen;
  29.   int namelen;
  30.   int info;
  31.   off_t currentpos;
  32.   bool crcpos;
  33.   bool needfname;
  34.   word mode;
  35.   off_t offset;
  36.   byte dummy;
  37. #ifdef __SUPPORT_CTIME_ATIME__
  38.   time_t ctime;
  39.   time_t atime;
  40. #endif
  41. #ifdef __SUPPORT_UID_GID__
  42.   uid_t uid;
  43.   gid_t gid;
  44. #endif
  45. #ifdef __SUPPORT_EA__
  46.   uint eatype;
  47. #ifdef __OS2__
  48.   FEA2LIST *ea;
  49. #endif
  50. #endif
  51. #ifdef __SUPPORT_KAPSEL__
  52.   word kapselheadersize;
  53.   word filesize;
  54. #endif
  55. } HEADER;
  56.  
  57.  
  58. typedef struct __headerlink
  59. {
  60.   byte *header;
  61.   ulong size;
  62.   struct __headerlink *next;
  63. } HEADERLINK;
  64.  
  65.  
  66. /* MS-DOS, Windows(LongNameFAT support) */
  67. #define CREATOR_MSDOS    'M'
  68.  
  69. /* OS/2 */
  70. #define CREATOR_OS2    '2'
  71. #define EA_CREATOR_OS2    "OS/2"
  72.  
  73. /* Windows/NT(NTFS and HPFS and VFAAT support) */
  74. #define CREATOR_WINDOWS_NT    'W'
  75. #define CREATOR_WINDOWS_95    'w'
  76.  
  77. /* UNIX oprating system */
  78. #define CREATOR_UNIX    'U'
  79.  
  80. /* MacOS */
  81. #define CREATOR_MAC    'm'
  82.  
  83. /* HUMAN */
  84. #define CREATOR_HUMAN    'H'
  85.  
  86. /* OS-9 */
  87. #define CREATOR_OS9    '9'
  88.  
  89.  
  90. /* EA type (OS dependent) */
  91. #define __TYPE_EA__        0x00    /* 拡張属性 */
  92. #define __TYPE_EA_COMPRESS__    0x01    /* 拡張属性(圧縮) */
  93.  
  94.  
  95. /* compression method */
  96. #define LH0        0
  97. #define LH1        1
  98. #define LH2        2
  99. #define LH3        3
  100. #define LH4        4
  101. #define LH5        5
  102. #define LZS        6
  103. #define LZ5        7
  104. #define LZ4        8
  105. #define LHD        9
  106. #define SENTINEL    10
  107. extern char methods[11][5];
  108.  
  109.  
  110. HEADERLINK *makehdr(HEADER *);
  111. bool inithdr(FILE *);
  112. char *gethdr(FILE *, HEADER *);
  113. bool writehdr(FILE *, HEADERLINK *, HEADER *);
  114. bool adjusthdr(FILE *, HEADERLINK *, HEADER *);
  115. bool copyhdr(FILE *, FILE *, HEADER *);
  116.  
  117. /* from append.c */
  118. void copylzh(HEADER *);
  119.  
  120. #define READ_MAX ((uint)-1)
  121.  
  122. #endif
  123.