home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2002 April / VPR0204A.ISO / OLS / UNGCA010A / ugca010a.lzh / UnGCA32.h < prev    next >
C/C++ Source or Header  |  2001-12-23  |  12KB  |  388 lines

  1.  
  2. #if !defined(UNGCA32_H)
  3. #define UNGCA32_H
  4. #define UNGCA32_DLL_NAME "UnGCA32.DLL"
  5. //#include <wtypes.h>
  6.  
  7. /* FNAME_MAX */
  8. #if !defined(FNAME_MAX32)
  9. #define FNAME_MAX32    512
  10. #define    FNAME_MAX    FNAME_MAX32
  11. #else
  12. #if !defined(FNAME_MAX)
  13. #define    FNAME_MAX    128
  14. #endif
  15. #endif
  16.  
  17. #if !defined(__BORLANDC__) || __BORLANDC__ >= 0x550
  18. typedef LONGLONG    ULHA_INT64;
  19. #else
  20. typedef struct {
  21.     DWORD    LowPart;
  22.     LONG    HighPart;
  23. } ULHA_INT64, *LPULHA_INT64;
  24. #endif
  25.  
  26. /* CHECKARCHIVE */
  27. #if !defined(CHECKARCHIVE_RAPID)
  28. #define    CHECKARCHIVE_RAPID        0
  29. #define    CHECKARCHIVE_BASIC        1
  30. #define    CHECKARCHIVE_FULLCRC    2
  31. #define CHECKARCHIVE_RECOVERY    4
  32. #define CHECKARCHIVE_SFX        8
  33. #define CHECKARCHIVE_ALL        16
  34. #endif
  35.  
  36. /* ISARC */
  37. #if !defined(ISARC_FUNCTION_START)
  38. #define ISARC_FUNCTION_START            0
  39. #define ISARC                            0
  40. #define ISARC_GET_VERSION                1
  41. #define ISARC_GET_CURSOR_INTERVAL        2
  42. #define ISARC_SET_CURSOR_INTERVAL        3
  43. #define ISARC_GET_BACK_GROUND_MODE        4
  44. #define ISARC_SET_BACK_GROUND_MODE        5
  45. #define ISARC_GET_CURSOR_MODE            6
  46. #define ISARC_SET_CURSOR_MODE            7
  47. #define ISARC_GET_RUNNING                8
  48.  
  49. #define ISARC_CHECK_ARCHIVE                16
  50. #define ISARC_CONFIG_DIALOG                17
  51. #define ISARC_GET_FILE_COUNT            18
  52. #define ISARC_QUERY_FUNCTION_LIST        19
  53. #define ISARC_HOUT                        20
  54. #define ISARC_STRUCTOUT                    21
  55. #define ISARC_GET_ARC_FILE_INFO            22
  56.  
  57. #define ISARC_OPEN_ARCHIVE                23
  58. #define ISARC_CLOSE_ARCHIVE                24
  59. #define ISARC_FIND_FIRST                25
  60. #define ISARC_FIND_NEXT                    26
  61. #define ISARC_EXTRACT                    27
  62. #define ISARC_ADD                        28
  63. #define ISARC_MOVE                        29
  64. #define ISARC_DELETE                    30
  65. #define ISARC_SETOWNERWINDOW            31
  66. #define ISARC_CLEAROWNERWINDOW            32
  67. #define ISARC_SETOWNERWINDOWEX            33
  68. #define ISARC_KILLOWNERWINDOWEX            34
  69.  
  70. #define ISARC_GET_ARC_FILE_NAME            40
  71. #define ISARC_GET_ARC_FILE_SIZE            41
  72. #define ISARC_GET_ARC_ORIGINAL_SIZE        42
  73. #define ISARC_GET_ARC_COMPRESSED_SIZE    43
  74. #define ISARC_GET_ARC_RATIO                44
  75. #define ISARC_GET_ARC_DATE                45
  76. #define ISARC_GET_ARC_TIME                46
  77. #define ISARC_GET_ARC_OS_TYPE            47
  78. #define ISARC_GET_ARC_IS_SFX_FILE        48
  79. #define ISARC_GET_ARC_WRITE_TIME_EX        49
  80. #define ISARC_GET_ARC_CREATE_TIME_EX    50
  81. #define    ISARC_GET_ARC_ACCESS_TIME_EX    51
  82. #define    ISARC_GET_ARC_CREATE_TIME_EX2    52
  83. #define ISARC_GET_ARC_WRITE_TIME_EX2    53
  84. #define ISARC_GET_FILE_NAME                57
  85. #define ISARC_GET_ORIGINAL_SIZE            58
  86. #define ISARC_GET_COMPRESSED_SIZE        59
  87. #define ISARC_GET_RATIO                    60
  88. #define ISARC_GET_DATE                    61
  89. #define ISARC_GET_TIME                    62
  90. #define ISARC_GET_CRC                    63
  91. #define ISARC_GET_ATTRIBUTE                64
  92. #define ISARC_GET_OS_TYPE                65
  93. #define ISARC_GET_METHOD                66
  94. #define ISARC_GET_WRITE_TIME            67
  95. #define ISARC_GET_CREATE_TIME            68
  96. #define ISARC_GET_ACCESS_TIME            69
  97. #define ISARC_GET_WRITE_TIME_EX            70
  98. #define ISARC_GET_CREATE_TIME_EX        71
  99. #define ISARC_GET_ACCESS_TIME_EX        72
  100. #define ISARC_SET_ENUM_MEMBERS_PROC        80
  101. #define ISARC_CLEAR_ENUM_MEMBERS_PROC    81
  102.  
  103. #define ISARC_FUNCTION_END                81
  104. #endif
  105.  
  106. /* ERROR */
  107. #if !defined(ERROR_START)
  108. #define ERROR_START                0x8000
  109.     /* warning */
  110. #define ERROR_DISK_SPACE        0x8005
  111. #define ERROR_READ_ONLY            0x8006
  112. #define ERROR_USER_SKIP            0x8007
  113. #define ERROR_UNKNOWN_TYPE        0x8008
  114. #define ERROR_METHOD            0x8009
  115. #define ERROR_PASSWORD_FILE        0x800A
  116. #define ERROR_VERSION            0x800B
  117. #define ERROR_FILE_CRC            0x800C
  118. #define ERROR_FILE_OPEN            0x800D
  119. #define ERROR_MORE_FRESH        0x800E
  120. #define ERROR_NOT_EXIST            0x800F
  121. #define ERROR_ALREADY_EXIST        0x8010
  122.  
  123. #define ERROR_TOO_MANY_FILES    0x8011
  124.     /* error */
  125. #define ERROR_MAKEDIRECTORY        0x8012
  126. #define ERROR_CANNOT_WRITE        0x8013
  127. #define ERROR_HUFFMAN_CODE        0x8014
  128. #define ERROR_COMMENT_HEADER    0x8015
  129. #define ERROR_HEADER_CRC        0x8016
  130. #define ERROR_HEADER_BROKEN        0x8017
  131. #define ERROR_ARC_FILE_OPEN        0x8018
  132. #define ERROR_NOT_ARC_FILE        0x8019
  133. #define ERROR_CANNOT_READ        0x801A
  134. #define ERROR_FILE_STYLE        0x801B
  135. #define ERROR_COMMAND_NAME        0x801C
  136. #define ERROR_MORE_HEAP_MEMORY    0x801D
  137. #define ERROR_ENOUGH_MEMORY        0x801E
  138. #if !defined(ERROR_ALREADY_RUNNING)
  139. #define ERROR_ALREADY_RUNNING    0x801F
  140. #endif
  141. #define ERROR_USER_CANCEL        0x8020
  142. #define ERRORhArc_ISNOT_OPENED    0x8021
  143. #define ERROR_NOT_SEARCH_MODE    0x8022
  144. #define ERROR_NOT_SUPPORT        0x8023
  145. #define ERROR_TIME_STAMP        0x8024
  146. #define ERROR_TMP_OPEN            0x8025
  147. #define ERROR_LONG_FILE_NAME    0x8026
  148. #define ERROR_ARC_READ_ONLY        0x8027
  149. #define ERROR_SAME_NAME_FILE    0x8028
  150. #define ERROR_NOT_FIND_ARC_FILE 0x8029
  151. #define ERROR_RESPONSE_READ        0x802A
  152. #define ERROR_NOT_FILENAME        0x802B
  153. #define ERROR_TMP_COPY            0x802C
  154. #define ERROR_EOF                0x802D
  155. #define ERROR_ADD_TO_LARC        0x802E
  156. #define ERROR_TMP_BACK_SPACE    0x802F
  157. #define ERROR_SHARING            0x8030
  158. #define ERROR_NOT_FIND_FILE        0x8031
  159. #define ERROR_LOG_FILE            0x8032
  160. #define    ERROR_NO_DEVICE            0x8033
  161. #define ERROR_GET_ATTRIBUTES    0x8034
  162. #define ERROR_SET_ATTRIBUTES    0x8035
  163. #define ERROR_GET_INFORMATION    0x8036
  164. #define ERROR_GET_POINT            0x8037
  165. #define ERROR_SET_POINT            0x8038
  166. #define ERROR_CONVERT_TIME        0x8039
  167. #define ERROR_GET_TIME            0x803a
  168. #define ERROR_SET_TIME            0x803b
  169. #define ERROR_CLOSE_FILE        0x803c
  170. #define ERROR_HEAP_MEMORY        0x803d
  171. #define ERROR_HANDLE            0x803e
  172. #define ERROR_TIME_STAMP_RANGE    0x803f
  173. #define ERROR_MAKE_ARCHIVE        0x8040
  174.  
  175. #define ERROR_END    ERROR_MAKE_ARCHIVE
  176. #define ERROR_BUF_TOO_SMALL        0x8041 /**/
  177. #endif
  178.  
  179. /* CONFIG */
  180. #if !defined(UNPACK_CONFIG_MODE)
  181. #define    UNPACK_CONFIG_MODE    1
  182. #define    PACK_CONFIG_MODE    2
  183. #endif
  184.  
  185. /* OPENARCHIVE */
  186. #if !defined(EXTRACT_FOUND_FILE)
  187. #define M_INIT_FILE_USE            0x00000001L
  188. #define M_REGARDLESS_INIT_FILE    0x00000002L
  189. #define M_NO_BACKGROUND_MODE    0x00000004L
  190. #define M_NOT_USE_TIME_STAMP    0x00000008L
  191. #define M_EXTRACT_REPLACE_FILE    0x00000010L
  192. #define M_EXTRACT_NEW_FILE        0x00000020L
  193. #define M_EXTRACT_UPDATE_FILE    0x00000040L
  194. #define M_CHECK_ALL_PATH        0x00000100L
  195. #define M_CHECK_FILENAME_ONLY    0x00000200L
  196. #define M_CHECK_DISK_SIZE        0x00000400L
  197. #define M_REGARDLESS_DISK_SIZE    0x00000800L
  198. #define M_USE_DRIVE_LETTER        0x00001000L
  199. #define M_NOT_USE_DRIVE_LETTER    0x00002000L
  200. #define M_INQUIRE_DIRECTORY        0x00004000L
  201. #define M_NOT_INQUIRE_DIRECTORY 0x00008000L
  202. #define M_INQUIRE_WRITE            0x00010000L
  203. #define M_NOT_INQUIRE_WRITE        0x00020000L
  204. #define M_CHECK_READONLY        0x00040000L
  205. #define M_REGARDLESS_READONLY    0x00080000L
  206. #define M_REGARD_E_COMMAND        0x00100000L
  207. #define M_REGARD_X_COMMAND        0x00200000L
  208. #define M_ERROR_MESSAGE_ON        0x00400000L
  209. #define M_ERROR_MESSAGE_OFF        0x00800000L
  210. #define M_BAR_WINDOW_ON            0x01000000L
  211. #define M_BAR_WINDOW_OFF        0x02000000L
  212. #define M_CHECK_PATH            0x04000000L
  213. #define M_RECOVERY_ON            0x08000000L
  214.  
  215. #define M_MAKE_INDEX_FILE        0x10000000L
  216. #define M_NOT_MAKE_INDEX_FILE    0x20000000L
  217. #define EXTRACT_FOUND_FILE        0x40000000L
  218. #define EXTRACT_NAMED_FILE        0x80000000L
  219. #endif
  220.  
  221. /* ATTRIBUTE */
  222. #ifndef FA_RDONLY
  223. #define FA_RDONLY       0x01
  224. #define FA_HIDDEN       0x02
  225. #define FA_SYSTEM       0x04
  226. #define FA_LABEL        0x08
  227. #define FA_DIREC        0x10
  228. #define FA_ARCH         0x20
  229. #endif
  230. #ifndef FA_ENCRYPTED
  231. #define FA_ENCRYPTED    0x40
  232. #endif
  233.  
  234. /* STRUCTURES */
  235. #if defined(__BORLANDC__)
  236. #pragma option -a-
  237. #else
  238. #pragma pack(1)
  239. #endif
  240.  
  241. typedef    HGLOBAL    HARCHIVE;
  242.  
  243. #ifndef ARC_DECSTRACT
  244. #define ARC_DECSTRACT
  245. typedef    HGLOBAL    HARC;
  246.  
  247. typedef struct {
  248.     DWORD    dwOriginalSize;
  249.     DWORD    dwCompressedSize;
  250.     DWORD    dwCRC;
  251.     UINT    uFlag;
  252.     UINT    uOSType;
  253.     WORD    wRatio;
  254.     WORD    wDate;
  255.     WORD    wTime;
  256.     char    szFileName[FNAME_MAX32 + 1];
  257.     char    dummy1[3];
  258.     char    szAttribute[8];
  259.     char    szMode[8];
  260. } INDIVIDUALINFO, FAR *LPINDIVIDUALINFO;
  261.  
  262. typedef struct {
  263.     DWORD    dwFileSize;
  264.     DWORD    dwWriteSize;
  265.     char    szSourceFileName[FNAME_MAX32 + 1];
  266.     char    dummy1[3];
  267.     char    szDestFileName[FNAME_MAX32 + 1];
  268.     char    dummy[3];
  269. } EXTRACTINGINFO, FAR *LPEXTRACTINGINFO;
  270.  
  271. typedef struct {
  272.     EXTRACTINGINFO exinfo;
  273.     DWORD dwCompressedSize;
  274.     DWORD dwCRC;
  275.     UINT  uOSType;
  276.     WORD  wRatio;
  277.     WORD  wDate;
  278.     WORD  wTime;
  279.     char  szAttribute[8];
  280.     char  szMode[8];
  281. } EXTRACTINGINFOEX, *LPEXTRACTINGINFOEX;
  282. #endif
  283.  
  284. #if !defined(__BORLANDC__)
  285. #pragma pack()
  286. #else
  287. #pragma option -a.
  288. #endif
  289.  
  290. #if !defined(__BORLANDC__)
  291. #define    _export
  292. #endif
  293.  
  294. /* WindowsMessage */
  295. #ifndef WM_ARCEXTRACT
  296. #define    WM_ARCEXTRACT    "wm_arcextract"
  297. #define    ARCEXTRACT_BEGIN        0
  298. #define    ARCEXTRACT_INPROCESS    1
  299. #define    ARCEXTRACT_END            2
  300. #define ARCEXTRACT_OPEN            3
  301. #define ARCEXTRACT_COPY            4
  302. typedef BOOL CALLBACK ARCHIVERPROC(HWND,UINT,UINT,LPEXTRACTINGINFOEX);
  303. typedef ARCHIVERPROC *LPARCHIVERPROC;
  304. #endif
  305.  
  306. /* API */
  307. #ifdef __cplusplus
  308. extern "C"
  309. #endif
  310. {
  311. /*LHA.DLL Ver.1.1と互換API*/
  312. int   WINAPI _export UnGCA(const HWND hWnd,LPCSTR szCmdLine,LPSTR szOutput, const DWORD dwSize);
  313. WORD  WINAPI _export UnGCAGetVersion(void);
  314. BOOL  WINAPI _export UnGCAGetRunning(void);
  315.  
  316. BOOL  WINAPI _export UnGCAGetBackGroundMode(void);
  317. BOOL  WINAPI _export UnGCASetBackGroundMode(const BOOL bBackGroundMode);
  318. BOOL  WINAPI _export UnGCAGetCursorMode(void);
  319. BOOL  WINAPI _export UnGCASetCursorMode(const BOOL bCursorMode);
  320. WORD  WINAPI _export UnGCAGetCursorInterval(void);
  321. BOOL  WINAPI _export UnGCASetCursorInterval(const WORD wInterval);
  322.  
  323. /*統合アーカイバAPI*/
  324. BOOL  WINAPI _export UnGCACheckArchive(LPCSTR szFileName, const int nMode);
  325. int   WINAPI _export UnGCAGetFileCount(LPCSTR szArcFile);
  326. BOOL  WINAPI _export UnGCAConfigDialog(const HWND hWnd,LPSTR szOptionBuffer, const int nMode);
  327. BOOL  WINAPI _export UnGCAQueryFunctionList(const int nFunction);
  328. /*
  329. WINAPI _export UnGCASetOwnerWindow(const HWND hWnd);
  330. BOOL WINAPI _export UnGCAClearOwnerWindow(void);
  331. typedef BOOL CALLBACK ARCHIVERPROC(HWND hWnd, UINT uiMsg, UINT uiState, LPEXTRACTINGINFOEX lpEis);
  332. typedef ARCHIVERPROC *LPARCHIVERPROC;
  333. BOOL WINAPI _export UnGCASetOwnerWindowEx(HWND hWnd, LPARCHIVERPROC lpArcProc);
  334. BOOL WINAPI _export UnGCAKillOwnerWindowEx(HWND hWnd);
  335. */
  336.  
  337. /*OpenArchive系API*/
  338. HARC  WINAPI _export UnGCAOpenArchive(const HWND hWnd, LPCSTR szFileName, const DWORD dwMode);
  339. int   WINAPI _export UnGCACloseArchive(HARC hArc);
  340. int   WINAPI _export UnGCAFindFirst(HARC hArc, LPCSTR szWildName, LPINDIVIDUALINFO lpSubInfo);
  341. int   WINAPI _export UnGCAFindNext(HARC hArc, LPINDIVIDUALINFO lpSubInfo);
  342.  
  343. int   WINAPI _export UnGCAGetArcFileName(HARC hArc, LPSTR szBuffer, const int nSize);
  344. DWORD WINAPI _export UnGCAGetArcFileSize(HARC hArc);
  345. DWORD WINAPI _export UnGCAGetArcOriginalSize(HARC hArc);
  346. DWORD WINAPI _export UnGCAGetArcCompressedSize(HARC hArc);
  347. BOOL WINAPI _export UnGCAGetArcFileSizeEx(HARC hArc, ULHA_INT64 *lpLLSize);
  348. BOOL WINAPI _export UnGCAGetArcOriginalSizeEx(HARC hArc, ULHA_INT64 *lpLLSize);
  349. BOOL WINAPI _export UnGCAGetArcCompressedSizeEx(HARC hArc, ULHA_INT64 *lpLLSize);
  350. WORD  WINAPI _export UnGCAGetArcRatio(HARC hArc);
  351. WORD  WINAPI _export UnGCAGetArcDate(HARC hArc);
  352. WORD  WINAPI _export UnGCAGetArcTime(HARC hArc);
  353.  
  354. BOOL  WINAPI _export UnGCAGetArcWriteTimeEx(HARC hArc, FILETIME *lpftLastWriteTime);
  355. BOOL  WINAPI _export UnGCAGetArcCreateTimeEx(HARC hArc, FILETIME *lpftCreationTime);
  356. BOOL  WINAPI _export UnGCAGetArcAccessTimeEx(HARC hArc, FILETIME *lpftLastAccessTime);
  357. UINT  WINAPI _export UnGCAGetArcOSType(HARC hArc);
  358. /*
  359. int WINAPI _export UnGCAIsSFXFile(HARC hArc);
  360. */
  361. int   WINAPI _export UnGCAGetFileName(HARC hArc, LPSTR szBuffer, const int nSize);
  362. int   WINAPI _export UnGCAGetMethod(HARC hArc, LPSTR szBuffer, const int nSize);
  363. DWORD WINAPI _export UnGCAGetOriginalSize(HARC hArc);
  364. DWORD WINAPI _export UnGCAGetCompressedSize(HARC hArc);
  365.  
  366.  
  367. WORD  WINAPI _export UnGCAGetRatio(HARC hArc);
  368. WORD  WINAPI _export UnGCAGetDate(HARC hArc);
  369. WORD  WINAPI _export UnGCAGetTime(HARC hArc);
  370. BOOL WINAPI _export UnGCAGetOriginalSizeEx(HARC hArc, ULHA_INT64 *lpLLSize);
  371. BOOL WINAPI _export UnGCAGetCompressedSizeEx(HARC hArc, ULHA_INT64 *lpLLSize);
  372. DWORD WINAPI _export UnGCAGetWriteTime(HARC hArc);
  373. BOOL  WINAPI _export UnGCAGetWriteTimeEx(HARC hArc, FILETIME *lpftLastWriteTime);
  374.  
  375. DWORD WINAPI _export UnGCAGetCRC(HARC hArc);
  376. int   WINAPI _export UnGCAGetAttribute(HARC hArc);
  377. UINT  WINAPI _export UnGCAGetOSType(HARC hArc);
  378.  
  379. /*UNLHA32.DLL独自API*/
  380. WORD  WINAPI _export UnGCAGetSubVersion(void);
  381. int   WINAPI _export UnGCAExtractMem(const HWND hWnd, LPCSTR szCmdLine, LPBYTE lpbBuffer, const DWORD dwSize, time_t *lpTime, LPWORD lpwAttr, LPDWORD lpdwWriteSize);
  382.  
  383. #ifdef __cplusplus
  384. }
  385. #endif
  386.  
  387. #endif
  388.