1ZIP_SOURCE_ZIP(3) Library Functions Manual ZIP_SOURCE_ZIP(3)
2
3
4
6 zip_source_zip - create data source from zip file
7
9 libzip (-lzip)
10
12 #include <zip.h>
13
14 struct zip_source * zip_source_zip(struct zip *archive, struct zip
15 *srcarchive); "zip_uint64_t srcidx" "int flags" "zip_uint64_t start"
16 "zip_int64_t len"
17
19 The function zip_source_zip creates a zip source from a file in a zip
20 archive. The srcarchive argument is the (open) zip archive containing
21 the source zip file at index srcidx. len bytes from offset start will
22 be used in the zip_source. If len is 0 or -1, the rest of the file,
23 starting from start, is used. If start is zero and len is -1, the
24 whole file will be copied without decompressing it.
25
26 Supported flags are:
27
28 ZIP_FL_UNCHANGED Try to get the original data without any
29 changes that may have been made to
30 srcarchive after opening it.
31
32 ZIP_FL_RECOMPRESS When adding the data from srcarchive, re-
33 compress it using the current settings
34 instead of copying the compressed data.
35
37 Upon successful completion, the created source is returned. Otherwise,
38 NULL is returned and the error code in archive is set to indicate the
39 error.
40
42 zip_source_zip fails if:
43
44 [ZIP_ER_CHANGED]
45 Unchanged data was requested, but it is not available.
46
47 [ZIP_ER_INVAL]
48 srcarchive, srcidx, start, or len are invalid.
49
50 [ZIP_ER_MEMORY]
51 Required memory could not be allocated.
52 Additionally, it can return all error codes from zip_stat_index and
53 zip_fopen_index.
54
56 libzip(3), zip_add(3), zip_replace(3), zip_source_buffer(3),
57 zip_source_file(3), zip_source_filep(3), zip_source_free(3),
58 zip_source_function(3)
59
61 Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at>
62
63
64
65NiH June 4, 2008 ZIP_SOURCE_ZIP(3)