1ZZIP_DISK_FOPEN(3) zziplib Function List ZZIP_DISK_FOPEN(3)
2
3
4
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
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
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_FILE* is rather simple in just encapsulating the
32 arguments given to the zzip_disk_entry_fopen function plus a zlib
33 deflate buffer. Note that the ZZIP_DISK pointer does already contain
34 the full mmapped file area of a zip disk, so open()ing a file part
35 within that area happens to be a lookup of its bounds and encoding.
36 That information is memorized on the ZZIP_DISK_FILE so that subsequent
37 _read() operations will be able to get the next data portion or return
38 an eof condition for that file part wrapped in the zip archive.
39
40 The zzip_disk_fread function reads more bytes into the output buffer
41 specified as arguments. The return value is null on eof or error, the
42 stdio-like interface can not distinguish between these so you need to
43 check with zzip_disk_feof for the difference.
44
45 The zzip_disk_fclose function releases any zlib decoder info needed for
46 decompression and dumps the ZZIP_DISK_FILE* then.
47
48 The zzip_disk_feof function allows to distinguish an error from an eof
49 condition. Actually, if we found an error but we did already reach eof
50 then we just keep on saying that it was an eof, so the app can just
51 continue.
52
54 ยท Guido Draheim <guidod@gmx.de>
55
57 Copyright (c) 2003,2004,2006 Guido Draheim All rights reserved, use
58 under the restrictions of the Lesser GNU General Public License or
59 alternatively the restrictions of the Mozilla Public License 1.1
60
61
62
63zziplib 0.13.49 ZZIP_DISK_FOPEN(3)