]> granicus.if.org Git - zziplib/blob - docs/manpages.ar
zzip64 support
[zziplib] / docs / manpages.ar
1 !<arch>
2 //                                              602       `
3 zzip_compr_str.3/
4 zzip_createdir.3/
5 zzip_dir_alloc.3/
6 zzip_dir_alloc_ext_io.3/
7 zzip_dir_close.3/
8 zzip_dir_creat.3/
9 zzip_dir_creat_ext_io.3/
10 zzip_dir_fdopen.3/
11 zzip_dir_fdopen_ext_io.3/
12 zzip_dirhandle.3/
13 zzip_dir_open_ext_io.3/
14 zzip_file_close.3/
15 zzip_file_creat.3/
16 zzip_file_mkdir.3/
17 zzip_file_open.3/
18 zzip_file_read.3/
19 zzip_file_real.3/
20 zzip_file_stat.3/
21 zzip_file_write.3/
22 __zzip_find_disk_trailer.3/
23 zzip_get_default_io.3/
24 zzip_inflate_init.3/
25 zzip_opendir_ext_io.3/
26 zzip_open_ext_io.3/
27 zzip_open_shared_io.3/
28 __zzip_parse_root_directory.3/
29 zzip_rewinddir.3/
30 zzip_strerror_of.3/
31 __zzip_try_open.3/
32
33 zzip_close.3/   1071214812  500   0     100664  23        `
34 .so man3/zzip_fclose.3
35
36 zzip_closedir.3/1071214812  500   0     100664  965       `
37 .\"Generated by db2man.xsl. Don't modify this, modify the source.
38 .de Sh \" Subsection
39 .br
40 .if t .Sp
41 .ne 5
42 .PP
43 \fB\\$1\fR
44 .PP
45 ..
46 .de Sp \" Vertical space (when we can't use .PP)
47 .if t .sp .5v
48 .if n .sp
49 ..
50 .de Ip \" List item
51 .br
52 .ie \\n(.$>=3 .ne \\$3
53 .el .ne 3
54 .IP "\\$1" \\$2
55 ..
56 .TH "ZZIP_CLOSEDIR" 3 "0.13.24" "zziplib" "zzip_closedir"
57 .SH NAME
58 zzip_closedir \- (zzip/dir.c)
59 .SH "SYNOPSIS"
60 .ad l
61 .hy 0
62
63
64
65
66 #include <zzip/lib\&.h>
67
68 .sp
69 .HP 20
70 int \ \fBzzip_closedir\fR\ (ZZIP_DIR*\ dir);
71 .ad
72 .hy
73
74 .SH "DESCRIPTION"
75
76 .PP
77  \fBThe zzip_closedir function\fR is the equivalent of \fBclosedir\fR(3) for a realdir or zipfile\&.
78
79 .PP
80  \fBThe zzip_closedir function\fR is magic \- if the given arg\-ZZIP_DIR is a real directory, it will call the real \fBclosedir\fR(3) and then free the wrapping ZZIP_DIR structure\&. Otherwise it will divert to \fBzzip_dir_close\fR which will free the ZZIP_DIR structure\&.
81
82 .SH "AUTHOR"
83
84 .TP 3
85 \(bu
86 Guido Draheim <guidod@gmx\&.de>
87 .LP
88
89
90 /0              1071214812  500   0     100664  692       `
91 .\"Generated by db2man.xsl. Don't modify this, modify the source.
92 .de Sh \" Subsection
93 .br
94 .if t .Sp
95 .ne 5
96 .PP
97 \fB\\$1\fR
98 .PP
99 ..
100 .de Sp \" Vertical space (when we can't use .PP)
101 .if t .sp .5v
102 .if n .sp
103 ..
104 .de Ip \" List item
105 .br
106 .ie \\n(.$>=3 .ne \\$3
107 .el .ne 3
108 .IP "\\$1" \\$2
109 ..
110 .TH "ZZIP_COMPR_STR" 3 "0.13.24" "zziplib" "zzip_compr_str"
111 .SH NAME
112 zzip_compr_str \- (zzip/info.c)
113 .SH "SYNOPSIS"
114 .ad l
115 .hy 0
116
117
118
119
120 #include <zzip/lib\&.h>
121
122 .sp
123 .HP 30
124 zzip_char_t* \ \fBzzip_compr_str\fR\ (int\ compr);
125 .ad
126 .hy
127
128 .SH "DESCRIPTION"
129
130 .PP
131 return static const string of the known compression methods, otherwise just "zipped" is returned
132
133 .SH "AUTHOR"
134
135 .TP 3
136 \(bu
137 Guido Draheim <guidod@gmx\&.de>
138 .LP
139
140 zzip_creat.3/   1071214812  500   0     100664  22        `
141 .so man3/zzip_mkdir.3
142 /18             1071214812  500   0     100664  2362      `
143 .\"Generated by db2man.xsl. Don't modify this, modify the source.
144 .de Sh \" Subsection
145 .br
146 .if t .Sp
147 .ne 5
148 .PP
149 \fB\\$1\fR
150 .PP
151 ..
152 .de Sp \" Vertical space (when we can't use .PP)
153 .if t .sp .5v
154 .if n .sp
155 ..
156 .de Ip \" List item
157 .br
158 .ie \\n(.$>=3 .ne \\$3
159 .el .ne 3
160 .IP "\\$1" \\$2
161 ..
162 .TH "ZZIP_CREATEDIR" 3 "0.13.24" "zziplib" "zzip_createdir"
163 .SH NAME
164 zzip_createdir \- create a new archive area for writing
165 .SH "SYNOPSIS"
166 .ad l
167 .hy 0
168
169
170  #include <zziplib\&.h>
171
172 .sp
173 .HP 27
174 ZZIP_DIR* \ \fBzzip_createdir\fR\ (zzip_char_t*\ name, int\ o_mode);
175 .ad
176 .hy
177
178 .SH "DESCRIPTION"
179
180 .PP
181
182
183 .PP
184  \fBThe zzip_createdir function\fR will create a new archive area\&. This may either be a a new zip archive or a new directory in the filesystem\&. The returned parameter is a new "zzip dir" handle that should be saved to a variable so it can be used a base argument for \fBzzip_file_mkdir\fR and \fBzzip_file_creat\fR calls\&. The returned handle wraps both possibilities, it can be representing a zip central directory that must be saved to disk using \fBzzip_closedir\fR or it is just a handle for the name of the real directory that still must be run through \fBzzip_closedir\fR to release the wrapper around the directory name\&.
185
186 .PP
187 The magic is pushed through the o_mode argument\&. Using a mode that has no group\-write bit set (S_IWGRP = 0040) then the file is created as a zip directory\&. Note that this is unabridged of any umask value in the system where the argument to \fBthe zzip_createdir function\fR could be 0775 but with an umask of 0755 it turns out as 0755 for a real directory\&. Using 0755 directly would not create it as a real directory but as a zip archive handle\&.
188
189 .PP
190  \fBThe zzip_createdir function\fR is not yet implemented, check for #def ZZIP_NO_CREAT Write\-support will extend \fBzzip_closedir\fR with semantics to finalize the zip\-archive by writing the zip\-trailer and closing the archive file\&.
191
192 .PP
193 Returns null on error and sets errno\&. Remember, according to posix the \fBcreat\fR(2) call is equivalent to 
194
195 .IP
196 .nf
197   open (path, O_WRONLY | O_CREAT | O_TRUNC, o_mode)
198 .fi
199  so any previous zip\-archive will be overwritten unconditionally and EEXIST errors from \fBmkdir\fR(2) are suppressed\&. (fixme: delete the given subtree? like suggested by O_TRUNC? not done so far!)
200
201 .SH "AUTHOR"
202
203 .TP 3
204 \(bu
205 Guido Draheim <guidod@gmx\&.de>
206 .LP
207
208 /36             1071214812  500   0     100664  33        `
209 .so man3/zzip_dir_alloc_ext_io.3
210
211 /54             1071214812  500   0     100664  1418      `
212 .\"Generated by db2man.xsl. Don't modify this, modify the source.
213 .de Sh \" Subsection
214 .br
215 .if t .Sp
216 .ne 5
217 .PP
218 \fB\\$1\fR
219 .PP
220 ..
221 .de Sp \" Vertical space (when we can't use .PP)
222 .if t .sp .5v
223 .if n .sp
224 ..
225 .de Ip \" List item
226 .br
227 .ie \\n(.$>=3 .ne \\$3
228 .el .ne 3
229 .IP "\\$1" \\$2
230 ..
231 .TH "ZZIP_DIR_ALLOC_EXT" 3 "0.13.24" "zziplib" "zzip_dir_alloc_ext_io"
232 .SH NAME
233 zzip_dir_alloc_ext_io, zzip_dir_alloc \- (zzip/zip.c)
234 .SH "SYNOPSIS"
235 .ad l
236 .hy 0
237
238
239
240
241 #include <zzip/lib\&.h>
242
243 .sp
244 .HP 34
245 ZZIP_DIR* \ \fBzzip_dir_alloc_ext_io\fR\ (zzip_strings_t*\ ext, const\ zzip_plugin_io_t\ io);
246 .HP 27
247 ZZIP_DIR* \ \fBzzip_dir_alloc\fR\ (zzip_strings_t*\ fileext);
248 .ad
249 .hy
250
251 .SH "DESCRIPTION"
252
253 .PP
254 allocate a new ZZIP_DIR handle and do basic initializations before usage by \fBzzip_dir_fdopen\fR  \fBzzip_dir_open\fR  \fBzzip_file_open\fR or through \fBzzip_open\fR (ext==null flags uses { "\&.zip" , "\&.ZIP" } ) (io ==null flags use of posix io defaults)
255
256 .PP
257  \fBthe zzip_dir_alloc function\fR is obsolete \- it was generally used for implementation and exported to let other code build on it\&. It is now advised to use \fBzzip_dir_alloc_ext_io\fR now on explicitly, just set that second argument to zero to achieve the same functionality as the old style\&.
258
259 .SH "AUTHOR"
260
261 .TP 3
262 \(bu
263 Guido Draheim <guidod@gmx\&.de>
264 .TP
265 \(bu
266 Tomi Ollila <too@iki\&.fi>
267 .TP
268 \(bu
269 Guido Draheim <guidod@gmx\&.de>
270 .TP
271 \(bu
272 Tomi Ollila <too@iki\&.fi>
273 .LP
274
275 /79             1071214812  500   0     100664  25        `
276 .so man3/zzip_dir_free.3
277
278 /97             1071214812  500   0     100664  2275      `
279 .\"Generated by db2man.xsl. Don't modify this, modify the source.
280 .de Sh \" Subsection
281 .br
282 .if t .Sp
283 .ne 5
284 .PP
285 \fB\\$1\fR
286 .PP
287 ..
288 .de Sp \" Vertical space (when we can't use .PP)
289 .if t .sp .5v
290 .if n .sp
291 ..
292 .de Ip \" List item
293 .br
294 .ie \\n(.$>=3 .ne \\$3
295 .el .ne 3
296 .IP "\\$1" \\$2
297 ..
298 .TH "ZZIP_DIR_CREAT" 3 "0.13.24" "zziplib" "zzip_dir_creat"
299 .SH NAME
300 zzip_dir_creat, zzip_dir_creat_ext_io \- create a new zip archive for writing
301 .SH "SYNOPSIS"
302 .ad l
303 .hy 0
304
305
306  #include <zziplib\&.h>
307
308 .sp
309 .HP 27
310 ZZIP_DIR* \ \fBzzip_dir_creat\fR\ (zzip_char_t*\ name, int\ o_mode);
311 .HP 34
312 ZZIP_DIR* \ \fBzzip_dir_creat_ext_io\fR\ (zzip_char_t*\ name, int\ o_mode, zzip_strings_t*\ ext, zzip_plugin_io_t\ io);
313 .ad
314 .hy
315
316 .SH "DESCRIPTION"
317
318 .PP
319
320
321 .PP
322  \fBThe zzip_dir_creat function\fR will create a new zip archive\&. The returned parameter is a new "zzip dir" handle that should be saved to a variable so it can be used a base argument for \fBzzip_mkdir\fR and \fBzzip_creat\fR calls\&. The returned handle represents a zip central directory that must be saved to disk using \fBzzip_closedir\fR\&.
323
324 .PP
325 Returns null on error and sets errno\&. Remember, according to posix the \fBcreat\fR(2) call is equivalent to 
326
327 .IP
328 .nf
329   open (path, O_WRONLY | O_CREAT | O_TRUNC, o_mode)
330 .fi
331  so any previous zip\-archive will be overwritten unconditionally and EEXIST errors from \fBmkdir\fR(2) are suppressed\&. (fixme: delete the given subtree? like suggested by O_TRUNC? not done so far!)
332
333 .PP
334
335
336 .PP
337 If the third argument "ext" has another special meaning here, as it is used to ensure that a given zip\-file is created with the first entry of the ext\-list appended as an extension unless the file\-path already ends with a file\-extension registered in the list\&. Therefore {"",0} matches all files and creates them as zip\-archives under the given nonmodified name\&. (Some magic here? If the path ends in the path separator then make a real directory even in the presence of ext\-list?)
338
339 .PP
340  \fBThe zzip_dir_creat_ext_io function\fR is not yet implemented, check for #def ZZIP_NO_CREAT Write\-support will extend \fBzzip_closedir\fR with semantics to finalize the zip\-archive by writing the zip\-trailer and closing the archive file\&.
341
342 .SH "AUTHOR"
343
344 .TP 3
345 \(bu
346 Guido Draheim <guidod@gmx\&.de>
347 .LP
348
349
350 /115            1071214812  500   0     100664  26        `
351 .so man3/zzip_dir_creat.3
352 zzip_dirfd.3/   1071214812  500   0     100664  26        `
353 .so man3/zzip_dirhandle.3
354 /140            1071214812  500   0     100664  1396      `
355 .\"Generated by db2man.xsl. Don't modify this, modify the source.
356 .de Sh \" Subsection
357 .br
358 .if t .Sp
359 .ne 5
360 .PP
361 \fB\\$1\fR
362 .PP
363 ..
364 .de Sp \" Vertical space (when we can't use .PP)
365 .if t .sp .5v
366 .if n .sp
367 ..
368 .de Ip \" List item
369 .br
370 .ie \\n(.$>=3 .ne \\$3
371 .el .ne 3
372 .IP "\\$1" \\$2
373 ..
374 .TH "ZZIP_DIR_FDOPEN" 3 "0.13.24" "zziplib" "zzip_dir_fdopen"
375 .SH NAME
376 zzip_dir_fdopen, zzip_dir_fdopen_ext_io \- (zzip/zip.c)
377 .SH "SYNOPSIS"
378 .ad l
379 .hy 0
380
381
382
383
384 #include <zzip/lib\&.h>
385
386 .sp
387 .HP 31
388 ZZIP_DIR\ *\ \ \fBzzip_dir_fdopen\fR\ (int\ fd, zzip_error_t\ *\ errcode_p);
389 .HP 38
390 ZZIP_DIR\ *\ \ \fBzzip_dir_fdopen_ext_io\fR\ (int\ fd, zzip_error_t\ *\ errcode_p, zzip_strings_t*\ ext, const\ zzip_plugin_io_t\ io);
391 .ad
392 .hy
393
394 .SH "DESCRIPTION"
395
396 .PP
397 used by the \fBzzip_dir_open\fR and zzip_opendir(2) call\&. Opens the zip\-archive as specified with the fd which points to an already openend file\&. \fBThe zzip_dir_fdopen function\fR then search and parse the zip's central directory\&.
398
399 .PP
400 NOTE: refcount is zero, so an _open/_close pair will also delete this _dirhandle
401
402 .PP
403  \fBthe zzip_dir_fdopen_ext_io function\fR uses explicit ext and io instead of the internal defaults, setting these to zero is equivalent to \fBzzip_dir_fdopen\fR 
404
405 .SH "AUTHOR"
406
407 .TP 3
408 \(bu
409 Guido Draheim <guidod@gmx\&.de>
410 .TP
411 \(bu
412 Tomi Ollila <too@iki\&.fi>
413 .TP
414 \(bu
415 Guido Draheim <guidod@gmx\&.de>
416 .TP
417 \(bu
418 Tomi Ollila <too@iki\&.fi>
419 .LP
420
421 /159            1071214812  500   0     100664  27        `
422 .so man3/zzip_dir_fdopen.3
423
424 zzip_dir_free.3/1071214812  500   0     100664  1249      `
425 .\"Generated by db2man.xsl. Don't modify this, modify the source.
426 .de Sh \" Subsection
427 .br
428 .if t .Sp
429 .ne 5
430 .PP
431 \fB\\$1\fR
432 .PP
433 ..
434 .de Sp \" Vertical space (when we can't use .PP)
435 .if t .sp .5v
436 .if n .sp
437 ..
438 .de Ip \" List item
439 .br
440 .ie \\n(.$>=3 .ne \\$3
441 .el .ne 3
442 .IP "\\$1" \\$2
443 ..
444 .TH "ZZIP_DIR_FREE" 3 "0.13.24" "zziplib" "zzip_dir_free"
445 .SH NAME
446 zzip_dir_free, zzip_dir_close \- (zzip/zip.c)
447 .SH "SYNOPSIS"
448 .ad l
449 .hy 0
450
451
452
453
454 #include <zzip/lib\&.h>
455
456 .sp
457 .HP 21
458 int\ \ \fBzzip_dir_free\fR\ (ZZIP_DIR\ *\ dir);
459 .HP 22
460 int\ \ \fBzzip_dir_close\fR\ (ZZIP_DIR\ *\ dir);
461 .ad
462 .hy
463
464 .SH "DESCRIPTION"
465
466 .PP
467 will free the zzip_dir handle unless there are still zzip_files attached (that may use its cache buffer)\&. This is the inverse of \fBzzip_dir_alloc\fR , and both are helper functions used implicitly in other zzipcalls e\&.g\&. \fBzzip_dir_close\fR = zzip_close
468
469 .PP
470 returns zero on sucess returns the refcount when files are attached\&.
471
472 .PP
473 It will also \fBfree\fR(2) the \fBZZIP_DIR\fR\-handle given\&. the counterpart for \fBzzip_dir_open\fR see also \fBzzip_dir_free\fR 
474
475 .SH "AUTHOR"
476
477 .TP 3
478 \(bu
479 Guido Draheim <guidod@gmx\&.de>
480 .TP
481 \(bu
482 Tomi Ollila <too@iki\&.fi>
483 .TP
484 \(bu
485 Guido Draheim <guidod@gmx\&.de>
486 .TP
487 \(bu
488 Tomi Ollila <too@iki\&.fi>
489 .LP
490
491
492 /185            1071214812  500   0     100664  1150      `
493 .\"Generated by db2man.xsl. Don't modify this, modify the source.
494 .de Sh \" Subsection
495 .br
496 .if t .Sp
497 .ne 5
498 .PP
499 \fB\\$1\fR
500 .PP
501 ..
502 .de Sp \" Vertical space (when we can't use .PP)
503 .if t .sp .5v
504 .if n .sp
505 ..
506 .de Ip \" List item
507 .br
508 .ie \\n(.$>=3 .ne \\$3
509 .el .ne 3
510 .IP "\\$1" \\$2
511 ..
512 .TH "ZZIP_DIRHANDLE" 3 "0.13.24" "zziplib" "zzip_dirhandle"
513 .SH NAME
514 zzip_dirhandle, zzip_dirfd \- (zzip/info.c)
515 .SH "SYNOPSIS"
516 .ad l
517 .hy 0
518
519
520
521
522 #include <zzip/lib\&.h>
523
524 .sp
525 .HP 30
526 ZZIP_DIR\ *\ \ \fBzzip_dirhandle\fR\ (ZZIP_FILE\ *\ fp);
527 .HP 18
528 int\ \ \fBzzip_dirfd\fR\ (ZZIP_DIR*\ dir);
529 .ad
530 .hy
531
532 .SH "DESCRIPTION"
533
534 .PP
535  \fBThe zzip_dirhandle function\fR will just return fp\->dir
536
537 .PP
538 If a ZZIP_FILE is contained within a zip\-file that one will be a valid pointer, otherwise a NULL is returned and the ZZIP_FILE wraps a real file\&.
539
540 .PP
541  \fBThe zzip_dirfd function\fR will just return dir\->fd
542
543 .PP
544 If a ZZIP_DIR does point to a zipfile then the file\-descriptor of that zipfile is returned, otherwise a NULL is returned and the ZZIP_DIR wraps a real directory DIR (if you have dirent on your system)\&.
545
546 .SH "AUTHOR"
547
548 .TP 3
549 \(bu
550 Guido Draheim <guidod@gmx\&.de>
551 .LP
552
553 zzip_dir_open.3/1071214812  500   0     100664  1538      `
554 .\"Generated by db2man.xsl. Don't modify this, modify the source.
555 .de Sh \" Subsection
556 .br
557 .if t .Sp
558 .ne 5
559 .PP
560 \fB\\$1\fR
561 .PP
562 ..
563 .de Sp \" Vertical space (when we can't use .PP)
564 .if t .sp .5v
565 .if n .sp
566 ..
567 .de Ip \" List item
568 .br
569 .ie \\n(.$>=3 .ne \\$3
570 .el .ne 3
571 .IP "\\$1" \\$2
572 ..
573 .TH "ZZIP_DIR_OPEN" 3 "0.13.24" "zziplib" "zzip_dir_open"
574 .SH NAME
575 zzip_dir_open, zzip_dir_open_ext_io, zzip_dir_read \- (zzip/zip.c)
576 .SH "SYNOPSIS"
577 .ad l
578 .hy 0
579
580
581
582
583 #include <zzip/lib\&.h>
584
585 .sp
586 .HP 27
587 ZZIP_DIR*\ \ \fBzzip_dir_open\fR\ (zzip_char_t*\ filename, zzip_error_t*\ e);
588 .HP 34
589 ZZIP_DIR*\ \ \fBzzip_dir_open_ext_io\fR\ (zzip_char_t*\ filename, zzip_error_t*\ e, zzip_strings_t*\ ext, zzip_plugin_io_t\ io);
590 .HP 20
591 int \ \fBzzip_dir_read\fR\ (ZZIP_DIR\ *\ dir, ZZIP_DIRENT\ *\ d);
592 .ad
593 .hy
594
595 .SH "DESCRIPTION"
596
597 .PP
598 Opens the zip\-archive (if available)\&. the two ext_io arguments will default to use posix io and a set of default fileext that can atleast add \&.zip ext itself\&.
599
600 .PP
601  \fBthe zzip_dir_open_ext_io function\fR uses explicit ext and io instead of the internal defaults\&. Setting these to zero is equivalent to \fBzzip_dir_open\fR 
602
603 .PP
604 fills the dirent\-argument with the values and increments the read\-pointer of the dir\-argument\&.
605
606 .PP
607 returns 0 if there no entry (anymore)\&.
608
609 .SH "AUTHOR"
610
611 .TP 3
612 \(bu
613 Guido Draheim <guidod@gmx\&.de>
614 .TP
615 \(bu
616 Tomi Ollila <too@iki\&.fi>
617 .TP
618 \(bu
619 Guido Draheim <guidod@gmx\&.de>
620 .TP
621 \(bu
622 Tomi Ollila <too@iki\&.fi>
623 .TP
624 \(bu
625 Guido Draheim <guidod@gmx\&.de>
626 .TP
627 \(bu
628 Tomi Ollila <too@iki\&.fi>
629 .LP
630
631 /203            1071214812  500   0     100664  25        `
632 .so man3/zzip_dir_open.3
633
634 zzip_dir_read.3/1071214812  500   0     100664  25        `
635 .so man3/zzip_dir_open.3
636
637 zzip_dir_real.3/1071214812  500   0     100664  26        `
638 .so man3/zzip_file_real.3
639 zzip_dir_stat.3/1071214812  500   0     100664  1876      `
640 .\"Generated by db2man.xsl. Don't modify this, modify the source.
641 .de Sh \" Subsection
642 .br
643 .if t .Sp
644 .ne 5
645 .PP
646 \fB\\$1\fR
647 .PP
648 ..
649 .de Sp \" Vertical space (when we can't use .PP)
650 .if t .sp .5v
651 .if n .sp
652 ..
653 .de Ip \" List item
654 .br
655 .ie \\n(.$>=3 .ne \\$3
656 .el .ne 3
657 .IP "\\$1" \\$2
658 ..
659 .TH "ZZIP_DIR_STAT" 3 "0.13.24" "zziplib" "zzip_dir_stat"
660 .SH NAME
661 zzip_dir_stat, zzip_file_stat, zzip_fstat \- (zzip/stat.c)
662 .SH "SYNOPSIS"
663 .ad l
664 .hy 0
665
666
667
668
669 #include <zzip/lib\&.h>
670
671 .sp
672 .HP 21
673 int\ \ \fBzzip_dir_stat\fR\ (ZZIP_DIR\ *\ dir, zzip_char_t*\ name, ZZIP_STAT\ *\ zs, int\ flags);
674 .HP 22
675 int\ \ \fBzzip_file_stat\fR\ (ZZIP_FILE*\ file, ZZIP_STAT*\ zs);
676 .HP 18
677 int\ \ \fBzzip_fstat\fR\ (ZZIP_FILE*\ file, ZZIP_STAT*\ zs);
678 .ad
679 .hy
680
681 .SH "DESCRIPTION"
682
683 .PP
684 obtain information about a filename in an opened zip\-archive without opening that file first\&. Mostly used to obtain the uncompressed size of a file inside a zip\-archive\&. see \fBzzip_dir_open\fR\&.
685
686 .PP
687  \fBThe zzip_file_stat function\fR will obtain information about a opened file _within_ a zip\-archive\&. The file is supposed to be open (otherwise \-1 is returned)\&. The st_size stat\-member contains the uncompressed size\&. The optional d_name is never set here\&.
688
689 .PP
690  \fBThe zzip_fstat function\fR will obtain information about a opened file which may be either real/zipped\&. The file is supposed to be open (otherwise \-1 is returned)\&. The st_size stat\-member contains the uncompressed size\&. The optional d_name is never set here\&. For a real file, we do set the d_csize := st_size and d_compr := 0 for meaningful defaults\&.
691
692 .SH "AUTHOR"
693
694 .TP 3
695 \(bu
696 Guido Draheim <guidod@gmx\&.de>
697 .TP
698 \(bu
699 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
700 .TP
701 \(bu
702 Guido Draheim <guidod@gmx\&.de>
703 .TP
704 \(bu
705 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
706 .TP
707 \(bu
708 Guido Draheim <guidod@gmx\&.de>
709 .TP
710 \(bu
711 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
712 .LP
713
714 zzip_errno.3/   1071214812  500   0     100664  895       `
715 .\"Generated by db2man.xsl. Don't modify this, modify the source.
716 .de Sh \" Subsection
717 .br
718 .if t .Sp
719 .ne 5
720 .PP
721 \fB\\$1\fR
722 .PP
723 ..
724 .de Sp \" Vertical space (when we can't use .PP)
725 .if t .sp .5v
726 .if n .sp
727 ..
728 .de Ip \" List item
729 .br
730 .ie \\n(.$>=3 .ne \\$3
731 .el .ne 3
732 .IP "\\$1" \\$2
733 ..
734 .TH "ZZIP_ERRNO" 3 "0.13.24" "zziplib" "zzip_errno"
735 .SH NAME
736 zzip_errno \- (zzip/err.c)
737 .SH "SYNOPSIS"
738 .ad l
739 .hy 0
740
741
742
743
744 #include <zzip/lib\&.h>
745
746 .sp
747 .HP 17
748 int \ \fBzzip_errno\fR\ (int\ errcode);
749 .ad
750 .hy
751
752 .SH "DESCRIPTION"
753
754 .PP
755 map the error code to a system error code\&. This is used for the drop\-in replacement functions to return a value that can be interpreted correctly by code sections that are unaware of the fact they their \fBopen\fR(2) call had been diverted to a file inside a zip\-archive\&.
756
757 .SH "AUTHOR"
758
759 .TP 3
760 \(bu
761 Guido Draheim <guidod@gmx\&.de>
762 .TP
763 \(bu
764 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
765 .LP
766
767
768 zzip_error.3/   1071214812  500   0     100664  872       `
769 .\"Generated by db2man.xsl. Don't modify this, modify the source.
770 .de Sh \" Subsection
771 .br
772 .if t .Sp
773 .ne 5
774 .PP
775 \fB\\$1\fR
776 .PP
777 ..
778 .de Sp \" Vertical space (when we can't use .PP)
779 .if t .sp .5v
780 .if n .sp
781 ..
782 .de Ip \" List item
783 .br
784 .ie \\n(.$>=3 .ne \\$3
785 .el .ne 3
786 .IP "\\$1" \\$2
787 ..
788 .TH "ZZIP_ERROR" 3 "0.13.24" "zziplib" "zzip_error"
789 .SH NAME
790 zzip_error, zzip_seterror \- (zzip/info.c)
791 .SH "SYNOPSIS"
792 .ad l
793 .hy 0
794
795
796
797
798 #include <zzip/lib\&.h>
799
800 .sp
801 .HP 18
802 int\ \ \fBzzip_error\fR\ (ZZIP_DIR\ *\ dir);
803 .HP 22
804 void\ \ \fBzzip_seterror\fR\ (ZZIP_DIR\ *\ dir, int\ errcode);
805 .ad
806 .hy
807
808 .SH "DESCRIPTION"
809
810 .PP
811 just returns dir\->errcode of the ZZIP_DIR handle see: \fBzzip_dir_open\fR, \fBzzip_diropen\fR, \fBzzip_readdir\fR, \fBzzip_dir_read\fR 
812
813 .PP
814  \fBThe zzip_seterror function\fR just does dir\->errcode = errcode
815
816 .SH "AUTHOR"
817
818 .TP 3
819 \(bu
820 Guido Draheim <guidod@gmx\&.de>
821 .LP
822
823 zzip_fclose.3/  1071214812  500   0     100664  993       `
824 .\"Generated by db2man.xsl. Don't modify this, modify the source.
825 .de Sh \" Subsection
826 .br
827 .if t .Sp
828 .ne 5
829 .PP
830 \fB\\$1\fR
831 .PP
832 ..
833 .de Sp \" Vertical space (when we can't use .PP)
834 .if t .sp .5v
835 .if n .sp
836 ..
837 .de Ip \" List item
838 .br
839 .ie \\n(.$>=3 .ne \\$3
840 .el .ne 3
841 .IP "\\$1" \\$2
842 ..
843 .TH "ZZIP_FCLOSE" 3 "0.13.24" "zziplib" "zzip_fclose"
844 .SH NAME
845 zzip_fclose, zzip_close \- (zzip/file.c)
846 .SH "SYNOPSIS"
847 .ad l
848 .hy 0
849
850
851
852
853 #include <zzip/lib\&.h>
854
855 .sp
856 .HP 19
857 int\ \ \fBzzip_fclose\fR\ (ZZIP_FILE\ *\ fp);
858 .HP 18
859 int\ \ \fBzzip_close\fR\ (ZZIP_FILE*\ fp);
860 .ad
861 .hy
862
863 .SH "DESCRIPTION"
864
865 .PP
866  \fBThe zzip_fclose function\fR closes the given ZZIP_FILE handle\&.
867
868 .PP
869 If the ZZIP_FILE wraps a normal stat'fd then it is just that int'fd that is being closed and the otherwise empty ZZIP_FILE gets freed\&.
870
871 .PP
872
873
874 .SH "AUTHOR"
875
876 .TP 3
877 \(bu
878 Guido Draheim <guidod@gmx\&.de>
879 .TP
880 \(bu
881 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
882 .TP
883 \(bu
884 Guido Draheim <guidod@gmx\&.de>
885 .TP
886 \(bu
887 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
888 .LP
889
890
891 /227            1071214812  500   0     100664  952       `
892 .\"Generated by db2man.xsl. Don't modify this, modify the source.
893 .de Sh \" Subsection
894 .br
895 .if t .Sp
896 .ne 5
897 .PP
898 \fB\\$1\fR
899 .PP
900 ..
901 .de Sp \" Vertical space (when we can't use .PP)
902 .if t .sp .5v
903 .if n .sp
904 ..
905 .de Ip \" List item
906 .br
907 .ie \\n(.$>=3 .ne \\$3
908 .el .ne 3
909 .IP "\\$1" \\$2
910 ..
911 .TH "ZZIP_FILE_CLOSE" 3 "0.13.24" "zziplib" "zzip_file_close"
912 .SH NAME
913 zzip_file_close \- (zzip/file.c)
914 .SH "SYNOPSIS"
915 .ad l
916 .hy 0
917
918
919
920
921 #include <zzip/lib\&.h>
922
923 .sp
924 .HP 23
925 int\ \ \fBzzip_file_close\fR\ (ZZIP_FILE\ *\ fp);
926 .ad
927 .hy
928
929 .SH "DESCRIPTION"
930
931 .PP
932 the direct function of \fBzzip_close\fR(fp)\&. it will cleanup the inflate\-portion of \fBzlib\fR and free the structure given\&.
933
934 .PP
935 it is called quite from the error\-cleanup parts of the various \fB_open\fR functions\&.
936
937 .PP
938 the \&.refcount is decreased and if zero the fp\->dir is closed just as well\&.
939
940 .SH "AUTHOR"
941
942 .TP 3
943 \(bu
944 Guido Draheim <guidod@gmx\&.de>
945 .TP
946 \(bu
947 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
948 .LP
949
950 /246            1071214812  500   0     100664  2954      `
951 .\"Generated by db2man.xsl. Don't modify this, modify the source.
952 .de Sh \" Subsection
953 .br
954 .if t .Sp
955 .ne 5
956 .PP
957 \fB\\$1\fR
958 .PP
959 ..
960 .de Sp \" Vertical space (when we can't use .PP)
961 .if t .sp .5v
962 .if n .sp
963 ..
964 .de Ip \" List item
965 .br
966 .ie \\n(.$>=3 .ne \\$3
967 .el .ne 3
968 .IP "\\$1" \\$2
969 ..
970 .TH "ZZIP_FILE_CREAT" 3 "0.13.24" "zziplib" "zzip_file_creat"
971 .SH NAME
972 zzip_file_creat, zzip_file_mkdir \- start next file entry in a zip archive
973 .SH "SYNOPSIS"
974 .ad l
975 .hy 0
976
977
978  #include <zziplib\&.h>
979
980 .sp
981 .HP 29
982 ZZIP_FILE* \ \fBzzip_file_creat\fR\ (ZZIP_DIR*\ dir, zzip_char_t*\ name, int\ o_mode);
983 .HP 22
984 int \ \fBzzip_file_mkdir\fR\ (ZZIP_DIR*\ dir, zzip_char_t*\ name, int\ o_mode);
985 .ad
986 .hy
987
988 .SH "DESCRIPTION"
989
990 .PP
991
992
993 .PP
994  \fBThe zzip_file_creat function\fR will create a new file within a zzip archive, the one given as the primary argument and additionally to the posix creat(2) \- just like zzip_mkdir has an additional argument over the posix mkdir(2) spec\&. For \fBthe zzip_file_creat function\fR the primary parameter can be null as well thereby creating a real file instead of a new one inside the zip\-archive otherwise given\&. If the primary parameter is not null but wraps a real directory then all new files are also real\&.
995
996 .PP
997  \fBThe zzip_file_creat function\fR is not yet implemented, check for #def ZZIP_NO_CREAT
998
999 .PP
1000 Returns NULL on an error setting errno, and opening a file _within_ a zip archive using O_RDONLY (and similar stuff) will surely lead to an error\&.
1001
1002 .PP
1003
1004
1005 .PP
1006  \fBThe zzip_file_mkdir function\fR has an additional primary argument over the posix mkdir(2) \- if it is null then \fBthe zzip_file_mkdir function\fR behaves just like posix mkdir(2)\&. The zzip_dir argument can be set to the result of a \fBzzip_createdir\fR which allows for some magic that the given directory name is created as an entry in the zip archive\&.
1007
1008 .PP
1009 If the given dir name argument is not within the basepath of the zip central directory then a real directory is created\&. Any EEXIST errors are not suppressed unlike with \fBzzip_createdir\fR 
1010
1011 .PP
1012 Standard usage accepts a global/threaded/modular ZZIP_DIR pointer for all zip archive operations like in: 
1013
1014 .IP
1015 .nf
1016   ZZIP_DIR* zip = zzip_createdir (sysconfpath, 0755, zip);  
1017    zzip_file_mkdir (zip, filepath[i], 0755);  
1018    ZZIP_FILE* file = zzip_file_creat (zip, filename[i], 0644);  
1019    zzip_write (file, buf, len);  
1020    zzip_close (file); file = 0;  
1021    zzip_closedir (zip); zip = 0;
1022 .fi
1023  
1024
1025 .PP
1026 compare with \fBzzip_mkdir\fR inline macro which allows to collapse the examples script to 
1027
1028 .IP
1029 .nf
1030   #define zzip_savefile myproject_saveconfig  
1031    #include <zzip/zzip\&.h>  
1032    ZZIP_DIR* zzip_savefile = zzip_createdir (sysconfpath, 0755);  
1033    zzip_mkdir (filepath[i], 0755);  
1034    ZZIP_FILE* file = zzip_creat(filepath[i], 0644);  
1035    zzip_write (file, buf, len);  
1036    zzip_close (file); file = 0;  
1037    zzip_closedir (zip_savefile);
1038 .fi
1039  
1040
1041 .SH "AUTHOR"
1042
1043 .TP 3
1044 \(bu
1045 Guido Draheim <guidod@gmx\&.de>
1046 .LP
1047
1048 /265            1071214812  500   0     100664  27        `
1049 .so man3/zzip_file_creat.3
1050
1051 /284            1071214812  500   0     100664  1006      `
1052 .\"Generated by db2man.xsl. Don't modify this, modify the source.
1053 .de Sh \" Subsection
1054 .br
1055 .if t .Sp
1056 .ne 5
1057 .PP
1058 \fB\\$1\fR
1059 .PP
1060 ..
1061 .de Sp \" Vertical space (when we can't use .PP)
1062 .if t .sp .5v
1063 .if n .sp
1064 ..
1065 .de Ip \" List item
1066 .br
1067 .ie \\n(.$>=3 .ne \\$3
1068 .el .ne 3
1069 .IP "\\$1" \\$2
1070 ..
1071 .TH "ZZIP_FILE_OPEN" 3 "0.13.24" "zziplib" "zzip_file_open"
1072 .SH NAME
1073 zzip_file_open \- (zzip/file.c)
1074 .SH "SYNOPSIS"
1075 .ad l
1076 .hy 0
1077
1078
1079
1080
1081 #include <zzip/lib\&.h>
1082
1083 .sp
1084 .HP 31
1085 ZZIP_FILE\ *\ \ \fBzzip_file_open\fR\ (ZZIP_DIR\ *\ dir, zzip_char_t*\ name, int\ o_mode);
1086 .ad
1087 .hy
1088
1089 .SH "DESCRIPTION"
1090
1091 .PP
1092 open an \fBZZIP_FILE\fR from an already open \fBZZIP_DIR\fR handle\&. Since we have a chance to reuse a cached \fBbuf32k\fR and \fBZZIP_FILE\fR memchunk this is the best choice to unpack multiple files\&.
1093
1094 .PP
1095 Note: the zlib supports 2\&.\&.15 bit windowsize, hence we provide a 32k memchunk here\&.\&.\&. just to be safe\&.
1096
1097 .SH "AUTHOR"
1098
1099 .TP 3
1100 \(bu
1101 Guido Draheim <guidod@gmx\&.de>
1102 .TP
1103 \(bu
1104 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
1105 .LP
1106
1107 /302            1071214812  500   0     100664  1300      `
1108 .\"Generated by db2man.xsl. Don't modify this, modify the source.
1109 .de Sh \" Subsection
1110 .br
1111 .if t .Sp
1112 .ne 5
1113 .PP
1114 \fB\\$1\fR
1115 .PP
1116 ..
1117 .de Sp \" Vertical space (when we can't use .PP)
1118 .if t .sp .5v
1119 .if n .sp
1120 ..
1121 .de Ip \" List item
1122 .br
1123 .ie \\n(.$>=3 .ne \\$3
1124 .el .ne 3
1125 .IP "\\$1" \\$2
1126 ..
1127 .TH "ZZIP_FILE_READ" 3 "0.13.24" "zziplib" "zzip_file_read"
1128 .SH NAME
1129 zzip_file_read \- (zzip/file.c)
1130 .SH "SYNOPSIS"
1131 .ad l
1132 .hy 0
1133
1134
1135
1136
1137 #include <zzip/lib\&.h>
1138
1139 .sp
1140 .HP 31
1141 zzip_ssize_t\ \ \fBzzip_file_read\fR\ (ZZIP_FILE\ *\ fp, char\ *\ buf, zzip_size_t\ len);
1142 .ad
1143 .hy
1144
1145 .SH "DESCRIPTION"
1146
1147 .PP
1148  \fBThe zzip_file_read function\fRs read data from zip\-contained file\&.
1149
1150 .PP
1151 It works like \fBread\fR(2) and will fill the given buffer with bytes from the opened file\&. It will return the number of bytes read, so if the \fBEOF\fR is encountered you will be prompted with the number of bytes actually read\&.
1152
1153 .PP
1154 This is the routines that needs the \fBbuf32k\fR buffer, and it would have need for much more polishing but it does already work quite well\&.
1155
1156 .PP
1157 Note: the 32K buffer is rather big\&. The original inflate\-algorithm required just that but the latest zlib would work just fine with a smaller buffer\&.
1158
1159 .SH "AUTHOR"
1160
1161 .TP 3
1162 \(bu
1163 Guido Draheim <guidod@gmx\&.de>
1164 .TP
1165 \(bu
1166 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
1167 .LP
1168
1169 /320            1071214812  500   0     100664  1525      `
1170 .\"Generated by db2man.xsl. Don't modify this, modify the source.
1171 .de Sh \" Subsection
1172 .br
1173 .if t .Sp
1174 .ne 5
1175 .PP
1176 \fB\\$1\fR
1177 .PP
1178 ..
1179 .de Sp \" Vertical space (when we can't use .PP)
1180 .if t .sp .5v
1181 .if n .sp
1182 ..
1183 .de Ip \" List item
1184 .br
1185 .ie \\n(.$>=3 .ne \\$3
1186 .el .ne 3
1187 .IP "\\$1" \\$2
1188 ..
1189 .TH "ZZIP_FILE_REAL" 3 "0.13.24" "zziplib" "zzip_file_real"
1190 .SH NAME
1191 zzip_file_real, zzip_dir_real, zzip_realdir, zzip_realfd \- (zzip/info.c)
1192 .SH "SYNOPSIS"
1193 .ad l
1194 .hy 0
1195
1196
1197
1198
1199 #include <zzip/lib\&.h>
1200
1201 .sp
1202 .HP 21
1203 int \ \fBzzip_file_real\fR\ (ZZIP_FILE*\ fp);
1204 .HP 20
1205 int \ \fBzzip_dir_real\fR\ (ZZIP_DIR*\ dir);
1206 .HP 21
1207 void* \ \fBzzip_realdir\fR\ (ZZIP_DIR*\ dir);
1208 .HP 18
1209 int \ \fBzzip_realfd\fR\ (ZZIP_FILE*\ fp);
1210 .ad
1211 .hy
1212
1213 .SH "DESCRIPTION"
1214
1215 .PP
1216  \fBThe zzip_file_real function\fR checks if the ZZIP_FILE\-handle is wrapping a real file or a zip\-contained file\&. Returns 1 for a stat'able file, and 0 for a file inside a zip\-archive\&.
1217
1218 .PP
1219  \fBThe zzip_dir_real function\fR checks if the ZZIP_DIR\-handle is wrapping a real directory or a zip\-archive\&. Returns 1 for a stat'able directory, and 0 for a handle to zip\-archive\&.
1220
1221 .PP
1222  \fBThe zzip_realdir function\fR returns the posix DIR* handle (if one exists)\&. Check before with \fBzzip_dir_real\fR if the the ZZIP_DIR points to a real directory\&.
1223
1224 .PP
1225  \fBThe zzip_realfd function\fR returns the posix file descriptor (if one exists)\&. Check before with \fBzzip_file_real\fR if the the ZZIP_FILE points to a real file\&.
1226
1227 .SH "AUTHOR"
1228
1229 .TP 3
1230 \(bu
1231 Guido Draheim <guidod@gmx\&.de>
1232 .LP
1233
1234
1235 /338            1071214812  500   0     100664  25        `
1236 .so man3/zzip_dir_stat.3
1237
1238 /356            1071214812  500   0     100664  22        `
1239 .so man3/zzip_write.3
1240 /375            1071214812  500   0     100664  919       `
1241 .\"Generated by db2man.xsl. Don't modify this, modify the source.
1242 .de Sh \" Subsection
1243 .br
1244 .if t .Sp
1245 .ne 5
1246 .PP
1247 \fB\\$1\fR
1248 .PP
1249 ..
1250 .de Sp \" Vertical space (when we can't use .PP)
1251 .if t .sp .5v
1252 .if n .sp
1253 ..
1254 .de Ip \" List item
1255 .br
1256 .ie \\n(.$>=3 .ne \\$3
1257 .el .ne 3
1258 .IP "\\$1" \\$2
1259 ..
1260 .TH "__ZZIP_FIND_DISK" 3 "0.13.24" "zziplib" "__zzip_find_disk_trailer"
1261 .SH NAME
1262 __zzip_find_disk_trailer \- (zzip/zip.c)
1263 .SH "SYNOPSIS"
1264 .ad l
1265 .hy 0
1266
1267
1268
1269
1270 #include <zzip/lib\&.h>
1271
1272 .sp
1273 .HP 32
1274 int\ \ \fB__zzip_find_disk_trailer\fR\ (int\ fd, zzip_off_t\ filesize, struct\ zzip_disk_trailer\ *\ trailer, zzip_plugin_io_t\ io);
1275 .ad
1276 .hy
1277
1278 .SH "DESCRIPTION"
1279
1280 .PP
1281  \fBThe __zzip_find_disk_trailer function\fR is used by \fBzzip_file_open\fR\&. It tries to find the zip's central directory info that is usually a few bytes off the end of the file\&.
1282
1283 .SH "AUTHOR"
1284
1285 .TP 3
1286 \(bu
1287 Guido Draheim <guidod@gmx\&.de>
1288 .TP
1289 \(bu
1290 Tomi Ollila <too@iki\&.fi>
1291 .LP
1292
1293
1294 zzip_fopen.3/   1071214812  500   0     100664  4108      `
1295 .\"Generated by db2man.xsl. Don't modify this, modify the source.
1296 .de Sh \" Subsection
1297 .br
1298 .if t .Sp
1299 .ne 5
1300 .PP
1301 \fB\\$1\fR
1302 .PP
1303 ..
1304 .de Sp \" Vertical space (when we can't use .PP)
1305 .if t .sp .5v
1306 .if n .sp
1307 ..
1308 .de Ip \" List item
1309 .br
1310 .ie \\n(.$>=3 .ne \\$3
1311 .el .ne 3
1312 .IP "\\$1" \\$2
1313 ..
1314 .TH "ZZIP_FOPEN" 3 "0.13.24" "zziplib" "zzip_fopen"
1315 .SH NAME
1316 zzip_fopen, zzip_freopen \- (zzip/file.c)
1317 .SH "SYNOPSIS"
1318 .ad l
1319 .hy 0
1320
1321
1322
1323
1324 #include <zzip/lib\&.h>
1325
1326 .sp
1327 .HP 24
1328 ZZIP_FILE* \ \fBzzip_fopen\fR\ (zzip_char_t*\ filename, zzip_char_t*\ mode);
1329 .HP 26
1330 ZZIP_FILE* \ \fBzzip_freopen\fR\ (zzip_char_t*\ filename, zzip_char_t*\ mode, ZZIP_FILE*\ stream);
1331 .ad
1332 .hy
1333
1334 .SH "DESCRIPTION"
1335
1336 .PP
1337  \fBThe zzip_fopen function\fR will \fBfopen\fR(3) a real/zipped file\&.
1338
1339 .PP
1340 It has some magic functionality builtin \- it will first try to open the given filename as a normal file\&. If it does not exist, the given path to the filename (if any) is split into its directory\-part and the file\-part\&. A "\&.zip" extension is then added to the directory\-part to create the name of a zip\-archive\&. That zip\-archive (if it exists) is being searched for the file\-part, and if found a zzip\-handle is returned\&.
1341
1342 .PP
1343 Note that if the file is found in the normal fs\-directory the returned structure is mostly empty and the \fBzzip_read\fR call will use the libc \fBread\fR to obtain data\&. Otherwise a \fBzzip_file_open\fR is performed and any error mapped to \fBerrno\fR(3)\&.
1344
1345 .PP
1346 unlike the posix\-wrapper \fBzzip_open\fR the mode\-argument is a string which allows for more freedom to support the extra zzip modes called ZZIP_CASEINSENSITIVE and ZZIP_IGNOREPATH\&. Currently, this \fBzzip_fopen\fR call will convert the following characters in the mode\-string into their corrsponding mode\-bits:
1347
1348 .nf
1349
1350 \fB "r" : O_RDONLY : \fR read\-only
1351    \fB "b" : O_BINARY : \fR binary (win32 specific)
1352    \fB "f" : O_NOCTTY : \fR no char device (unix)
1353    \fB "i" : ZZIP_CASELESS : \fR inside zip file
1354    \fB "*" : ZZIP_NOPATHS : \fR inside zip file only
1355    
1356 .fi
1357
1358 .PP
1359 all other modes will be ignored for zip\-contained entries but they are transferred for compatibility and portability, including these extra sugar bits:
1360
1361 .nf
1362
1363 \fB "x" : O_EXCL :\fR fail if file did exist
1364    \fB "s" : O_SYNC :\fR synchronized access
1365    \fB "n" : O_NONBLOCK :\fR nonblocking access
1366    \fB "z#" : compression level :\fR for zlib
1367    \fB "g#" : group access :\fR unix access bits
1368    \fB "u#" : owner access :\fR unix access bits
1369    \fB "o#" : world access :\fR unix access bits
1370    
1371 .fi
1372
1373 .PP
1374 \&.\&.\&. the access bits are in traditional unix bit format with 7 = read/write/execute, 6 = read/write, 4 = read\-only\&.
1375
1376 .PP
1377 The default access mode is 0664, and the compression level is ignored since the lib can not yet write zip files, otherwise it would be the initialisation value for the zlib deflateInit where 0 = no\-compression, 1 = best\-speed, 9 = best\-compression\&.
1378
1379 .PP
1380
1381
1382 .PP
1383  \fBThe zzip_freopen function\fR receives an additional argument pointing to a ZZIP_FILE* being already in use\&. If this extra argument is null then \fBthe zzip_freopen function\fR is identical with calling \fBzzip_fopen\fR 
1384
1385 .PP
1386 Per default, the old file stream is closed and only the internal structures associated with it are kept\&. These internal structures may be reused for the return value, and this is a lot quicker when the filename matches a zipped file that is incidently in the very same zip arch as the old filename wrapped in the stream struct\&.
1387
1388 .PP
1389 That's simply because the zip arch's central directory does not need to be read again\&. As an extension for \fBthe zzip_freopen function\fR, if the mode\-string contains a "q" then the old stream is not closed but left untouched, instead it is only given as a hint that a new file handle may share/copy the zip arch structures of the old file handle if that is possible, i\&.e when they are in the same zip arch\&.
1390
1391 .SH "AUTHOR"
1392
1393 .TP 3
1394 \(bu
1395 Guido Draheim <guidod@gmx\&.de>
1396 .TP
1397 \(bu
1398 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
1399 .TP
1400 \(bu
1401 Guido Draheim <guidod@gmx\&.de>
1402 .TP
1403 \(bu
1404 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
1405 .LP
1406
1407 zzip_fread.3/   1071214812  500   0     100664  21        `
1408 .so man3/zzip_read.3
1409
1410 zzip_freopen.3/ 1071214812  500   0     100664  22        `
1411 .so man3/zzip_fopen.3
1412 zzip_fstat.3/   1071214812  500   0     100664  25        `
1413 .so man3/zzip_dir_stat.3
1414
1415 zzip_fwrite.3/  1071214812  500   0     100664  22        `
1416 .so man3/zzip_write.3
1417 __zzip_get16.3/ 1071214812  500   0     100664  24        `
1418 .so man3/__zzip_get32.3
1419 __zzip_get32.3/ 1071214812  500   0     100664  1010      `
1420 .\"Generated by db2man.xsl. Don't modify this, modify the source.
1421 .de Sh \" Subsection
1422 .br
1423 .if t .Sp
1424 .ne 5
1425 .PP
1426 \fB\\$1\fR
1427 .PP
1428 ..
1429 .de Sp \" Vertical space (when we can't use .PP)
1430 .if t .sp .5v
1431 .if n .sp
1432 ..
1433 .de Ip \" List item
1434 .br
1435 .ie \\n(.$>=3 .ne \\$3
1436 .el .ne 3
1437 .IP "\\$1" \\$2
1438 ..
1439 .TH "__ZZIP_GET32" 3 "0.13.24" "zziplib" "__zzip_get32"
1440 .SH NAME
1441 __zzip_get32, __zzip_get16 \- (zzip/zip.c)
1442 .SH "SYNOPSIS"
1443 .ad l
1444 .hy 0
1445
1446
1447
1448
1449 #include <zzip/lib\&.h>
1450
1451 .sp
1452 .HP 25
1453 uint32_t\ \ \fB__zzip_get32\fR\ (unsigned\ char\ *\ s);
1454 .HP 25
1455 uint16_t\ \ \fB__zzip_get16\fR\ (unsigned\ char\ *\ s);
1456 .ad
1457 .hy
1458
1459 .SH "DESCRIPTION"
1460
1461 .PP
1462 Make 32 bit value in host byteorder from little\-endian mapped octet\-data (works also on machines which SIGBUS on misaligned data access (eg\&. 68000))
1463
1464 .PP
1465  \fBThe __zzip_get16 function\fR does the same for a 16 bit value\&.
1466
1467 .SH "AUTHOR"
1468
1469 .TP 3
1470 \(bu
1471 Guido Draheim <guidod@gmx\&.de>
1472 .TP
1473 \(bu
1474 Tomi Ollila <too@iki\&.fi>
1475 .TP
1476 \(bu
1477 Guido Draheim <guidod@gmx\&.de>
1478 .TP
1479 \(bu
1480 Tomi Ollila <too@iki\&.fi>
1481 .LP
1482
1483 /403            1071214812  500   0     100664  24        `
1484 .so man3/zzip_init_io.3
1485 /426            1071214812  500   0     100664  787       `
1486 .\"Generated by db2man.xsl. Don't modify this, modify the source.
1487 .de Sh \" Subsection
1488 .br
1489 .if t .Sp
1490 .ne 5
1491 .PP
1492 \fB\\$1\fR
1493 .PP
1494 ..
1495 .de Sp \" Vertical space (when we can't use .PP)
1496 .if t .sp .5v
1497 .if n .sp
1498 ..
1499 .de Ip \" List item
1500 .br
1501 .ie \\n(.$>=3 .ne \\$3
1502 .el .ne 3
1503 .IP "\\$1" \\$2
1504 ..
1505 .TH "ZZIP_INFLATE_INIT" 3 "0.13.24" "zziplib" "zzip_inflate_init"
1506 .SH NAME
1507 zzip_inflate_init \- (zzip/file.c)
1508 .SH "SYNOPSIS"
1509 .ad l
1510 .hy 0
1511
1512
1513
1514
1515 #include <zzip/lib\&.h>
1516
1517 .sp
1518 .HP 33
1519 static\ int\ \ \fBzzip_inflate_init\fR\ (ZZIP_FILE\ *\ fp, struct\ zzip_dir_hdr*\ hdr);
1520 .ad
1521 .hy
1522
1523 .SH "DESCRIPTION"
1524
1525 .PP
1526 call \fBinflateInit\fR and setup fp's iterator variables, used by lowlevel \fB_open\fR functions\&.
1527
1528 .SH "AUTHOR"
1529
1530 .TP 3
1531 \(bu
1532 Guido Draheim <guidod@gmx\&.de>
1533 .TP
1534 \(bu
1535 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
1536 .LP
1537
1538
1539 zzip_init_io.3/ 1071214812  500   0     100664  1135      `
1540 .\"Generated by db2man.xsl. Don't modify this, modify the source.
1541 .de Sh \" Subsection
1542 .br
1543 .if t .Sp
1544 .ne 5
1545 .PP
1546 \fB\\$1\fR
1547 .PP
1548 ..
1549 .de Sp \" Vertical space (when we can't use .PP)
1550 .if t .sp .5v
1551 .if n .sp
1552 ..
1553 .de Ip \" List item
1554 .br
1555 .ie \\n(.$>=3 .ne \\$3
1556 .el .ne 3
1557 .IP "\\$1" \\$2
1558 ..
1559 .TH "ZZIP_INIT_IO" 3 "0.13.24" "zziplib" "zzip_init_io"
1560 .SH NAME
1561 zzip_init_io, zzip_get_default_io \- (zzip/plugin.c)
1562 .SH "SYNOPSIS"
1563 .ad l
1564 .hy 0
1565
1566
1567
1568
1569 #include <zzip/lib\&.h>
1570
1571 .sp
1572 .HP 20
1573 int\ \ \fBzzip_init_io\fR\ (zzip_plugin_io_handlers_t\ io, int\ flags);
1574 .HP 39
1575 zzip_plugin_io_t \ \fBzzip_get_default_io\fR\ ();
1576 .ad
1577 .hy
1578
1579 .SH "DESCRIPTION"
1580
1581 .PP
1582  \fBThe zzip_init_io function\fR initializes the users handler struct to default values being the posix io functions in default configured environments\&.
1583
1584 .PP
1585  \fBThe zzip_get_default_io function\fR returns a zzip_plugin_io_t handle to static defaults wrapping the posix io file functions for actual file access\&.
1586
1587 .SH "AUTHOR"
1588
1589 .TP 3
1590 \(bu
1591 Guido Draheim <guidod@gmx\&.de>
1592 .TP
1593 \(bu
1594 Mike Nordell <tamlin@algonet\&.se>
1595 .TP
1596 \(bu
1597 Guido Draheim <guidod@gmx\&.de>
1598 .TP
1599 \(bu
1600 Mike Nordell <tamlin@algonet\&.se>
1601 .LP
1602
1603
1604 zziplib.h.3/    1071214812  500   0     100664  3477      `
1605 .\"Generated by db2man.xsl. Don't modify this, modify the source.
1606 .de Sh \" Subsection
1607 .br
1608 .if t .Sp
1609 .ne 5
1610 .PP
1611 \fB\\$1\fR
1612 .PP
1613 ..
1614 .de Sp \" Vertical space (when we can't use .PP)
1615 .if t .sp .5v
1616 .if n .sp
1617 ..
1618 .de Ip \" List item
1619 .br
1620 .ie \\n(.$>=3 .ne \\$3
1621 .el .ne 3
1622 .IP "\\$1" \\$2
1623 ..
1624 .TH "ZZIPLIB.H" 3 "0.13.24" "the library zziplib" ""
1625 .SH NAME
1626 zziplib.h \- library
1627 .SH "SYNOPSIS"
1628 .ad l
1629 .hy 0
1630
1631
1632
1633
1634 #include <zzip/lib\&.h>
1635
1636 .sp
1637 .HP 23
1638 void\ \ \fBzzip_rewinddir\fR\ (ZZIP_DIR\ *\ dir);
1639 .HP 29
1640 ZZIP_DIRENT*\ \ \fBzzip_readdir\fR\ (ZZIP_DIR\ *\ dir);
1641 .HP 26
1642 ZZIP_DIR*\ \ \fBzzip_opendir\fR\ (zzip_char_t*\ filename);
1643 .HP 20
1644 int \ \fBzzip_closedir\fR\ (ZZIP_DIR*\ dir);
1645 .HP 30
1646 zzip_char_t*\ \ \fBzzip_strerror\fR\ (int\ errcode);
1647 .HP 17
1648 int \ \fBzzip_errno\fR\ (int\ errcode);
1649 .HP 23
1650 int\ \ \fBzzip_file_close\fR\ (ZZIP_FILE\ *\ fp);
1651 .HP 31
1652 ZZIP_FILE\ *\ \ \fBzzip_file_open\fR\ (ZZIP_DIR\ *\ dir, zzip_char_t*\ name, int\ o_mode);
1653 .HP 33
1654 static\ int\ \ \fBzzip_inflate_init\fR\ (ZZIP_FILE\ *\ fp, struct\ zzip_dir_hdr*\ hdr);
1655 .HP 19
1656 int\ \ \fBzzip_fclose\fR\ (ZZIP_FILE\ *\ fp);
1657 .HP 31
1658 zzip_ssize_t\ \ \fBzzip_file_read\fR\ (ZZIP_FILE\ *\ fp, char\ *\ buf, zzip_size_t\ len);
1659 .HP 25
1660 zzip_ssize_t \ \fBzzip_read\fR\ (ZZIP_FILE\ *\ fp, char\ *\ buf, zzip_size_t\ len);
1661 .HP 24
1662 ZZIP_FILE* \ \fBzzip_fopen\fR\ (zzip_char_t*\ filename, zzip_char_t*\ mode);
1663 .HP 23
1664 ZZIP_FILE* \ \fBzzip_open\fR\ (zzip_char_t*\ filename, int\ o_flags);
1665 .HP 18
1666 int \ \fBzzip_rewind\fR\ (ZZIP_FILE\ *fp);
1667 .HP 23
1668 zzip_off_t \ \fBzzip_seek\fR\ (ZZIP_FILE\ *\ fp, zzip_off_t\ offset, int\ whence);
1669 .HP 23
1670 zzip_off_t \ \fBzzip_tell\fR\ (ZZIP_FILE\ *\ fp);
1671 .HP 18
1672 int\ \ \fBzzip_error\fR\ (ZZIP_DIR\ *\ dir);
1673 .HP 30
1674 ZZIP_DIR\ *\ \ \fBzzip_dirhandle\fR\ (ZZIP_FILE\ *\ fp);
1675 .HP 30
1676 zzip_char_t* \ \fBzzip_compr_str\fR\ (int\ compr);
1677 .HP 21
1678 int \ \fBzzip_file_real\fR\ (ZZIP_FILE*\ fp);
1679 .HP 20
1680 int\ \ \fBzzip_init_io\fR\ (zzip_plugin_io_handlers_t\ io, int\ flags);
1681 .HP 21
1682 int\ \ \fBzzip_dir_stat\fR\ (ZZIP_DIR\ *\ dir, zzip_char_t*\ name, ZZIP_STAT\ *\ zs, int\ flags);
1683 .HP 27
1684 ZZIP_DIR* \ \fBzzip_dir_creat\fR\ (zzip_char_t*\ name, int\ o_mode);
1685 .HP 27
1686 ZZIP_DIR* \ \fBzzip_createdir\fR\ (zzip_char_t*\ name, int\ o_mode);
1687 .HP 29
1688 ZZIP_FILE* \ \fBzzip_file_creat\fR\ (ZZIP_DIR*\ dir, zzip_char_t*\ name, int\ o_mode);
1689 .HP 26
1690 zzip_ssize_t \ \fBzzip_write\fR\ (ZZIP_FILE*\ file, const\ void*\ ptr, zzip_size_t\ len);
1691 .HP 25
1692 int\ inline \ \fBzzip_mkdir\fR\ (zzip_char_t*\ name, int\ o_mode);
1693 .HP 27
1694 void\ inline \ \fBzzip_mkfifo\fR\ (zzip_char_t*\ name, int\ o_mode);
1695 .HP 25
1696 uint32_t\ \ \fB__zzip_get32\fR\ (unsigned\ char\ *\ s);
1697 .HP 32
1698 int\ \ \fB__zzip_find_disk_trailer\fR\ (int\ fd, zzip_off_t\ filesize, struct\ zzip_disk_trailer\ *\ trailer, zzip_plugin_io_t\ io);
1699 .HP 35
1700 int\ \ \fB__zzip_parse_root_directory\fR\ (int\ fd, struct\ zzip_disk_trailer\ *\ trailer, struct\ zzip_dir_hdr\ **\ hdr_return, zzip_plugin_io_t\ io);
1701 .HP 34
1702 ZZIP_DIR* \ \fBzzip_dir_alloc_ext_io\fR\ (zzip_strings_t*\ ext, const\ zzip_plugin_io_t\ io);
1703 .HP 21
1704 int\ \ \fBzzip_dir_free\fR\ (ZZIP_DIR\ *\ dir);
1705 .HP 31
1706 ZZIP_DIR\ *\ \ \fBzzip_dir_fdopen\fR\ (int\ fd, zzip_error_t\ *\ errcode_p);
1707 .HP 22
1708 int \ \fB__zzip_try_open\fR\ (zzip_char_t*\ filename, int\ filemode, zzip_strings_t*\ ext, zzip_plugin_io_t\ io);
1709 .HP 27
1710 ZZIP_DIR*\ \ \fBzzip_dir_open\fR\ (zzip_char_t*\ filename, zzip_error_t*\ e);
1711 .ad
1712 .hy
1713
1714 .SH "DESCRIPTION"
1715
1716 .PP
1717 zziplib library
1718
1719 .SH "AUTHOR"
1720
1721 .TP 3
1722 \(bu
1723 Guido Draheim <guidod@gmx\&.de>
1724 .TP
1725 \(bu
1726 Tomi Ollila <too@iki\&.fi>
1727 .LP
1728
1729
1730 zzip_mkdir.3/   1071214812  500   0     100664  2079      `
1731 .\"Generated by db2man.xsl. Don't modify this, modify the source.
1732 .de Sh \" Subsection
1733 .br
1734 .if t .Sp
1735 .ne 5
1736 .PP
1737 \fB\\$1\fR
1738 .PP
1739 ..
1740 .de Sp \" Vertical space (when we can't use .PP)
1741 .if t .sp .5v
1742 .if n .sp
1743 ..
1744 .de Ip \" List item
1745 .br
1746 .ie \\n(.$>=3 .ne \\$3
1747 .el .ne 3
1748 .IP "\\$1" \\$2
1749 ..
1750 .TH "ZZIP_MKDIR" 3 "0.13.24" "zziplib" "zzip_mkdir"
1751 .SH NAME
1752 zzip_mkdir, zzip_creat \- create a zipped file/directory
1753 .SH "SYNOPSIS"
1754 .ad l
1755 .hy 0
1756
1757
1758  #include <zziplib\&.h>
1759
1760 .sp
1761 .HP 25
1762 int\ inline \ \fBzzip_mkdir\fR\ (zzip_char_t*\ name, int\ o_mode);
1763 .HP 32
1764 ZZIP_FILE*\ inline \ \fBzzip_creat\fR\ (zzip_char_t*\ name, int\ o_mode);
1765 .ad
1766 .hy
1767
1768 .SH "DESCRIPTION"
1769
1770 .PP
1771
1772
1773 .PP
1774  \fBThe zzip_mkdir function\fR creates a directory entry in the default zip\-archive\&. If you did not specify a "#define zzip_savefile somevar" then the default zip\-archive is null and all directories are created as real directories in the filesystem\&. \fBThe zzip_mkdir function\fR is really a preprocessor macro or preferably an inline function around \fBzzip_file_mkdir\fR, there is no such symbol generated into the library\&. The prototype is modelled after the posix \fBmkdir\fR(2) call\&. 
1775
1776 .IP
1777 .nf
1778   #ifndef zzip_savefile  
1779    #define zzip_savefile 0  
1780    #endif  
1781    #define zzip_mkdir(name,mode) \\ \-
1782 .fi
1783  zzip_file_mkdir(zzip_savefile,name,mode)
1784
1785 .PP
1786
1787
1788 .PP
1789
1790
1791 .PP
1792  \fBThe zzip_creat function\fR creates a file in the default zip\-archive\&. If you did not specify a "#define zzip_savefile somevar" then the default zip\-archive is null and all files are created as real files\&. \fBThe zzip_creat function\fR is really a preprocessor macro or preferably an inline function around \fBzzip_file_creat\fR, there is no such symbol generated into the library\&. The prototype is modelled after the posix \fBcreat\fR(2) call\&. 
1793
1794 .IP
1795 .nf
1796   #ifndef zzip_savefile  
1797    #define zzip_savefile 0  
1798    #endif  
1799    #define zzip_creat(name,mode) \\ \-
1800 .fi
1801  zzip_file_creat(zzip_savefile,name,mode)
1802
1803 .SH "AUTHOR"
1804
1805 .TP 3
1806 \(bu
1807 Guido Draheim <guidod@gmx\&.de>
1808 .LP
1809
1810 .SH "SEE ALSO"
1811
1812 .PP
1813 zzip_dir_creat, mkdir(2), creat(2), zzip_start
1814
1815
1816 zzip_mkfifo.3/  1071214812  500   0     100664  2503      `
1817 .\"Generated by db2man.xsl. Don't modify this, modify the source.
1818 .de Sh \" Subsection
1819 .br
1820 .if t .Sp
1821 .ne 5
1822 .PP
1823 \fB\\$1\fR
1824 .PP
1825 ..
1826 .de Sp \" Vertical space (when we can't use .PP)
1827 .if t .sp .5v
1828 .if n .sp
1829 ..
1830 .de Ip \" List item
1831 .br
1832 .ie \\n(.$>=3 .ne \\$3
1833 .el .ne 3
1834 .IP "\\$1" \\$2
1835 ..
1836 .TH "ZZIP_MKFIFO" 3 "0.13.24" "zziplib" "zzip_mkfifo"
1837 .SH NAME
1838 zzip_mkfifo, zzip_sync \- start writing to the magic zzip_savefile
1839 .SH "SYNOPSIS"
1840 .ad l
1841 .hy 0
1842
1843
1844  #include <zziplib\&.h>
1845
1846 .sp
1847 .HP 27
1848 void\ inline \ \fBzzip_mkfifo\fR\ (zzip_char_t*\ name, int\ o_mode);
1849 .HP 25
1850 void\ inline \ \fBzzip_sync\fR\ (void);
1851 .ad
1852 .hy
1853
1854 .SH "DESCRIPTION"
1855
1856 .PP
1857
1858
1859 .PP
1860 open a zip archive for writing via the magic zzip_savefile macro variable\&. The name and mode are given to \fBzzip_createdir\fR and the result is stored into \fBzzip_savefile\fR \- if the \fBzzip_savefile\fR did already have a zzip_dir handle then it is automatically finalized with \fBzzip_sync\fR and the handle closed and the zzip_savefile variable reused for the new zip archive just started with this call\&. \- \fBThe zzip_mkfifo function\fR is really a preprocessor macro or preferably an inline function around \fBzzip_dir_create\fR, there is no such symbol generated into the library\&. 
1861
1862 .IP
1863 .nf
1864   #ifndef zzip_savefile  
1865    #define zzip_savefile 0  
1866    #endif  
1867    #define zzip_start(name,mode,ext) \\ \-
1868 .fi
1869  { if (zzip_savefile) zzip_closedir(zzip_savefile); \\ \- zzip_savefile = zzip_createdir(name,mode,ext); } \fBThe zzip_mkfifo function\fR returns null on error or a zzip_dir handle on success\&. It is perfectly okay to continue with a null in the zzip_savefile variable since it makes subsequent calls to \fBzzip_creat\fR and \fBzzip_mkdir\fR to run as \fBcreat\fR(2) / \fBmkdir\fR(2) on the real filesystem\&.
1870
1871 .PP
1872
1873
1874 .PP
1875 finalize a zip archive thereby writing the central directory to the end of the file\&. If it was a real directory then we do just nothing \- even that the prototype of the call itself is modelled to be similar to the posix \fBsync\fR(2) call\&. \fBThe zzip_sync function\fR is really a preprocessor macro or preferably an inline function around \fBzzip_closedir\fR, there is no such symbol generated into the library\&. 
1876
1877 .IP
1878 .nf
1879   #ifndef zzip_savefile  
1880    #define zzip_savefile 0  
1881    #endif  
1882    #define zzip_sync(name,mode) \\ \-
1883 .fi
1884  { zzip_closedir(zzip_savefile); zzip_savefile = 0; }
1885
1886 .PP
1887
1888
1889 .SH "AUTHOR"
1890
1891 .TP 3
1892 \(bu
1893 Guido Draheim <guidod@gmx\&.de>
1894 .LP
1895
1896 .SH "SEE ALSO"
1897
1898 .PP
1899 zzip_creat, zzip_write, zzip_closedir, sync(2)
1900
1901
1902 zzip_open.3/    1071214812  500   0     100664  3961      `
1903 .\"Generated by db2man.xsl. Don't modify this, modify the source.
1904 .de Sh \" Subsection
1905 .br
1906 .if t .Sp
1907 .ne 5
1908 .PP
1909 \fB\\$1\fR
1910 .PP
1911 ..
1912 .de Sp \" Vertical space (when we can't use .PP)
1913 .if t .sp .5v
1914 .if n .sp
1915 ..
1916 .de Ip \" List item
1917 .br
1918 .ie \\n(.$>=3 .ne \\$3
1919 .el .ne 3
1920 .IP "\\$1" \\$2
1921 ..
1922 .TH "ZZIP_OPEN" 3 "0.13.24" "zziplib" "zzip_open"
1923 .SH NAME
1924 zzip_open, zzip_open_ext_io, zzip_open_shared_io \- (zzip/file.c)
1925 .SH "SYNOPSIS"
1926 .ad l
1927 .hy 0
1928
1929
1930
1931
1932 #include <zzip/lib\&.h>
1933
1934 .sp
1935 .HP 23
1936 ZZIP_FILE* \ \fBzzip_open\fR\ (zzip_char_t*\ filename, int\ o_flags);
1937 .HP 30
1938 ZZIP_FILE* \ \fBzzip_open_ext_io\fR\ (zzip_char_t*\ filename, int\ o_flags, int\ o_modes, zzip_strings_t*\ ext, zzip_plugin_io_t\ io);
1939 .HP 33
1940 ZZIP_FILE* \ \fBzzip_open_shared_io\fR\ (ZZIP_FILE*\ stream, zzip_char_t*\ filename, int\ o_flags, int\ o_modes, zzip_strings_t*\ ext, zzip_plugin_io_t\ io);
1941 .ad
1942 .hy
1943
1944 .SH "DESCRIPTION"
1945
1946 .PP
1947  \fBThe zzip_open function\fR will \fBopen\fR(2) a real/zipped file
1948
1949 .PP
1950 It has some magic functionality builtin \- it will first try to open the given filename as a normal file\&. If it does not exist, the given path to the filename (if any) is split into its directory\-part and the file\-part\&. A "\&.zip" extension is then added to the directory\-part to create the name of a zip\-archive\&. That zip\-archive (if it exists) is being searched for the file\-part, and if found a zzip\-handle is returned\&.
1951
1952 .PP
1953 Note that if the file is found in the normal fs\-directory the returned structure is mostly empty and the \fBzzip_read\fR call will use the libc \fBread\fR to obtain data\&. Otherwise a \fBzzip_file_open\fR is performed and any error mapped to \fBerrno\fR(3)\&.
1954
1955 .PP
1956 There was a possibility to transfer zziplib\-specific openmodes through o_flags but you should please not use them anymore and look into \fBzzip_open_ext_io\fR to submit them down\&. \fBThe zzip_open function\fR is shallow in that it just extracts the zzipflags and calls
1957
1958 .nf
1959
1960 \fB
1961    zzip_open_ext_io(filename, o_flags, zzipflags|0664, 0, 0) \fR
1962 .fi
1963
1964 .PP
1965 you must stop using this extra functionality (not well known anyway) since zzip_open might be later usable to open files for writing in which case the _EXTRAFLAGS will get in conflict\&.
1966
1967 .PP
1968 compare with \fBopen\fR(2) and \fBzzip_fopen\fR 
1969
1970 .PP
1971
1972
1973 .PP
1974  \fBThe zzip_open_ext_io function\fR uses explicit ext and io instead of the internal defaults, setting them to zero is equivalent to \fBzzip_open\fR 
1975
1976 .PP
1977 note that the two flag types have been split into an o_flags (for fcntl\-like openflags) and o_modes where the latter shall carry the zzip_flags and possibly accessmodes for unix filesystems\&. Since this version of zziplib can not write zipfiles, it is not yet used for anything else than zzip\-specific modeflags\&.
1978
1979 .PP
1980
1981
1982 .PP
1983  \fBThe zzip_open_shared_io function\fR takes an extra stream argument \- if a handle has been then ext/io can be left null and the new stream handle will pick up the ext/io\&. This should be used only in specific environment however since \fBzzip_file_real\fR does not store any ext\-sequence\&.
1984
1985 .PP
1986 The benefit for \fBthe zzip_open_shared_io function\fR comes in when the old file handle was openened from a file within a zip archive\&. When the new file is in the same zip archive then the internal zzip_dir structures will be shared\&. It is even quicker, as no check needs to be done anymore trying to guess the zip archive place in the filesystem, here we just check whether the zip archive's filepath is a prefix part of the filename to be opened\&.
1987
1988 .PP
1989 Note that \fBthe zzip_open_shared_io function\fR is also used by \fBzzip_freopen\fR that will unshare the old handle, thereby possibly closing the handle\&.
1990
1991 .SH "AUTHOR"
1992
1993 .TP 3
1994 \(bu
1995 Guido Draheim <guidod@gmx\&.de>
1996 .TP
1997 \(bu
1998 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
1999 .TP
2000 \(bu
2001 Guido Draheim <guidod@gmx\&.de>
2002 .TP
2003 \(bu
2004 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
2005 .TP
2006 \(bu
2007 Guido Draheim <guidod@gmx\&.de>
2008 .TP
2009 \(bu
2010 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
2011 .LP
2012
2013
2014 zzip_opendir.3/ 1071214812  500   0     100664  1353      `
2015 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2016 .de Sh \" Subsection
2017 .br
2018 .if t .Sp
2019 .ne 5
2020 .PP
2021 \fB\\$1\fR
2022 .PP
2023 ..
2024 .de Sp \" Vertical space (when we can't use .PP)
2025 .if t .sp .5v
2026 .if n .sp
2027 ..
2028 .de Ip \" List item
2029 .br
2030 .ie \\n(.$>=3 .ne \\$3
2031 .el .ne 3
2032 .IP "\\$1" \\$2
2033 ..
2034 .TH "ZZIP_OPENDIR" 3 "0.13.24" "zziplib" "zzip_opendir"
2035 .SH NAME
2036 zzip_opendir, zzip_opendir_ext_io \- (zzip/dir.c)
2037 .SH "SYNOPSIS"
2038 .ad l
2039 .hy 0
2040
2041
2042
2043
2044 #include <zzip/lib\&.h>
2045
2046 .sp
2047 .HP 26
2048 ZZIP_DIR*\ \ \fBzzip_opendir\fR\ (zzip_char_t*\ filename);
2049 .HP 33
2050 ZZIP_DIR*\ \ \fBzzip_opendir_ext_io\fR\ (zzip_char_t*\ filename, int\ o_modes, zzip_strings_t*\ ext, zzip_plugin_io_t\ io);
2051 .ad
2052 .hy
2053
2054 .SH "DESCRIPTION"
2055
2056 .PP
2057  \fBThe zzip_opendir function\fR is the equivalent of \fBopendir\fR(3) for a realdir or zipfile\&.
2058
2059 .PP
2060  \fBThe zzip_opendir function\fR has some magic \- if the given argument\-path is a directory, it will wrap a real \fBopendir\fR(3) into the ZZIP_DIR structure\&. Otherwise it will divert to \fBzzip_dir_open\fR which can also attach a "\&.zip" extension if needed to find the archive\&.
2061
2062 .PP
2063 the error\-code is mapped to \fBerrno\fR(3)\&.
2064
2065 .PP
2066  \fBThe zzip_opendir_ext_io function\fR uses explicit ext and io instead of the internal defaults, setting them to zero is equivalent to \fBzzip_opendir\fR 
2067
2068 .SH "AUTHOR"
2069
2070 .TP 3
2071 \(bu
2072 Guido Draheim <guidod@gmx\&.de>
2073 .LP
2074
2075
2076 /447            1071214812  500   0     100664  24        `
2077 .so man3/zzip_opendir.3
2078 /470            1071214812  500   0     100664  21        `
2079 .so man3/zzip_open.3
2080
2081 /490            1071214812  500   0     100664  21        `
2082 .so man3/zzip_open.3
2083
2084 /513            1071214812  500   0     100664  1012      `
2085 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2086 .de Sh \" Subsection
2087 .br
2088 .if t .Sp
2089 .ne 5
2090 .PP
2091 \fB\\$1\fR
2092 .PP
2093 ..
2094 .de Sp \" Vertical space (when we can't use .PP)
2095 .if t .sp .5v
2096 .if n .sp
2097 ..
2098 .de Ip \" List item
2099 .br
2100 .ie \\n(.$>=3 .ne \\$3
2101 .el .ne 3
2102 .IP "\\$1" \\$2
2103 ..
2104 .TH "__ZZIP_PARSE_RO" 3 "0.13.24" "zziplib" "__zzip_parse_root_directory"
2105 .SH NAME
2106 __zzip_parse_root_directory \- (zzip/zip.c)
2107 .SH "SYNOPSIS"
2108 .ad l
2109 .hy 0
2110
2111
2112
2113
2114 #include <zzip/lib\&.h>
2115
2116 .sp
2117 .HP 35
2118 int\ \ \fB__zzip_parse_root_directory\fR\ (int\ fd, struct\ zzip_disk_trailer\ *\ trailer, struct\ zzip_dir_hdr\ **\ hdr_return, zzip_plugin_io_t\ io);
2119 .ad
2120 .hy
2121
2122 .SH "DESCRIPTION"
2123
2124 .PP
2125  \fBThe __zzip_parse_root_directory function\fR is used by \fBzzip_file_open\fR, it is usually called after \fB__zzip_find_disk_trailer\fR\&. It will parse the zip's central directory information and create a zziplib private directory table in memory\&.
2126
2127 .SH "AUTHOR"
2128
2129 .TP 3
2130 \(bu
2131 Guido Draheim <guidod@gmx\&.de>
2132 .TP
2133 \(bu
2134 Tomi Ollila <too@iki\&.fi>
2135 .LP
2136
2137 zzip_read.3/    1071214812  500   0     100664  1418      `
2138 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2139 .de Sh \" Subsection
2140 .br
2141 .if t .Sp
2142 .ne 5
2143 .PP
2144 \fB\\$1\fR
2145 .PP
2146 ..
2147 .de Sp \" Vertical space (when we can't use .PP)
2148 .if t .sp .5v
2149 .if n .sp
2150 ..
2151 .de Ip \" List item
2152 .br
2153 .ie \\n(.$>=3 .ne \\$3
2154 .el .ne 3
2155 .IP "\\$1" \\$2
2156 ..
2157 .TH "ZZIP_READ" 3 "0.13.24" "zziplib" "zzip_read"
2158 .SH NAME
2159 zzip_read, zzip_fread \- (zzip/file.c)
2160 .SH "SYNOPSIS"
2161 .ad l
2162 .hy 0
2163
2164
2165
2166
2167 #include <zzip/lib\&.h>
2168
2169 .sp
2170 .HP 25
2171 zzip_ssize_t \ \fBzzip_read\fR\ (ZZIP_FILE\ *\ fp, char\ *\ buf, zzip_size_t\ len);
2172 .HP 25
2173 zzip_size_t \ \fBzzip_fread\fR\ (void\ *ptr, zzip_size_t\ size, zzip_size_t\ nmemb, ZZIP_FILE\ *file);
2174 .ad
2175 .hy
2176
2177 .SH "DESCRIPTION"
2178
2179 .PP
2180  \fBThe zzip_read function\fR will read(2) data from a real/zipped file\&.
2181
2182 .PP
2183 the replacement for \fBread\fR(2) will fill the given buffer with bytes from the opened file\&. It will return the number of bytes read, so if the EOF is encountered you will be prompted with the number of bytes actually read\&.
2184
2185 .PP
2186 If the file\-handle is wrapping a stat'able file then it will actually just perform a normal \fBread\fR(2)\-call, otherwise \fBzzip_file_read\fR is called to decompress the data stream and any error is mapped to \fBerrno\fR(3)\&.
2187
2188 .PP
2189
2190
2191 .SH "AUTHOR"
2192
2193 .TP 3
2194 \(bu
2195 Guido Draheim <guidod@gmx\&.de>
2196 .TP
2197 \(bu
2198 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
2199 .TP
2200 \(bu
2201 Guido Draheim <guidod@gmx\&.de>
2202 .TP
2203 \(bu
2204 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
2205 .LP
2206
2207 zzip_readdir.3/ 1071214812  500   0     100664  1035      `
2208 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2209 .de Sh \" Subsection
2210 .br
2211 .if t .Sp
2212 .ne 5
2213 .PP
2214 \fB\\$1\fR
2215 .PP
2216 ..
2217 .de Sp \" Vertical space (when we can't use .PP)
2218 .if t .sp .5v
2219 .if n .sp
2220 ..
2221 .de Ip \" List item
2222 .br
2223 .ie \\n(.$>=3 .ne \\$3
2224 .el .ne 3
2225 .IP "\\$1" \\$2
2226 ..
2227 .TH "ZZIP_READDIR" 3 "0.13.24" "zziplib" "zzip_readdir"
2228 .SH NAME
2229 zzip_readdir \- (zzip/dir.c)
2230 .SH "SYNOPSIS"
2231 .ad l
2232 .hy 0
2233
2234
2235
2236
2237 #include <zzip/lib\&.h>
2238
2239 .sp
2240 .HP 29
2241 ZZIP_DIRENT*\ \ \fBzzip_readdir\fR\ (ZZIP_DIR\ *\ dir);
2242 .ad
2243 .hy
2244
2245 .SH "DESCRIPTION"
2246
2247 .PP
2248  \fBThe zzip_readdir function\fR is the equivalent of a \fBreaddir\fR(2) for a realdir or a zipfile referenced by the ZZIP_DIR returned from \fBzzip_opendir\fR\&.
2249
2250 .PP
2251 The ZZIP_DIR handle (as returned by \fBzzip_opendir\fR) contains a few more entries than being copied into the ZZIP_DIRENT\&. The only valid fields in a ZZIP_DIRENT are d_name (the file name), d_compr (compression), d_csize (compressed size), st_size (uncompressed size)\&.
2252
2253 .SH "AUTHOR"
2254
2255 .TP 3
2256 \(bu
2257 Guido Draheim <guidod@gmx\&.de>
2258 .LP
2259
2260
2261 zzip_realdir.3/ 1071214812  500   0     100664  26        `
2262 .so man3/zzip_file_real.3
2263 zzip_realfd.3/  1071214812  500   0     100664  26        `
2264 .so man3/zzip_file_real.3
2265 zzip_rewind.3/  1071214812  500   0     100664  799       `
2266 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2267 .de Sh \" Subsection
2268 .br
2269 .if t .Sp
2270 .ne 5
2271 .PP
2272 \fB\\$1\fR
2273 .PP
2274 ..
2275 .de Sp \" Vertical space (when we can't use .PP)
2276 .if t .sp .5v
2277 .if n .sp
2278 ..
2279 .de Ip \" List item
2280 .br
2281 .ie \\n(.$>=3 .ne \\$3
2282 .el .ne 3
2283 .IP "\\$1" \\$2
2284 ..
2285 .TH "ZZIP_REWIND" 3 "0.13.24" "zziplib" "zzip_rewind"
2286 .SH NAME
2287 zzip_rewind \- (zzip/file.c)
2288 .SH "SYNOPSIS"
2289 .ad l
2290 .hy 0
2291
2292
2293
2294
2295 #include <zzip/lib\&.h>
2296
2297 .sp
2298 .HP 18
2299 int \ \fBzzip_rewind\fR\ (ZZIP_FILE\ *fp);
2300 .ad
2301 .hy
2302
2303 .SH "DESCRIPTION"
2304
2305 .PP
2306  \fBThe zzip_rewind function\fR will rewind a real/zipped file\&.
2307
2308 .PP
2309 It seeks to the beginning of this file's data in the zip, or the beginning of the file for a stat'fd\&.
2310
2311 .SH "AUTHOR"
2312
2313 .TP 3
2314 \(bu
2315 Guido Draheim <guidod@gmx\&.de>
2316 .TP
2317 \(bu
2318 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
2319 .LP
2320
2321
2322 /544            1071214812  500   0     100664  1264      `
2323 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2324 .de Sh \" Subsection
2325 .br
2326 .if t .Sp
2327 .ne 5
2328 .PP
2329 \fB\\$1\fR
2330 .PP
2331 ..
2332 .de Sp \" Vertical space (when we can't use .PP)
2333 .if t .sp .5v
2334 .if n .sp
2335 ..
2336 .de Ip \" List item
2337 .br
2338 .ie \\n(.$>=3 .ne \\$3
2339 .el .ne 3
2340 .IP "\\$1" \\$2
2341 ..
2342 .TH "ZZIP_REWINDDIR" 3 "0.13.24" "zziplib" "zzip_rewinddir"
2343 .SH NAME
2344 zzip_rewinddir, zzip_telldir, zzip_seekdir \- (zzip/dir.c)
2345 .SH "SYNOPSIS"
2346 .ad l
2347 .hy 0
2348
2349
2350
2351
2352 #include <zzip/lib\&.h>
2353
2354 .sp
2355 .HP 23
2356 void\ \ \fBzzip_rewinddir\fR\ (ZZIP_DIR\ *\ dir);
2357 .HP 27
2358 zzip_off_t\ \ \fBzzip_telldir\fR\ (ZZIP_DIR*\ dir);
2359 .HP 20
2360 void \ \fBzzip_seekdir\fR\ (ZZIP_DIR*\ dir, zzip_off_t\ offset);
2361 .ad
2362 .hy
2363
2364 .SH "DESCRIPTION"
2365
2366 .PP
2367  \fBThe zzip_rewinddir function\fR is the equivalent of a \fBrewinddir\fR(2) for a realdir or the zipfile in place of a directory\&. The ZZIP_DIR handle returned from \fBzzip_opendir\fR has a flag saying realdir or zipfile\&. As for a zipfile, the filenames will include the filesubpath, so take care\&.
2368
2369 .PP
2370  \fBThe zzip_telldir function\fR is the equivalent of \fBtelldir\fR(2) for a realdir or zipfile\&.
2371
2372 .PP
2373  \fBThe zzip_seekdir function\fR is the equivalent of \fBseekdir\fR(2) for a realdir or zipfile\&.
2374
2375 .SH "AUTHOR"
2376
2377 .TP 3
2378 \(bu
2379 Guido Draheim <guidod@gmx\&.de>
2380 .LP
2381
2382 zzip_seek.3/    1071214812  500   0     100664  1339      `
2383 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2384 .de Sh \" Subsection
2385 .br
2386 .if t .Sp
2387 .ne 5
2388 .PP
2389 \fB\\$1\fR
2390 .PP
2391 ..
2392 .de Sp \" Vertical space (when we can't use .PP)
2393 .if t .sp .5v
2394 .if n .sp
2395 ..
2396 .de Ip \" List item
2397 .br
2398 .ie \\n(.$>=3 .ne \\$3
2399 .el .ne 3
2400 .IP "\\$1" \\$2
2401 ..
2402 .TH "ZZIP_SEEK" 3 "0.13.24" "zziplib" "zzip_seek"
2403 .SH NAME
2404 zzip_seek \- (zzip/file.c)
2405 .SH "SYNOPSIS"
2406 .ad l
2407 .hy 0
2408
2409
2410
2411
2412 #include <zzip/lib\&.h>
2413
2414 .sp
2415 .HP 23
2416 zzip_off_t \ \fBzzip_seek\fR\ (ZZIP_FILE\ *\ fp, zzip_off_t\ offset, int\ whence);
2417 .ad
2418 .hy
2419
2420 .SH "DESCRIPTION"
2421
2422 .PP
2423  \fBThe zzip_seek function\fR will perform a \fBlseek\fR(2) operation on a real/zipped file
2424
2425 .PP
2426 It will try to seek to the offset specified by offset, relative to whence, which is one of SEEK_SET, SEEK_CUR or SEEK_END\&.
2427
2428 .PP
2429 If the file\-handle is wrapping a stat'able file then it will actually just perform a normal \fBlseek\fR(2)\-call\&. Otherwise the relative offset is calculated, negative offsets are transformed into positive ones by rewinding the file, and then data is read until the offset is reached\&. This can make the function terribly slow, but this is how gzio implements it, so I'm not sure there is a better way without using the internals of the algorithm\&.
2430
2431 .SH "AUTHOR"
2432
2433 .TP 3
2434 \(bu
2435 Guido Draheim <guidod@gmx\&.de>
2436 .TP
2437 \(bu
2438 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
2439 .LP
2440
2441
2442 zzip_seekdir.3/ 1071214812  500   0     100664  26        `
2443 .so man3/zzip_rewinddir.3
2444 zzip_seterror.3/1071214812  500   0     100664  22        `
2445 .so man3/zzip_error.3
2446 zzip_strerror.3/1071214812  500   0     100664  1317      `
2447 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2448 .de Sh \" Subsection
2449 .br
2450 .if t .Sp
2451 .ne 5
2452 .PP
2453 \fB\\$1\fR
2454 .PP
2455 ..
2456 .de Sp \" Vertical space (when we can't use .PP)
2457 .if t .sp .5v
2458 .if n .sp
2459 ..
2460 .de Ip \" List item
2461 .br
2462 .ie \\n(.$>=3 .ne \\$3
2463 .el .ne 3
2464 .IP "\\$1" \\$2
2465 ..
2466 .TH "ZZIP_STRERROR" 3 "0.13.24" "zziplib" "zzip_strerror"
2467 .SH NAME
2468 zzip_strerror, zzip_strerror_of \- (zzip/err.c)
2469 .SH "SYNOPSIS"
2470 .ad l
2471 .hy 0
2472
2473
2474
2475
2476 #include <zzip/lib\&.h>
2477
2478 .sp
2479 .HP 30
2480 zzip_char_t*\ \ \fBzzip_strerror\fR\ (int\ errcode);
2481 .HP 33
2482 zzip_char_t*\ \ \fBzzip_strerror_of\fR\ (ZZIP_DIR*\ dir);
2483 .ad
2484 .hy
2485
2486 .SH "DESCRIPTION"
2487
2488 .PP
2489 returns the static string for the given error code\&. The error code can be either a normal system error (a positive error code will flag this), it can be \fBlibz\fR error code (a small negative error code will flag this) or it can be an error code from \fBlibzzip\fR, which is an negative value lower than \fBZZIP_ERROR\fR 
2490
2491 .PP
2492  \fBThe zzip_strerror_of function\fR fetches the errorcode from the \fBDIR\fR\-handle and runs it through \fBzzip_strerror\fR to obtain the static string describing the error\&.
2493
2494 .SH "AUTHOR"
2495
2496 .TP 3
2497 \(bu
2498 Guido Draheim <guidod@gmx\&.de>
2499 .TP
2500 \(bu
2501 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
2502 .TP
2503 \(bu
2504 Guido Draheim <guidod@gmx\&.de>
2505 .TP
2506 \(bu
2507 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
2508 .LP
2509
2510
2511 /562            1071214812  500   0     100664  25        `
2512 .so man3/zzip_strerror.3
2513
2514 zzip_sync.3/    1071214812  500   0     100664  23        `
2515 .so man3/zzip_mkfifo.3
2516
2517 zzip_tell.3/    1071214812  500   0     100664  1061      `
2518 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2519 .de Sh \" Subsection
2520 .br
2521 .if t .Sp
2522 .ne 5
2523 .PP
2524 \fB\\$1\fR
2525 .PP
2526 ..
2527 .de Sp \" Vertical space (when we can't use .PP)
2528 .if t .sp .5v
2529 .if n .sp
2530 ..
2531 .de Ip \" List item
2532 .br
2533 .ie \\n(.$>=3 .ne \\$3
2534 .el .ne 3
2535 .IP "\\$1" \\$2
2536 ..
2537 .TH "ZZIP_TELL" 3 "0.13.24" "zziplib" "zzip_tell"
2538 .SH NAME
2539 zzip_tell \- (zzip/file.c)
2540 .SH "SYNOPSIS"
2541 .ad l
2542 .hy 0
2543
2544
2545
2546
2547 #include <zzip/lib\&.h>
2548
2549 .sp
2550 .HP 23
2551 zzip_off_t \ \fBzzip_tell\fR\ (ZZIP_FILE\ *\ fp);
2552 .ad
2553 .hy
2554
2555 .SH "DESCRIPTION"
2556
2557 .PP
2558  \fBThe zzip_tell function\fR will \fBtell\fR(2) the current position in a real/zipped file
2559
2560 .PP
2561 It will return the current offset within the real/zipped file, measured in uncompressed bytes for the zipped\-file case\&.
2562
2563 .PP
2564 If the file\-handle is wrapping a stat'able file then it will actually just perform a normal \fBtell\fR(2)\-call, otherwise the offset is calculated from the amount of data left and the total uncompressed size;
2565
2566 .SH "AUTHOR"
2567
2568 .TP 3
2569 \(bu
2570 Guido Draheim <guidod@gmx\&.de>
2571 .TP
2572 \(bu
2573 Tomi Ollila <Tomi\&.Ollila@iki\&.fi>
2574 .LP
2575
2576
2577 zzip_telldir.3/ 1071214812  500   0     100664  26        `
2578 .so man3/zzip_rewinddir.3
2579 /582            1071214812  500   0     100664  867       `
2580 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2581 .de Sh \" Subsection
2582 .br
2583 .if t .Sp
2584 .ne 5
2585 .PP
2586 \fB\\$1\fR
2587 .PP
2588 ..
2589 .de Sp \" Vertical space (when we can't use .PP)
2590 .if t .sp .5v
2591 .if n .sp
2592 ..
2593 .de Ip \" List item
2594 .br
2595 .ie \\n(.$>=3 .ne \\$3
2596 .el .ne 3
2597 .IP "\\$1" \\$2
2598 ..
2599 .TH "__ZZIP_TRY_OPEN" 3 "0.13.24" "zziplib" "__zzip_try_open"
2600 .SH NAME
2601 __zzip_try_open \- (zzip/zip.c)
2602 .SH "SYNOPSIS"
2603 .ad l
2604 .hy 0
2605
2606
2607
2608
2609 #include <zzip/lib\&.h>
2610
2611 .sp
2612 .HP 22
2613 int \ \fB__zzip_try_open\fR\ (zzip_char_t*\ filename, int\ filemode, zzip_strings_t*\ ext, zzip_plugin_io_t\ io);
2614 .ad
2615 .hy
2616
2617 .SH "DESCRIPTION"
2618
2619 .PP
2620 will attach a \&.zip extension and tries to open it the with \fBopen\fR(2)\&. This is a helper function for \fBzzip_dir_open\fR, \fBzzip_opendir\fR and \fBzzip_open\fR\&.
2621
2622 .SH "AUTHOR"
2623
2624 .TP 3
2625 \(bu
2626 Guido Draheim <guidod@gmx\&.de>
2627 .TP
2628 \(bu
2629 Tomi Ollila <too@iki\&.fi>
2630 .LP
2631
2632
2633 zzip_write.3/   1071214812  500   0     100664  2266      `
2634 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2635 .de Sh \" Subsection
2636 .br
2637 .if t .Sp
2638 .ne 5
2639 .PP
2640 \fB\\$1\fR
2641 .PP
2642 ..
2643 .de Sp \" Vertical space (when we can't use .PP)
2644 .if t .sp .5v
2645 .if n .sp
2646 ..
2647 .de Ip \" List item
2648 .br
2649 .ie \\n(.$>=3 .ne \\$3
2650 .el .ne 3
2651 .IP "\\$1" \\$2
2652 ..
2653 .TH "ZZIP_WRITE" 3 "0.13.24" "zziplib" "zzip_write"
2654 .SH NAME
2655 zzip_write, zzip_file_write, zzip_fwrite \- write to zzip storage
2656 .SH "SYNOPSIS"
2657 .ad l
2658 .hy 0
2659
2660
2661  #include <zziplib\&.h>
2662
2663 .sp
2664 .HP 26
2665 zzip_ssize_t \ \fBzzip_write\fR\ (ZZIP_FILE*\ file, const\ void*\ ptr, zzip_size_t\ len);
2666 .HP 31
2667 zzip_ssize_t \ \fBzzip_file_write\fR\ (ZZIP_FILE*\ file, const\ void*\ ptr, zzip_size_t\ len);
2668 .HP 26
2669 zzip_size_t \ \fBzzip_fwrite\fR\ (const\ void*\ ptr, zzip_size_t\ len, zzip_size_t\ multiply, ZZIP_FILE*\ file);
2670 .ad
2671 .hy
2672
2673 .SH "DESCRIPTION"
2674
2675 .PP
2676
2677
2678 .PP
2679  \fBThe zzip_write function\fR will write data to a file descriptor\&. If the file descriptor represents a real file then it will be forwarded to call posix \fBwrite\fR(2) directly\&. If it is a descriptor for a file within a zip directory then the data will be "deflated" using \fBzlib\fR(3) and appended to the zip archive file\&.
2680
2681 .PP
2682
2683
2684 .PP
2685  \fBThe zzip_file_write function\fR will write data to a file descriptor inside a zip archive\&. The data will be "deflated" using \fBzlib\fR(3) compression and appended to the end of the zip archive file\&. Only one file descriptor may be open per zzip_dir archive handle (fifo\-like)\&.
2686
2687 .PP
2688  \fBThe zzip_file_write function\fR is not yet implemented, check for #def ZZIP_NO_CREAT It returns immediately \-1 and sets errno=EROFS for indication\&.
2689
2690 .PP
2691  \fBThe zzip_fwrite function\fR is the stdc variant for writing and the arguments are forwarded to \fBzzip_write\fR \- the return value is floored to null as for STDC spec but there is no zzip_ferror call so far for the zziplib (later? is it actually needed?)\&.
2692
2693 .PP
2694  \fBThe zzip_fwrite function\fR is not yet implemented, check for #def ZZIP_NO_CREAT Write\-support extends \fBzzip_close\fR with semantics to write out a file\-trailer to the zip\-archive leaving a name/offset marker in the (still\-open) ZZIP_DIR handle\&.
2695
2696 .SH "AUTHOR"
2697
2698 .TP 3
2699 \(bu
2700 Guido Draheim <guidod@gmx\&.de>
2701 .LP
2702
2703 .SH "SEE ALSO"
2704
2705 .PP
2706 write(2), zlib(3), zzip_file_creat
2707