1ZZIP_DISK_FOPEN(3)           zziplib Function List          ZZIP_DISK_FOPEN(3)
2
3
4

NAME

6       zzip_disk_fopen, zzip_disk_entry_fopen, zzip_disk_fread,
7       zzip_disk_fclose, zzip_disk_feof - openening a file part wrapped within
8       a (mmapped) zip archive
9

SYNOPSIS

11       #include <zzip/mmapped.h>
12
13       zzip__new__ ZZIP_DISK_FILE *
14                                                    zzip_disk_fopen((ZZIP_DISK * disk, char *filename));
15
16       zzip__new__ ZZIP_DISK_FILE *
17                                                          zzip_disk_entry_fopen((ZZIP_DISK * disk, ZZIP_DISK_ENTRY * entry));
18
19       zzip_size_t
20                                   zzip_disk_fread((void *ptr, zzip_size_t sized, zzip_size_t nmemb, ZZIP_DISK_FILE * file));
21
22       int zzip_disk_fclose((ZZIP_DISK_FILE * file));
23
24       int zzip_disk_feof((ZZIP_DISK_FILE * file));
25

DESCRIPTION

27       The zzip_disk_fopen function opens a file found by name, so it does a
28       search into the zip central directory with zzip_disk_findfile and
29       whatever is found first is given to zzip_disk_entry_fopen
30
31       The zzip_disk_fopen function may return null on errors (errno).
32
33       the ZZIP_DISK_FILE* is rather simple in just encapsulating the
34       arguments given to the zzip_disk_entry_fopen function plus a zlib
35       deflate buffer. Note that the ZZIP_DISK pointer does already contain
36       the full mmapped file area of a zip disk, so open()ing a file part
37       within that area happens to be a lookup of its bounds and encoding.
38       That information is memorized on the ZZIP_DISK_FILE so that subsequent
39       _read() operations will be able to get the next data portion or return
40       an eof condition for that file part wrapped in the zip archive.
41
42       The zzip_disk_entry_fopen function may return null on errors (errno =
43       ENOMEM|EBADMSG).
44
45       The zzip_disk_fread function reads more bytes into the output buffer
46       specified as arguments. The return value is null on eof or error, the
47       stdio-like interface can not distinguish between these so you need to
48       check with zzip_disk_feof for the difference.
49
50       The zzip_disk_fclose function releases any zlib decoder info needed for
51       decompression and dumps the ZZIP_DISK_FILE* then.
52
53       The zzip_disk_fclose function always returns 0.
54
55       The zzip_disk_feof function allows to distinguish an error from an eof
56       condition. Actually, if we found an error but we did already reach eof
57       then we just keep on saying that it was an eof, so the app can just
58       continue.
59
60       The zzip_disk_feof function returns EOF in case and 0 when not at the
61       end of file.
62

AUTHOR

64       ยท   Guido Draheim <guidod@gmx.de>
65
67       Copyright (c)Guido Draheim, use under copyleft (LGPL,MPL)
68
69
70
71zziplib                             0.13.69                 ZZIP_DISK_FOPEN(3)
Impressum