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

NAME

6       zzip_entry_fopen, zzip_entry_ffile, zzip_entry_fread,
7       zzip_entry_fclose, zzip_entry_feof - open a file within a zip disk for
8       reading
9

SYNOPSIS

11       #include <zzip/fseeko.h>
12
13       zzip__new__ ZZIP_ENTRY_FILE *
14                                                      zzip_entry_fopen((ZZIP_ENTRY * entry, int takeover));
15
16       zzip__new__ ZZIP_ENTRY_FILE *
17                                                      zzip_entry_ffile((FILE * disk, char *filename));
18
19       zzip_size_t
20                                    zzip_entry_fread((void *ptr, zzip_size_t sized, zzip_size_t nmemb, ZZIP_ENTRY_FILE * file));
21
22       int zzip_entry_fclose((ZZIP_ENTRY_FILE * file));
23
24       int zzip_entry_feof((ZZIP_ENTRY_FILE * file));
25

DESCRIPTION

27       The zzip_entry_fopen function does take an "entry" argument and copies
28       it (or just takes it over as owner) to a new ZZIP_ENTRY_FILE handle
29       structure. That structure contains also a zlib buffer for decoding. The
30       zzip_entry_fopen function does seek to the file_header of the given
31       "entry" and validates it for the data buffer following it. We do also
32       prefetch some data from the data buffer thereby trying to match the
33       disk pagesize for faster access later. The zzip_entry_fread will then
34       read in chunks of pagesizes which is the size of the internal readahead
35       buffer. If an error occurs then null is returned.
36
37       The zzip_entry_ffile function opens a file found by name, so it does a
38       search into the zip central directory with zzip_entry_findfile and
39       whatever is found first is given to zzip_entry_fopen
40
41       The zzip_entry_fread function reads more bytes into the output buffer
42       specified as arguments. The return value is null on eof or error, the
43       stdio-like interface can not distinguish between these so you need to
44       check with zzip_entry_feof for the difference.
45
46       The zzip_entry_fclose function releases any zlib decoder info needed
47       for decompression and dumps the ZZIP_ENTRY_FILE struct then.
48
49       The zzip_entry_feof function allows to distinguish an error from an eof
50       condition. Actually, if we found an error but we did already reach eof
51       then we just keep on saying that it was an eof, so the app can just
52       continue.
53

AUTHOR

55       ยท   Guido Draheim <guidod@gmx.de>
56
58       Copyright (c) Guido Draheim, use under copyleft (LGPL,MPL)
59
60
61
62zziplib                             0.13.69                ZZIP_ENTRY_FOPEN(3)
Impressum