ReadHeader: Difference between revisions

From TotalcmdWiki
Jump to navigation Jump to search
(backlins)
m (typo)
 
Line 6: Line 6:


ReadHeader is called as long as it returns zero (as long as the previous call to this function returned zero).
ReadHeader is called as long as it returns zero (as long as the previous call to this function returned zero).
* Each time it is called, ''HeaderData'' is supposed to provide Totalcmd with information about the next file contained in the archive. When all files in the archive have been returned, ReadHeader should return E_END_ARCHIVE which will prevent ReaderHeader from being called again. If an error occurs, ReadHeader should return one of the [[Packer plugins developper errors|error values]] or 0 for no error.
* Each time it is called, ''HeaderData'' is supposed to provide Totalcmd with information about the next file contained in the archive. When all files in the archive have been returned, ReadHeader should return E_END_ARCHIVE which will prevent ReaderHeader from being called again. If an error occurs, ReadHeader should return one of the [[Packer plugins developer errors|error values]] or 0 for no error.
* ''hArcData'' contains the handle returned by [[OpenArchive]]. The programmer is encouraged to store other information in the location that can be accessed via this handle. For example, you may want to store the position in the archive when returning files information in ReadHeader.
* ''hArcData'' contains the handle returned by [[OpenArchive]]. The programmer is encouraged to store other information in the location that can be accessed via this handle. For example, you may want to store the position in the archive when returning files information in ReadHeader.



Latest revision as of 19:56, 18 April 2006

Totalcmd calls ReadHeader to find out what files are in the archive.

 int __stdcall ReadHeader (HANDLE hArcData, tHeaderData *HeaderData);

Description

ReadHeader is called as long as it returns zero (as long as the previous call to this function returned zero).

  • Each time it is called, HeaderData is supposed to provide Totalcmd with information about the next file contained in the archive. When all files in the archive have been returned, ReadHeader should return E_END_ARCHIVE which will prevent ReaderHeader from being called again. If an error occurs, ReadHeader should return one of the error values or 0 for no error.
  • hArcData contains the handle returned by OpenArchive. The programmer is encouraged to store other information in the location that can be accessed via this handle. For example, you may want to store the position in the archive when returning files information in ReadHeader.

In short, you are supposed to set at least the PackSize, UnpSize, FileTime, and FileName members of tHeaderData. Totalcmd will use this information to display content of the archive when the archive is viewed as a directory.


Back to Packer plugins developer guide

Back to Packer plugins developer guide overview Back to ProcessFile Back to THeaderData