File: structmscab__decompressor.html

package info (click to toggle)
libmspack 0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 3,916 kB
  • sloc: sh: 11,332; ansic: 7,879; perl: 131; makefile: 97
file content (358 lines) | stat: -rw-r--r-- 37,852 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>libmspack: mscab_decompressor Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">libmspack
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="classes.html"><span>Data&#160;Structure&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Data&#160;Fields</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-attribs">Data Fields</a>  </div>
  <div class="headertitle">
<div class="title">mscab_decompressor Struct Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A decompressor for .CAB (Microsoft Cabinet) files.  
 <a href="structmscab__decompressor.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="mspack_8h_source.html">mspack.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:ad2d5af33948f587fcb9b57d4f70a621e"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structmscabd__cabinet.html">mscabd_cabinet</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmscab__decompressor.html#ad2d5af33948f587fcb9b57d4f70a621e">open</a> )(struct <a class="el" href="structmscab__decompressor.html">mscab_decompressor</a> *self, const char *filename)</td></tr>
<tr class="memdesc:ad2d5af33948f587fcb9b57d4f70a621e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Opens a cabinet file and reads its contents.  <a href="#ad2d5af33948f587fcb9b57d4f70a621e">More...</a><br/></td></tr>
<tr class="separator:ad2d5af33948f587fcb9b57d4f70a621e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab469fdadc4bd9a58574427bcd0138a01"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmscab__decompressor.html#ab469fdadc4bd9a58574427bcd0138a01">close</a> )(struct <a class="el" href="structmscab__decompressor.html">mscab_decompressor</a> *self, struct <a class="el" href="structmscabd__cabinet.html">mscabd_cabinet</a> *cab)</td></tr>
<tr class="memdesc:ab469fdadc4bd9a58574427bcd0138a01"><td class="mdescLeft">&#160;</td><td class="mdescRight">Closes a previously opened cabinet or cabinet set.  <a href="#ab469fdadc4bd9a58574427bcd0138a01">More...</a><br/></td></tr>
<tr class="separator:ab469fdadc4bd9a58574427bcd0138a01"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac389b8ac60162e33f6292de8b94d2d0"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structmscabd__cabinet.html">mscabd_cabinet</a> *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmscab__decompressor.html#aac389b8ac60162e33f6292de8b94d2d0">search</a> )(struct <a class="el" href="structmscab__decompressor.html">mscab_decompressor</a> *self, const char *filename)</td></tr>
<tr class="memdesc:aac389b8ac60162e33f6292de8b94d2d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Searches a regular file for embedded cabinets.  <a href="#aac389b8ac60162e33f6292de8b94d2d0">More...</a><br/></td></tr>
<tr class="separator:aac389b8ac60162e33f6292de8b94d2d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00eb7059f80ef8bed33f8bd410c9d665"><td class="memItemLeft" align="right" valign="top">int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmscab__decompressor.html#a00eb7059f80ef8bed33f8bd410c9d665">append</a> )(struct <a class="el" href="structmscab__decompressor.html">mscab_decompressor</a> *self, struct <a class="el" href="structmscabd__cabinet.html">mscabd_cabinet</a> *cab, struct <a class="el" href="structmscabd__cabinet.html">mscabd_cabinet</a> *nextcab)</td></tr>
<tr class="memdesc:a00eb7059f80ef8bed33f8bd410c9d665"><td class="mdescLeft">&#160;</td><td class="mdescRight">Appends one <a class="el" href="structmscabd__cabinet.html" title="A structure which represents a single cabinet file. ">mscabd_cabinet</a> to another, forming or extending a cabinet set.  <a href="#a00eb7059f80ef8bed33f8bd410c9d665">More...</a><br/></td></tr>
<tr class="separator:a00eb7059f80ef8bed33f8bd410c9d665"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8cd61b0d08747508291a9e1e6c753ec7"><td class="memItemLeft" align="right" valign="top">int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmscab__decompressor.html#a8cd61b0d08747508291a9e1e6c753ec7">prepend</a> )(struct <a class="el" href="structmscab__decompressor.html">mscab_decompressor</a> *self, struct <a class="el" href="structmscabd__cabinet.html">mscabd_cabinet</a> *cab, struct <a class="el" href="structmscabd__cabinet.html">mscabd_cabinet</a> *prevcab)</td></tr>
<tr class="memdesc:a8cd61b0d08747508291a9e1e6c753ec7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prepends one <a class="el" href="structmscabd__cabinet.html" title="A structure which represents a single cabinet file. ">mscabd_cabinet</a> to another, forming or extending a cabinet set.  <a href="#a8cd61b0d08747508291a9e1e6c753ec7">More...</a><br/></td></tr>
<tr class="separator:a8cd61b0d08747508291a9e1e6c753ec7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8224719c30138a5f6322048859b8ca52"><td class="memItemLeft" align="right" valign="top">int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmscab__decompressor.html#a8224719c30138a5f6322048859b8ca52">extract</a> )(struct <a class="el" href="structmscab__decompressor.html">mscab_decompressor</a> *self, struct <a class="el" href="structmscabd__file.html">mscabd_file</a> *file, const char *filename)</td></tr>
<tr class="memdesc:a8224719c30138a5f6322048859b8ca52"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extracts a file from a cabinet or cabinet set.  <a href="#a8224719c30138a5f6322048859b8ca52">More...</a><br/></td></tr>
<tr class="separator:a8224719c30138a5f6322048859b8ca52"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae818d71d1b62101c063edefcaa43fb08"><td class="memItemLeft" align="right" valign="top">int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmscab__decompressor.html#ae818d71d1b62101c063edefcaa43fb08">set_param</a> )(struct <a class="el" href="structmscab__decompressor.html">mscab_decompressor</a> *self, int param, int value)</td></tr>
<tr class="memdesc:ae818d71d1b62101c063edefcaa43fb08"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a CAB decompression engine parameter.  <a href="#ae818d71d1b62101c063edefcaa43fb08">More...</a><br/></td></tr>
<tr class="separator:ae818d71d1b62101c063edefcaa43fb08"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a52b374b473d3144407ae2ca0e704a6a5"><td class="memItemLeft" align="right" valign="top">int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmscab__decompressor.html#a52b374b473d3144407ae2ca0e704a6a5">last_error</a> )(struct <a class="el" href="structmscab__decompressor.html">mscab_decompressor</a> *self)</td></tr>
<tr class="memdesc:a52b374b473d3144407ae2ca0e704a6a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the error code set by the most recently called method.  <a href="#a52b374b473d3144407ae2ca0e704a6a5">More...</a><br/></td></tr>
<tr class="separator:a52b374b473d3144407ae2ca0e704a6a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A decompressor for .CAB (Microsoft Cabinet) files. </p>
<p>All fields are READ ONLY.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="mspack_8h.html#a9964981ec0e6f49814301101e1708f95" title="Creates a new CAB decompressor. ">mspack_create_cab_decompressor()</a>, <a class="el" href="mspack_8h.html#a13e9100ea34b16693cacb92b212ccadc" title="Destroys an existing CAB decompressor. ">mspack_destroy_cab_decompressor()</a> </dd></dl>
</div><h2 class="groupheader">Field Documentation</h2>
<a class="anchor" id="a00eb7059f80ef8bed33f8bd410c9d665"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(* mscab_decompressor::append)(struct <a class="el" href="structmscab__decompressor.html">mscab_decompressor</a> *self, struct <a class="el" href="structmscabd__cabinet.html">mscabd_cabinet</a> *cab, struct <a class="el" href="structmscabd__cabinet.html">mscabd_cabinet</a> *nextcab)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Appends one <a class="el" href="structmscabd__cabinet.html" title="A structure which represents a single cabinet file. ">mscabd_cabinet</a> to another, forming or extending a cabinet set. </p>
<p>This will attempt to append one cabinet to another such that <code>(cab-&gt;nextcab == nextcab) &amp;&amp; (nextcab-&gt;prevcab == cab)</code> and any folders split between the two cabinets are merged.</p>
<p>The cabinets MUST be part of a cabinet set &ndash; a cabinet set is a cabinet that spans more than one physical cabinet file on disk &ndash; and must be appropriately matched.</p>
<p>It can be determined if a cabinet has further parts to load by examining the <a class="el" href="structmscabd__cabinet.html#a6c5b8d1773e14b12c70d64d5b8867b01" title="Header flags. ">mscabd_cabinet::flags</a> field:</p>
<ul>
<li>if <code>(flags &amp; MSCAB_HDR_PREVCAB)</code> is non-zero, there is a predecessor cabinet to <a class="el" href="structmscab__decompressor.html#ad2d5af33948f587fcb9b57d4f70a621e" title="Opens a cabinet file and reads its contents. ">open()</a> and <a class="el" href="structmscab__decompressor.html#a8cd61b0d08747508291a9e1e6c753ec7" title="Prepends one mscabd_cabinet to another, forming or extending a cabinet set. ">prepend()</a>. Its MS-DOS case-insensitive filename is <a class="el" href="structmscabd__cabinet.html#a1f595a7655daa62ba709ecf40a0cb13c" title="The filename of the previous cabinet in a cabinet set, or NULL. ">mscabd_cabinet::prevname</a></li>
<li>if <code>(flags &amp; MSCAB_HDR_NEXTCAB)</code> is non-zero, there is a successor cabinet to <a class="el" href="structmscab__decompressor.html#ad2d5af33948f587fcb9b57d4f70a621e" title="Opens a cabinet file and reads its contents. ">open()</a> and <a class="el" href="structmscab__decompressor.html#a00eb7059f80ef8bed33f8bd410c9d665" title="Appends one mscabd_cabinet to another, forming or extending a cabinet set. ">append()</a>. Its MS-DOS case-insensitive filename is <a class="el" href="structmscabd__cabinet.html#abe1b8a6ccc9eeeebf2a454bfbe2d4a1a" title="The filename of the next cabinet in a cabinet set, or NULL. ">mscabd_cabinet::nextname</a></li>
</ul>
<p>If the cabinets do not match, an error code will be returned. Neither cabinet has been altered, and both should be closed seperately.</p>
<p>Files and folders in a cabinet set are a single entity. All cabinets in a set use the same file list, which is updated as cabinets in the set are added. All pointers to <a class="el" href="structmscabd__folder.html" title="A structure which represents a single folder in a cabinet or cabinet set. ">mscabd_folder</a> and <a class="el" href="structmscabd__file.html" title="A structure which represents a single file in a cabinet or cabinet set. ">mscabd_file</a> structures in either cabinet must be discarded and re-obtained after merging.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a self-referential pointer to the <a class="el" href="structmscab__decompressor.html" title="A decompressor for .CAB (Microsoft Cabinet) files. ">mscab_decompressor</a> instance being called </td></tr>
    <tr><td class="paramname">cab</td><td>the cabinet which will be appended to, predecessor of nextcab </td></tr>
    <tr><td class="paramname">nextcab</td><td>the cabinet which will be appended, successor of cab </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an error code, or MSPACK_ERR_OK if successful </dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structmscab__decompressor.html#a8cd61b0d08747508291a9e1e6c753ec7" title="Prepends one mscabd_cabinet to another, forming or extending a cabinet set. ">prepend()</a>, <a class="el" href="structmscab__decompressor.html#ad2d5af33948f587fcb9b57d4f70a621e" title="Opens a cabinet file and reads its contents. ">open()</a>, <a class="el" href="structmscab__decompressor.html#ab469fdadc4bd9a58574427bcd0138a01" title="Closes a previously opened cabinet or cabinet set. ">close()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ab469fdadc4bd9a58574427bcd0138a01"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* mscab_decompressor::close)(struct <a class="el" href="structmscab__decompressor.html">mscab_decompressor</a> *self, struct <a class="el" href="structmscabd__cabinet.html">mscabd_cabinet</a> *cab)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Closes a previously opened cabinet or cabinet set. </p>
