update Sun Mar 14 12:37:00 PDT 2010
[pkgsrc.git] / archivers / libarchive / files / doc / html / archive_write.3.html
1 %!PS-Adobe-3.0
2 %%Creator: groff version 1.19.2
3 %%CreationDate: Sun Mar 14 02:49:16 2010
4 %%DocumentNeededResources: font Times-Roman
5 %%DocumentSuppliedResources: procset grops 1.19 2
6 %%Pages: 107
7 %%PageOrder: Ascend
8 %%DocumentMedia: Default 612 792 0 () ()
9 %%Orientation: Portrait
10 %%EndComments
11 %%BeginDefaults
12 %%PageMedia: Default
13 %%EndDefaults
14 %%BeginProlog
15 %%BeginResource: procset grops 1.19 2
16 %!PS-Adobe-3.0 Resource-ProcSet
17 /setpacking where{
18 pop
19 currentpacking
20 true setpacking
21 }if
22 /grops 120 dict dup begin
23 /SC 32 def
24 /A/show load def
25 /B{0 SC 3 -1 roll widthshow}bind def
26 /C{0 exch ashow}bind def
27 /D{0 exch 0 SC 5 2 roll awidthshow}bind def
28 /E{0 rmoveto show}bind def
29 /F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
30 /G{0 rmoveto 0 exch ashow}bind def
31 /H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
32 /I{0 exch rmoveto show}bind def
33 /J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
34 /K{0 exch rmoveto 0 exch ashow}bind def
35 /L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
36 /M{rmoveto show}bind def
37 /N{rmoveto 0 SC 3 -1 roll widthshow}bind def
38 /O{rmoveto 0 exch ashow}bind def
39 /P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
40 /Q{moveto show}bind def
41 /R{moveto 0 SC 3 -1 roll widthshow}bind def
42 /S{moveto 0 exch ashow}bind def
43 /T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
44 /SF{
45 findfont exch
46 [exch dup 0 exch 0 exch neg 0 0]makefont
47 dup setfont
48 [exch/setfont cvx]cvx bind def
49 }bind def
50 /MF{
51 findfont
52 [5 2 roll
53 0 3 1 roll
54 neg 0 0]makefont
55 dup setfont
56 [exch/setfont cvx]cvx bind def
57 }bind def
58 /level0 0 def
59 /RES 0 def
60 /PL 0 def
61 /LS 0 def
62 /MANUAL{
63 statusdict begin/manualfeed true store end
64 }bind def
65 /PLG{
66 gsave newpath clippath pathbbox grestore
67 exch pop add exch pop
68 }bind def
69 /BP{
70 /level0 save def
71 1 setlinecap
72 1 setlinejoin
73 72 RES div dup scale
74 LS{
75 90 rotate
76 }{
77 0 PL translate
78 }ifelse
79 1 -1 scale
80 }bind def
81 /EP{
82 level0 restore
83 showpage
84 }def
85 /DA{
86 newpath arcn stroke
87 }bind def
88 /SN{
89 transform
90 .25 sub exch .25 sub exch
91 round .25 add exch round .25 add exch
92 itransform
93 }bind def
94 /DL{
95 SN
96 moveto
97 SN
98 lineto stroke
99 }bind def
100 /DC{
101 newpath 0 360 arc closepath
102 }bind def
103 /TM matrix def
104 /DE{
105 TM currentmatrix pop
106 translate scale newpath 0 0 .5 0 360 arc closepath
107 TM setmatrix
108 }bind def
109 /RC/rcurveto load def
110 /RL/rlineto load def
111 /ST/stroke load def
112 /MT/moveto load def
113 /CL/closepath load def
114 /Fr{
115 setrgbcolor fill
116 }bind def
117 /setcmykcolor where{
118 pop
119 /Fk{
120 setcmykcolor fill
121 }bind def
122 }if
123 /Fg{
124 setgray fill
125 }bind def
126 /FL/fill load def
127 /LW/setlinewidth load def
128 /Cr/setrgbcolor load def
129 /setcmykcolor where{
130 pop
131 /Ck/setcmykcolor load def
132 }if
133 /Cg/setgray load def
134 /RE{
135 findfont
136 dup maxlength 1 index/FontName known not{1 add}if dict begin
137 {
138 1 index/FID ne{def}{pop pop}ifelse
139 }forall
140 /Encoding exch def
141 dup/FontName exch def
142 currentdict end definefont pop
143 }bind def
144 /DEFS 0 def
145 /EBEGIN{
146 moveto
147 DEFS begin
148 }bind def
149 /EEND/end load def
150 /CNT 0 def
151 /level1 0 def
152 /PBEGIN{
153 /level1 save def
154 translate
155 div 3 1 roll div exch scale
156 neg exch neg exch translate
157 0 setgray
158 0 setlinecap
159 1 setlinewidth
160 0 setlinejoin
161 10 setmiterlimit
162 []0 setdash
163 /setstrokeadjust where{
164 pop
165 false setstrokeadjust
166 }if
167 /setoverprint where{
168 pop
169 false setoverprint
170 }if
171 newpath
172 /CNT countdictstack def
173 userdict begin
174 /showpage{}def
175 /setpagedevice{}def
176 }bind def
177 /PEND{
178 countdictstack CNT sub{end}repeat
179 level1 restore
180 }bind def
181 end def
182 /setpacking where{
183 pop
184 setpacking
185 }if
186 %%EndResource
187 %%EndProlog
188 %%BeginSetup
189 %%BeginFeature: *PageSize Default
190 << /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
191 %%EndFeature
192 %%IncludeResource: font Times-Roman
193 grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
194 def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
195 /scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
196 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
197 /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
198 /.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
199 /ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
200 /period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
201 /semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
202 /P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
203 /underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
204 /z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
205 /guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
206 /endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
207 /dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
208 /quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
209 /brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
210 /logicalnot/minus/registered/macron/degree/plusminus/twosuperior
211 /threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
212 /ordmasculine/guilsinglright/onequarter/onehalf/threequarters
213 /questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
214 /Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
215 /Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
216 /multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
217 /germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
218 /egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
219 /eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
220 /ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
221 /Times-Roman@0 ENC0/Times-Roman RE
222 %%EndSetup
223 %%Page: 1 1
224 %%BeginPageSetup
225 BP
226 %%EndPageSetup
227 /F0 10/Times-Roman@0 SF(<html>)0 12 Q(<head>)0 24 Q(<title>)36 36 Q
228 (May 11, 2008 archi)74.5 48 Q -.15(ve)-.25 G(_write 3).15 E(</title>)36
229 72 Q 0 Cg EP
230 %%Page: 2 2
231 %%BeginPageSetup
232 BP
233 %%EndPageSetup
234 /F0 10/Times-Roman@0 SF(<style type="te)36 12 Q(xt/css">)-.15 E(<!--)36
235 24 Q(body { mar)72 36 Q(gin-left:4%; })-.18 E(H1, H2, H3, H4, H5 {)72 48
236 Q(color: maroon; padding: 4pt; mar)108 60 Q(gin-left: -4%;)-.18 E
237 (border: solid; border)108 72 Q(-width: thin; width: 100%;)-.2 E 0 Cg EP
238 %%Page: 3 3
239 %%BeginPageSetup
240 BP
241 %%EndPageSetup
242 /F0 10/Times-Roman@0 SF(background: r)108 12 Q(gb\(204,204,255\))-.18 E
243 (})72 24 Q(-->)36 36 Q(</style>)36 48 Q(</head>)0 60 Q
244 (<body bgcolor="#FFFFFF" te)0 72 Q(xt="#000000">)-.15 E 0 Cg EP
245 %%Page: 4 4
246 %%BeginPageSetup
247 BP
248 %%EndPageSetup
249 /F0 10/Times-Roman@0 SF(<h3 id="N)36 12 Q(AME">)-.35 E -.35(NA)36 24 S
250 (ME).35 E(</h3>)36 36 Q(<b>archi)0 48 Q -.15(ve)-.25 G(_write_ne).15 E
251 (w</b>,)-.25 E(<b>archi)0 60 Q -.15(ve)-.25 G
252 (_write_set_format_cpio</b>,).15 E(<b>archi)0 72 Q -.15(ve)-.25 G
253 (_write_set_format_pax</b>,).15 E 0 Cg EP
254 %%Page: 5 5
255 %%BeginPageSetup
256 BP
257 %%EndPageSetup
258 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
259 (_write_set_format_pax_restricted</b>,).15 E(<b>archi)0 24 Q -.15(ve)
260 -.25 G(_write_set_format_shar</b>,).15 E(<b>archi)0 36 Q -.15(ve)-.25 G
261 (_write_set_format_shar_binary</b>,).15 E(<b>archi)0 48 Q -.15(ve)-.25 G
262 (_write_set_format_ustar</b>,).15 E(<b>archi)0 60 Q -.15(ve)-.25 G
263 (_write_get_bytes_per_block</b>,).15 E(<b>archi)0 72 Q -.15(ve)-.25 G
264 (_write_set_bytes_per_block</b>,).15 E 0 Cg EP
265 %%Page: 6 6
266 %%BeginPageSetup
267 BP
268 %%EndPageSetup
269 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
270 (_write_set_bytes_in_last_block</b>,).15 E(<b>archi)0 24 Q -.15(ve)-.25
271 G(_write_set_compression_bzip2</b>,).15 E(<b>archi)0 36 Q -.15(ve)-.25 G
272 (_write_set_compression_compress</b>,).15 E(<b>archi)0 48 Q -.15(ve)-.25
273 G(_write_set_compression_gzip</b>,).15 E(<b>archi)0 60 Q -.15(ve)-.25 G
274 (_write_set_compression_none</b>,).15 E(<b>archi)0 72 Q -.15(ve)-.25 G
275 (_write_set_compression_program</b>,).15 E 0 Cg EP
276 %%Page: 7 7
277 %%BeginPageSetup
278 BP
279 %%EndPageSetup
280 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
281 (_write_set_compressor_options</b>,).15 E(<b>archi)0 24 Q -.15(ve)-.25 G
282 (_write_set_format_options</b>,).15 E(<b>archi)0 36 Q -.15(ve)-.25 G
283 (_write_set_options</b>,).15 E(<b>archi)0 48 Q -.15(ve)-.25 G
284 (_write_open</b>,).15 E(<b>archi)0 60 Q -.15(ve)-.25 G
285 (_write_open_fd</b>,).15 E(<b>archi)0 72 Q -.15(ve)-.25 G
286 (_write_open_FILE</b>,).15 E 0 Cg EP
287 %%Page: 8 8
288 %%BeginPageSetup
289 BP
290 %%EndPageSetup
291 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
292 (_write_open_\214lename</b>,).15 E(<b>archi)0 24 Q -.15(ve)-.25 G
293 (_write_open_memory</b>,).15 E(<b>archi)0 36 Q -.15(ve)-.25 G
294 (_write_header</b>,).15 E(<b>archi)0 48 Q -.15(ve)-.25 G
295 (_write_data</b>,).15 E(<b>archi)0 60 Q -.15(ve)-.25 G
296 (_write_\214nish_entry</b>,).15 E(<b>archi)0 72 Q -.15(ve)-.25 G
297 (_write_close</b>,).15 E 0 Cg EP
298 %%Page: 9 9
299 %%BeginPageSetup
300 BP
301 %%EndPageSetup
302 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
303 (_write_\214nish</b>).15 E 2.5(-f)0 24 S(unctions for creating archi)
304 -2.5 E -.15(ve)-.25 G(s).15 E(<h3 id="SYNOPSIS">)36 36 Q(SYNOPSIS)36 48
305 Q(</h3>)36 60 Q(<br><br><code></code><code>struct</code><code> archi)0
306 72 Q -.15(ve)-.25 G(</code><code> *</code>).15 E 0 Cg EP
307 %%Page: 10 10
308 %%BeginPageSetup
309 BP
310 %%EndPageSetup
311 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G(_write_ne).15 E
312 (w</b>\(<code></code><code>v)-.25 E(oid</code>\))-.2 E
313 (<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 36 Q -.15(ve)
314 -.25 G(_write_get_bytes_per_block</b>\(<code></code><code>struct archi)
315 .15 E .3 -.15(ve *)-.25 H(</code>\)).15 E
316 (<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
317 -.25 G(_write_set_bytes_per_block</b>\(<code></code><code>struct archi)
318 .15 E .3 -.15(ve *)-.25 H(</code><code>, int bytes_per_block</code>\))
319 .15 E(<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
320 %%Page: 11 11
321 %%BeginPageSetup
322 BP
323 %%EndPageSetup
324 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
325 (_write_set_bytes_in_last_block</b>\(<code></code><code>struct archi).15
326 E .3 -.15(ve *)-.25 H(</code><code>, int</code>\)).15 E
327 (<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 36 Q -.15(ve)
328 -.25 G
329 (_write_set_compression_bzip2</b>\(<code></code><code>struct archi).15 E
330 .3 -.15(ve *)-.25 H(</code>\)).15 E
331 (<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
332 -.25 G
333 (_write_set_compression_compress</b>\(<code></code><code>struct archi)
334 .15 E .3 -.15(ve *)-.25 H(</code>\)).15 E
335 (<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
336 %%Page: 12 12
337 %%BeginPageSetup
338 BP
339 %%EndPageSetup
340 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
341 (_write_set_compression_gzip</b>\(<code></code><code>struct archi).15 E
342 .3 -.15(ve *)-.25 H(</code>\)).15 E
343 (<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 36 Q -.15(ve)
344 -.25 G(_write_set_compression_none</b>\(<code></code><code>struct archi)
345 .15 E .3 -.15(ve *)-.25 H(</code>\)).15 E
346 (<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
347 -.25 G
348 (_write_set_compression_program</b>\(<code></code><code>struct archi).15
349 E .3 -.15(ve *)-.25 H(</code><code>, const char * cmd</code>\)).15 E
350 (<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
351 %%Page: 13 13
352 %%BeginPageSetup
353 BP
354 %%EndPageSetup
355 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
356 (_write_set_format_cpio</b>\(<code></code><code>struct archi).15 E .3
357 -.15(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0
358 24 Q(<b>archi)0 36 Q -.15(ve)-.25 G
359 (_write_set_format_pax</b>\(<code></code><code>struct archi).15 E .3
360 -.15(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0
361 48 Q(<b>archi)0 60 Q -.15(ve)-.25 G
362 (_write_set_format_pax_restricted</b>\(<code></code><code>struct archi)
363 .15 E .3 -.15(ve *)-.25 H(</code>\)).15 E
364 (<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
365 %%Page: 14 14
366 %%BeginPageSetup
367 BP
368 %%EndPageSetup
369 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
370 (_write_set_format_shar</b>\(<code></code><code>struct archi).15 E .3
371 -.15(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0
372 24 Q(<b>archi)0 36 Q -.15(ve)-.25 G
373 (_write_set_format_shar_binary</b>\(<code></code><code>struct archi).15
374 E .3 -.15(ve *)-.25 H(</code>\)).15 E
375 (<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
376 -.25 G(_write_set_format_ustar</b>\(<code></code><code>struct archi).15
377 E .3 -.15(ve *)-.25 H(</code>\)).15 E
378 (<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
379 %%Page: 15 15
380 %%BeginPageSetup
381 BP
382 %%EndPageSetup
383 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
384 (_write_set_format_options</b>\(<code></code><code>struct archi).15 E .3
385 -.15(ve *)-.25 H(</code><code>, const char *</code>\)).15 E
386 (<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 36 Q -.15(ve)
387 -.25 G
388 (_write_set_compressor_options</b>\(<code></code><code>struct archi).15
389 E .3 -.15(ve *)-.25 H(</code><code>, const char *</code>\)).15 E
390 (<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
391 -.25 G(_write_set_options</b>\(<code></code><code>struct archi).15 E .3
392 -.15(ve *)-.25 H(</code><code>, const char *</code>\)).15 E
393 (<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
394 %%Page: 16 16
395 %%BeginPageSetup
396 BP
397 %%EndPageSetup
398 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
399 (_write_open</b>\(<code></code>).15 E(<code></code><code>struct archi)0
400 24 Q .3 -.15(ve *)-.25 H(</code>).15 E(<code></code><code>v)0 36 Q
401 (oid *client_data</code>)-.2 E(<code></code><code>archi)0 48 Q -.15(ve)
402 -.25 G(_open_callback *</code>).15 E(<code></code><code>archi)0 60 Q
403 -.15(ve)-.25 G(_write_callback *</code>).15 E(<code></code><code>archi)0
404 72 Q -.15(ve)-.25 G(_close_callback *</code>).15 E 0 Cg EP
405 %%Page: 17 17
406 %%BeginPageSetup
407 BP
408 %%EndPageSetup
409 /F0 10/Times-Roman@0 SF(\))0 12 Q(<br><br><code></code><code>int</code>)
410 0 24 Q(<b>archi)0 36 Q -.15(ve)-.25 G
411 (_write_open_fd</b>\(<code></code><code>struct archi).15 E .3 -.15(ve *)
412 -.25 H(</code><code>, int fd</code>\)).15 E
413 (<br><br><code></code><code>int</code>)0 48 Q(<b>archi)0 60 Q -.15(ve)
414 -.25 G(_write_open_FILE</b>\(<code></code><code>struct archi).15 E .3
415 -.15(ve *)-.25 H(</code><code>, FILE *\214le</code>\)).15 E
416 (<br><br><code></code><code>int</code>)0 72 Q 0 Cg EP
417 %%Page: 18 18
418 %%BeginPageSetup
419 BP
420 %%EndPageSetup
421 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
422 (_write_open_\214lename</b>\(<code></code><code>struct archi).15 E .3
423 -.15(ve *)-.25 H(</code><code>, const char *\214lename</code>\)).15 E
424 (<br><br><code></code><code>int</code>)0 24 Q(<b>archi)0 36 Q -.15(ve)
425 -.25 G(_write_open_memory</b>\(<code></code>).15 E
426 (<code></code><code>struct archi)0 48 Q .3 -.15(ve *)-.25 H(</code>).15
427 E(<code></code><code>v)0 60 Q(oid *b)-.2 E(uf)-.2 E(fer</code>)-.25 E
428 (<code></code><code>size_t b)0 72 Q(uf)-.2 E(ferSize</code>)-.25 E 0 Cg
429 EP
430 %%Page: 19 19
431 %%BeginPageSetup
432 BP
433 %%EndPageSetup
434 /F0 10/Times-Roman@0 SF(<code></code><code>size_t *outUsed</code>)0 12 Q
435 (\))0 24 Q(<br><br><code></code><code>int</code>)0 36 Q(<b>archi)0 48 Q
436 -.15(ve)-.25 G(_write_header</b>\(<code></code><code>struct archi).15 E
437 .3 -.15(ve *)-.25 H(</code><code>, struct archi).15 E -.15(ve)-.25 G
438 (_entry *</code>\)).15 E(<br><br><code></code><code>ssize_t</code>)0 60
439 Q(<b>archi)0 72 Q -.15(ve)-.25 G
440 (_write_data</b>\(<code></code><code>struct archi).15 E .3 -.15(ve *)
441 -.25 H(</code><code>, const v).15 E(oid *</code><code>, size_t</code>\))
442 -.2 E 0 Cg EP
443 %%Page: 20 20
444 %%BeginPageSetup
445 BP
446 %%EndPageSetup
447 /F0 10/Times-Roman@0 SF(<br><br><code></code><code>int</code>)0 12 Q
448 (<b>archi)0 24 Q -.15(ve)-.25 G
449 (_write_\214nish_entry</b>\(<code></code><code>struct archi).15 E .3
450 -.15(ve *)-.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0
451 36 Q(<b>archi)0 48 Q -.15(ve)-.25 G
452 (_write_close</b>\(<code></code><code>struct archi).15 E .3 -.15(ve *)
453 -.25 H(</code>\)).15 E(<br><br><code></code><code>int</code>)0 60 Q
454 (<b>archi)0 72 Q -.15(ve)-.25 G
455 (_write_\214nish</b>\(<code></code><code>struct archi).15 E .3 -.15
456 (ve *)-.25 H(</code>\)).15 E 0 Cg EP
457 %%Page: 21 21
458 %%BeginPageSetup
459 BP
460 %%EndPageSetup
461 /F0 10/Times-Roman@0 SF(<h3 id="DESCRIPTION">)36 12 Q(DESCRIPTION)36 24
462 Q(</h3>)36 36 Q(These functions pro)0 48 Q
463 (vide a complete API for creating streaming)-.15 E(archi)0 60 Q .3 -.15
464 (ve \214)-.25 H(les.).15 E(The general process is to \214rst create the)
465 0 72 Q 0 Cg EP
466 %%Page: 22 22
467 %%BeginPageSetup
468 BP
469 %%EndPageSetup
470 /F0 10/Times-Roman@0 SF(<font size="-1"></font><font size="-1">struct</\
471 font><font size="-1"> archi)0 12 Q -.15(ve)-.25 G(</font>).15 E
472 (object, set an)0 24 Q 2.5(yd)-.15 G
473 (esired options, initialize the archi)-2.5 E -.15(ve)-.25 G 2.5(,a).15 G
474 (ppend entries, then)-2.5 E(close the archi)0 36 Q .3 -.15(ve a)-.25 H
475 (nd release all resources.).15 E(The follo)0 48 Q
476 (wing summary describes the functions in approximately)-.25 E
477 (the order the)0 60 Q 2.5(ya)-.15 G(re ordinarily used:)-2.5 E
478 (<dl compact>)0 72 Q 0 Cg EP
479 %%Page: 23 23
480 %%BeginPageSetup
481 BP
482 %%EndPageSetup
483 /F0 10/Times-Roman@0 SF(<p><dt><b>archi)0 12 Q -.15(ve)-.25 G(_write_ne)
484 .15 E(w</b>\(<code></code>\)<dd>)-.25 E(Allocates and initializes a)0 24
485 Q(<font size="-1"></font><font size="-1">struct</font><font size="-1"> \
486 archi)0 36 Q -.15(ve)-.25 G(</font>).15 E
487 (object suitable for writing a tar archi)0 48 Q -.15(ve)-.25 G(.).15 E
488 (<p><dt><b>archi)0 60 Q -.15(ve)-.25 G
489 (_write_set_bytes_per_block</b>\(<code></code>\)<dd>).15 E
490 (Sets the block size used for writing the archi)0 72 Q .3 -.15(ve d)-.25
491 H(ata.).15 E 0 Cg EP
492 %%Page: 24 24
493 %%BeginPageSetup
494 BP
495 %%EndPageSetup
496 /F0 10/Times-Roman@0 SF(Ev)0 12 Q
497 (ery call to the write callback function, e)-.15 E
498 (xcept possibly the last one, will)-.15 E(use this v)0 24 Q
499 (alue for the length.)-.25 E(The third parameter is a boolean that spec\
500 i\214es whether or not the \214nal block)0 36 Q
501 (written will be padded to the full block size.)0 48 Q
502 (If it is zero, the last block will not be padded.)0 60 Q(If it is non-\
503 zero, padding will be added both before and after compression.)0 72 Q 0
504 Cg EP
505 %%Page: 25 25
506 %%BeginPageSetup
507 BP
508 %%EndPageSetup
509 /F0 10/Times-Roman@0 SF(The def)0 12 Q
510 (ault is to use a block size of 10240 bytes and to pad the last block.)
511 -.1 E(Note that a block size of zero will suppress internal blocking)0
512 24 Q(and cause writes to be sent directly to the write callback as the)0
513 36 Q 2.5(yo)-.15 G(ccur)-2.5 E(.)-.55 E(<p><dt><b>archi)0 48 Q -.15(ve)
514 -.25 G(_write_get_bytes_per_block</b>\(<code></code>\)<dd>).15 E(Retrie)
515 0 60 Q .3 -.15(ve t)-.25 H(he block size to be used for writing.).15 E
516 2.5(Av)0 72 S(alue of -1 here indicates that the library should use def)
517 -2.75 E(ault v)-.1 E(alues.)-.25 E 0 Cg EP
518 %%Page: 26 26
519 %%BeginPageSetup
520 BP
521 %%EndPageSetup
522 /F0 10/Times-Roman@0 SF 2.5(Av)0 12 S
523 (alue of zero indicates that internal blocking is suppressed.)-2.75 E
524 (<p><dt><b>archi)0 24 Q -.15(ve)-.25 G
525 (_write_set_bytes_in_last_block</b>\(<code></code>\)<dd>).15 E
526 (Sets the block size used for writing the last block.)0 36 Q(If this v)0
527 48 Q(alue is zero, the last block will be padded to the same size)-.25 E
528 (as the other blocks.)0 60 Q(Otherwise, the \214nal block will be padde\
529 d to a multiple of this size.)0 72 Q 0 Cg EP
530 %%Page: 27 27
531 %%BeginPageSetup
532 BP
533 %%EndPageSetup
534 /F0 10/Times-Roman@0 SF(In particular)0 12 Q 2.5(,s)-.4 G
535 (etting it to 1 will cause the \214nal block to not be padded.)-2.5 E
536 -.15(Fo)0 24 S 2.5(rc).15 G(ompressed output, an)-2.5 E 2.5(yp)-.15 G
537 (adding generated by this option)-2.5 E
538 (is applied only after the compression.)0 36 Q
539 (The uncompressed data is al)0 48 Q -.1(wa)-.1 G(ys unpadded.).1 E
540 (The def)0 60 Q
541 (ault is to pad the last block to the full block size \(note that)-.1 E
542 (<b>archi)0 72 Q -.15(ve)-.25 G
543 (_write_open_\214lename</b>\(<code></code>\)).15 E 0 Cg EP
544 %%Page: 28 28
545 %%BeginPageSetup
546 BP
547 %%EndPageSetup
548 /F0 10/Times-Roman@0 SF(will set this based on the \214le type\).)0 12 Q
549 (Unlik)0 24 Q 2.5(et)-.1 G(he other)-2.5 E -.74(``)0 36 S(set').74 E(')
550 -.74 E(functions, this function can be called after the archi)0 48 Q .3
551 -.15(ve i)-.25 H 2.5(so).15 G(pened.)-2.5 E(<p><dt><b>archi)0 60 Q -.15
552 (ve)-.25 G(_write_get_bytes_in_last_block</b>\(<code></code>\)<dd>).15 E
553 (Retrie)0 72 Q .3 -.15(ve t)-.25 H(he currently-set v).15 E
554 (alue for last block size.)-.25 E 0 Cg EP
555 %%Page: 29 29
556 %%BeginPageSetup
557 BP
558 %%EndPageSetup
559 /F0 10/Times-Roman@0 SF 2.5(Av)0 12 S
560 (alue of -1 here indicates that the library should use def)-2.75 E
561 (ault v)-.1 E(alues.)-.25 E(<p><dt>Xo<dd>)0 24 Q(<b>archi)0 36 Q -.15
562 (ve)-.25 G(_write_set_format_cpio</b>\(<code></code>\),).15 E(<b>archi)0
563 48 Q -.15(ve)-.25 G(_write_set_format_pax</b>\(<code></code>\),).15 E
564 (<b>archi)0 60 Q -.15(ve)-.25 G
565 (_write_set_format_pax_restricted</b>\(<code></code>\),).15 E(<b>archi)0
566 72 Q -.15(ve)-.25 G(_write_set_format_shar</b>\(<code></code>\),).15 E 0
567 Cg EP
568 %%Page: 30 30
569 %%BeginPageSetup
570 BP
571 %%EndPageSetup
572 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
573 (_write_set_format_shar_binary</b>\(<code></code>\),).15 E(<b>archi)0 24
574 Q -.15(ve)-.25 G(_write_set_format_ustar</b>\(<code></code>\)).15 E
575 (Sets the format that will be used for the archi)0 36 Q -.15(ve)-.25 G
576 (.).15 E(The library can write)0 48 Q
577 (POSIX octet-oriented cpio format archi)0 60 Q -.15(ve)-.25 G(s,).15 E
578 (POSIX-standard)0 72 Q 0 Cg EP
579 %%Page: 31 31
580 %%BeginPageSetup
581 BP
582 %%EndPageSetup
583 /F0 10/Times-Roman@0 SF -.74(``)0 12 S(pax interchange').74 E(')-.74 E
584 (format archi)0 24 Q -.15(ve)-.25 G(s,).15 E(traditional)0 36 Q -.74(``)
585 0 48 S(shar').74 E(')-.74 E(archi)0 60 Q -.15(ve)-.25 G(s,).15 E
586 (enhanced)0 72 Q 0 Cg EP
587 %%Page: 32 32
588 %%BeginPageSetup
589 BP
590 %%EndPageSetup
591 /F0 10/Times-Roman@0 SF -.74(``)0 12 S(binary').74 E(')-.74 E
592 (shar archi)0 24 Q -.15(ve)-.25 G 2.5(st).15 G(hat store a v)-2.5 E
593 (ariety of \214le attrib)-.25 E(utes and handle binary \214les,)-.2 E
594 (and)0 36 Q(POSIX-standard)0 48 Q -.74(``)0 60 S(ustar').74 E(')-.74 E
595 (archi)0 72 Q -.15(ve)-.25 G(s.).15 E 0 Cg EP
596 %%Page: 33 33
597 %%BeginPageSetup
598 BP
599 %%EndPageSetup
600 /F0 10/Times-Roman@0 SF(The pax interchange format is a backw)0 12 Q
601 (ards-compatible tar format that)-.1 E(adds k)0 24 Q -.15(ey)-.1 G(/v)
602 .15 E(alue attrib)-.25 E(utes to each entry and supports arbitrary)-.2 E
603 (\214lenames, linknames, uids, sizes, etc.)0 36 Q -.74(``)0 48 S
604 (Restricted pax interchange format').74 E(')-.74 E(is the library def)0
605 60 Q(ault; this is the same as pax format, b)-.1 E(ut suppresses)-.2 E
606 (the pax e)0 72 Q(xtended header for most normal \214les.)-.15 E 0 Cg EP
607 %%Page: 34 34
608 %%BeginPageSetup
609 BP
610 %%EndPageSetup
611 /F0 10/Times-Roman@0 SF
612 (In most cases, this will result in ordinary ustar archi)0 12 Q -.15(ve)
613 -.25 G(s.).15 E(<p><dt>Xo<dd>)0 24 Q(<b>archi)0 36 Q -.15(ve)-.25 G
614 (_write_set_compression_bzip2</b>\(<code></code>\),).15 E(<b>archi)0 48
615 Q -.15(ve)-.25 G(_write_set_compression_compress</b>\(<code></code>\),)
616 .15 E(<b>archi)0 60 Q -.15(ve)-.25 G
617 (_write_set_compression_gzip</b>\(<code></code>\),).15 E(<b>archi)0 72 Q
618 -.15(ve)-.25 G(_write_set_compression_none</b>\(<code></code>\)).15 E 0
619 Cg EP
620 %%Page: 35 35
621 %%BeginPageSetup
622 BP
623 %%EndPageSetup
624 /F0 10/Times-Roman@0 SF(The resulting archi)0 12 Q .3 -.15(ve w)-.25 H
625 (ill be compressed as speci\214ed.).15 E
626 (Note that the compressed output is al)0 24 Q -.1(wa)-.1 G
627 (ys properly block).1 E(ed.)-.1 E(<p><dt><b>archi)0 36 Q -.15(ve)-.25 G
628 (_write_set_compression_program</b>\(<code></code>\)<dd>).15 E
629 (The archi)0 48 Q .3 -.15(ve w)-.25 H
630 (ill be fed into the speci\214ed compression program.).15 E
631 (The output of that program is block)0 60 Q
632 (ed and written to the client)-.1 E(write callbacks.)0 72 Q 0 Cg EP
633 %%Page: 36 36
634 %%BeginPageSetup
635 BP
636 %%EndPageSetup
637 /F0 10/Times-Roman@0 SF(<p><dt>Xo<dd>)0 12 Q(<b>archi)0 24 Q -.15(ve)
638 -.25 G(_write_set_compressor_options</b>\(<code></code>\),).15 E
639 (<b>archi)0 36 Q -.15(ve)-.25 G
640 (_write_set_format_options</b>\(<code></code>\),).15 E(<b>archi)0 48 Q
641 -.15(ve)-.25 G(_write_set_options</b>\(<code></code>\)).15 E
642 (Speci\214es options that will be passed to the currently-enabled)0 60 Q
643 (compressor and/or format writer)0 72 Q(.)-.55 E 0 Cg EP
644 %%Page: 37 37
645 %%BeginPageSetup
646 BP
647 %%EndPageSetup
648 /F0 10/Times-Roman@0 SF(The ar)0 12 Q
649 (gument is a comma-separated list of indi)-.18 E(vidual options.)-.25 E
650 (Indi)0 24 Q(vidual options ha)-.25 E .3 -.15(ve o)-.2 H
651 (ne of the follo).15 E(wing forms:)-.25 E(<dl compact>)0 36 Q
652 (<dt><i></i><i>option=v)0 48 Q(alue</i><dd>)-.25 E(The option/v)0 60 Q
653 (alue pair will be pro)-.25 E(vided to e)-.15 E -.15(ve)-.25 G
654 (ry module.).15 E
655 (Modules that do not accept an option with this name will ignore it.)0
656 72 Q 0 Cg EP
657 %%Page: 38 38
658 %%BeginPageSetup
659 BP
660 %%EndPageSetup
661 /F0 10/Times-Roman@0 SF(<dt><i></i><i>option</i><dd>)0 12 Q
662 (The option will be pro)0 24 Q(vided to e)-.15 E -.15(ve)-.25 G
663 (ry module with a v).15 E(alue of)-.25 E -.74(``)0 36 S(1').74 E('.)-.74
664 E(<dt><i></i><i>!option</i><dd>)0 48 Q(The option will be pro)0 60 Q
665 (vided to e)-.15 E -.15(ve)-.25 G(ry module with a NULL v).15 E(alue.)
666 -.25 E(<dt><i></i><i>module:option=v)0 72 Q(alue</i><i></i>,<i> module:\
667 option</i><i></i>,<i> module:!option</i><dd>)-.25 E 0 Cg EP
668 %%Page: 39 39
669 %%BeginPageSetup
670 BP
671 %%EndPageSetup
672 /F0 10/Times-Roman@0 SF(As abo)0 12 Q -.15(ve)-.15 G 2.5(,b).15 G
673 (ut the corresponding option and v)-2.7 E(alue will be pro)-.25 E(vided)
674 -.15 E(only to modules whose name matches)0 24 Q(<i></i><i>module</i>.)0
675 36 Q(</dl>)0 48 Q(The return v)0 60 Q(alue will be)-.25 E
676 (<b></b><b>ARCHIVE_OK</b>)0 72 Q 0 Cg EP
677 %%Page: 40 40
678 %%BeginPageSetup
679 BP
680 %%EndPageSetup
681 /F0 10/Times-Roman@0 SF(if an)0 12 Q 2.5(ym)-.15 G
682 (odule accepts the option, or)-2.5 E(<b></b><b>ARCHIVE_W)0 24 Q(ARN</b>)
683 -1.2 E(if no module accepted the option, or)0 36 Q(<b></b><b>ARCHIVE_F)0
684 48 Q -1.21 -1.11(AT A)-.74 H(L</b>)1.11 E(if there w)0 60 Q(as a f)-.1 E
685 (atal error while attempting to process the option.)-.1 E(<p>)36 72 Q 0
686 Cg EP
687 %%Page: 41 41
688 %%BeginPageSetup
689 BP
690 %%EndPageSetup
691 /F0 10/Times-Roman@0 SF(The currently supported options are:)0 12 Q
692 (<dl compact>)0 24 Q(<dt>Compressor gzip<dd>)0 36 Q(<dl compact>)0 48 Q
693 (<dt><b></b><b>compression-le)0 60 Q -.15(ve)-.25 G(l</b><dd>).15 E
694 (The v)0 72 Q(alue is interpreted as a decimal inte)-.25 E
695 (ger specifying the)-.15 E 0 Cg EP
696 %%Page: 42 42
697 %%BeginPageSetup
698 BP
699 %%EndPageSetup
700 /F0 10/Times-Roman@0 SF(gzip compression le)0 12 Q -.15(ve)-.25 G(l.).15
701 E(</dl>)0 24 Q(<dt>Compressor xz<dd>)0 36 Q(<dl compact>)0 48 Q
702 (<dt><b></b><b>compression-le)0 60 Q -.15(ve)-.25 G(l</b><dd>).15 E
703 (The v)0 72 Q(alue is interpreted as a decimal inte)-.25 E
704 (ger specifying the)-.15 E 0 Cg EP
705 %%Page: 43 43
706 %%BeginPageSetup
707 BP
708 %%EndPageSetup
709 /F0 10/Times-Roman@0 SF(compression le)0 12 Q -.15(ve)-.25 G(l.).15 E
710 (</dl>)0 24 Q(<dt>F)0 36 Q(ormat mtree<dd>)-.15 E(<dl compact>)0 48 Q
711 (<dt><b></b><b>cksum</b><b></b>,<b> de)0 60 Q(vice</b><b></b>,<b> \215a\
712 gs</b><b></b>,<b> gid</b><b></b>,<b> gname</b><b></b>,<b> indent</b><b>\
713 </b>,<b> link</b><b></b>,<b> md5</b><b></b>,<b> mode</b><b></b>,<b> nli\
714 nk</b><b></b>,<b> rmd160</b><b></b>,<b> sha1</b><b></b>,<b> sha256</b><\
715 b></b>,<b> sha384</b>)-.25 E(<b></b>,<b> sha512</b><b></b>,<b> size</b>\
716 <b></b>,<b> time</b><b></b>,<b> uid</b><b></b>,<b> uname</b><dd>)A
717 (Enable a particular k)0 72 Q -.15(ey)-.1 G -.1(wo).15 G
718 (rd in the mtree output.).1 E 0 Cg EP
719 %%Page: 44 44
720 %%BeginPageSetup
721 BP
722 %%EndPageSetup
723 /F0 10/Times-Roman@0 SF(Pre\214x with an e)0 12 Q
724 (xclamation mark to disable the corresponding k)-.15 E -.15(ey)-.1 G -.1
725 (wo).15 G(rd.).1 E(The def)0 24 Q(ault is equi)-.1 E -.25(va)-.25 G
726 (lent to).25 E -.74(``)0 36 S(de).74 E(vice, \215ags, gid, gname, link,\
727  mode, nlink, size, time, type, uid, uname')-.25 E('.)-.74 E
728 (<dt><b></b><b>all</b><dd>)0 48 Q(Enables all of the abo)0 60 Q .3 -.15
729 (ve k)-.15 H -.15(ey).05 G -.1(wo).15 G(rds.).1 E
730 (<dt><b></b><b>use-set</b><dd>)0 72 Q 0 Cg EP
731 %%Page: 45 45
732 %%BeginPageSetup
733 BP
734 %%EndPageSetup
735 /F0 10/Times-Roman@0 SF(Enables generation of)0 12 Q(<b></b><b>/set</b>)
736 0 24 Q(lines that specify def)0 36 Q(ault v)-.1 E(alues for the follo)
737 -.25 E(wing \214les and/or directories.)-.25 E
738 (<dt><b></b><b>indent</b><dd>)0 48 Q(XXX needs e)0 60 Q(xplanation XXX)
739 -.15 E(</dl>)0 72 Q 0 Cg EP
740 %%Page: 46 46
741 %%BeginPageSetup
742 BP
743 %%EndPageSetup
744 /F0 10/Times-Roman@0 SF(</dl>)0 12 Q(<p><dt><b>archi)0 24 Q -.15(ve)-.25
745 G(_write_open</b>\(<code></code>\)<dd>).15 E
746 (Freeze the settings, open the archi)0 36 Q -.15(ve)-.25 G 2.5(,a).15 G
747 (nd prepare for writing entries.)-2.5 E
748 (This is the most generic form of this function, which accepts)0 48 Q
749 (pointers to three callback functions which will be in)0 60 Q -.2(vo)-.4
750 G -.1(ke).2 G 2.5(db).1 G(y)-2.5 E
751 (the compression layer to write the constructed archi)0 72 Q -.15(ve)
752 -.25 G(.).15 E 0 Cg EP
753 %%Page: 47 47
754 %%BeginPageSetup
755 BP
756 %%EndPageSetup
757 /F0 10/Times-Roman@0 SF(<p><dt><b>archi)0 12 Q -.15(ve)-.25 G
758 (_write_open_fd</b>\(<code></code>\)<dd>).15 E 2.5(Ac)0 24 S(on)-2.5 E
759 -.15(ve)-.4 G(nience form of).15 E(<b>archi)0 36 Q -.15(ve)-.25 G
760 (_write_open</b>\(<code></code>\)).15 E
761 (that accepts a \214le descriptor)0 48 Q(.)-.55 E(The)0 60 Q(<b>archi)0
762 72 Q -.15(ve)-.25 G(_write_open_fd</b>\(<code></code>\)).15 E 0 Cg EP
763 %%Page: 48 48
764 %%BeginPageSetup
765 BP
766 %%EndPageSetup
767 /F0 10/Times-Roman@0 SF(function is safe for use with tape dri)0 12 Q
768 -.15(ve)-.25 G 2.5(so).15 G 2.5(ro)-2.5 G(ther)-2.5 E(block-oriented de)
769 0 24 Q(vices.)-.25 E(<p><dt><b>archi)0 36 Q -.15(ve)-.25 G
770 (_write_open_FILE</b>\(<code></code>\)<dd>).15 E 2.5(Ac)0 48 S(on)-2.5 E
771 -.15(ve)-.4 G(nience form of).15 E(<b>archi)0 60 Q -.15(ve)-.25 G
772 (_write_open</b>\(<code></code>\)).15 E(that accepts a)0 72 Q 0 Cg EP
773 %%Page: 49 49
774 %%BeginPageSetup
775 BP
776 %%EndPageSetup
777 /F0 10/Times-Roman@0 SF(<br><br><code></code><code>FILE *</code>)0 12 Q
778 (pointer)0 24 Q(.)-.55 E(Note that)0 36 Q(<b>archi)0 48 Q -.15(ve)-.25 G
779 (_write_open_FILE</b>\(<code></code>\)).15 E
780 (is not safe for writing to tape dri)0 60 Q -.15(ve)-.25 G 2.5(so).15 G
781 2.5(ro)-2.5 G(ther de)-2.5 E(vices)-.25 E
782 (that require correct blocking.)0 72 Q 0 Cg EP
783 %%Page: 50 50
784 %%BeginPageSetup
785 BP
786 %%EndPageSetup
787 /F0 10/Times-Roman@0 SF(<p><dt><b>archi)0 12 Q -.15(ve)-.25 G
788 (_write_open_\214le</b>\(<code></code>\)<dd>).15 E 2.5(Ad)0 24 S
789 (eprecated synon)-2.5 E(ym for)-.15 E(<b>archi)0 36 Q -.15(ve)-.25 G
790 (_write_open_\214lename</b>\(<code></code>\).).15 E(<p><dt><b>archi)0 48
791 Q -.15(ve)-.25 G(_write_open_\214lename</b>\(<code></code>\)<dd>).15 E
792 2.5(Ac)0 60 S(on)-2.5 E -.15(ve)-.4 G(nience form of).15 E(<b>archi)0 72
793 Q -.15(ve)-.25 G(_write_open</b>\(<code></code>\)).15 E 0 Cg EP
794 %%Page: 51 51
795 %%BeginPageSetup
796 BP
797 %%EndPageSetup
798 /F0 10/Times-Roman@0 SF(that accepts a \214lename.)0 12 Q 2.5(AN)0 24 S
799 (ULL ar)-2.5 E
800 (gument indicates that the output should be written to standard output;)
801 -.18 E(an ar)0 36 Q(gument of)-.18 E -.74(``)0 48 S(-').74 E(')-.74 E
802 (will open a \214le with that name.)0 60 Q(If you ha)0 72 Q .3 -.15
803 (ve n)-.2 H(ot in).15 E -.2(vo)-.4 G -.1(ke).2 G(d).1 E 0 Cg EP
804 %%Page: 52 52
805 %%BeginPageSetup
806 BP
807 %%EndPageSetup
808 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
809 (_write_set_bytes_in_last_block</b>\(<code></code>\),).15 E(then)0 24 Q
810 (<b>archi)0 36 Q -.15(ve)-.25 G
811 (_write_open_\214lename</b>\(<code></code>\)).15 E
812 (will adjust the last-block padding depending on the \214le:)0 48 Q
813 (it will enable padding when writing to standard output or)0 60 Q
814 (to a character or block de)0 72 Q
815 (vice node, it will disable padding otherwise.)-.25 E 0 Cg EP
816 %%Page: 53 53
817 %%BeginPageSetup
818 BP
819 %%EndPageSetup
820 /F0 10/Times-Roman@0 SF -1.1(Yo)0 12 S 2.5(uc)1.1 G(an o)-2.5 E -.15(ve)
821 -.15 G(rride this by manually in).15 E -.2(vo)-.4 G(king).2 E(<b>archi)0
822 24 Q -.15(ve)-.25 G(_write_set_bytes_in_last_block</b>\(<code></code>\))
823 .15 E(before calling)0 36 Q(<b>archi)0 48 Q -.15(ve)-.25 G
824 (_write_open</b>\(<code></code>\).).15 E(The)0 60 Q(<b>archi)0 72 Q -.15
825 (ve)-.25 G(_write_open_\214lename</b>\(<code></code>\)).15 E 0 Cg EP
826 %%Page: 54 54
827 %%BeginPageSetup
828 BP
829 %%EndPageSetup
830 /F0 10/Times-Roman@0 SF(function is safe for use with tape dri)0 12 Q
831 -.15(ve)-.25 G 2.5(so).15 G 2.5(ro)-2.5 G(ther)-2.5 E(block-oriented de)
832 0 24 Q(vices.)-.25 E(<p><dt><b>archi)0 36 Q -.15(ve)-.25 G
833 (_write_open_memory</b>\(<code></code>\)<dd>).15 E 2.5(Ac)0 48 S(on)-2.5
834 E -.15(ve)-.4 G(nience form of).15 E(<b>archi)0 60 Q -.15(ve)-.25 G
835 (_write_open</b>\(<code></code>\)).15 E
836 (that accepts a pointer to a block of memory that will recei)0 72 Q -.15
837 (ve)-.25 G 0 Cg EP
838 %%Page: 55 55
839 %%BeginPageSetup
840 BP
841 %%EndPageSetup
842 /F0 10/Times-Roman@0 SF(the archi)0 12 Q -.15(ve)-.25 G(.).15 E
843 (The \214nal)0 24 Q(<br><br><code></code><code>size_t *</code>)0 36 Q
844 (ar)0 48 Q(gument points to a v)-.18 E(ariable that will be updated)-.25
845 E(after each write to re\215ect ho)0 60 Q 2.5(wm)-.25 G(uch of the b)
846 -2.5 E(uf)-.2 E(fer)-.25 E(is currently in use.)0 72 Q 0 Cg EP
847 %%Page: 56 56
848 %%BeginPageSetup
849 BP
850 %%EndPageSetup
851 /F0 10/Times-Roman@0 SF -1.1(Yo)0 12 S 2.5(us)1.1 G
852 (hould be careful to ensure that this v)-2.5 E(ariable)-.25 E
853 (remains allocated until after the archi)0 24 Q .3 -.15(ve i)-.25 H(s)
854 .15 E(closed.)0 36 Q(<p><dt><b>archi)0 48 Q -.15(ve)-.25 G
855 (_write_header</b>\(<code></code>\)<dd>).15 E
856 (Build and write a header using the data in the pro)0 60 Q(vided)-.15 E
857 (<font size="-1"></font><font size="-1">struct</font><font size="-1"> a\
858 rchi)0 72 Q -.15(ve)-.25 G(_entry</font>).15 E 0 Cg EP
859 %%Page: 57 57
860 %%BeginPageSetup
861 BP
862 %%EndPageSetup
863 /F0 10/Times-Roman@0 SF(structure.)0 12 Q(See)0 24 Q
864 (<a href="../html3/archi)0 36 Q -.15(ve)-.25 G(_entry).15 E
865 (.html">archi)-.65 E -.15(ve)-.25 G(_entry\(3\)</a>).15 E
866 (for information on creating and populating)0 48 Q(<font size="-1"></fo\
867 nt><font size="-1">struct</font><font size="-1"> archi)0 60 Q -.15(ve)
868 -.25 G(_entry</font>).15 E(objects.)0 72 Q 0 Cg EP
869 %%Page: 58 58
870 %%BeginPageSetup
871 BP
872 %%EndPageSetup
873 /F0 10/Times-Roman@0 SF(<p><dt><b>archi)0 12 Q -.15(ve)-.25 G
874 (_write_data</b>\(<code></code>\)<dd>).15 E
875 (Write data corresponding to the header just written.)0 24 Q
876 (Returns number of bytes written or -1 on error)0 36 Q(.)-.55 E
877 (<p><dt><b>archi)0 48 Q -.15(ve)-.25 G
878 (_write_\214nish_entry</b>\(<code></code>\)<dd>).15 E
879 (Close out the entry just written.)0 60 Q(In particular)0 72 Q 2.5(,t)
880 -.4 G(his writes out the \214nal padding required by some formats.)-2.5
881 E 0 Cg EP
882 %%Page: 59 59
883 %%BeginPageSetup
884 BP
885 %%EndPageSetup
886 /F0 10/Times-Roman@0 SF(Ordinarily)0 12 Q 2.5(,c)-.65 G(lients ne)-2.5 E
887 -.15(ve)-.25 G 2.5(rn).15 G(eed to call this, as it)-2.5 E
888 (is called automatically by)0 24 Q(<b>archi)0 36 Q -.15(ve)-.25 G
889 (_write_ne).15 E(xt_header</b>\(<code></code>\))-.15 E(and)0 48 Q
890 (<b>archi)0 60 Q -.15(ve)-.25 G(_write_close</b>\(<code></code>\)).15 E
891 (as needed.)0 72 Q 0 Cg EP
892 %%Page: 60 60
893 %%BeginPageSetup
894 BP
895 %%EndPageSetup
896 /F0 10/Times-Roman@0 SF(<p><dt><b>archi)0 12 Q -.15(ve)-.25 G
897 (_write_close</b>\(<code></code>\)<dd>).15 E(Complete the archi)0 24 Q
898 .3 -.15(ve a)-.25 H(nd in).15 E -.2(vo)-.4 G .2 -.1(ke t).2 H
899 (he close callback.).1 E(<p><dt><b>archi)0 36 Q -.15(ve)-.25 G
900 (_write_\214nish</b>\(<code></code>\)<dd>).15 E(In)0 48 Q -.2(vo)-.4 G
901 -.1(ke).2 G(s).1 E(<b>archi)0 60 Q -.15(ve)-.25 G
902 (_write_close</b>\(<code></code>\)).15 E(if it w)0 72 Q(as not in)-.1 E
903 -.2(vo)-.4 G -.1(ke).2 G 2.5(dm).1 G(anually)-2.5 E 2.5(,t)-.65 G
904 (hen releases all resources.)-2.5 E 0 Cg EP
905 %%Page: 61 61
906 %%BeginPageSetup
907 BP
908 %%EndPageSetup
909 /F0 10/Times-Roman@0 SF(Note that this function w)0 12 Q
910 (as declared to return)-.1 E(<br><br><code></code><code>v)0 24 Q
911 (oid</code>)-.2 E(in libarchi)0 36 Q .3 -.15(ve 1)-.25 H
912 (.x, which made it impossible to detect errors when).15 E(<b>archi)0 48
913 Q -.15(ve)-.25 G(_write_close</b>\(<code></code>\)).15 E -.1(wa)0 60 S
914 2.5(si).1 G -1.9 -.4(nv o)-2.5 H -.1(ke).4 G 2.5(di).1 G
915 (mplicitly from this function.)-2.5 E(This is corrected be)0 72 Q
916 (ginning with libarchi)-.15 E .3 -.15(ve 2)-.25 H(.0.).15 E 0 Cg EP
917 %%Page: 62 62
918 %%BeginPageSetup
919 BP
920 %%EndPageSetup
921 /F0 10/Times-Roman@0 SF(</dl>)0 12 Q(More information about the)0 24 Q
922 (<i></i><i>struct</i><i> archi)0 36 Q -.15(ve)-.25 G(</i>).15 E
923 (object and the o)0 48 Q -.15(ve)-.15 G
924 (rall design of the library can be found in the).15 E
925 (<a href="../html3/libarchi)0 60 Q -.15(ve)-.25 G(.html">libarchi).15 E
926 -.15(ve)-.25 G(\(3\)</a>).15 E -.15(ove)0 72 S(rvie).15 E -.65(w.)-.25 G
927 0 Cg EP
928 %%Page: 63 63
929 %%BeginPageSetup
930 BP
931 %%EndPageSetup
932 /F0 10/Times-Roman@0 SF(<h3 id="IMPLEMENT)36 12 Q -1.11(AT)-.93 G(ION">)
933 1.11 E(IMPLEMENT)36 24 Q -1.11(AT)-.93 G(ION)1.11 E(</h3>)36 36 Q
934 (Compression support is b)0 48 Q(uilt-in to libarchi)-.2 E -.15(ve)-.25
935 G 2.5(,w).15 G(hich uses zlib and bzlib)-2.5 E
936 (to handle gzip and bzip2 compression, respecti)0 60 Q -.15(ve)-.25 G
937 (ly).15 E(.)-.65 E(<h3 id="CLIENT CALLB)36 72 Q -.4(AC)-.35 G(KS">).4 E
938 0 Cg EP
939 %%Page: 64 64
940 %%BeginPageSetup
941 BP
942 %%EndPageSetup
943 /F0 10/Times-Roman@0 SF(CLIENT CALLB)36 12 Q -.4(AC)-.35 G(KS).4 E
944 (</h3>)36 24 Q 1.6 -.8(To u)0 36 T(se this library).8 E 2.5(,y)-.65 G
945 (ou will need to de\214ne and re)-2.5 E(gister)-.15 E
946 (callback functions that will be in)0 48 Q -.2(vo)-.4 G -.1(ke).2 G 2.5
947 (dt).1 G 2.5(ow)-2.5 G(rite data to the)-2.5 E(resulting archi)0 60 Q
948 -.15(ve)-.25 G(.).15 E(These functions are re)0 72 Q
949 (gistered by calling)-.15 E 0 Cg EP
950 %%Page: 65 65
951 %%BeginPageSetup
952 BP
953 %%EndPageSetup
954 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
955 (_write_open</b>\(<code></code>\):).15 E(<dl>)0 24 Q(<p><dd>)0 36 Q
956 (<br><br><code></code><code>typedef</code><code> int</code>)0 48 Q
957 (<b>archi)0 60 Q -.15(ve)-.25 G
958 (_open_callback</b>\(<code></code><code>struct archi).15 E .3 -.15(ve *)
959 -.25 H(</code><code>, v).15 E(oid *client_data</code>\))-.2 E(</dl>)0 72
960 Q 0 Cg EP
961 %%Page: 66 66
962 %%BeginPageSetup
963 BP
964 %%EndPageSetup
965 /F0 10/Times-Roman@0 SF(<p>)36 12 Q(The open callback is in)0 24 Q -.2
966 (vo)-.4 G -.1(ke).2 G 2.5(db).1 G(y)-2.5 E(<b>archi)0 36 Q -.15(ve)-.25
967 G(_write_open</b>\(<code></code>\).).15 E(It should return)0 48 Q
968 (<b></b><b>ARCHIVE_OK</b>)0 60 Q
969 (if the underlying \214le or data source is successfully)0 72 Q 0 Cg EP
970 %%Page: 67 67
971 %%BeginPageSetup
972 BP
973 %%EndPageSetup
974 /F0 10/Times-Roman@0 SF(opened.)0 12 Q(If the open f)0 24 Q
975 (ails, it should call)-.1 E(<b>archi)0 36 Q -.15(ve)-.25 G
976 (_set_error</b>\(<code></code>\)).15 E(to re)0 48 Q
977 (gister an error code and message and return)-.15 E(<b></b><b>ARCHIVE_F)
978 0 60 Q -1.21 -1.11(AT A)-.74 H(L</b>.)1.11 E(<dl>)0 72 Q 0 Cg EP
979 %%Page: 68 68
980 %%BeginPageSetup
981 BP
982 %%EndPageSetup
983 /F0 10/Times-Roman@0 SF(<p><dd>)0 12 Q
984 (<br><br><code></code><code>typedef</code><code> ssize_t</code>)0 24 Q
985 (<b>archi)0 36 Q -.15(ve)-.25 G(_write_callback</b>\(<code></code>).15 E
986 (<code></code><code>struct archi)0 48 Q .3 -.15(ve *)-.25 H(</code>).15
987 E(<code></code><code>v)0 60 Q(oid *client_data</code>)-.2 E
988 (<code></code><code>const v)0 72 Q(oid *b)-.2 E(uf)-.2 E(fer</code>)-.25
989 E 0 Cg EP
990 %%Page: 69 69
991 %%BeginPageSetup
992 BP
993 %%EndPageSetup
994 /F0 10/Times-Roman@0 SF(<code></code><code>size_t length</code>)0 12 Q
995 (\))0 24 Q(</dl>)0 36 Q(<p>)36 48 Q(The write callback is in)0 60 Q -.2
996 (vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(hene)-2.5 E -.15(ve)-.25 G 2.5(rt).15
997 G(he library)-2.5 E(needs to write ra)0 72 Q 2.5(wb)-.15 G
998 (ytes to the archi)-2.5 E -.15(ve)-.25 G(.).15 E 0 Cg EP
999 %%Page: 70 70
1000 %%BeginPageSetup
1001 BP
1002 %%EndPageSetup
1003 /F0 10/Times-Roman@0 SF -.15(Fo)0 12 S 2.5(rc).15 G
1004 (orrect blocking, each call to the write callback function)-2.5 E
1005 (should translate into a single)0 24 Q
1006 (<a href="../html2/write.html">write\(2\)</a>)0 36 Q(system call.)0 48 Q
1007 (This is especially critical when writing archi)0 60 Q -.15(ve)-.25 G
1008 2.5(st).15 G 2.5(ot)-2.5 G(ape dri)-2.5 E -.15(ve)-.25 G(s.).15 E
1009 (On success, the write callback should return the)0 72 Q 0 Cg EP
1010 %%Page: 71 71
1011 %%BeginPageSetup
1012 BP
1013 %%EndPageSetup
1014 /F0 10/Times-Roman@0 SF(number of bytes actually written.)0 12 Q
1015 (On error)0 24 Q 2.5(,t)-.4 G(he callback should in)-2.5 E -.2(vo)-.4 G
1016 -.1(ke).2 G(<b>archi)0 36 Q -.15(ve)-.25 G
1017 (_set_error</b>\(<code></code>\)).15 E(to re)0 48 Q
1018 (gister an error code and message and return -1.)-.15 E(<dl>)0 60 Q
1019 (<p><dd>)0 72 Q 0 Cg EP
1020 %%Page: 72 72
1021 %%BeginPageSetup
1022 BP
1023 %%EndPageSetup
1024 /F0 10/Times-Roman@0 SF
1025 (<br><br><code></code><code>typedef</code><code> int</code>)0 12 Q
1026 (<b>archi)0 24 Q -.15(ve)-.25 G
1027 (_close_callback</b>\(<code></code><code>struct archi).15 E .3 -.15
1028 (ve *)-.25 H(</code><code>, v).15 E(oid *client_data</code>\))-.2 E
1029 (</dl>)0 36 Q(<p>)36 48 Q(The close callback is in)0 60 Q -.2(vo)-.4 G
1030 -.1(ke).2 G 2.5(db).1 G 2.5(ya)-2.5 G(rchi)-2.5 E -.15(ve)-.25 G
1031 (_close when).15 E(the archi)0 72 Q .3 -.15(ve p)-.25 H
1032 (rocessing is complete.).15 E 0 Cg EP
1033 %%Page: 73 73
1034 %%BeginPageSetup
1035 BP
1036 %%EndPageSetup
1037 /F0 10/Times-Roman@0 SF(The callback should return)0 12 Q
1038 (<b></b><b>ARCHIVE_OK</b>)0 24 Q(on success.)0 36 Q(On f)0 48 Q
1039 (ailure, the callback should in)-.1 E -.2(vo)-.4 G -.1(ke).2 G(<b>archi)
1040 0 60 Q -.15(ve)-.25 G(_set_error</b>\(<code></code>\)).15 E(to re)0 72 Q
1041 (gister an error code and message and)-.15 E 0 Cg EP
1042 %%Page: 74 74
1043 %%BeginPageSetup
1044 BP
1045 %%EndPageSetup
1046 /F0 10/Times-Roman@0 SF(return)0 12 Q(<b></b><b>ARCHIVE_F)0 24 Q -1.21
1047 -1.11(AT A)-.74 H(L.</b>)1.11 E(<h3 id="EXAMPLE">)36 36 Q(EXAMPLE)36 48
1048 Q(</h3>)36 60 Q(The follo)0 72 Q(wing sk)-.25 E
1049 (etch illustrates basic usage of the library)-.1 E(.)-.65 E 0 Cg EP
1050 %%Page: 75 75
1051 %%BeginPageSetup
1052 BP
1053 %%EndPageSetup
1054 /F0 10/Times-Roman@0 SF(In this e)0 12 Q(xample,)-.15 E
1055 (the callback functions are simply wrappers around the standard)0 24 Q
1056 (<a href="../html2/open.html">open\(2\)</a>,)0 36 Q
1057 (<a href="../html2/write.html">write\(2\)</a>,)0 48 Q(and)0 60 Q
1058 (<a href="../html2/close.html">close\(2\)</a>)0 72 Q 0 Cg EP
1059 %%Page: 76 76
1060 %%BeginPageSetup
1061 BP
1062 %%EndPageSetup
1063 /F0 10/Times-Roman@0 SF(system calls.)0 12 Q(<dl compact><dt><dd>)0 24 Q
1064 (<code>)0 36 Q(<pre>)0 48 Q(#ifdef __linux__)0 60 Q 4.06
1065 (#de\214ne _FILE_OFFSET_BITS)0 72 R(64)2.5 E 0 Cg EP
1066 %%Page: 77 77
1067 %%BeginPageSetup
1068 BP
1069 %%EndPageSetup
1070 /F0 10/Times-Roman@0 SF(#endif)0 12 Q(#include <sys/stat.h>)0 24 Q
1071 (#include <archi)0 36 Q -.15(ve)-.25 G(.h>).15 E(#include <archi)0 48 Q
1072 -.15(ve)-.25 G(_entry).15 E(.h>)-.65 E(#include <fcntl.h>)0 60 Q
1073 (#include <stdlib)0 72 Q(.h>)-.4 E 0 Cg EP
1074 %%Page: 78 78
1075 %%BeginPageSetup
1076 BP
1077 %%EndPageSetup
1078 /F0 10/Times-Roman@0 SF(#include <unistd.h>)0 12 Q(<p>)36 24 Q
1079 (struct mydata {)0 36 Q(const char *name;)36 48 Q(int fd;)36 60 Q(};)0
1080 72 Q 0 Cg EP
1081 %%Page: 79 79
1082 %%BeginPageSetup
1083 BP
1084 %%EndPageSetup
1085 /F0 10/Times-Roman@0 SF(<p>)36 12 Q(int)0 24 Q(myopen\(struct archi)0 36
1086 Q .3 -.15(ve *)-.25 H(a, v).15 E(oid *client_data\))-.2 E({)0 48 Q
1087 (struct mydata *mydata = client_data;)5 60 Q(<p>)36 72 Q 0 Cg EP
1088 %%Page: 80 80
1089 %%BeginPageSetup
1090 BP
1091 %%EndPageSetup
1092 /F0 10/Times-Roman@0 SF(mydata->fd = open\(mydata->name, O_WR)5 12 Q
1093 (ONL)-.4 E 2.5(Y|O)-1 G(_CREA)-2.5 E 1.48 -.74(T, 0)-1.11 H(644\);).74 E
1094 (if \(mydata->fd >= 0\))5 24 Q(return \(ARCHIVE_OK\);)10 36 Q(else)5 48
1095 Q(return \(ARCHIVE_F)10 60 Q -1.21 -1.11(AT A)-.74 H(L\);)1.11 E(})0 72
1096 Q 0 Cg EP
1097 %%Page: 81 81
1098 %%BeginPageSetup
1099 BP
1100 %%EndPageSetup
1101 /F0 10/Times-Roman@0 SF(<p>)36 12 Q(ssize_t)0 24 Q
1102 (mywrite\(struct archi)0 36 Q .3 -.15(ve *)-.25 H(a, v).15 E
1103 (oid *client_data, const v)-.2 E(oid *b)-.2 E(uf)-.2 E(f, size_t n\))
1104 -.25 E({)0 48 Q(struct mydata *mydata = client_data;)5 60 Q(<p>)36 72 Q
1105 0 Cg EP
1106 %%Page: 82 82
1107 %%BeginPageSetup
1108 BP
1109 %%EndPageSetup
1110 /F0 10/Times-Roman@0 SF(return \(write\(mydata->fd, b)5 12 Q(uf)-.2 E
1111 (f, n\)\);)-.25 E(})0 24 Q(<p>)36 36 Q(int)0 48 Q(myclose\(struct archi)
1112 0 60 Q .3 -.15(ve *)-.25 H(a, v).15 E(oid *client_data\))-.2 E({)0 72 Q
1113 0 Cg EP
1114 %%Page: 83 83
1115 %%BeginPageSetup
1116 BP
1117 %%EndPageSetup
1118 /F0 10/Times-Roman@0 SF(struct mydata *mydata = client_data;)5 12 Q(<p>)
1119 36 24 Q(if \(mydata->fd > 0\))5 36 Q(close\(mydata->fd\);)10 48 Q
1120 (return \(0\);)5 60 Q(})0 72 Q 0 Cg EP
1121 %%Page: 84 84
1122 %%BeginPageSetup
1123 BP
1124 %%EndPageSetup
1125 /F0 10/Times-Roman@0 SF(<p>)36 12 Q -.2(vo)0 24 S(id).2 E(write_archi)0
1126 36 Q -.15(ve)-.25 G(\(const char *outname, const char **\214lename\)).15
1127 E({)0 48 Q(struct mydata *mydata = malloc\(sizeof\(struct mydata\)\);)5
1128 60 Q(struct archi)5 72 Q .3 -.15(ve *)-.25 H(a;).15 E 0 Cg EP
1129 %%Page: 85 85
1130 %%BeginPageSetup
1131 BP
1132 %%EndPageSetup
1133 /F0 10/Times-Roman@0 SF(struct archi)5 12 Q -.15(ve)-.25 G
1134 (_entry *entry;).15 E(struct stat st;)5 24 Q(char b)5 36 Q(uf)-.2 E
1135 (f[8192];)-.25 E(int len;)5 48 Q(int fd;)5 60 Q(<p>)36 72 Q 0 Cg EP
1136 %%Page: 86 86
1137 %%BeginPageSetup
1138 BP
1139 %%EndPageSetup
1140 /F0 10/Times-Roman@0 SF 2.5(a=a)5 12 S(rchi)-2.5 E -.15(ve)-.25 G
1141 (_write_ne).15 E(w\(\);)-.25 E(mydata->name = outname;)5 24 Q(archi)5 36
1142 Q -.15(ve)-.25 G(_write_set_compression_gzip\(a\);).15 E(archi)5 48 Q
1143 -.15(ve)-.25 G(_write_set_format_ustar\(a\);).15 E(archi)5 60 Q -.15(ve)
1144 -.25 G(_write_open\(a, mydata, myopen, mywrite, myclose\);).15 E
1145 (while \(*\214lename\) {)5 72 Q 0 Cg EP
1146 %%Page: 87 87
1147 %%BeginPageSetup
1148 BP
1149 %%EndPageSetup
1150 /F0 10/Times-Roman@0 SF(stat\(*\214lename, &st\);)10 12 Q(entry = archi)
1151 10 24 Q -.15(ve)-.25 G(_entry_ne).15 E(w\(\);)-.25 E(archi)10 36 Q -.15
1152 (ve)-.25 G(_entry_cop).15 E(y_stat\(entry)-.1 E 2.5(,&)-.65 G(st\);)-2.5
1153 E(archi)10 48 Q -.15(ve)-.25 G(_entry_set_pathname\(entry).15 E 2.5(,*)
1154 -.65 G(\214lename\);)-2.5 E(archi)10 60 Q -.15(ve)-.25 G
1155 (_write_header\(a, entry\);).15 E(fd = open\(*\214lename, O_RDONL)10 72
1156 Q(Y\);)-1 E 0 Cg EP
1157 %%Page: 88 88
1158 %%BeginPageSetup
1159 BP
1160 %%EndPageSetup
1161 /F0 10/Times-Roman@0 SF(len = read\(fd, b)10 12 Q(uf)-.2 E(f, sizeof\(b)
1162 -.25 E(uf)-.2 E(f\)\);)-.25 E(while \( len > 0 \) {)10 24 Q(archi)36 36
1163 Q -.15(ve)-.25 G(_write_data\(a, b).15 E(uf)-.2 E(f, len\);)-.25 E
1164 (len = read\(fd, b)36 48 Q(uf)-.2 E(f, sizeof\(b)-.25 E(uf)-.2 E(f\)\);)
1165 -.25 E(})10 60 Q(archi)10 72 Q -.15(ve)-.25 G(_entry_free\(entry\);).15
1166 E 0 Cg EP
1167 %%Page: 89 89
1168 %%BeginPageSetup
1169 BP
1170 %%EndPageSetup
1171 /F0 10/Times-Roman@0 SF(\214lename++;)10 12 Q(})5 24 Q(archi)5 36 Q -.15
1172 (ve)-.25 G(_write_\214nish\(a\);).15 E(})0 48 Q(<p>)36 60 Q
1173 (int main\(int ar)0 72 Q(gc, const char **ar)-.18 E(gv\))-.18 E 0 Cg EP
1174 %%Page: 90 90
1175 %%BeginPageSetup
1176 BP
1177 %%EndPageSetup
1178 /F0 10/Times-Roman@0 SF({)0 12 Q(const char *outname;)36 24 Q(ar)36 36 Q
1179 (gv++;)-.18 E(outname = ar)36 48 Q(gv++;)-.18 E(write_archi)36 60 Q -.15
1180 (ve)-.25 G(\(outname, ar).15 E(gv\);)-.18 E(return 0;)36 72 Q 0 Cg EP
1181 %%Page: 91 91
1182 %%BeginPageSetup
1183 BP
1184 %%EndPageSetup
1185 /F0 10/Times-Roman@0 SF(})0 12 Q(</pre>)0 24 Q(</code>)0 36 Q(</dl>)0 48
1186 Q(<h3 id="RETURN V)36 60 Q(ALUES">)-1.35 E(RETURN V)36 72 Q(ALUES)-1.35
1187 E 0 Cg EP
1188 %%Page: 92 92
1189 %%BeginPageSetup
1190 BP
1191 %%EndPageSetup
1192 /F0 10/Times-Roman@0 SF(</h3>)36 12 Q(Most functions return)0 24 Q
1193 (<b></b><b>ARCHIVE_OK</b>)0 36 Q(\(zero\) on success, or one of se)0 48
1194 Q -.15(ve)-.25 G(ral non-zero).15 E(error codes for errors.)0 60 Q
1195 (Speci\214c error codes include:)0 72 Q 0 Cg EP
1196 %%Page: 93 93
1197 %%BeginPageSetup
1198 BP
1199 %%EndPageSetup
1200 /F0 10/Times-Roman@0 SF(<b></b><b>ARCHIVE_RETR)0 12 Q(Y</b>)-.65 E
1201 (for operations that might succeed if retried,)0 24 Q
1202 (<b></b><b>ARCHIVE_W)0 36 Q(ARN</b>)-1.2 E
1203 (for unusual conditions that do not pre)0 48 Q -.15(ve)-.25 G
1204 (nt further operations, and).15 E(<b></b><b>ARCHIVE_F)0 60 Q -1.21 -1.11
1205 (AT A)-.74 H(L</b>)1.11 E(for serious errors that mak)0 72 Q 2.5(er)-.1
1206 G(emaining operations impossible.)-2.5 E 0 Cg EP
1207 %%Page: 94 94
1208 %%BeginPageSetup
1209 BP
1210 %%EndPageSetup
1211 /F0 10/Times-Roman@0 SF(The)0 12 Q(<b>archi)0 24 Q -.15(ve)-.25 G
1212 (_errno</b>\(<code></code>\)).15 E(and)0 36 Q(<b>archi)0 48 Q -.15(ve)
1213 -.25 G(_error_string</b>\(<code></code>\)).15 E
1214 (functions can be used to retrie)0 60 Q .3 -.15(ve a)-.25 H 2.5(na).15 G
1215 (ppropriate error code and a)-2.5 E(te)0 72 Q(xtual error message.)-.15
1216 E 0 Cg EP
1217 %%Page: 95 95
1218 %%BeginPageSetup
1219 BP
1220 %%EndPageSetup
1221 /F0 10/Times-Roman@0 SF(<p>)36 12 Q(<b>archi)0 24 Q -.15(ve)-.25 G
1222 (_write_ne).15 E(w</b>\(<code></code>\))-.25 E
1223 (returns a pointer to a ne)0 36 Q(wly-allocated)-.25 E(<font size="-1">\
1224 </font><font size="-1">struct</font><font size="-1"> archi)0 48 Q -.15
1225 (ve)-.25 G(</font>).15 E(object.)0 60 Q(<p>)36 72 Q 0 Cg EP
1226 %%Page: 96 96
1227 %%BeginPageSetup
1228 BP
1229 %%EndPageSetup
1230 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
1231 (_write_data</b>\(<code></code>\)).15 E
1232 (returns a count of the number of bytes actually written.)0 24 Q
1233 (On error)0 36 Q 2.5(,-)-.4 G 2.5(1i)-2.5 G 2.5(sr)-2.5 G
1234 (eturned and the)-2.5 E(<b>archi)0 48 Q -.15(ve)-.25 G
1235 (_errno</b>\(<code></code>\)).15 E(and)0 60 Q(<b>archi)0 72 Q -.15(ve)
1236 -.25 G(_error_string</b>\(<code></code>\)).15 E 0 Cg EP
1237 %%Page: 97 97
1238 %%BeginPageSetup
1239 BP
1240 %%EndPageSetup
1241 /F0 10/Times-Roman@0 SF(functions will return appropriate v)0 12 Q
1242 (alues.)-.25 E(Note that if the client-pro)0 24 Q
1243 (vided write callback function)-.15 E(returns a non-zero v)0 36 Q
1244 (alue, that error will be propag)-.25 E(ated back to the caller)-.05 E
1245 (through whate)0 48 Q -.15(ve)-.25 G 2.5(rA).15 G
1246 (PI function resulted in that call, which)-2.5 E(may include)0 60 Q
1247 (<b>archi)0 72 Q -.15(ve)-.25 G(_write_header</b>\(<code></code>\),).15
1248 E 0 Cg EP
1249 %%Page: 98 98
1250 %%BeginPageSetup
1251 BP
1252 %%EndPageSetup
1253 /F0 10/Times-Roman@0 SF(<b>archi)0 12 Q -.15(ve)-.25 G
1254 (_write_data</b>\(<code></code>\),).15 E(<b>archi)0 24 Q -.15(ve)-.25 G
1255 (_write_close</b>\(<code></code>\),).15 E(or)0 36 Q(<b>archi)0 48 Q -.15
1256 (ve)-.25 G(_write_\214nish</b>\(<code></code>\).).15 E
1257 (The client callback can call)0 60 Q(<b>archi)0 72 Q -.15(ve)-.25 G
1258 (_set_error</b>\(<code></code>\)).15 E 0 Cg EP
1259 %%Page: 99 99
1260 %%BeginPageSetup
1261 BP
1262 %%EndPageSetup
1263 /F0 10/Times-Roman@0 SF(to pro)0 12 Q(vide v)-.15 E
1264 (alues that can then be retrie)-.25 E -.15(ve)-.25 G 2.5(db).15 G(y)-2.5
1265 E(<b>archi)0 24 Q -.15(ve)-.25 G(_errno</b>\(<code></code>\)).15 E(and)0
1266 36 Q(<b>archi)0 48 Q -.15(ve)-.25 G(_error_string</b>\(<code></code>\).)
1267 .15 E(<h3 id="SEE ALSO">)36 60 Q(SEE ALSO)36 72 Q 0 Cg EP
1268 %%Page: 100 100
1269 %%BeginPageSetup
1270 BP
1271 %%EndPageSetup
1272 /F0 10/Times-Roman@0 SF(</h3>)36 12 Q(<a href="../html1/tar)0 24 Q
1273 (.html">tar\(1\)</a>,)-.55 E(<a href="../html3/libarchi)0 36 Q -.15(ve)
1274 -.25 G(.html">libarchi).15 E -.15(ve)-.25 G(\(3\)</a>,).15 E
1275 (<a href="../html5/tar)0 48 Q(.html">tar\(5\)</a>)-.55 E(<h3 id="HIST)36
1276 60 Q(OR)-.18 E(Y">)-.65 E(HIST)36 72 Q(OR)-.18 E(Y)-.65 E 0 Cg EP
1277 %%Page: 101 101
1278 %%BeginPageSetup
1279 BP
1280 %%EndPageSetup
1281 /F0 10/Times-Roman@0 SF(</h3>)36 12 Q(The)0 24 Q(<b>libarchi)0 36 Q -.15
1282 (ve)-.25 G(</b>).15 E(library \214rst appeared in)0 48 Q(FreeBSD5.3.)0
1283 60 Q(<h3 id="A)36 72 Q(UTHORS">)-.55 E 0 Cg EP
1284 %%Page: 102 102
1285 %%BeginPageSetup
1286 BP
1287 %%EndPageSetup
1288 /F0 10/Times-Roman@0 SF -.55(AU)36 12 S(THORS).55 E(</h3>)36 24 Q(<p>)36
1289 36 Q(The)0 48 Q(<b>libarchi)0 60 Q -.15(ve)-.25 G(</b>).15 E(library w)0
1290 72 Q(as written by)-.1 E 0 Cg EP
1291 %%Page: 103 103
1292 %%BeginPageSetup
1293 BP
1294 %%EndPageSetup
1295 /F0 10/Times-Roman@0 SF -.35(Ti)0 12 S 2.5(mK).35 G
1296 (ientzle &lt;kientzle@acm.or)-2.5 E(g&gt;.)-.18 E(<h3 id="B)36 24 Q
1297 (UGS">)-.1 E -.1(BU)36 36 S(GS).1 E(</h3>)36 48 Q(There are man)0 60 Q
1298 2.5(yp)-.15 G(eculiar b)-2.5 E
1299 (ugs in historic tar implementations that may cause)-.2 E
1300 (certain programs to reject archi)0 72 Q -.15(ve)-.25 G 2.5(sw).15 G
1301 (ritten by this library)-2.5 E(.)-.65 E 0 Cg EP
1302 %%Page: 104 104
1303 %%BeginPageSetup
1304 BP
1305 %%EndPageSetup
1306 /F0 10/Times-Roman@0 SF -.15(Fo)0 12 S 2.5(re).15 G(xample, se)-2.65 E
1307 -.15(ve)-.25 G(ral historic implementations calculated header checksums)
1308 .15 E(incorrectly and will thus reject v)0 24 Q(alid archi)-.25 E -.15
1309 (ve)-.25 G(s; GNU tar does not fully support).15 E(pax interchange form\
1310 at; some old tar implementations required speci\214c)0 36 Q
1311 (\214eld terminations.)0 48 Q(<p>)36 60 Q(The def)0 72 Q
1312 (ault pax interchange format eliminates most of the historic)-.1 E 0 Cg
1313 EP
1314 %%Page: 105 105
1315 %%BeginPageSetup
1316 BP
1317 %%EndPageSetup
1318 /F0 10/Times-Roman@0 SF(tar limitations and pro)0 12 Q
1319 (vides a generic k)-.15 E -.15(ey)-.1 G(/v).15 E(alue attrib)-.25 E
1320 (ute f)-.2 E(acility)-.1 E(for v)0 24 Q(endor)-.15 E(-de\214ned e)-.2 E
1321 (xtensions.)-.15 E(One o)0 36 Q -.15(ve)-.15 G(rsight in POSIX is the f)
1322 .15 E(ailure to pro)-.1 E(vide a standard attrib)-.15 E(ute)-.2 E
1323 (for lar)0 48 Q(ge de)-.18 E(vice numbers.)-.25 E(This library uses)0 60
1324 Q -.74(``)0 72 S(SCHIL).74 E -1.29(Y.)-1 G(de)1.29 E(vminor')-.25 E(')
1325 -.74 E 0 Cg EP
1326 %%Page: 106 106
1327 %%BeginPageSetup
1328 BP
1329 %%EndPageSetup
1330 /F0 10/Times-Roman@0 SF(and)0 12 Q -.74(``)0 24 S(SCHIL).74 E -1.29(Y.)
1331 -1 G(de)1.29 E(vmajor')-.25 E(')-.74 E(for de)0 36 Q
1332 (vice numbers that e)-.25 E(xceed the range supported by the backw)-.15
1333 E(ards-compatible)-.1 E(ustar header)0 48 Q(.)-.55 E(These k)0 60 Q -.15
1334 (ey)-.1 G 2.5(sa).15 G(re compatible with Joer)-2.5 E 2.5(gS)-.18 G
1335 (chilling')-2.5 E(s)-.55 E(<b>star</b>)0 72 Q 0 Cg EP
1336 %%Page: 107 107
1337 %%BeginPageSetup
1338 BP
1339 %%EndPageSetup
1340 /F0 10/Times-Roman@0 SF(archi)0 12 Q -.15(ve)-.25 G -.55(r.).15 G
1341 (Other implementations may not recognize these k)0 24 Q -.15(ey)-.1 G
1342 2.5(sa).15 G(nd will thus be unable)-2.5 E(to correctly restore de)0 36
1343 Q(vice nodes with lar)-.25 E(ge de)-.18 E(vice numbers from archi)-.25 E
1344 -.15(ve)-.25 G(s).15 E(created by this library)0 48 Q(.)-.65 E(</body>)0
1345 60 Q(</html>)0 72 Q 0 Cg EP
1346 %%Trailer
1347 end
1348 %%EOF