home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2001 January / VPR0101A.BIN / OLS / TAR32053 / tar32053.exe / SDK / API_TARE.TXT < prev    next >
Text File  |  1999-05-23  |  16KB  |  392 lines

  1. =====================================================================
  2.                Tar32.DLL Ver x.xx API Reference
  3. =======================================================================
  4. -----------------------------------------------------------------------
  5. int WINAPI Tar(const HWND hWnd,LPCSTR szCmdLine,LPSTR szOutput,
  6.          const DWORD dwSize);
  7. -----------------------------------------------------------------------
  8.  
  9. Description
  10.     Do Pack & Unpack using command.
  11.  
  12. Arguments
  13.     hWnd        Window Handle
  14.     szCmdLine    Command Line String. Please see cmd_tare.txt.
  15.     
  16.     szOutput    Buffer that command result.
  17.     dwSize        szOutPut buffer size.
  18.  
  19. Example
  20.     ret = Tar(hWnd,"-zxvf filename.tgz",NULL,0);
  21.  
  22. -----------------------------------------------------------------------
  23. BOOL WINAPI TarCheckArchive(LPCSTR szFileName,const int iMode);
  24. -----------------------------------------------------------------------
  25. -----------------------------------------------------------------------
  26. int WINAPI TarGetArchiveType(LPCSTR szFileName);
  27. -----------------------------------------------------------------------
  28. Description
  29.     Get ArchiveFile Type.
  30.  
  31. Arguments
  32.     szFileName    Filename
  33.     
  34. Return Value
  35.     ARCHIVETYPE_TAR (1)    TAR
  36.     ARCHIVETYPE_TARGZ (2)    TAR.GZ(TGZ)
  37.     ARCHIVETYPE_TARZ (3)    TAR.Z(TAZ)
  38.     ARCHIVETYPE_GZ (4)    GZ
  39.     ARCHIVETYPE_Z (5)    Z
  40.     
  41.     0            other format.
  42.     -1            Error
  43.  
  44. -----------------------------------------------------------------------
  45. BOOL WINAPI TarConfigDialog(const HWND hWnd,LPSTR szOptionBuffer,
  46.             const int iMode);
  47. -----------------------------------------------------------------------
  48.  
  49. Description
  50.     Display Dialog
  51.  
  52.     hwnd        Window Handle
  53.     szOptionBuffer  Buffer(Current Ignore)
  54.     iMode        mode(Current Ignore)
  55.  
  56. Return Value
  57.     ERROR_ALREADY_RUNNING    Error
  58.     TRUE            Success
  59.     FALSE            Cancel
  60.  
  61. Other
  62.     Configration is saved at Registory HKEY_CURRENT_USER 
  63.     Software\ArchiverDLL
  64.  
  65. -----------------------------------------------------------------------
  66. WORD WINAPI TarGetVersion(VOID);
  67. -----------------------------------------------------------------------
  68. Description
  69.     Ger Version Number.(*100)
  70.  
  71. Return
  72.     Current Version   Return Value
  73.     0.12        ->12
  74.     0.3        ->30
  75.     
  76.  
  77. -----------------------------------------------------------------------
  78. BOOL WINAPI TarGetRunning(VOID);
  79. -----------------------------------------------------------------------
  80. -----------------------------------------------------------------------
  81. BOOL WINAPI TarGetBackGroundMode(VOID);
  82. -----------------------------------------------------------------------
  83. -----------------------------------------------------------------------
  84. BOOL WINAPI TarSetBackGroundMode(const BOOL bBackGroundMode);
  85. -----------------------------------------------------------------------
  86. -----------------------------------------------------------------------
  87. BOOL WINAPI TarGetCursorMode(VOID);
  88. -----------------------------------------------------------------------
  89. -----------------------------------------------------------------------
  90. BOOL WINAPI TarSetCursorMode(const BOOL bCursorMode);
  91. -----------------------------------------------------------------------
  92. -----------------------------------------------------------------------
  93. WORD WINAPI TarGetCursorInterval(VOID);
  94. -----------------------------------------------------------------------
  95. -----------------------------------------------------------------------
  96. BOOL WINAPI TarSetCursorInterval(const WORD wInterval);
  97. -----------------------------------------------------------------------
  98. -----------------------------------------------------------------------
  99. int WINAPI TarGetArcFileInfo(LPSTR szFileName, MAININFO *lpMainInfo);
  100. -----------------------------------------------------------------------
  101. -----------------------------------------------------------------------
  102. int WINAPI TarGetFileCount(LPCSTR szArcFile);
  103. -----------------------------------------------------------------------
  104. -----------------------------------------------------------------------
  105. BOOL WINAPI TarQueryFunctionList(const int iFunction);
  106. -----------------------------------------------------------------------
  107. Description
  108.     You get information whether you can use specified API or not.
  109.     
  110. Arguments
  111.     iFunction    Numeric Value that identify API.
  112.             Please refer TAR32.H for concreate value.
  113.             (ex: ISARC_GET_VERSION)
  114.  
  115. Return Value
  116.     TRUE(1)        You can use that API.
  117.     FALSE(0)    cannot.
  118.     
  119. -----------------------------------------------------------------------
  120. HARC WINAPI TarOpenArchive(const HWND hWnd,LPCSTR szFileName,
  121.                 const DWORD dwMode);
  122. -----------------------------------------------------------------------
  123. Description
  124.     Open Archiver-file.and return ARCHIVER-HANDLE.
  125.     You can access archiver using this handle.
  126.     (TarFindFirst/TarFindNext/TarCloseArchive)
  127.     This API only support TAR/TGZ(tar.gz)/TAZ(tar.Z),and not support GZ/Z.
  128.     TarOpenArchive and TarFinfFist API is similar to WIN32 FindFirst() API.
  129.  
  130.             
  131. Arguments.
  132.     hwnd        Window Handle
  133.     szFileName    filename
  134.     dwMode        mode(current ignore)
  135.  
  136. Return Value:
  137.     Archiver Handle.
  138.     If error,return NULL.
  139.  
  140. Example:
  141.         INDIVIDUALINFO info;
  142.         harc = TarOpenArchive(hwnd,"filename.tgz",0);
  143.         if(harc == NULL){ ERROR }
  144.         ret = TarFindFirst(harc,"*.*",info);
  145.         while(ret){
  146.             /* filename is info.szFileName */
  147.             /* ... */
  148.             ret = TarFindNext(harc,&info);
  149.         }
  150.         TarCloseArchive(harc);
  151.  
  152.  
  153. -----------------------------------------------------------------------
  154. int WINAPI TarCloseArchive(HARC hArc);
  155. -----------------------------------------------------------------------
  156. Description
  157.     Release handle that allocated at TarOpenArchive().
  158.     This API is similar to WIN32 FindClose() API.
  159.  
  160. Arguments
  161.     hArc        Handle that allocated at TarOpenArchive()
  162.  
  163. Return Value
  164.     0    OK
  165.     Other    Error
  166.  
  167. -----------------------------------------------------------------------
  168. int WINAPI TarFindFirst(HARC hArc,
  169.             LPCSTR szWildName,LPINDIVIDUALINFO lpSubInfo);
  170. -----------------------------------------------------------------------
  171. Description
  172.     Get Information about the first filename stored in archiver.
  173.     This API is similar to WIN32 FindFirstFile() API.
  174.     TarOpenArchive and TarFinfFist API is similar to WIN32 FindFirst() API.
  175.  
  176. Arguments
  177.     hAac        handle that TarOpenArchive() retun.
  178.     szWildName    Search filename. You can use wildcard(*,?).
  179.             If specified "",Search all filename.( = "*.*")
  180.     lpSubInfo    A Pointer to INDIVIDUALINFO structure that recieve information about each stored file.
  181.  
  182. Return
  183.     0    Success
  184.     -1    End of Search.
  185.  
  186. -----------------------------------------------------------------------
  187. int WINAPI TarFindNext(HARC hArc,LPINDIVIDUALINFO lpSubInfo);
  188. -----------------------------------------------------------------------
  189. Description
  190.     Get stored file information of the next of TarFindFirst() or TarFindNext() API.
  191.     This API is similar to WIN32 FindNextFile() API.
  192.  
  193. Arguments
  194.     hAac        handle that TarOpenArchive() retun.
  195.     szWildName    Search filename. You can use wildcard(*,?).
  196.             If specified "",Search all filename.( = "*.*")
  197.     lpSubInfo    A Pointer to INDIVIDUALINFO structure that recieve information about each stored file.
  198.  
  199. Return
  200.     0    Success
  201.     -1    End of Search.
  202.  
  203. -----------------------------------------------------------------------
  204. int WINAPI TarExtract(HARC hArc,LPCSTR szFileName,
  205.                 LPCSTR szDirName, DWORD dwMode);
  206. -----------------------------------------------------------------------
  207. -----------------------------------------------------------------------
  208. int WINAPI TarAdd(HARC hArc,LPCSTR szFileName,DWORD dwMode);
  209. -----------------------------------------------------------------------
  210. -----------------------------------------------------------------------
  211. int WINAPI TarMove(HARC hArc,LPCSTR szFileName,DWORD dwMode);
  212. -----------------------------------------------------------------------
  213. -----------------------------------------------------------------------
  214. int WINAPI TarDelete(HARC hArc,LPCSTR szFileName,DWORD dwMode);
  215. -----------------------------------------------------------------------
  216. -----------------------------------------------------------------------
  217. int WINAPI TarGetArcFileName(HARC hArc,LPCSTR lpBuffer,int nSize);
  218. -----------------------------------------------------------------------
  219. -----------------------------------------------------------------------
  220. DWORD WINAPI TarGetArcFileSize(HARC hArc);
  221. -----------------------------------------------------------------------
  222. -----------------------------------------------------------------------
  223. DWORD WINAPI TarGetArcOriginalSize(HARC hArc);
  224. -----------------------------------------------------------------------
  225. -----------------------------------------------------------------------
  226. DWORD WINAPI TarGetArcCompressedSize(HARC hArc);
  227. -----------------------------------------------------------------------
  228. -----------------------------------------------------------------------
  229. WORD WINAPI TarGetArcRatio(HARC hArc);
  230. -----------------------------------------------------------------------
  231. -----------------------------------------------------------------------
  232. WORD WINAPI TarGetArcDate(HARC hArc);
  233. -----------------------------------------------------------------------
  234. -----------------------------------------------------------------------
  235. WORD WINAPI TarGetArcTime(HARC hArc);
  236. -----------------------------------------------------------------------
  237. -----------------------------------------------------------------------
  238. UINT WINAPI TarGetArcOSType(HARC hArc);
  239. -----------------------------------------------------------------------
  240. -----------------------------------------------------------------------
  241. int WINAPI TarIsSFXFile(HARC hArc);
  242. -----------------------------------------------------------------------
  243. -----------------------------------------------------------------------
  244. int WINAPI TarGetFileName(HARC hArc,LPCSTR lpBuffer,int nSize);
  245. -----------------------------------------------------------------------
  246. -----------------------------------------------------------------------
  247. DWORD WINAPI TarGetOriginalSize(HARC hArc);
  248. -----------------------------------------------------------------------
  249. -----------------------------------------------------------------------
  250. DWORD WINAPI TarGetCompressedSize(HARC harc);
  251. -----------------------------------------------------------------------
  252. -----------------------------------------------------------------------
  253. WORD WINAPI TarGetRatio(HARC hArc);
  254. -----------------------------------------------------------------------
  255. -----------------------------------------------------------------------
  256. WORD WINAPI TarGetDate(HARC hArc);
  257. -----------------------------------------------------------------------
  258. -----------------------------------------------------------------------
  259. WORD WINAPI TarGetTime(HARC hArc);
  260. -----------------------------------------------------------------------
  261. -----------------------------------------------------------------------
  262. DWORD WINAPI TarGetCRC(HARC hArc);
  263. -----------------------------------------------------------------------
  264. -----------------------------------------------------------------------
  265. int WINAPI TarGetAttribute(HARC hArc);
  266. -----------------------------------------------------------------------
  267. -----------------------------------------------------------------------
  268. UINT WINAPI TarGetOSType(HARC hArc);
  269. -----------------------------------------------------------------------
  270. -----------------------------------------------------------------------
  271. int WINAPI TarExtractMem(const HWND hWnd,LPCSTR szCmdLine,
  272.         LPBYTE szBuffer,const DWORD dwSize,time_t *lpTime,
  273.         LPWORD lpwAttr,LPDWORD lpdwWriteSize);
  274. -----------------------------------------------------------------------
  275. -----------------------------------------------------------------------
  276. int WINAPI TarCompressMem(const HWND hWnd,LPCSTR szCmdLine,
  277.         const LPBYTE szBuffer,const DWORD dwSize,
  278.         const time_t *lpTime,const LPWORD lpwAttr,
  279.         LPDWORD lpdwWriteSize);
  280. -----------------------------------------------------------------------
  281. -----------------------------------------------------------------------
  282. BOOL WINAPI TarSetOwnerWindow(HWND hWnd);
  283. -----------------------------------------------------------------------
  284. -----------------------------------------------------------------------
  285. BOOL WINAPI TarClearOwnerWindow(VOID);
  286. -----------------------------------------------------------------------
  287. -----------------------------------------------------------------------
  288. BOOL WINAPI TarSetOwnerWindowEx(HWND hWnd,LPARCHIVERPROC lpArcProc)
  289. -----------------------------------------------------------------------
  290. -----------------------------------------------------------------------
  291. BOOL WINAPI TarKillOwnerWindowEx(HWND hWnd)
  292. -----------------------------------------------------------------------
  293.  
  294. -----------------------------------------------------------------------
  295. INDIVIDUALINFO Structure
  296. -----------------------------------------------------------------------
  297. Structure Definition
  298.         typedef struct {
  299.             char        szFileName[FNAME_MAX + 1];
  300.             UINT        uFlag;
  301.             DWORD         dwOriginalSize;
  302.             DWORD         dwCompressedSize;
  303.             WORD        wRatio;
  304.             WORD        wDate;
  305.             WORD         wTime;
  306.             DWORD        dwCRC;
  307.             char        szAttribute[5];
  308.             char        szMode[8];
  309.             UINT        uOSType;
  310.         } INDIVIDUALINFO;
  311.  
  312. Member variables
  313.     szFileName        Archive FileName
  314.     uFlag            Not Supported.
  315.     
  316.     dwOriginalSize        Original File Size
  317.     dwCompressedSize    Compressed File Size.(always 0 at TAR32.DLL)
  318.     wRatio            Pack Ratio(always 0 at TAR32.DLL)
  319.     wDate            Stored File's Data
  320.                 Format:
  321.                  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
  322.                 +---------------+---------------+
  323.                 + Year - 1980 | Month |  Date   |
  324.                 +---------------+---------------+
  325.     wTime            Store's File's Time.
  326.                 Format:
  327.                  0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
  328.                 +---------------+---------------+
  329.                 + Hour    | Minutes   |Second/2 |
  330.                 +---------------+---------------+
  331.     
  332.     dwCRC            CRC
  333.     szAttribute        Attribute of stored file.
  334.     szMode            mode(not supported)
  335.     uOSType            OS(always 0)
  336.  
  337.  
  338. -----------------------------------------------------------------------
  339. Windows Message
  340. -----------------------------------------------------------------------
  341. +wm_arcextract
  342.  
  343. wm_arcextract
  344.  
  345. nMode = (int)wParam            /* Notify Mode */
  346. lpEis = (LPEXTRACTINGINFO)lParam    /* Pointer to Structure */
  347.  
  348.   TAR32.DLL can send wm_arcextract message to the window specified by TarSetOwnerWindow().
  349.   
  350. nMode        wParam value. The state of processing.
  351.  
  352.     0 : Begin
  353.     1 : Processing.
  354.     2 : End.
  355.  
  356. lpEis        lParam value. A pointer to EXTRACTINGINFO that store filename,etc.
  357.  
  358. -----------------------------------------------------------------------
  359. EXTRACTINGINFO Structure
  360. -----------------------------------------------------------------------
  361.         typedef struct {
  362.             char    szSourceFileName[FNAME_MAX + 1];
  363.             char    szDestFileName[FNAME_MAX + 1];
  364.             DWORD    dwFileSize;
  365.             DWORD    dwWriteSize;
  366.         }  EXTRACTINGINFO
  367.  
  368. Member variables.
  369.     szSourceFileName    
  370.     szDestFileName        
  371.     dwFileSize        
  372.     dwWriteSize        
  373.  
  374. ------------------------------------------------------------------------
  375. TAR32.DLL Message Processing
  376. ------------------------------------------------------------------------
  377. foreach file in archiver{
  378.     Send Message by nMode:0
  379.     while unpacking file{
  380.         Send Message by nMode:1
  381.     }
  382. }
  383. Send Message by nMode:2
  384.  
  385. -----------------------------------------------------------------------
  386. Attention
  387. -----------------------------------------------------------------------
  388.  
  389. API Specification may be changed.
  390.  
  391. =======================================================================
  392.