<p>This closes a cabinet, all cabinets associated with it via the <a class="el" href="structmscabd__cabinet.html#a94d02cd4adb598945f544d77362d1658" title="The next cabinet in a chained list, if this cabinet was opened with mscab_decompressor::search(). ">mscabd_cabinet::next</a>, <a class="el" href="structmscabd__cabinet.html#ad915066d3781892754b6cfd87b08d378" title="The previous cabinet in a cabinet set, or NULL. ">mscabd_cabinet::prevcab</a> and <a class="el" href="structmscabd__cabinet.html#ae3ab25aa910ea50dca515659848ab5dc" title="The next cabinet in a cabinet set, or NULL. ">mscabd_cabinet::nextcab</a> pointers, and all folders and files. All memory used by these entities is freed.</p>
<p>The cabinet pointer is now invalid and cannot be used again. All <a class="el" href="structmscabd__folder.html" title="A structure which represents a single folder in a cabinet or cabinet set. ">mscabd_folder</a> and <a class="el" href="structmscabd__file.html" title="A structure which represents a single file in a cabinet or cabinet set. ">mscabd_file</a> pointers from that cabinet or cabinet set are also now invalid, and cannot be used again.</p>
<p>If the cabinet pointer given was created using <a class="el" href="structmscab__decompressor.html#aac389b8ac60162e33f6292de8b94d2d0" title="Searches a regular file for embedded cabinets. ">search()</a>, it MUST be the cabinet pointer returned by <a class="el" href="structmscab__decompressor.html#aac389b8ac60162e33f6292de8b94d2d0" title="Searches a regular file for embedded cabinets. ">search()</a> and not one of the later cabinet pointers further along the <a class="el" href="structmscabd__cabinet.html#a94d02cd4adb598945f544d77362d1658" title="The next cabinet in a chained list, if this cabinet was opened with mscab_decompressor::search(). ">mscabd_cabinet::next</a> chain.</p>
<p>If extra cabinets have been added using <a class="el" href="structmscab__decompressor.html#a00eb7059f80ef8bed33f8bd410c9d665" title="Appends one mscabd_cabinet to another, forming or extending a cabinet set. ">append()</a> or <a class="el" href="structmscab__decompressor.html#a8cd61b0d08747508291a9e1e6c753ec7" title="Prepends one mscabd_cabinet to another, forming or extending a cabinet set. ">prepend()</a>, these will all be freed, even if the cabinet pointer given is not the first cabinet in the set. Do NOT <a class="el" href="structmscab__decompressor.html#ab469fdadc4bd9a58574427bcd0138a01" title="Closes a previously opened cabinet or cabinet set. ">close()</a> more than one cabinet in the set.</p>
<p>The <a class="el" href="structmscabd__cabinet.html#a8e37f9e7834660a3b752e7c0f9a0da06" title="The filename of the cabinet. ">mscabd_cabinet::filename</a> is not freed by the library, as it is not allocated by the library. The caller should free this itself if necessary, before it is lost forever.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a self-referential pointer to the <a class="el" href="structmscab__decompressor.html" title="A decompressor for .CAB (Microsoft Cabinet) files. ">mscab_decompressor</a> instance being called </td></tr>
    <tr><td class="paramname">cab</td><td>the cabinet to close </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structmscab__decompressor.html#ad2d5af33948f587fcb9b57d4f70a621e" title="Opens a cabinet file and reads its contents. ">open()</a>, <a class="el" href="structmscab__decompressor.html#aac389b8ac60162e33f6292de8b94d2d0" title="Searches a regular file for embedded cabinets. ">search()</a>, <a class="el" href="structmscab__decompressor.html#a00eb7059f80ef8bed33f8bd410c9d665" title="Appends one mscabd_cabinet to another, forming or extending a cabinet set. ">append()</a>, <a class="el" href="structmscab__decompressor.html#a8cd61b0d08747508291a9e1e6c753ec7" title="Prepends one mscabd_cabinet to another, forming or extending a cabinet set. ">prepend()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a8224719c30138a5f6322048859b8ca52"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(* mscab_decompressor::extract)(struct <a class="el" href="structmscab__decompressor.html">mscab_decompressor</a> *self, struct <a class="el" href="structmscabd__file.html">mscabd_file</a> *file, const char *filename)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Extracts a file from a cabinet or cabinet set. </p>
