ReadHeader: Difference between revisions

From TotalcmdWiki
Jump to navigation Jump to search
No edit summary
 
m (typo)
 
(3 intermediate revisions by 2 users not shown)
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 [[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.


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.
 
{{backlink|Packer plugins developer guide|Packer plugins developer guide}}
{{back|Packer plugins developer guide overview|Packer plugins developer guide overview}}
{{back|ProcessFile|ProcessFile}}
{{Back|THeaderData|THeaderData}}

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