ReadHeader: Difference between revisions

From TotalcmdWiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 5: Line 5:
== Description ==
== 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.
ReadHeader is called as long as it returns zero (as long as the previous call to this function returned zero).
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.
* 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 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.
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.

Revision as of 14:54, 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.