<p>This extracts a compressed file in a cabinet and writes it to the given filename.</p>
<p>The MS-DOS filename of the file, <a class="el" href="structmscabd__file.html#a181b45655523f55ed114b51249d305f8" title="The filename of the file. ">mscabd_file::filename</a>, is NOT USED by <a class="el" href="structmscab__decompressor.html#a8224719c30138a5f6322048859b8ca52" title="Extracts a file from a cabinet or cabinet set. ">extract()</a>. The caller must examine this MS-DOS filename, copy and change it as necessary, create directories as necessary, and provide the correct filename as a parameter, which will be passed unchanged to the decompressor's <a class="el" href="structmspack__system.html#a1a85cac5eeb55db6a432fe3824aa04a3" title="Opens a file for reading, writing, appending or updating. ">mspack_system::open()</a></p>
<p>If the file belongs to a split folder in a multi-part cabinet set, and not enough parts of the cabinet set have been loaded and appended or prepended, an error will be returned immediately.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a self-referential pointer to the <a class="el" href="structmscab__decompressor.html" title="A decompressor for .CAB (Microsoft Cabinet) files. ">mscab_decompressor</a> instance being called </td></tr>
    <tr><td class="paramname">file</td><td>the file to be decompressed </td></tr>
    <tr><td class="paramname">filename</td><td>the filename of the file being written to </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an error code, or MSPACK_ERR_OK if successful </dd></dl>

