1ZIP_SOURCE_ZIP(3) BSD Library Functions Manual ZIP_SOURCE_ZIP(3)
2
4 zip_source_zip — create data source from zip file
5
7 libzip (-lzip)
8
10 #include <zip.h>
11
12 zip_source_t *
13 zip_source_zip(zip_t *archive, zip_t *srcarchive, zip_uint64_t srcidx,
14 zip_flags_t flags, zip_uint64_t start, zip_int64_t len);
15
17 The function zip_source_zip() creates a zip source from a file in a zip
18 archive. The srcarchive argument is the (open) zip archive containing
19 the source zip file at index srcidx. len bytes from offset start will be
20 used in the zip_source. If len is 0 or -1, the rest of the file, start‐
21 ing from start, is used. If start is zero and len is -1, the whole file
22 will be copied without decompressing it.
23
24 Supported flags are:
25
26 ZIP_FL_UNCHANGED Try to get the original data without any changes
27 that may have been made to srcarchive after open‐
28 ing it.
29
30 ZIP_FL_RECOMPRESS When adding the data from srcarchive, re-compress
31 it using the current settings instead of copying
32 the compressed data.
33
35 Upon successful completion, the created source is returned. Otherwise,
36 NULL is returned and the error code in archive is set to indicate the
37 error.
38
40 zip_source_zip() fails if:
41
42 [ZIP_ER_CHANGED] Unchanged data was requested, but it is not available.
43
44 [ZIP_ER_INVAL] srcarchive, srcidx, start, or len are invalid.
45
46 [ZIP_ER_MEMORY] Required memory could not be allocated.
47 Additionally, it can return all error codes from zip_stat_index() and
48 zip_fopen_index().
49
51 libzip(3), zip_file_add(3), zip_file_replace(3), zip_source(3)
52
54 zip_source_zip() was added in libzip 1.0.
55
57 Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
58
59BSD December 18, 2017 BSD