1 Archive support plugin considers all *.fmt DLL modules in Formats
\r
2 directory as second level plugins. Examples of such plugins
\r
3 are supplied here. To reduce the size of the compiled DLLs,
\r
4 the examples mainly use Win32 API functions and were compiled
\r
5 without the standard C startup code.
\r
7 Second-level archive support plugins must export the following functions:
\r
9 ----------------------------------------------------------------------------
\r
10 Called when second-level plugin module is loaded. This function
\r
11 is optional and may be omitted.
\r
13 DWORD WINAPI _export LoadFormatModule(
\r
14 const char *ModuleName
\r
18 ModuleName - name of the second-level plugin module
\r
21 Must be 0. In future it may be used to return second-level
\r
23 ----------------------------------------------------------------------------
\r
24 Checks if the given archive file is supported by the plugin or not.
\r
26 BOOL WINAPI IsArchive(
\r
28 const unsigned char *Data,
\r
35 DataSize - archive data size
\r
38 TRUE if this archive type is supported.
\r
40 ----------------------------------------------------------------------------
\r
41 Open archive and prepare to read it. Called after successful IsArchive.
\r
43 BOOL WINAPI OpenArchive(
\r
50 Type - if the plugin supports several archive types, it must put the type
\r
51 here, otherwise set *Type to 0
\r
54 TRUE if the archive was opened successfully.
\r
56 ----------------------------------------------------------------------------
\r
57 Get the next archive item. Called after OpenArchive.
\r
59 int WINAPI GetArcItem(
\r
60 struct PluginPanelItem *Item,
\r
61 struct ArcItemInfo *Info
\r
65 Item - this structure must be filled. Read its description in plugins.hlp.
\r
66 Info - additional item info, which should be filled if possible.
\r
70 char HostOS[32]; - Host OS name or empty if unknown
\r
71 char Description[256]; - Item description or empty string
\r
72 int Solid; - "Solid" flag
\r
73 int Comment; - Set if file comment is present
\r
74 int Encrypted; - Set if file is encrypted
\r
75 int DictSize; - Dictionary size or 0 if unknown
\r
76 int UnpVer; - Version to unpack (HighNumber*256+LowNumber)
\r
78 int Chapter; - chapter item
\r
81 This structure is filled with zeros before it is passed to GetArcItem.
\r
84 GETARC_EOF End of archive
\r
85 GETARC_SUCCESS Item successfully read
\r
86 GETARC_BROKEN Archive broken
\r
87 GETARC_UNEXPEOF Unexpected end of archive
\r
88 GETARC_READERROR Read error
\r
90 ----------------------------------------------------------------------------
\r
91 Close the archive. Called after the last GetArcItem call.
\r
93 BOOL WINAPI CloseArchive(
\r
94 struct ArcInfo *Info
\r
98 Info - additional archive info, which should be filled if possible.
\r
102 int SFXSize; - SFX module size
\r
103 int Volume; - Volume flag
\r
104 int Comment; - Archive comment present
\r
105 int Recovery; - Recovery record present
\r
106 int Lock; - Archive is locked
\r
107 DWORD Flags; - Additional archive information flags
\r
108 DWORD Reserved; - Reserved
\r
109 int Chapters; - count chapters in archive
\r
112 'Flags' field can be combination of the following values:
\r
114 AF_AVPRESENT Authenticity information present
\r
116 AF_IGNOREERRORS Archiver commands exit code must be ignored
\r
119 This structure is filled with zeros before it is passed to CloseArchive.
\r
122 TRUE if successful.
\r
124 ----------------------------------------------------------------------------
\r
125 Get the archive format name.
\r
127 BOOL WINAPI GetFormatName(
\r
134 Type - archive type
\r
135 FormatName - format name. It will be used to save parameters
\r
136 in registry and select desired format
\r
137 DefaultExt - default file extension for this format (without dot).
\r
138 Used to increase format recognizing speed.
\r
141 TRUE if successful. If specified Type value is greater than
\r
142 the maximum supported, FALSE must be returned.
\r
144 ----------------------------------------------------------------------------
\r
145 Get the default archiver command strings.
\r
147 BOOL WINAPI GetDefaultCommands(
\r
154 Type - archive type
\r
155 Command - command number
\r
157 1 - extract without path
\r
164 8 - add recovery record
\r
168 12 - add files and folders
\r
169 13 - move files and folders
\r
170 14 - mask to select all files
\r
172 Dest - buffer to copy the command
\r
175 TRUE if successful. If specified Type value is greater than the maximum
\r
176 supported, FALSE must be returned. If Type is supported, but the required
\r
177 command is absent, return TRUE and set Dest to an empty string.
\r
180 ----------------------------------------------------------------------------
\r
181 Send a pointer to the PluginStartupInfo structure. Called when the
\r
182 second-level plugin module is loaded (called after the LoadFormatModule
\r
183 function). This function is optional and may be omitted.
\r
185 void WINAPI SetFarInfo(
\r
186 const struct PluginStartupInfo *Info
\r
190 Info - plugin startup info:
\r
195 ----------------------------------------------------------------------------
\r
196 Returns the start position of the archive in the stream of data passed
\r
197 to the IsArchive function. The function GetSFXPos is called
\r
198 immediately after the archive has been recognized by the IsArchive
\r
199 function. MultiArc selects the FMT module that has returned the lowest
\r
200 offset (closer to the beginning of the file). This allows to handle
\r
201 correctly the situation when, for example, an ARJ archive is stored
\r
202 without compression in a ZIP archive called "N3gk8v1t.106". Previous
\r
203 versions of MultiArc showed the ARJ archive, and not the ZIP archive,
\r
204 when entering such file.
\r
206 BOOL WINAPI GetSFXPos(void);
\r
212 Offset of the archive beginning from the start of the file.
\r
215 ----------------------------------------------------------------------------
\r
216 ATTENTION! IF YOU WRITE ARCHIVE FORMAT PLUGINS, KEEP IN MIND THAT THE CURRENT
\r
217 STRUCTURE ALIGNMENT MAY BE DIFFERENT FROM 1, AND IF YOU NEED TO DESCRIBE THE
\r
218 STRUCTURE OF YOUR ARCHIVE FILE PRECISELY, THEN SWITCH ALIGNMENT BEFORE YOUR
\r
219 STRUCTURE DEFINITION EXPLICITLY! OTHERWISE THE FIELDS IN YOUR STRUCTURE MAY
\r
220 HAVE THE WRONG SIZE.
\r
222 For explanations about alignment, consult your compiler manual.
\r
223 ----------------------------------------------------------------------------
\r