home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1998 November / VPR9811A.BIN / OLS / tar32043 / tar32043.exe / SDK / TAR32.H < prev    next >
C/C++ Source or Header  |  1998-08-10  |  10KB  |  308 lines

  1. /* tar32.h */
  2. /* tar32.DLL DLL transplanted by Yoshioka Tsuneo */
  3.  
  4. #ifndef TAR32_H
  5. #define TAR32_H
  6.  
  7.  
  8. #ifndef FNAME_MAX32
  9. #define FNAME_MAX32        512
  10. #endif
  11. #if defined(__BORLANDC__)
  12. #pragma option -a-
  13. #else
  14. #pragma pack(1)
  15. #endif
  16.  
  17. #ifndef _TIME_T_DEFINED
  18. typedef long time_t;
  19. #define _TIME_T_DEFINED
  20. #endif
  21.  
  22. #ifndef ARC_DECSTRACT
  23. #define ARC_DECSTRACT
  24. /* #define void *HGLOBAL */
  25.  
  26. #include <wtypes.h>
  27.  
  28. typedef    HGLOBAL    HARC;
  29.  
  30. typedef struct {
  31.     DWORD             dwOriginalSize;
  32.     DWORD             dwCompressedSize;
  33.     DWORD            dwCRC;
  34.     UINT            uFlag;
  35.     UINT            uOSType;
  36.     WORD            wRatio;
  37.     WORD            wDate;
  38.     WORD             wTime;
  39.     char            szFileName[FNAME_MAX32 + 1];
  40.     char            dummy1[3];
  41.     char            szAttribute[8];
  42.     char            szMode[8];
  43. }    INDIVIDUALINFO;
  44.  
  45. typedef INDIVIDUALINFO *LPINDIVIDUALINFO;
  46.  
  47. /* only declare struct( NO IMPLEMENTED )*/
  48. typedef struct {
  49.     DWORD             dwFileSize;
  50.     DWORD            dwWriteSize;
  51.     char            szSourceFileName[FNAME_MAX32 + 1];
  52.     char            dummy1[3];
  53.     char            szDestFileName[FNAME_MAX32 + 1];
  54.     char            dummy[3];
  55. }    EXTRACTINGINFO;
  56. typedef struct {
  57.     EXTRACTINGINFO exinfo;
  58.     DWORD dwCompressedSize;
  59.     DWORD dwCRC;
  60.     UINT  uOSType;
  61.     WORD  wRatio;
  62.     WORD  wDate;
  63.     WORD  wTime;
  64.     char  szAttribute[8];
  65.     char  szMode[8];
  66. } EXTRACTINGINFOEX;
  67. typedef BOOL CALLBACK ARCHIVERPROC(HWND _hwnd,UINT _uMsg,UINT _nState, EXTRACTINGINFOEX * _lpEis);
  68.  
  69. #endif
  70.  
  71. #if !defined(__BORLANDC__)
  72. #pragma pack()
  73. #else
  74. #pragma option -a.
  75. #endif
  76.  
  77. #if !defined(__BORLANDC__)
  78. #define    _export
  79. #endif
  80.  
  81. #ifdef __cplusplus
  82. extern "C" {
  83. #endif
  84. WORD WINAPI _export TarGetVersion(VOID);
  85.  
  86. BOOL WINAPI _export TarGetRunning(VOID);
  87.  
  88. BOOL WINAPI _export TarGetBackGroundMode(VOID);/* NO IMPLEMENT:return FALSE */
  89. BOOL WINAPI _export TarSetBackGroundMode(const BOOL _BackGroundMode);/* NO IMPLEMENT:return FALSE */
  90. BOOL WINAPI _export TarGetCursorMode(VOID);/* NO IMPLEMENT:return FALSE */
  91. BOOL WINAPI _export TarSetCursorMode(const BOOL _CursorMode);/* NO IMPLEMENT:return FALSE */
  92. WORD WINAPI _export TarGetCursorInterval(VOID);/* NO IMPLEMENT:return 80 */
  93. BOOL WINAPI _export TarSetCursorInterval(const WORD _Interval);/* NO IMPLEMENT:return FALSE */
  94.  
  95. int WINAPI _export Tar(const HWND _hwnd, LPCSTR _szCmdLine,LPSTR _szOutput, const DWORD _dwSize);
  96. /* NO IMPLEMENT:return -1 */
  97. int WINAPI _export TarExtractMem(const HWND _hwndParent,LPCSTR _szCmdLine, LPBYTE _lpBuffer, const DWORD _dwSize,time_t *_lpTime, LPWORD _lpwAttr, LPDWORD _lpdwWriteSize);
  98. /* NO IMPLEMENT:return -1 */
  99. int WINAPI _export TarCompressMem(const HWND _hwndParent,LPCSTR _szCmdLine, const LPBYTE _lpBuffer, const DWORD _dwSize,const time_t *_lpTime, const LPWORD _lpwAttr,LPDWORD _lpdwWriteSize);
  100. BOOL WINAPI _export TarCheckArchive(LPCSTR _szFileName, const int _iMode);
  101. /* Simple Dialog Only :return TRUE */
  102. BOOL WINAPI _export TarConfigDialog(const HWND _hwnd, LPSTR _lpszComBuffer,const int _iMode);
  103. int WINAPI _export TarGetFileCount(LPCSTR _szArcFile);
  104. HARC WINAPI _export TarOpenArchive(const HWND _hwnd, LPCSTR _szFileName,const DWORD _dwMode);
  105. int WINAPI _export TarCloseArchive(HARC _harc);
  106. int WINAPI _export TarFindFirst(HARC _harc, LPCSTR _szWildName,INDIVIDUALINFO *_lpSubInfo);
  107. int WINAPI _export TarFindNext(HARC _harc, INDIVIDUALINFO *_lpSubInfo);
  108. int WINAPI _export TarGetArcFileName(HARC _harc, LPSTR _lpBuffer,const int _nSize);
  109.  
  110. DWORD WINAPI _export TarGetArcFileSize(HARC _harc);
  111. DWORD WINAPI _export TarGetArcOriginalSize(HARC _harc);
  112. /* NO IMPLEMENT:return 0: */
  113. DWORD WINAPI _export TarGetArcCompressedSize(HARC _harc);
  114. /* NO IMPLEMENT:return 0: */
  115. WORD WINAPI _export TarGetArcRatio(HARC _harc);
  116. WORD WINAPI _export TarGetArcDate(HARC _harc);
  117. WORD WINAPI _export TarGetArcTime(HARC _harc);
  118. /* NO IMPLEMENT:return -1: */
  119. UINT WINAPI _export TarGetArcOSType(HARC _harc);
  120. int WINAPI _export TarGetFileName(HARC _harc, LPSTR _lpBuffer,
  121.                             const int _nSize);
  122. int WINAPI _export TarGetMethod(HARC _harc, LPSTR _lpBuffer,
  123.                             const int _nSize);
  124. DWORD WINAPI _export TarGetOriginalSize(HARC _harc);
  125. DWORD WINAPI _export TarGetCompressedSize(HARC _harc);
  126. WORD WINAPI _export TarGetRatio(HARC _harc);
  127. WORD WINAPI _export TarGetDate(HARC _harc);
  128. WORD WINAPI _export TarGetTime(HARC _harc);
  129. DWORD WINAPI _export TarGetWriteTime(HARC _harc);
  130. DWORD WINAPI _export TarGetAccessTime(HARC _harc);
  131. DWORD WINAPI _export TarGetCreateTime(HARC _harc);
  132. DWORD WINAPI _export TarGetCRC(HARC _harc);
  133. int WINAPI _export TarGetAttribute(HARC _harc);
  134. UINT WINAPI _export TarGetOSType(HARC _harc);
  135.  
  136. BOOL WINAPI _export TarQueryFunctionList(const int _iFunction);
  137.  
  138. BOOL WINAPI _export TarSetOwnerWindow(const HWND _hwnd);
  139. BOOL WINAPI _export TarClearOwnerWindow(void);
  140. BOOL WINAPI _export TarSetOwnerWindowEx(HWND _hwnd,ARCHIVERPROC *_lpArcProc);
  141. BOOL WINAPI _export TarKillOwnerWindowEx(HWND _hwnd);
  142.  
  143. int WINAPI _export TarGetArchiveType(LPCSTR _szFileName);
  144.  
  145. #ifdef __cplusplus
  146. }
  147. #endif
  148.  
  149. #define    WM_ARCEXTRACT    "wm_arcextract"
  150.  
  151. #define    ARCEXTRACT_BEGIN        0    /* 該当ファイルの処理の開始 */
  152. #define    ARCEXTRACT_INPROCESS    1    /* 該当ファイルの展開中 */
  153. #define    ARCEXTRACT_END            2    /* 処理終了、関連メモリを開放 */
  154. #define ARCEXTRACT_OPEN            3    /* 該当書庫の処理の開始 */
  155. #define ARCEXTRACT_COPY            4    /* ワークファイルの書き戻し */
  156.  
  157. #define    UNPACK_CONFIG_MODE        1
  158. #define PACK_CONFIG_MODE        2
  159.  
  160. #define    CHECKARCHIVE_RAPID        0
  161. #define    CHECKARCHIVE_BASIC        1
  162. #define    CHECKARCHIVE_FULLCRC    2
  163.  
  164. #if !defined(EXTRACT_FOUND_FILE)
  165. /* MODE (for ???OpenArchive) */
  166. #define M_INIT_FILE_USE            0x00000001L
  167. #define M_REGARDLESS_INIT_FILE    0x00000002L
  168. #define M_CHECK_ALL_PATH        0x00000100L
  169. #define M_CHECK_FILENAME_ONLY    0x00000200L
  170. #define M_USE_DRIVE_LETTER        0x00001000L
  171. #define M_NOT_USE_DRIVE_LETTER    0x00002000L
  172. #define M_ERROR_MESSAGE_ON        0x00400000L
  173. #define M_ERROR_MESSAGE_OFF        0x00800000L
  174. #define M_ERROR_MESSAGE_ON        0x00400000L    /* エラーメッセージを表示 */
  175. #define M_ERROR_MESSAGE_OFF        0x00800000L    /* 〃を表示しない */
  176. #define M_BAR_WINDOW_ON            0x01000000L
  177. #define M_BAR_WINDOW_OFF        0x02000000L
  178.  
  179. #define EXTRACT_FOUND_FILE        0x40000000L
  180. #define EXTRACT_NAMED_FILE        0x80000000L
  181. #endif /* EXTRACT_FOUND_FILE */
  182.  
  183. #if !defined(ISARC_FUNCTION_START)
  184. #define ISARC_FUNCTION_START            0
  185. #define ISARC                            0
  186. #define ISARC_GET_VERSION                1
  187. #define ISARC_GET_CURSOR_INTERVAL        2
  188. #define ISARC_SET_CURSOR_INTERVAL        3
  189. #define ISARC_GET_BACK_GROUND_MODE        4
  190. #define ISARC_SET_BACK_GROUND_MODE        5
  191. #define ISARC_GET_CURSOR_MODE            6
  192. #define ISARC_SET_CURSOR_MODE            7
  193. #define ISARC_GET_RUNNING                8
  194.  
  195. #define ISARC_CHECK_ARCHIVE                16
  196. #define ISARC_CONFIG_DIALOG                17
  197. #define ISARC_GET_FILE_COUNT            18
  198. #define ISARC_QUERY_FUNCTION_LIST        19
  199. #define ISARC_HOUT                        20
  200. #define ISARC_STRUCTOUT                    21
  201. #define ISARC_GET_ARC_FILE_INFO            22
  202.  
  203. #define ISARC_OPEN_ARCHIVE                23
  204. #define ISARC_CLOSE_ARCHIVE                24
  205. #define ISARC_FIND_FIRST                25
  206. #define ISARC_FIND_NEXT                    26
  207. #define ISARC_EXTRACT                    27
  208. #define ISARC_ADD                        28
  209. #define ISARC_MOVE                        29
  210. #define ISARC_DELETE                    30
  211.  
  212. #define ISARC_GET_ARC_FILE_NAME            40
  213. #define ISARC_GET_ARC_FILE_SIZE            41
  214. #define ISARC_GET_ARC_ORIGINAL_SIZE        42
  215. #define ISARC_GET_ARC_COMPRESSED_SIZE    43
  216. #define ISARC_GET_ARC_RATIO                44
  217. #define ISARC_GET_ARC_DATE                45
  218. #define ISARC_GET_ARC_TIME                46
  219. #define ISARC_GET_ARC_OS_TYPE            47
  220. #define ISARC_GET_ARC_IS_SFX_FILE        48
  221. #define ISARC_GET_FILE_NAME                57
  222. #define ISARC_GET_ORIGINAL_SIZE            58
  223. #define ISARC_GET_COMPRESSED_SIZE        59
  224. #define ISARC_GET_RATIO                    60
  225. #define ISARC_GET_DATE                    61
  226. #define ISARC_GET_TIME                    62
  227. #define ISARC_GET_CRC                    63
  228. #define ISARC_GET_ATTRIBUTE                64
  229. #define ISARC_GET_OS_TYPE                65
  230. #define ISARC_GET_METHOD                66
  231. #define ISARC_GET_WRITE_TIME            67
  232. #define ISARC_GET_CREATE_TIME            68
  233. #define ISARC_GET_ACCESS_TIME            69
  234.  
  235. #define ISARC_FUNCTION_END                69
  236. #endif    /* ISARC_FUNCTION_START */
  237.  
  238. #ifndef FA_RDONLY
  239. /* Attribute */
  240. #define FA_RDONLY       0x01            /* Read only attribute */
  241. #define FA_HIDDEN       0x02            /* Hidden file */
  242. #define FA_SYSTEM       0x04            /* System file */
  243. #define FA_LABEL        0x08            /* Volume label */
  244. #define FA_DIREC        0x10            /* Directory */
  245. #define FA_ARCH         0x20            /* Archive */
  246. #endif
  247.  
  248. #ifndef ERROR_ARC_FILE_OPEN
  249. /* WARNING */
  250. #define ERROR_DISK_SPACE        0x8005
  251. #define ERROR_READ_ONLY            0x8006
  252. #define ERROR_USER_SKIP            0x8007
  253. #define ERROR_UNKNOWN_TYPE        0x8008
  254. #define ERROR_METHOD            0x8009
  255. #define ERROR_PASSWORD_FILE        0x800A
  256. #define ERROR_VERSION            0x800B
  257. #define ERROR_FILE_CRC            0x800C
  258. #define ERROR_FILE_OPEN            0x800D
  259. #define ERROR_MORE_FRESH        0x800E
  260. #define ERROR_NOT_EXIST            0x800F
  261. #define ERROR_ALREADY_EXIST        0x8010
  262.  
  263. #define ERROR_TOO_MANY_FILES    0x8011
  264.  
  265. /* ERROR */
  266. #define ERROR_MAKEDIRECTORY        0x8012
  267. #define ERROR_CANNOT_WRITE        0x8013
  268. #define ERROR_HUFFMAN_CODE        0x8014
  269. #define ERROR_COMMENT_HEADER    0x8015
  270. #define ERROR_HEADER_CRC        0x8016
  271. #define ERROR_HEADER_BROKEN        0x8017
  272. #define ERROR_ARC_FILE_OPEN        0x8018
  273. #define ERROR_NOT_ARC_FILE        0x8019
  274. #define ERROR_CANNOT_READ        0x801A
  275. #define ERROR_FILE_STYLE        0x801B
  276. #define ERROR_COMMAND_NAME        0x801C
  277. #define ERROR_MORE_HEAP_MEMORY    0x801D
  278. #define ERROR_ENOUGH_MEMORY        0x801E
  279. #if !defined(ERROR_ALREADY_RUNNING)
  280. #define ERROR_ALREADY_RUNNING    0x801F
  281. #endif
  282. #define ERROR_USER_CANCEL        0x8020
  283. #define ERROR_HARC_ISNOT_OPENED    0x8021
  284. #define ERROR_NOT_SEARCH_MODE    0x8022
  285. #define ERROR_NOT_SUPPORT        0x8023
  286. #define ERROR_TIME_STAMP        0x8024
  287. #define ERROR_TMP_OPEN            0x8025
  288. #define ERROR_LONG_FILE_NAME    0x8026
  289. #define ERROR_ARC_READ_ONLY        0x8027
  290. #define ERROR_SAME_NAME_FILE    0x8028
  291. #define ERROR_NOT_FIND_ARC_FILE 0x8029
  292. #define ERROR_RESPONSE_READ        0x802A
  293. #define ERROR_NOT_FILENAME        0x802B
  294.  
  295. #define ERROR_END    ERROR_NOT_FILENAME
  296. #endif /* ERROR_ARC_FILE_OPEN */
  297.  
  298. #define ARCHIVETYPE_TAR 1
  299. #define ARCHIVETYPE_TARGZ 2
  300. #define ARCHIVETYPE_TARZ 3
  301. #define ARCHIVETYPE_GZ 4
  302. #define ARCHIVETYPE_Z 5
  303. #define ARCHIVETYPE_TARBZ2 6
  304. #define ARCHIVETYPE_BZ2    7
  305.  
  306. #endif /* TAR32_H*/
  307.  
  308.