</div>
</div>
<a class="anchor" id="a52b374b473d3144407ae2ca0e704a6a5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(* mscab_decompressor::last_error)(struct <a class="el" href="structmscab__decompressor.html">mscab_decompressor</a> *self)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the error code set by the most recently called method. </p>
<p>This is useful for <a class="el" href="structmscab__decompressor.html#ad2d5af33948f587fcb9b57d4f70a621e" title="Opens a cabinet file and reads its contents. ">open()</a> and <a class="el" href="structmscab__decompressor.html#aac389b8ac60162e33f6292de8b94d2d0" title="Searches a regular file for embedded cabinets. ">search()</a>, which do not return an error code directly.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a self-referential pointer to the <a class="el" href="structmscab__decompressor.html" title="A decompressor for .CAB (Microsoft Cabinet) files. ">mscab_decompressor</a> instance being called </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the most recent error code </dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structmscab__decompressor.html#ad2d5af33948f587fcb9b57d4f70a621e" title="Opens a cabinet file and reads its contents. ">open()</a>, <a class="el" href="structmscab__decompressor.html#aac389b8ac60162e33f6292de8b94d2d0" title="Searches a regular file for embedded cabinets. ">search()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ad2d5af33948f587fcb9b57d4f70a621e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structmscabd__cabinet.html">mscabd_cabinet</a>*(* mscab_decompressor::open)(struct <a class="el" href="structmscab__decompressor.html">mscab_decompressor</a> *self, const char *filename)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Opens a cabinet file and reads its contents. </p>
<p>If the file opened is a valid cabinet file, all headers will be read and a <a class="el" href="structmscabd__cabinet.html" title="A structure which represents a single cabinet file. ">mscabd_cabinet</a> structure will be returned, with a full list of folders and files.</p>
<p>In the case of an error occuring, NULL is returned and the error code is available from <a class="el" href="structmscab__decompressor.html#a52b374b473d3144407ae2ca0e704a6a5" title="Returns the error code set by the most recently called method. ">last_error()</a>.</p>
<p>The filename pointer should be considered "in use" until <a class="el" href="structmscab__decompressor.html#ab469fdadc4bd9a58574427bcd0138a01" title="Closes a previously opened cabinet or cabinet set. ">close()</a> is called on the cabinet.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a self-referential pointer to the <a class="el" href="structmscab__decompressor.html" title="A decompressor for .CAB (Microsoft Cabinet) files. ">mscab_decompressor</a> instance being called </td></tr>
    <tr><td class="paramname">filename</td><td>the filename of the cabinet file. This is passed directly to <a class="el" href="structmspack__system.html#a1a85cac5eeb55db6a432fe3824aa04a3" title="Opens a file for reading, writing, appending or updating. ">mspack_system::open()</a>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a pointer to a <a class="el" href="structmscabd__cabinet.html" title="A structure which represents a single cabinet file. ">mscabd_cabinet</a> structure, or NULL on failure </dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structmscab__decompressor.html#ab469fdadc4bd9a58574427bcd0138a01" title="Closes a previously opened cabinet or cabinet set. ">close()</a>, <a class="el" href="structmscab__decompressor.html#aac389b8ac60162e33f6292de8b94d2d0" title="Searches a regular file for embedded cabinets. ">search()</a>, <a class="el" href="structmscab__decompressor.html#a52b374b473d3144407ae2ca0e704a6a5" title="Returns the error code set by the most recently called method. ">last_error()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a8cd61b0d08747508291a9e1e6c753ec7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(* mscab_decompressor::prepend)(struct <a class="el" href="structmscab__decompressor.html">mscab_decompressor</a> *self, struct <a class="el" href="structmscabd__cabinet.html">mscabd_cabinet</a> *cab, struct <a class="el" href="structmscabd__cabinet.html">mscabd_cabinet</a> *prevcab)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Prepends one <a class="el" href="structmscabd__cabinet.html" title="A structure which represents a single cabinet file. ">mscabd_cabinet</a> to another, forming or extending a cabinet set. </p>
