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     (obsolete interface)
6

LIBRARY

8     libzip (-lzip)
9

SYNOPSIS

11     #include <zip.h>
12
13     zip_source_t *
14     zip_source_zip(zip_t *archive, zip_t *srcarchive, zip_uint64_t srcidx,
15         zip_flags_t flags, zip_uint64_t start, zip_int64_t len);
16
17     zip_source_t *
18     zip_source_zip_create(zip_t *srcarchive, zip_uint64_t srcidx,
19         zip_flags_t flags, zip_uint64_t start, zip_int64_t len,
20         zip_error_t *error);
21

DESCRIPTION

23     The functions zip_source_zip() and zip_source_zip_create() are the obso‐
24     lete versions of zip_source_zip_file(3) or zip_source_zip_file_create(3)
25     respectively.  If you want to get the compressed data of the complete
26     file, use
27           zip_source_zip_file(za, source_archive, source_index,
28           ZIP_FL_COMPRESSED, 0, -1, NULL)
29
30     The functions zip_source_zip() and zip_source_zip_create() create a zip
31     source from a file in a zip archive.  The srcarchive argument is the
32     (open) zip archive containing the source zip file at index srcidx.  len
33     bytes from offset start will be used in the zip_source.  If len is 0 or
34     -1, the rest of the file, starting from start, is used.  If start is zero
35     and len is -1, the whole file will be copied without decompressing it.
36
37     Supported flags are:
38     Try to get the original data without any changes that may have been made
39     to srcarchive after opening it.
40

RETURN VALUES

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

ERRORS

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

SEE ALSO

58     libzip(3), zip_file_add(3), zip_file_replace(3), zip_source(3)
59

HISTORY

61     zip_source_zip() was added in libzip 1.0.  zip_source_zip_create() was
62     added in libzip 1.8.0.  Both were deprecated in libzip 1.10.0.  Use
63     zip_source_zip_file() or instead.
64

AUTHORS

66     Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
67
68BSD                            January 23, 2023                            BSD
Impressum