home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2003 May / VPR0305.ISO / OLS / TAR32223 / tar32223.lzh / tar32_2 / src / tar32api.h < prev    next >
C/C++ Source or Header  |  2003-01-17  |  12KB  |  372 lines

  1. /*
  2.     TAR32API.H
  3.         TAR32.DLL API header.
  4.         by Yoshioka Tsuneo(QWF00133@nifty.ne.jp)
  5. */
  6. /*    
  7.     このファイルの利用条件:
  8.         このソースファイルの利用制限は一切ありません。
  9.         ソースの一部、全部を商用、非商用など目的に
  10.         かかわりなく他のプログラムで自由に使用できます。
  11.         パブリック・ドメイン・ソフトウェアと同様に扱えます。
  12.     
  13.     プログラマ向けの要望(制限ではありません):
  14.         ソース中に改善すべき点があればお知らせください。
  15.         ソースコード中にバグを見つけた場合は報告してください。
  16.         直した部分などありましたら教えてください。
  17.         断片的な情報でも結構です。
  18.         このファイルを利用した場合はなるべく教えてください。
  19. */
  20. /*
  21.     LICENSE of this file:
  22.         There is no restriction for using this file.
  23.         You can use this file in your software for any purpose.
  24.         In other words, you can use this file as Public Domain Software.
  25.  
  26.     RECOMMENDATION for Programmer(not restriction):
  27.         If you find points to improve code, please report me.
  28.         If you find bug in source code, please report me.
  29.         If you fixed bug, please teach me.
  30.         I want any trivial information.
  31.         If you use this file, please report me.
  32. */
  33.  
  34. #ifndef TAR32API_H
  35. #define TAR32API_H
  36.  
  37. #ifndef FNAME_MAX32
  38. #define FNAME_MAX32        512
  39. #endif
  40. #if defined(__BORLANDC__)
  41. #pragma option -a-
  42. #else
  43. #pragma pack(1)
  44. #endif
  45.  
  46. #ifndef _TIME_T_DEFINED
  47. typedef long time_t;
  48. #define _TIME_T_DEFINED
  49. #endif
  50.  
  51. #ifndef ARC_DECSTRACT
  52. #define ARC_DECSTRACT
  53. /* #define void *HGLOBAL */
  54.  
  55. #include <wtypes.h>
  56.  
  57. typedef    HGLOBAL    HARC;
  58.  
  59. typedef struct {
  60.     DWORD             dwOriginalSize;
  61.     DWORD             dwCompressedSize;
  62.     DWORD            dwCRC;
  63.     UINT            uFlag;
  64.     UINT            uOSType;
  65.     WORD            wRatio;
  66.     WORD            wDate;
  67.     WORD             wTime;
  68.     char            szFileName[FNAME_MAX32 + 1];
  69.     char            dummy1[3];
  70.     char            szAttribute[8];
  71.     char            szMode[8];
  72. }    INDIVIDUALINFO;
  73.  
  74. typedef INDIVIDUALINFO *LPINDIVIDUALINFO;
  75.  
  76. /* only declare struct( NO IMPLEMENTED )*/
  77. typedef struct {
  78.     DWORD             dwFileSize;
  79.     DWORD            dwWriteSize;
  80.     char            szSourceFileName[FNAME_MAX32 + 1];
  81.     char            dummy1[3];
  82.     char            szDestFileName[FNAME_MAX32 + 1];
  83.     char            dummy[3];
  84. }    EXTRACTINGINFO;
  85. typedef struct {
  86.     EXTRACTINGINFO exinfo;
  87.     DWORD dwCompressedSize;
  88.     DWORD dwCRC;
  89.     UINT  uOSType;
  90.     WORD  wRatio;
  91.     WORD  wDate;
  92.     WORD  wTime;
  93.     char  szAttribute[8];
  94.     char  szMode[8];
  95. } EXTRACTINGINFOEX;
  96. typedef BOOL CALLBACK ARCHIVERPROC(HWND _hwnd,UINT _uMsg,UINT _nState, EXTRACTINGINFOEX * _lpEis);
  97.  
  98. #endif
  99.  
  100. #if !defined(__BORLANDC__)
  101. #pragma pack()
  102. #else
  103. #pragma option -a.
  104. #endif
  105.  
  106. #if !defined(__BORLANDC__)
  107. #define    _export
  108. #endif
  109.  
  110. #ifdef __cplusplus
  111. extern "C" {
  112. #endif
  113. WORD WINAPI _export TarGetVersion(VOID);
  114.  
  115. BOOL WINAPI _export TarGetRunning(VOID);
  116.  
  117. BOOL WINAPI _export TarGetBackGroundMode(VOID);/* NO IMPLEMENT:return FALSE */
  118. BOOL WINAPI _export TarSetBackGroundMode(const BOOL _BackGroundMode);/* NO IMPLEMENT:return FALSE */
  119. BOOL WINAPI _export TarGetCursorMode(VOID);/* NO IMPLEMENT:return FALSE */
  120. BOOL WINAPI _export TarSetCursorMode(const BOOL _CursorMode);/* NO IMPLEMENT:return FALSE */
  121. WORD WINAPI _export TarGetCursorInterval(VOID);/* NO IMPLEMENT:return 80 */
  122. BOOL WINAPI _export TarSetCursorInterval(const WORD _Interval);/* NO IMPLEMENT:return FALSE */
  123.  
  124. int WINAPI _export Tar(const HWND _hwnd, LPCSTR _szCmdLine,LPSTR _szOutput, const DWORD _dwSize);
  125. /* NO IMPLEMENT:return -1 */
  126. int WINAPI _export TarExtractMem(const HWND _hwndParent,LPCSTR _szCmdLine, LPBYTE _lpBuffer, const DWORD _dwSize,time_t *_lpTime, LPWORD _lpwAttr, LPDWORD _lpdwWriteSize);
  127. /* NO IMPLEMENT:return -1 */
  128. int WINAPI _export TarCompressMem(const HWND _hwndParent,LPCSTR _szCmdLine, const LPBYTE _lpBuffer, const DWORD _dwSize,const time_t *_lpTime, const LPWORD _lpwAttr,LPDWORD _lpdwWriteSize);
  129. BOOL WINAPI _export TarCheckArchive(LPCSTR _szFileName, const int _iMode);
  130. /* Simple Dialog Only :return TRUE */
  131. BOOL WINAPI _export TarConfigDialog(const HWND _hwnd, LPSTR _lpszComBuffer,const int _iMode);
  132. int WINAPI _export TarGetFileCount(LPCSTR _szArcFile);
  133. HARC WINAPI _export TarOpenArchive(const HWND _hwnd, LPCSTR _szFileName,const DWORD _dwMode);
  134. int WINAPI _export TarCloseArchive(HARC _harc);
  135. int WINAPI _export TarFindFirst(HARC _harc, LPCSTR _szWildName,INDIVIDUALINFO *_lpSubInfo);
  136. int WINAPI _export TarFindNext(HARC _harc, INDIVIDUALINFO *_lpSubInfo);
  137. int WINAPI _export TarGetArcFileName(HARC _harc, LPSTR _lpBuffer,const int _nSize);
  138.  
  139. DWORD WINAPI _export TarGetArcFileSize(HARC _harc);
  140. DWORD WINAPI _export TarGetArcOriginalSize(HARC _harc);
  141. /* NO IMPLEMENT:return 0: */
  142. DWORD WINAPI _export TarGetArcCompressedSize(HARC _harc);
  143. /* NO IMPLEMENT:return 0: */
  144. WORD WINAPI _export TarGetArcRatio(HARC _harc);
  145. WORD WINAPI _export TarGetArcDate(HARC _harc);
  146. WORD WINAPI _export TarGetArcTime(HARC _harc);
  147. /* NO IMPLEMENT:return -1: */
  148. UINT WINAPI _export TarGetArcOSType(HARC _harc);
  149. int WINAPI _export TarGetFileName(HARC _harc, LPSTR _lpBuffer,
  150.                             const int _nSize);
  151. int WINAPI _export TarGetMethod(HARC _harc, LPSTR _lpBuffer,
  152.                             const int _nSize);
  153. DWORD WINAPI _export TarGetOriginalSize(HARC _harc);
  154. DWORD WINAPI _export TarGetCompressedSize(HARC _harc);
  155. WORD WINAPI _export TarGetRatio(HARC _harc);
  156. WORD WINAPI _export TarGetDate(HARC _harc);
  157. WORD WINAPI _export TarGetTime(HARC _harc);
  158. DWORD WINAPI _export TarGetWriteTime(HARC _harc);
  159. DWORD WINAPI _export TarGetAccessTime(HARC _harc);
  160. DWORD WINAPI _export TarGetCreateTime(HARC _harc);
  161. DWORD WINAPI _export TarGetCRC(HARC _harc);
  162. int WINAPI _export TarGetAttribute(HARC _harc);
  163. UINT WINAPI _export TarGetOSType(HARC _harc);
  164.  
  165. BOOL WINAPI _export TarQueryFunctionList(const int _iFunction);
  166.  
  167. BOOL WINAPI _export TarSetOwnerWindow(const HWND _hwnd);
  168. BOOL WINAPI _export TarClearOwnerWindow(void);
  169. BOOL WINAPI _export TarSetOwnerWindowEx(HWND _hwnd,ARCHIVERPROC *_lpArcProc);
  170. BOOL WINAPI _export TarKillOwnerWindowEx(HWND _hwnd);
  171.  
  172. int WINAPI _export TarGetArchiveType(LPCSTR _szFileName);
  173.  
  174. #ifdef __cplusplus
  175. }
  176. #endif
  177.  
  178. #define    WM_ARCEXTRACT    "wm_arcextract"
  179.  
  180. #define    ARCEXTRACT_BEGIN        0    /* 該当ファイルの処理の開始 */
  181. #define    ARCEXTRACT_INPROCESS    1    /* 該当ファイルの展開中 */
  182. #define    ARCEXTRACT_END            2    /* 処理終了、関連メモリを開放 */
  183. #define ARCEXTRACT_OPEN            3    /* 該当書庫の処理の開始 */
  184. #define ARCEXTRACT_COPY            4    /* ワークファイルの書き戻し */
  185.  
  186. #define    UNPACK_CONFIG_MODE        1
  187. #define PACK_CONFIG_MODE        2
  188.  
  189. #define    CHECKARCHIVE_RAPID        0
  190. #define    CHECKARCHIVE_BASIC        1
  191. #define    CHECKARCHIVE_FULLCRC    2
  192.  
  193. #if !defined(EXTRACT_FOUND_FILE)
  194. /* MODE (for ???OpenArchive) */
  195. #define M_INIT_FILE_USE            0x00000001L
  196. #define M_REGARDLESS_INIT_FILE    0x00000002L
  197. #define M_CHECK_ALL_PATH        0x00000100L
  198. #define M_CHECK_FILENAME_ONLY    0x00000200L
  199. #define M_USE_DRIVE_LETTER        0x00001000L
  200. #define M_NOT_USE_DRIVE_LETTER    0x00002000L
  201. #define M_ERROR_MESSAGE_ON        0x00400000L
  202. #define M_ERROR_MESSAGE_OFF        0x00800000L
  203. #define M_ERROR_MESSAGE_ON        0x00400000L    /* エラーメッセージを表示 */
  204. #define M_ERROR_MESSAGE_OFF        0x00800000L    /* 〃を表示しない */
  205. #define M_BAR_WINDOW_ON            0x01000000L
  206. #define M_BAR_WINDOW_OFF        0x02000000L
  207.  
  208. #define EXTRACT_FOUND_FILE        0x40000000L
  209. #define EXTRACT_NAMED_FILE        0x80000000L
  210. #endif /* EXTRACT_FOUND_FILE */
  211.  
  212. #if !defined(ISARC_FUNCTION_START)
  213. #define ISARC_FUNCTION_START            0
  214. #define ISARC                            0
  215. #define ISARC_GET_VERSION                1
  216. #define ISARC_GET_CURSOR_INTERVAL        2
  217. #define ISARC_SET_CURSOR_INTERVAL        3
  218. #define ISARC_GET_BACK_GROUND_MODE        4
  219. #define ISARC_SET_BACK_GROUND_MODE        5
  220. #define ISARC_GET_CURSOR_MODE            6
  221. #define ISARC_SET_CURSOR_MODE            7
  222. #define ISARC_GET_RUNNING                8
  223.  
  224. #define ISARC_CHECK_ARCHIVE                16
  225. #define ISARC_CONFIG_DIALOG                17
  226. #define ISARC_GET_FILE_COUNT            18
  227. #define ISARC_QUERY_FUNCTION_LIST        19
  228. #define ISARC_HOUT                        20
  229. #define ISARC_STRUCTOUT                    21
  230. #define ISARC_GET_ARC_FILE_INFO            22
  231.  
  232. #define ISARC_OPEN_ARCHIVE                23
  233. #define ISARC_CLOSE_ARCHIVE                24
  234. #define ISARC_FIND_FIRST                25
  235. #define ISARC_FIND_NEXT                    26
  236. #define ISARC_EXTRACT                    27
  237. #define ISARC_ADD                        28
  238. #define ISARC_MOVE                        29
  239. #define ISARC_DELETE                    30
  240. #define ISARC_SETOWNERWINDOW            31    /* UnlhaSetOwnerWindow */
  241. #define ISARC_CLEAROWNERWINDOW            32    /* UnlhaClearOwnerWindow */
  242. #define ISARC_SETOWNERWINDOWEX            33    /* UnlhaSetOwnerWindowEx */
  243. #define ISARC_KILLOWNERWINDOWEX            34    /* UnlhaKillOwnerWindowEx */
  244.  
  245. #define ISARC_GET_ARC_FILE_NAME            40
  246. #define ISARC_GET_ARC_FILE_SIZE            41
  247. #define ISARC_GET_ARC_ORIGINAL_SIZE        42
  248. #define ISARC_GET_ARC_COMPRESSED_SIZE    43
  249. #define ISARC_GET_ARC_RATIO                44
  250. #define ISARC_GET_ARC_DATE                45
  251. #define ISARC_GET_ARC_TIME                46
  252. #define ISARC_GET_ARC_OS_TYPE            47
  253. #define ISARC_GET_ARC_IS_SFX_FILE        48
  254. #define ISARC_GET_FILE_NAME                57
  255. #define ISARC_GET_ORIGINAL_SIZE            58
  256. #define ISARC_GET_COMPRESSED_SIZE        59
  257. #define ISARC_GET_RATIO                    60
  258. #define ISARC_GET_DATE                    61
  259. #define ISARC_GET_TIME                    62
  260. #define ISARC_GET_CRC                    63
  261. #define ISARC_GET_ATTRIBUTE                64
  262. #define ISARC_GET_OS_TYPE                65
  263. #define ISARC_GET_METHOD                66
  264. #define ISARC_GET_WRITE_TIME            67
  265. #define ISARC_GET_CREATE_TIME            68
  266. #define ISARC_GET_ACCESS_TIME            69
  267.  
  268. #define ISARC_FUNCTION_END                69
  269. #endif    /* ISARC_FUNCTION_START */
  270.  
  271. #ifndef FA_RDONLY
  272. /* Attribute */
  273. #define FA_RDONLY       0x01            /* Read only attribute */
  274. #define FA_HIDDEN       0x02            /* Hidden file */
  275. #define FA_SYSTEM       0x04            /* System file */
  276. #define FA_LABEL        0x08            /* Volume label */
  277. #define FA_DIREC        0x10            /* Directory */
  278. #define FA_ARCH         0x20            /* Archive */
  279. #endif
  280.  
  281. #ifndef ERROR_ARC_FILE_OPEN
  282. /* WARNING */
  283. #define ERROR_DISK_SPACE        0x8005
  284. #define ERROR_READ_ONLY            0x8006
  285. #define ERROR_USER_SKIP            0x8007
  286. #define ERROR_UNKNOWN_TYPE        0x8008
  287. #define ERROR_METHOD            0x8009
  288. #define ERROR_PASSWORD_FILE        0x800A
  289. #define ERROR_VERSION            0x800B
  290. #define ERROR_FILE_CRC            0x800C
  291. #define ERROR_FILE_OPEN            0x800D
  292. #define ERROR_MORE_FRESH        0x800E
  293. #define ERROR_NOT_EXIST            0x800F
  294. #define ERROR_ALREADY_EXIST        0x8010
  295.  
  296. #define ERROR_TOO_MANY_FILES    0x8011
  297.  
  298. /* ERROR */
  299. #define ERROR_MAKEDIRECTORY        0x8012
  300. #define ERROR_CANNOT_WRITE        0x8013
  301. #define ERROR_HUFFMAN_CODE        0x8014
  302. #define ERROR_COMMENT_HEADER    0x8015
  303. #define ERROR_HEADER_CRC        0x8016
  304. #define ERROR_HEADER_BROKEN        0x8017
  305. #define ERROR_ARC_FILE_OPEN        0x8018
  306. #define ERROR_NOT_ARC_FILE        0x8019
  307. #define ERROR_CANNOT_READ        0x801A
  308. #define ERROR_FILE_STYLE        0x801B
  309. #define ERROR_COMMAND_NAME        0x801C
  310. #define ERROR_MORE_HEAP_MEMORY    0x801D
  311. #define ERROR_ENOUGH_MEMORY        0x801E
  312. #if !defined(ERROR_ALREADY_RUNNING)
  313. #define ERROR_ALREADY_RUNNING    0x801F
  314. #endif
  315. #define ERROR_USER_CANCEL        0x8020
  316. #define ERROR_HARC_ISNOT_OPENED    0x8021
  317. #define ERROR_NOT_SEARCH_MODE    0x8022
  318. #define ERROR_NOT_SUPPORT        0x8023
  319. #define ERROR_TIME_STAMP        0x8024
  320. #define ERROR_TMP_OPEN            0x8025
  321. #define ERROR_LONG_FILE_NAME    0x8026
  322. #define ERROR_ARC_READ_ONLY        0x8027
  323. #define ERROR_SAME_NAME_FILE    0x8028
  324. #define ERROR_NOT_FIND_ARC_FILE 0x8029
  325. #define ERROR_RESPONSE_READ        0x802A
  326. #define ERROR_NOT_FILENAME        0x802B
  327. #define ERROR_TMP_COPY            0x802C
  328. #define ERROR_EOF                0x802D
  329. #define ERROR_ADD_TO_LARC        0x802E
  330. #define ERROR_TMP_BACK_SPACE    0x802F
  331. #define ERROR_SHARING            0x8030
  332. #define ERROR_NOT_FIND_FILE        0x8031
  333. #define ERROR_LOG_FILE            0x8032
  334. #define    ERROR_NO_DEVICE            0x8033
  335. #define ERROR_GET_ATTRIBUTES    0x8034
  336. #define ERROR_SET_ATTRIBUTES    0x8035
  337. #define ERROR_GET_INFORMATION    0x8036
  338. #define ERROR_GET_POINT            0x8037
  339. #define ERROR_SET_POINT            0x8038
  340. #define ERROR_CONVERT_TIME        0x8039
  341. #define ERROR_GET_TIME            0x803a
  342. #define ERROR_SET_TIME            0x803b
  343. #define ERROR_CLOSE_FILE        0x803c
  344. #define ERROR_HEAP_MEMORY        0x803d
  345. #define ERROR_HANDLE            0x803e
  346. #define ERROR_TIME_STAMP_RANGE    0x803f
  347.  
  348. #define ERROR_END    ERROR_TIME_STAMP_RANGE
  349. #endif /* ERROR_ARC_FILE_OPEN */
  350.  
  351. #define ARCHIVETYPE_NORMAL 0
  352. #define ARCHIVETYPE_TAR 1
  353. #define ARCHIVETYPE_TARGZ 2
  354. #define ARCHIVETYPE_TARZ 3
  355. #define ARCHIVETYPE_GZ 4
  356. #define ARCHIVETYPE_Z 5
  357. #define ARCHIVETYPE_TARBZ2 6
  358. #define ARCHIVETYPE_BZ2    7
  359.  
  360. #define ARCHIVETYPE_CPIO    32
  361. #define ARCHIVETYPE_CPIOGZ    32+4
  362. #define ARCHIVETYPE_CPIOZ    32+5
  363. #define ARCHIVETYPE_CPIOBZ2    32+7
  364.  
  365. #define ARCHIVETYPE_AR        48
  366. #define ARCHIVETYPE_ARGZ    48+4
  367. #define ARCHIVETYPE_ARZ        48+5
  368. #define ARCHIVETYPE_ARBZ2    48+7
  369.  
  370. #endif // TAR32API_H
  371.  
  372.