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
14       zzip__new__ ZZIP_ENTRY_FILE *
15       zzip_entry_fopen(ZZIP_ENTRY * entry, int takeover)
16
17       zzip__new__ ZZIP_ENTRY_FILE *
18       zzip_entry_ffile(FILE * disk, char *filename)
19
20       zzip_size_t
21       zzip_entry_fread(void *ptr, zzip_size_t sized, zzip_size_t nmemb,
22                        ZZIP_ENTRY_FILE * file)
23
24       int
25       zzip_entry_fclose(ZZIP_ENTRY_FILE * file)
26
27       int
28       zzip_entry_feof(ZZIP_ENTRY_FILE * file)
29
30
31
32

DESCRIPTION

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

AUTHOR

64        Guido Draheim <guidod@gmx.de>
65
66
67
69        Copyright (c) Guido Draheim, use under copyleft (LGPL,MPL)
70
71
72
73
74
75zziplib                             0.13.72                zzip_entry_fopen(3)
Impressum