<p>This will attempt to prepend one cabinet to another, such that <code>(cab-&gt;prevcab == prevcab) &amp;&amp; (prevcab-&gt;nextcab == cab)</code>. In all other respects, it is identical to <a class="el" href="structmscab__decompressor.html#a00eb7059f80ef8bed33f8bd410c9d665" title="Appends one mscabd_cabinet to another, forming or extending a cabinet set. ">append()</a>. See <a class="el" href="structmscab__decompressor.html#a00eb7059f80ef8bed33f8bd410c9d665" title="Appends one mscabd_cabinet to another, forming or extending a cabinet set. ">append()</a> for the full documentation.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a self-referential pointer to the <a class="el" href="structmscab__decompressor.html" title="A decompressor for .CAB (Microsoft Cabinet) files. ">mscab_decompressor</a> instance being called </td></tr>
    <tr><td class="paramname">cab</td><td>the cabinet which will be prepended to, successor of prevcab </td></tr>
    <tr><td class="paramname">prevcab</td><td>the cabinet which will be prepended, predecessor of cab </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>an error code, or MSPACK_ERR_OK if successful </dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structmscab__decompressor.html#a00eb7059f80ef8bed33f8bd410c9d665" title="Appends one mscabd_cabinet to another, forming or extending a cabinet set. ">append()</a>, <a class="el" href="structmscab__decompressor.html#ad2d5af33948f587fcb9b57d4f70a621e" title="Opens a cabinet file and reads its contents. ">open()</a>, <a class="el" href="structmscab__decompressor.html#ab469fdadc4bd9a58574427bcd0138a01" title="Closes a previously opened cabinet or cabinet set. ">close()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aac389b8ac60162e33f6292de8b94d2d0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structmscabd__cabinet.html">mscabd_cabinet</a>*(* mscab_decompressor::search)(struct <a class="el" href="structmscab__decompressor.html">mscab_decompressor</a> *self, const char *filename)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Searches a regular file for embedded cabinets. </p>
