%!PS-Adobe-3.0 %%Creator: groff version 1.19.2 %%CreationDate: Wed Jun 30 11:55:52 2010 %%DocumentNeededResources: font Times-Roman %%DocumentSuppliedResources: procset grops 1.19 2 %%Pages: 107 %%PageOrder: Ascend %%DocumentMedia: Default 612 792 0 () () %%Orientation: Portrait %%EndComments %%BeginDefaults %%PageMedia: Default %%EndDefaults %%BeginProlog %%BeginResource: procset grops 1.19 2 %!PS-Adobe-3.0 Resource-ProcSet /setpacking where{ pop currentpacking true setpacking }if /grops 120 dict dup begin /SC 32 def /A/show load def /B{0 SC 3 -1 roll widthshow}bind def /C{0 exch ashow}bind def /D{0 exch 0 SC 5 2 roll awidthshow}bind def /E{0 rmoveto show}bind def /F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def /G{0 rmoveto 0 exch ashow}bind def /H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def /I{0 exch rmoveto show}bind def /J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def /K{0 exch rmoveto 0 exch ashow}bind def /L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def /M{rmoveto show}bind def /N{rmoveto 0 SC 3 -1 roll widthshow}bind def /O{rmoveto 0 exch ashow}bind def /P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def /Q{moveto show}bind def /R{moveto 0 SC 3 -1 roll widthshow}bind def /S{moveto 0 exch ashow}bind def /T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def /SF{ findfont exch [exch dup 0 exch 0 exch neg 0 0]makefont dup setfont [exch/setfont cvx]cvx bind def }bind def /MF{ findfont [5 2 roll 0 3 1 roll neg 0 0]makefont dup setfont [exch/setfont cvx]cvx bind def }bind def /level0 0 def /RES 0 def /PL 0 def /LS 0 def /MANUAL{ statusdict begin/manualfeed true store end }bind def /PLG{ gsave newpath clippath pathbbox grestore exch pop add exch pop }bind def /BP{ /level0 save def 1 setlinecap 1 setlinejoin 72 RES div dup scale LS{ 90 rotate }{ 0 PL translate }ifelse 1 -1 scale }bind def /EP{ level0 restore showpage }def /DA{ newpath arcn stroke }bind def /SN{ transform .25 sub exch .25 sub exch round .25 add exch round .25 add exch itransform }bind def /DL{ SN moveto SN lineto stroke }bind def /DC{ newpath 0 360 arc closepath }bind def /TM matrix def /DE{ TM currentmatrix pop translate scale newpath 0 0 .5 0 360 arc closepath TM setmatrix }bind def /RC/rcurveto load def /RL/rlineto load def /ST/stroke load def /MT/moveto load def /CL/closepath load def /Fr{ setrgbcolor fill }bind def /setcmykcolor where{ pop /Fk{ setcmykcolor fill }bind def }if /Fg{ setgray fill }bind def /FL/fill load def /LW/setlinewidth load def /Cr/setrgbcolor load def /setcmykcolor where{ pop /Ck/setcmykcolor load def }if /Cg/setgray load def /RE{ findfont dup maxlength 1 index/FontName known not{1 add}if dict begin { 1 index/FID ne{def}{pop pop}ifelse }forall /Encoding exch def dup/FontName exch def currentdict end definefont pop }bind def /DEFS 0 def /EBEGIN{ moveto DEFS begin }bind def /EEND/end load def /CNT 0 def /level1 0 def /PBEGIN{ /level1 save def translate div 3 1 roll div exch scale neg exch neg exch translate 0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit []0 setdash /setstrokeadjust where{ pop false setstrokeadjust }if /setoverprint where{ pop false setoverprint }if newpath /CNT countdictstack def userdict begin /showpage{}def /setpagedevice{}def }bind def /PEND{ countdictstack CNT sub{end}repeat level1 restore }bind def end def /setpacking where{ pop setpacking }if %%EndResource %%EndProlog %%BeginSetup %%BeginFeature: *PageSize Default << /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice %%EndFeature %%IncludeResource: font Times-Roman grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron /scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent /ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen /period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon /semicolon/less/equal/greater/question/at/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/Z/bracketleft/backslash/bracketright/circumflex /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 /z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft /guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl /endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut /dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash /quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen /brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft /logicalnot/minus/registered/macron/degree/plusminus/twosuperior /threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior /ordmasculine/guilsinglright/onequarter/onehalf/threequarters /questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE /Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex /Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis /multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn /germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla /egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis /eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash /ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def /Times-Roman@0 ENC0/Times-Roman RE %%EndSetup %%Page: 1 1 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF()0 12 Q(
)0 24 Q(
struct
archi)0
72 Q -.15(ve)-.25 G(
*
).15 E 0 Cg EP
%%Page: 10 10
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(archi)0 12 Q -.15(ve)-.25 G(_write_ne).15 E
(w\(
v)-.25 E(oid
\))-.2 E
(
int
)0 24 Q(archi)0 36 Q -.15(ve)
-.25 G(_write_get_bytes_per_block\(
struct archi)
.15 E .3 -.15(ve *)-.25 H(
\)).15 E
(
int
)0 48 Q(archi)0 60 Q -.15(ve)
-.25 G(_write_set_bytes_per_block\(
struct archi)
.15 E .3 -.15(ve *)-.25 H(
, int bytes_per_block
\))
.15 E(
int
)0 72 Q 0 Cg EP
%%Page: 11 11
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(archi)0 12 Q -.15(ve)-.25 G
(_write_set_bytes_in_last_block\(
struct archi).15
E .3 -.15(ve *)-.25 H(
, int
\)).15 E
(
int
)0 24 Q(archi)0 36 Q -.15(ve)
-.25 G
(_write_set_compression_bzip2\(
struct archi).15 E
.3 -.15(ve *)-.25 H(
\)).15 E
(
int
)0 48 Q(archi)0 60 Q -.15(ve)
-.25 G
(_write_set_compression_compress\(
struct archi)
.15 E .3 -.15(ve *)-.25 H(
\)).15 E
(
int
)0 72 Q 0 Cg EP
%%Page: 12 12
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(archi)0 12 Q -.15(ve)-.25 G
(_write_set_compression_gzip\(
struct archi).15 E
.3 -.15(ve *)-.25 H(
\)).15 E
(
int
)0 24 Q(archi)0 36 Q -.15(ve)
-.25 G(_write_set_compression_none\(
struct archi)
.15 E .3 -.15(ve *)-.25 H(
\)).15 E
(
int
)0 48 Q(archi)0 60 Q -.15(ve)
-.25 G
(_write_set_compression_program\(
struct archi).15
E .3 -.15(ve *)-.25 H(
, const char * cmd
\)).15 E
(
int
)0 72 Q 0 Cg EP
%%Page: 13 13
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(archi)0 12 Q -.15(ve)-.25 G
(_write_set_format_cpio\(
struct archi).15 E .3
-.15(ve *)-.25 H(
\)).15 E(
int
)0
24 Q(archi)0 36 Q -.15(ve)-.25 G
(_write_set_format_pax\(
struct archi).15 E .3
-.15(ve *)-.25 H(
\)).15 E(
int
)0
48 Q(archi)0 60 Q -.15(ve)-.25 G
(_write_set_format_pax_restricted\(
struct archi)
.15 E .3 -.15(ve *)-.25 H(
\)).15 E
(
int
)0 72 Q 0 Cg EP
%%Page: 14 14
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(archi)0 12 Q -.15(ve)-.25 G
(_write_set_format_shar\(
struct archi).15 E .3
-.15(ve *)-.25 H(
\)).15 E(
int
)0
24 Q(archi)0 36 Q -.15(ve)-.25 G
(_write_set_format_shar_binary\(
struct archi).15
E .3 -.15(ve *)-.25 H(
\)).15 E
(
int
)0 48 Q(archi)0 60 Q -.15(ve)
-.25 G(_write_set_format_ustar\(
struct archi).15
E .3 -.15(ve *)-.25 H(
\)).15 E
(
int
)0 72 Q 0 Cg EP
%%Page: 15 15
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(archi)0 12 Q -.15(ve)-.25 G
(_write_set_format_options\(
struct archi).15 E .3
-.15(ve *)-.25 H(
, const char *
\)).15 E
(
int
)0 24 Q(archi)0 36 Q -.15(ve)
-.25 G
(_write_set_compressor_options\(
struct archi).15
E .3 -.15(ve *)-.25 H(
, const char *
\)).15 E
(
int
)0 48 Q(archi)0 60 Q -.15(ve)
-.25 G(_write_set_options\(
struct archi).15 E .3
-.15(ve *)-.25 H(
, const char *
\)).15 E
(
int
)0 72 Q 0 Cg EP
%%Page: 16 16
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(archi)0 12 Q -.15(ve)-.25 G
(_write_open\(
).15 E(
struct archi)0
24 Q .3 -.15(ve *)-.25 H(
).15 E(
v)0 36 Q
(oid *client_data
)-.2 E(
archi)0 48 Q -.15(ve)
-.25 G(_open_callback *
).15 E(
archi)0 60 Q
-.15(ve)-.25 G(_write_callback *
).15 E(
archi)0
72 Q -.15(ve)-.25 G(_close_callback *
).15 E 0 Cg EP
%%Page: 17 17
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(\))0 12 Q(
int
)
0 24 Q(archi)0 36 Q -.15(ve)-.25 G
(_write_open_fd\(
struct archi).15 E .3 -.15(ve *)
-.25 H(
, int fd
\)).15 E
(
int
)0 48 Q(archi)0 60 Q -.15(ve)
-.25 G(_write_open_FILE\(
struct archi).15 E .3
-.15(ve *)-.25 H(
, FILE *\214le
\)).15 E
(
int
)0 72 Q 0 Cg EP
%%Page: 18 18
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(archi)0 12 Q -.15(ve)-.25 G
(_write_open_\214lename\(
struct archi).15 E .3
-.15(ve *)-.25 H(
, const char *\214lename
\)).15 E
(
int
)0 24 Q(archi)0 36 Q -.15(ve)
-.25 G(_write_open_memory\(
).15 E
(
struct archi)0 48 Q .3 -.15(ve *)-.25 H(
).15
E(
v)0 60 Q(oid *b)-.2 E(uf)-.2 E(fer
)-.25 E
(
size_t b)0 72 Q(uf)-.2 E(ferSize
)-.25 E 0 Cg
EP
%%Page: 19 19
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(
size_t *outUsed
)0 12 Q
(\))0 24 Q(
int
)0 36 Q(archi)0 48 Q
-.15(ve)-.25 G(_write_header\(
struct archi).15 E
.3 -.15(ve *)-.25 H(
, struct archi).15 E -.15(ve)-.25 G
(_entry *
\)).15 E(
ssize_t
)0 60
Q(archi)0 72 Q -.15(ve)-.25 G
(_write_data\(
struct archi).15 E .3 -.15(ve *)
-.25 H(
, const v).15 E(oid *
, size_t
\))
-.2 E 0 Cg EP
%%Page: 20 20
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(
int
)0 12 Q
(archi)0 24 Q -.15(ve)-.25 G
(_write_\214nish_entry\(
struct archi).15 E .3
-.15(ve *)-.25 H(
\)).15 E(
int
)0
36 Q(archi)0 48 Q -.15(ve)-.25 G
(_write_close\(
struct archi).15 E .3 -.15(ve *)
-.25 H(
\)).15 E(
int
)0 60 Q
(archi)0 72 Q -.15(ve)-.25 G
(_write_\214nish\(
struct archi).15 E .3 -.15
(ve *)-.25 H(
\)).15 E 0 Cg EP
%%Page: 21 21
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(
\)
\)
\)
\)
\)).15 E 0 Cg EP
%%Page: 28 28
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(will set this based on the \214le type\).)0 12 Q
(Unlik)0 24 Q 2.5(et)-.1 G(he other)-2.5 E -.74(``)0 36 S(set').74 E(')
-.74 E(functions, this function can be called after the archi)0 48 Q .3
-.15(ve i)-.25 H 2.5(so).15 G(pened.)-2.5 E(
\)
\),).15 E(archi)0
48 Q -.15(ve)-.25 G(_write_set_format_pax\(
\),).15 E
(archi)0 60 Q -.15(ve)-.25 G
(_write_set_format_pax_restricted\(
\),).15 E(archi)0
72 Q -.15(ve)-.25 G(_write_set_format_shar\(
\),).15 E 0
Cg EP
%%Page: 30 30
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(archi)0 12 Q -.15(ve)-.25 G
(_write_set_format_shar_binary\(
\),).15 E(archi)0 24
Q -.15(ve)-.25 G(_write_set_format_ustar\(
\)).15 E
(Sets the format that will be used for the archi)0 36 Q -.15(ve)-.25 G
(.).15 E(The library can write)0 48 Q
(POSIX octet-oriented cpio format archi)0 60 Q -.15(ve)-.25 G(s,).15 E
(POSIX-standard)0 72 Q 0 Cg EP
%%Page: 31 31
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.74(``)0 12 S(pax interchange').74 E(')-.74 E
(format archi)0 24 Q -.15(ve)-.25 G(s,).15 E(traditional)0 36 Q -.74(``)
0 48 S(shar').74 E(')-.74 E(archi)0 60 Q -.15(ve)-.25 G(s,).15 E
(enhanced)0 72 Q 0 Cg EP
%%Page: 32 32
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.74(``)0 12 S(binary').74 E(')-.74 E
(shar archi)0 24 Q -.15(ve)-.25 G 2.5(st).15 G(hat store a v)-2.5 E
(ariety of \214le attrib)-.25 E(utes and handle binary \214les,)-.2 E
(and)0 36 Q(POSIX-standard)0 48 Q -.74(``)0 60 S(ustar').74 E(')-.74 E
(archi)0 72 Q -.15(ve)-.25 G(s.).15 E 0 Cg EP
%%Page: 33 33
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(The pax interchange format is a backw)0 12 Q
(ards-compatible tar format that)-.1 E(adds k)0 24 Q -.15(ey)-.1 G(/v)
.15 E(alue attrib)-.25 E(utes to each entry and supports arbitrary)-.2 E
(\214lenames, linknames, uids, sizes, etc.)0 36 Q -.74(``)0 48 S
(Restricted pax interchange format').74 E(')-.74 E(is the library def)0
60 Q(ault; this is the same as pax format, b)-.1 E(ut suppresses)-.2 E
(the pax e)0 72 Q(xtended header for most normal \214les.)-.15 E 0 Cg EP
%%Page: 34 34
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF
(In most cases, this will result in ordinary ustar archi)0 12 Q -.15(ve)
-.25 G(s.).15 E(
\),).15 E(archi)0 48
Q -.15(ve)-.25 G(_write_set_compression_compress\(
\),)
.15 E(archi)0 60 Q -.15(ve)-.25 G
(_write_set_compression_gzip\(
\),).15 E(archi)0 72 Q
-.15(ve)-.25 G(_write_set_compression_none\(
\)).15 E 0
Cg EP
%%Page: 35 35
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(The resulting archi)0 12 Q .3 -.15(ve w)-.25 H
(ill be compressed as speci\214ed.).15 E
(Note that the compressed output is al)0 24 Q -.1(wa)-.1 G
(ys properly block).1 E(ed.)-.1 E(
\)
\),).15 E
(archi)0 36 Q -.15(ve)-.25 G
(_write_set_format_options\(
\),).15 E(archi)0 48 Q
-.15(ve)-.25 G(_write_set_options\(
\)).15 E
(Speci\214es options that will be passed to the currently-enabled)0 60 Q
(compressor and/or format writer)0 72 Q(.)-.55 E 0 Cg EP
%%Page: 37 37
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(The ar)0 12 Q
(gument is a comma-separated list of indi)-.18 E(vidual options.)-.25 E
(Indi)0 24 Q(vidual options ha)-.25 E .3 -.15(ve o)-.2 H
(ne of the follo).15 E(wing forms:)-.25 E()36 72 Q 0 Cg EP %%Page: 41 41 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(The currently supported options are:)0 12 Q (
\)
\)
\)).15 E
(that accepts a \214le descriptor)0 48 Q(.)-.55 E(The)0 60 Q(archi)0
72 Q -.15(ve)-.25 G(_write_open_fd\(
\)).15 E 0 Cg EP
%%Page: 48 48
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(function is safe for use with tape dri)0 12 Q
-.15(ve)-.25 G 2.5(so).15 G 2.5(ro)-2.5 G(ther)-2.5 E(block-oriented de)
0 24 Q(vices.)-.25 E(
\)
\)).15 E(that accepts a)0 72 Q 0 Cg EP
%%Page: 49 49
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(
FILE *
)0 12 Q
(pointer)0 24 Q(.)-.55 E(Note that)0 36 Q(archi)0 48 Q -.15(ve)-.25 G
(_write_open_FILE\(
\)).15 E
(is not safe for writing to tape dri)0 60 Q -.15(ve)-.25 G 2.5(so).15 G
2.5(ro)-2.5 G(ther de)-2.5 E(vices)-.25 E
(that require correct blocking.)0 72 Q 0 Cg EP
%%Page: 50 50
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(
\)
\).).15 E(
\)
\)).15 E 0 Cg EP
%%Page: 51 51
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(that accepts a \214lename.)0 12 Q 2.5(AN)0 24 S
(ULL ar)-2.5 E
(gument indicates that the output should be written to standard output;)
-.18 E(an ar)0 36 Q(gument of)-.18 E -.74(``)0 48 S(-').74 E(')-.74 E
(will open a \214le with that name.)0 60 Q(If you ha)0 72 Q .3 -.15
(ve n)-.2 H(ot in).15 E -.2(vo)-.4 G -.1(ke).2 G(d).1 E 0 Cg EP
%%Page: 52 52
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(archi)0 12 Q -.15(ve)-.25 G
(_write_set_bytes_in_last_block\(
\),).15 E(then)0 24 Q
(archi)0 36 Q -.15(ve)-.25 G
(_write_open_\214lename\(
\)).15 E
(will adjust the last-block padding depending on the \214le:)0 48 Q
(it will enable padding when writing to standard output or)0 60 Q
(to a character or block de)0 72 Q
(vice node, it will disable padding otherwise.)-.25 E 0 Cg EP
%%Page: 53 53
%%BeginPageSetup
BP
%%EndPageSetup
/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)
-.15 G(rride this by manually in).15 E -.2(vo)-.4 G(king).2 E(archi)0
24 Q -.15(ve)-.25 G(_write_set_bytes_in_last_block\(
\))
.15 E(before calling)0 36 Q(archi)0 48 Q -.15(ve)-.25 G
(_write_open\(
\).).15 E(The)0 60 Q(archi)0 72 Q -.15
(ve)-.25 G(_write_open_\214lename\(
\)).15 E 0 Cg EP
%%Page: 54 54
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(function is safe for use with tape dri)0 12 Q
-.15(ve)-.25 G 2.5(so).15 G 2.5(ro)-2.5 G(ther)-2.5 E(block-oriented de)
0 24 Q(vices.)-.25 E(
\)
\)).15 E
(that accepts a pointer to a block of memory that will recei)0 72 Q -.15
(ve)-.25 G 0 Cg EP
%%Page: 55 55
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(the archi)0 12 Q -.15(ve)-.25 G(.).15 E
(The \214nal)0 24 Q(
size_t *
)0 36 Q
(ar)0 48 Q(gument points to a v)-.18 E(ariable that will be updated)-.25
E(after each write to re\215ect ho)0 60 Q 2.5(wm)-.25 G(uch of the b)
-2.5 E(uf)-.2 E(fer)-.25 E(is currently in use.)0 72 Q 0 Cg EP
%%Page: 56 56
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -1.1(Yo)0 12 S 2.5(us)1.1 G
(hould be careful to ensure that this v)-2.5 E(ariable)-.25 E
(remains allocated until after the archi)0 24 Q .3 -.15(ve i)-.25 H(s)
.15 E(closed.)0 36 Q(
\)
\)
\)
\))-.15 E(and)0 48 Q
(archi)0 60 Q -.15(ve)-.25 G(_write_close\(
\)).15 E
(as needed.)0 72 Q 0 Cg EP
%%Page: 60 60
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(
\)
\)
\)).15 E(if it w)0 72 Q(as not in)-.1 E
-.2(vo)-.4 G -.1(ke).2 G 2.5(dm).1 G(anually)-2.5 E 2.5(,t)-.65 G
(hen releases all resources.)-2.5 E 0 Cg EP
%%Page: 61 61
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(Note that this function w)0 12 Q
(as declared to return)-.1 E(
v)0 24 Q
(oid
)-.2 E(in libarchi)0 36 Q .3 -.15(ve 1)-.25 H
(.x, which made it impossible to detect errors when).15 E(archi)0 48
Q -.15(ve)-.25 G(_write_close\(
\)).15 E -.1(wa)0 60 S
2.5(si).1 G -1.9 -.4(nv o)-2.5 H -.1(ke).4 G 2.5(di).1 G
(mplicitly from this function.)-2.5 E(This is corrected be)0 72 Q
(ginning with libarchi)-.15 E .3 -.15(ve 2)-.25 H(.0.).15 E 0 Cg EP
%%Page: 62 62
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(
\):).15 E(
typedef
int
)0 48 Q
(archi)0 60 Q -.15(ve)-.25 G
(_open_callback\(
struct archi).15 E .3 -.15(ve *)
-.25 H(
, v).15 E(oid *client_data
\))-.2 E()36 12 Q(The open callback is in)0 24 Q -.2
(vo)-.4 G -.1(ke).2 G 2.5(db).1 G(y)-2.5 E(archi)0 36 Q -.15(ve)-.25
G(_write_open\(\).).15 E(It should return)0 48 Q
(ARCHIVE_OK)0 60 Q
(if the underlying \214le or data source is successfully)0 72 Q 0 Cg EP
%%Page: 67 67
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(opened.)0 12 Q(If the open f)0 24 Q
(ails, it should call)-.1 E(archi)0 36 Q -.15(ve)-.25 G
(_set_error\(
\)).15 E(to re)0 48 Q
(gister an error code and message and return)-.15 E(ARCHIVE_F)
0 60 Q -1.21 -1.11(AT A)-.74 H(L.)1.11 E(
typedef
ssize_t
)0 24 Q
(archi)0 36 Q -.15(ve)-.25 G(_write_callback\(
).15 E
(
struct archi)0 48 Q .3 -.15(ve *)-.25 H(
).15
E(
v)0 60 Q(oid *client_data
)-.2 E
(
const v)0 72 Q(oid *b)-.2 E(uf)-.2 E(fer
)-.25
E 0 Cg EP
%%Page: 69 69
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(
size_t length
)0 12 Q
(\))0 24 Q()36 48 Q(The write callback is in)0 60 Q -.2
(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(hene)-2.5 E -.15(ve)-.25 G 2.5(rt).15
G(he library)-2.5 E(needs to write ra)0 72 Q 2.5(wb)-.15 G
(ytes to the archi)-2.5 E -.15(ve)-.25 G(.).15 E 0 Cg EP
%%Page: 70 70
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.15(Fo)0 12 S 2.5(rc).15 G
(orrect blocking, each call to the write callback function)-2.5 E
(should translate into a single)0 24 Q
(write\(2\))0 36 Q(system call.)0 48 Q
(This is especially critical when writing archi)0 60 Q -.15(ve)-.25 G
2.5(st).15 G 2.5(ot)-2.5 G(ape dri)-2.5 E -.15(ve)-.25 G(s.).15 E
(On success, the write callback should return the)0 72 Q 0 Cg EP
%%Page: 71 71
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(number of bytes actually written.)0 12 Q
(On error)0 24 Q 2.5(,t)-.4 G(he callback should in)-2.5 E -.2(vo)-.4 G
-.1(ke).2 G(archi)0 36 Q -.15(ve)-.25 G
(_set_error\(\)).15 E(to re)0 48 Q
(gister an error code and message and return -1.)-.15 E(
typedef
int
)0 12 Q
(archi)0 24 Q -.15(ve)-.25 G
(_close_callback\(
struct archi).15 E .3 -.15
(ve *)-.25 H(
, v).15 E(oid *client_data
\))-.2 E
()36 48 Q(The close callback is in)0 60 Q -.2(vo)-.4 G
-.1(ke).2 G 2.5(db).1 G 2.5(ya)-2.5 G(rchi)-2.5 E -.15(ve)-.25 G
(_close when).15 E(the archi)0 72 Q .3 -.15(ve p)-.25 H
(rocessing is complete.).15 E 0 Cg EP
%%Page: 73 73
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(The callback should return)0 12 Q
(ARCHIVE_OK)0 24 Q(on success.)0 36 Q(On f)0 48 Q
(ailure, the callback should in)-.1 E -.2(vo)-.4 G -.1(ke).2 G(archi)
0 60 Q -.15(ve)-.25 G(_set_error\(\)).15 E(to re)0 72 Q
(gister an error code and message and)-.15 E 0 Cg EP
%%Page: 74 74
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(return)0 12 Q(ARCHIVE_F)0 24 Q -1.21
-1.11(AT A)-.74 H(L.)1.11 E(
)0 36 Q()0 48 Q(#ifdef __linux__)0 60 Q 4.06
(#de\214ne _FILE_OFFSET_BITS)0 72 R(64)2.5 E 0 Cg EP
%%Page: 77 77
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(#endif)0 12 Q(#include )0 24 Q
(#include ).15 E(#include )-.65 E(#include )0 60 Q
(#include )-.4 E 0 Cg EP
%%Page: 78 78
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(#include )0 12 Q()36 24 Q
(struct mydata {)0 36 Q(const char *name;)36 48 Q(int fd;)36 60 Q(};)0
72 Q 0 Cg EP
%%Page: 79 79
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(
)36 12 Q(int)0 24 Q(myopen\(struct archi)0 36
Q .3 -.15(ve *)-.25 H(a, v).15 E(oid *client_data\))-.2 E({)0 48 Q
(struct mydata *mydata = client_data;)5 60 Q(
)36 72 Q 0 Cg EP
%%Page: 80 80
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(mydata->fd = open\(mydata->name, O_WR)5 12 Q
(ONL)-.4 E 2.5(Y|O)-1 G(_CREA)-2.5 E 1.48 -.74(T, 0)-1.11 H(644\);).74 E
(if \(mydata->fd >= 0\))5 24 Q(return \(ARCHIVE_OK\);)10 36 Q(else)5 48
Q(return \(ARCHIVE_F)10 60 Q -1.21 -1.11(AT A)-.74 H(L\);)1.11 E(})0 72
Q 0 Cg EP
%%Page: 81 81
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(
)36 12 Q(ssize_t)0 24 Q
(mywrite\(struct archi)0 36 Q .3 -.15(ve *)-.25 H(a, v).15 E
(oid *client_data, const v)-.2 E(oid *b)-.2 E(uf)-.2 E(f, size_t n\))
-.25 E({)0 48 Q(struct mydata *mydata = client_data;)5 60 Q(
)36 72 Q
0 Cg EP
%%Page: 82 82
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(return \(write\(mydata->fd, b)5 12 Q(uf)-.2 E
(f, n\)\);)-.25 E(})0 24 Q(
)36 36 Q(int)0 48 Q(myclose\(struct archi)
0 60 Q .3 -.15(ve *)-.25 H(a, v).15 E(oid *client_data\))-.2 E({)0 72 Q
0 Cg EP
%%Page: 83 83
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(struct mydata *mydata = client_data;)5 12 Q(
)
36 24 Q(if \(mydata->fd > 0\))5 36 Q(close\(mydata->fd\);)10 48 Q
(return \(0\);)5 60 Q(})0 72 Q 0 Cg EP
%%Page: 84 84
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(
)36 12 Q -.2(vo)0 24 S(id).2 E(write_archi)0
36 Q -.15(ve)-.25 G(\(const char *outname, const char **\214lename\)).15
E({)0 48 Q(struct mydata *mydata = malloc\(sizeof\(struct mydata\)\);)5
60 Q(struct archi)5 72 Q .3 -.15(ve *)-.25 H(a;).15 E 0 Cg EP
%%Page: 85 85
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(struct archi)5 12 Q -.15(ve)-.25 G
(_entry *entry;).15 E(struct stat st;)5 24 Q(char b)5 36 Q(uf)-.2 E
(f[8192];)-.25 E(int len;)5 48 Q(int fd;)5 60 Q(
)36 72 Q 0 Cg EP
%%Page: 86 86
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF 2.5(a=a)5 12 S(rchi)-2.5 E -.15(ve)-.25 G
(_write_ne).15 E(w\(\);)-.25 E(mydata->name = outname;)5 24 Q(archi)5 36
Q -.15(ve)-.25 G(_write_set_compression_gzip\(a\);).15 E(archi)5 48 Q
-.15(ve)-.25 G(_write_set_format_ustar\(a\);).15 E(archi)5 60 Q -.15(ve)
-.25 G(_write_open\(a, mydata, myopen, mywrite, myclose\);).15 E
(while \(*\214lename\) {)5 72 Q 0 Cg EP
%%Page: 87 87
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(stat\(*\214lename, &st\);)10 12 Q(entry = archi)
10 24 Q -.15(ve)-.25 G(_entry_ne).15 E(w\(\);)-.25 E(archi)10 36 Q -.15
(ve)-.25 G(_entry_cop).15 E(y_stat\(entry)-.1 E 2.5(,&)-.65 G(st\);)-2.5
E(archi)10 48 Q -.15(ve)-.25 G(_entry_set_pathname\(entry).15 E 2.5(,*)
-.65 G(\214lename\);)-2.5 E(archi)10 60 Q -.15(ve)-.25 G
(_write_header\(a, entry\);).15 E(fd = open\(*\214lename, O_RDONL)10 72
Q(Y\);)-1 E 0 Cg EP
%%Page: 88 88
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(len = read\(fd, b)10 12 Q(uf)-.2 E(f, sizeof\(b)
-.25 E(uf)-.2 E(f\)\);)-.25 E(while \( len > 0 \) {)10 24 Q(archi)36 36
Q -.15(ve)-.25 G(_write_data\(a, b).15 E(uf)-.2 E(f, len\);)-.25 E
(len = read\(fd, b)36 48 Q(uf)-.2 E(f, sizeof\(b)-.25 E(uf)-.2 E(f\)\);)
-.25 E(})10 60 Q(archi)10 72 Q -.15(ve)-.25 G(_entry_free\(entry\);).15
E 0 Cg EP
%%Page: 89 89
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(\214lename++;)10 12 Q(})5 24 Q(archi)5 36 Q -.15
(ve)-.25 G(_write_\214nish\(a\);).15 E(})0 48 Q(
)36 60 Q
(int main\(int ar)0 72 Q(gc, const char **ar)-.18 E(gv\))-.18 E 0 Cg EP
%%Page: 90 90
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF({)0 12 Q(const char *outname;)36 24 Q(ar)36 36 Q
(gv++;)-.18 E(outname = ar)36 48 Q(gv++;)-.18 E(write_archi)36 60 Q -.15
(ve)-.25 G(\(outname, ar).15 E(gv\);)-.18 E(return 0;)36 72 Q 0 Cg EP
%%Page: 91 91
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(})0 12 Q(
)0 24 Q(
)0 36 Q(
\)).15 E(and)0 36 Q(archi)0 48 Q -.15(ve)
-.25 G(_error_string\(
\)).15 E
(functions can be used to retrie)0 60 Q .3 -.15(ve a)-.25 H 2.5(na).15 G
(ppropriate error code and a)-2.5 E(te)0 72 Q(xtual error message.)-.15
E 0 Cg EP
%%Page: 95 95
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF()36 12 Q(archi)0 24 Q -.15(ve)-.25 G
(_write_ne).15 E(w\(\))-.25 E
(returns a pointer to a ne)0 36 Q(wly-allocated)-.25 E(\
struct archi)0 48 Q -.15
(ve)-.25 G().15 E(object.)0 60 Q(
)36 72 Q 0 Cg EP
%%Page: 96 96
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(archi)0 12 Q -.15(ve)-.25 G
(_write_data\(\)).15 E
(returns a count of the number of bytes actually written.)0 24 Q
(On error)0 36 Q 2.5(,-)-.4 G 2.5(1i)-2.5 G 2.5(sr)-2.5 G
(eturned and the)-2.5 E(archi)0 48 Q -.15(ve)-.25 G
(_errno\(
\)).15 E(and)0 60 Q(archi)0 72 Q -.15(ve)
-.25 G(_error_string\(
\)).15 E 0 Cg EP
%%Page: 97 97
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(functions will return appropriate v)0 12 Q
(alues.)-.25 E(Note that if the client-pro)0 24 Q
(vided write callback function)-.15 E(returns a non-zero v)0 36 Q
(alue, that error will be propag)-.25 E(ated back to the caller)-.05 E
(through whate)0 48 Q -.15(ve)-.25 G 2.5(rA).15 G
(PI function resulted in that call, which)-2.5 E(may include)0 60 Q
(archi)0 72 Q -.15(ve)-.25 G(_write_header\(
\),).15
E 0 Cg EP
%%Page: 98 98
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(archi)0 12 Q -.15(ve)-.25 G
(_write_data\(
\),).15 E(archi)0 24 Q -.15(ve)-.25 G
(_write_close\(
\),).15 E(or)0 36 Q(archi)0 48 Q -.15
(ve)-.25 G(_write_\214nish\(
\).).15 E
(The client callback can call)0 60 Q(archi)0 72 Q -.15(ve)-.25 G
(_set_error\(
\)).15 E 0 Cg EP
%%Page: 99 99
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(to pro)0 12 Q(vide v)-.15 E
(alues that can then be retrie)-.25 E -.15(ve)-.25 G 2.5(db).15 G(y)-2.5
E(archi)0 24 Q -.15(ve)-.25 G(_errno\(
\)).15 E(and)0
36 Q(archi)0 48 Q -.15(ve)-.25 G(_error_string\(
\).)
.15 E(
)36 36 Q(The)0 48 Q(libarchi)0 60 Q -.15(ve)-.25 G().15 E(library w)0 72 Q(as written by)-.1 E 0 Cg EP %%Page: 103 103 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF -.35(Ti)0 12 S 2.5(mK).35 G (ientzle <kientzle@acm.or)-2.5 E(g>.)-.18 E(
)36 60 Q(The def)0 72 Q (ault pax interchange format eliminates most of the historic)-.1 E 0 Cg EP %%Page: 105 105 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(tar limitations and pro)0 12 Q (vides a generic k)-.15 E -.15(ey)-.1 G(/v).15 E(alue attrib)-.25 E (ute f)-.2 E(acility)-.1 E(for v)0 24 Q(endor)-.15 E(-de\214ned e)-.2 E (xtensions.)-.15 E(One o)0 36 Q -.15(ve)-.15 G(rsight in POSIX is the f) .15 E(ailure to pro)-.1 E(vide a standard attrib)-.15 E(ute)-.2 E (for lar)0 48 Q(ge de)-.18 E(vice numbers.)-.25 E(This library uses)0 60 Q -.74(``)0 72 S(SCHIL).74 E -1.29(Y.)-1 G(de)1.29 E(vminor')-.25 E(') -.74 E 0 Cg EP %%Page: 106 106 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(and)0 12 Q -.74(``)0 24 S(SCHIL).74 E -1.29(Y.) -1 G(de)1.29 E(vmajor')-.25 E(')-.74 E(for de)0 36 Q (vice numbers that e)-.25 E(xceed the range supported by the backw)-.15 E(ards-compatible)-.1 E(ustar header)0 48 Q(.)-.55 E(These k)0 60 Q -.15 (ey)-.1 G 2.5(sa).15 G(re compatible with Joer)-2.5 E 2.5(gS)-.18 G (chilling')-2.5 E(s)-.55 E(star)0 72 Q 0 Cg EP %%Page: 107 107 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(archi)0 12 Q -.15(ve)-.25 G -.55(r.).15 G (Other implementations may not recognize these k)0 24 Q -.15(ey)-.1 G 2.5(sa).15 G(nd will thus be unable)-2.5 E(to correctly restore de)0 36 Q(vice nodes with lar)-.25 E(ge de)-.18 E(vice numbers from archi)-.25 E -.15(ve)-.25 G(s).15 E(created by this library)0 48 Q(.)-.65 E()0 60 Q()0 72 Q 0 Cg EP %%Trailer end %%EOF