1ZIP_SOURCE_ZIP(3)        BSD Library Functions Manual        ZIP_SOURCE_ZIP(3)
2

NAME

4     zip_source_zip, zip_source_zip_create — create data source from zip file
5

LIBRARY

7     libzip (-lzip)
8

SYNOPSIS

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
16     zip_source_t *
17     zip_source_zip_create(zip_t *srcarchive, zip_uint64_t srcidx,
18         zip_flags_t flags, zip_uint64_t start, zip_int64_t len,
19         zip_error_t *error);
20

DESCRIPTION

22     The functions zip_source_zip() and zip_source_zip_create() create a zip
23     source from a file in a zip archive.  The srcarchive argument is the
24     (open) zip archive containing the source zip file at index srcidx.  len
25     bytes from offset start will be used in the zip_source.  If len is 0 or
26     -1, the rest of the file, starting from start, is used.  If start is zero
27     and len is -1, the whole file will be copied without decompressing it.
28
29     Supported flags are:
30
31     ZIP_FL_UNCHANGED       Try to get the original data without any changes
32                            that may have been made to srcarchive after open‐
33                            ing it.
34
35     ZIP_FL_RECOMPRESS      When adding the data from srcarchive, re-compress
36                            it using the current settings instead of copying
37                            the compressed data.
38

RETURN VALUES

40     Upon successful completion, the created source is returned.  Otherwise,
41     NULL is returned and the error code in archive or error is set to indi‐
42     cate the error.
43

ERRORS

45     zip_source_zip() and zip_source_zip_create() fail if:
46
47     [ZIP_ER_CHANGED]   Unchanged data was requested, but it is not available.
48
49     [ZIP_ER_INVAL]     srcarchive, srcidx, start, or len are invalid.
50
51     [ZIP_ER_MEMORY]    Required memory could not be allocated.
52     Additionally, it can return all error codes from zip_stat_index() and
53     zip_fopen_index().
54

SEE ALSO

56     libzip(3), zip_file_add(3), zip_file_replace(3), zip_source(3)
57

HISTORY

59     zip_source_zip() was added in libzip 1.0.  zip_source_zip_create() was
60     added in libzip 1.8.0.
61

AUTHORS

63     Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
64
65BSD                              April 4, 2021                             BSD
Impressum