<p>This opens a normal file with the given filename and will search the entire file for embedded cabinet files</p>
<p>If any cabinets are found, the equivalent of <a class="el" href="structmscab__decompressor.html#ad2d5af33948f587fcb9b57d4f70a621e" title="Opens a cabinet file and reads its contents. ">open()</a> is called on each potential cabinet file at the offset it was found. All successfully <a class="el" href="structmscab__decompressor.html#ad2d5af33948f587fcb9b57d4f70a621e" title="Opens a cabinet file and reads its contents. ">open()</a>ed cabinets are kept in a list.</p>
<p>The first cabinet found will be returned directly as the result of this method. Any further cabinets found will be chained in a list using the <a class="el" href="structmscabd__cabinet.html#a94d02cd4adb598945f544d77362d1658" title="The next cabinet in a chained list, if this cabinet was opened with mscab_decompressor::search(). ">mscabd_cabinet::next</a> field.</p>
<p>In the case of an error occuring anywhere other than the simulated <a class="el" href="structmscab__decompressor.html#ad2d5af33948f587fcb9b57d4f70a621e" title="Opens a cabinet file and reads its contents. ">open()</a>, NULL is returned and the error code is available from <a class="el" href="structmscab__decompressor.html#a52b374b473d3144407ae2ca0e704a6a5" title="Returns the error code set by the most recently called method. ">last_error()</a>.</p>
<p>If no error occurs, but no cabinets can be found in the file, NULL is returned and <a class="el" href="structmscab__decompressor.html#a52b374b473d3144407ae2ca0e704a6a5" title="Returns the error code set by the most recently called method. ">last_error()</a> returns MSPACK_ERR_OK.</p>
<p>The filename pointer should be considered in use until <a class="el" href="structmscab__decompressor.html#ab469fdadc4bd9a58574427bcd0138a01" title="Closes a previously opened cabinet or cabinet set. ">close()</a> is called on the cabinet.</p>
<p><a class="el" href="structmscab__decompressor.html#ab469fdadc4bd9a58574427bcd0138a01" title="Closes a previously opened cabinet or cabinet set. ">close()</a> should only be called on the result of <a class="el" href="structmscab__decompressor.html#aac389b8ac60162e33f6292de8b94d2d0" title="Searches a regular file for embedded cabinets. ">search()</a>, not on any subsequent cabinets in the <a class="el" href="structmscabd__cabinet.html#a94d02cd4adb598945f544d77362d1658" title="The next cabinet in a chained list, if this cabinet was opened with mscab_decompressor::search(). ">mscabd_cabinet::next</a> chain.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a self-referential pointer to the <a class="el" href="structmscab__decompressor.html" title="A decompressor for .CAB (Microsoft Cabinet) files. ">mscab_decompressor</a> instance being called </td></tr>
    <tr><td class="paramname">filename</td><td>the filename of the file to search for cabinets. This is passed directly to <a class="el" href="structmspack__system.html#a1a85cac5eeb55db6a432fe3824aa04a3" title="Opens a file for reading, writing, appending or updating. ">mspack_system::open()</a>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a pointer to a <a class="el" href="structmscabd__cabinet.html" title="A structure which represents a single cabinet file. ">mscabd_cabinet</a> structure, or NULL </dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structmscab__decompressor.html#ab469fdadc4bd9a58574427bcd0138a01" title="Closes a previously opened cabinet or cabinet set. ">close()</a>, <a class="el" href="structmscab__decompressor.html#ad2d5af33948f587fcb9b57d4f70a621e" title="Opens a cabinet file and reads its contents. ">open()</a>, <a class="el" href="structmscab__decompressor.html#a52b374b473d3144407ae2ca0e704a6a5" title="Returns the error code set by the most recently called method. ">last_error()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ae818d71d1b62101c063edefcaa43fb08"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(* mscab_decompressor::set_param)(struct <a class="el" href="structmscab__decompressor.html">mscab_decompressor</a> *self, int param, int value)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets a CAB decompression engine parameter. </p>
<p>The following parameters are defined:</p>
<ul>
<li><a class="el" href="mspack_8h.html#a3888f5036eae320e691f5de290293a9f" title="mscab_decompressor::set_param() parameter: search buffer size. ">MSCABD_PARAM_SEARCHBUF</a>: How many bytes should be allocated as a buffer when using <a class="el" href="structmscab__decompressor.html#aac389b8ac60162e33f6292de8b94d2d0" title="Searches a regular file for embedded cabinets. ">search()</a>? The minimum value is 4. The default value is 32768.</li>
<li><a class="el" href="mspack_8h.html#a852a791d880d602989063128d4ce33d1" title="mscab_decompressor::set_param() parameter: repair MS-ZIP streams? ">MSCABD_PARAM_FIXMSZIP</a>: If non-zero, <a class="el" href="structmscab__decompressor.html#a8224719c30138a5f6322048859b8ca52" title="Extracts a file from a cabinet or cabinet set. ">extract()</a> will ignore bad checksums and recover from decompression errors in MS-ZIP compressed folders. The default value is 0 (don't recover).</li>
<li><a class="el" href="mspack_8h.html#a197cc07b45645f807bd400ed576b2968" title="mscab_decompressor::set_param() parameter: size of decompression buffer ">MSCABD_PARAM_DECOMPBUF</a>: How many bytes should be used as an input bit buffer by decompressors? The minimum value is 4. The default value is 4096.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>a self-referential pointer to the <a class="el" href="structmscab__decompressor.html" title="A decompressor for .CAB (Microsoft Cabinet) files. ">mscab_decompressor</a> instance being called </td></tr>
    <tr><td class="paramname">param</td><td>the parameter to set </td></tr>
    <tr><td class="paramname">value</td><td>the value to set the parameter to </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>MSPACK_ERR_OK if all is OK, or MSPACK_ERR_ARGS if there is a problem with either parameter or value. </dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="structmscab__decompressor.html#aac389b8ac60162e33f6292de8b94d2d0" title="Searches a regular file for embedded cabinets. ">search()</a>, <a class="el" href="structmscab__decompressor.html#a8224719c30138a5f6322048859b8ca52" title="Extracts a file from a cabinet or cabinet set. ">extract()</a> </dd></dl>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="mspack_8h_source.html">mspack.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>