Imported Upstream version 1.1.3
[platform/upstream/libzip.git] / man / zip_source_zip.man
1 .TH "ZIP_SOURCE_ZIP" "3" "August 2, 2014" "NiH" "Library Functions Manual"
2 .nh
3 .if n .ad l
4 .SH "NAME"
5 \fBzip_source_zip\fR
6 \- create data source from zip file
7 .SH "LIBRARY"
8 libzip (-lzip)
9 .SH "SYNOPSIS"
10 \fB#include <zip.h>\fR
11 .sp
12 \fIzip_source_t *\fR
13 .PD 0
14 .HP 4n
15 \fBzip_source_zip\fR(\fIzip_t\ *archive\fR, \fIzip_t\ *srcarchive\fR, \fIzip_uint64_t\ srcidx\fR, \fIzip_flags_t\ flags\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ len\fR);
16 .PD
17 .SH "DESCRIPTION"
18 The function
19 \fBzip_source_zip\fR()
20 creates a zip source from a file in a zip archive.
21 The
22 \fIsrcarchive\fR
23 argument is the (open) zip archive containing the source zip file
24 at index
25 \fIsrcidx\fR.
26 \fIlen\fR
27 bytes from offset
28 \fIstart\fR
29 will be used in the zip_source.
30 If
31 \fIlen\fR
32 is 0 or \-1, the rest of the file, starting from
33 \fIstart\fR,
34 is used.
35 If
36 \fIstart\fR
37 is zero and
38 \fIlen\fR
39 is \-1, the whole file will be copied without decompressing it.
40 .PP
41 Supported flags are:
42 .TP 23n
43 \fRZIP_FL_UNCHANGED\fR
44 Try to get the original data without any changes that may have been
45 made to
46 \fIsrcarchive\fR
47 after opening it.
48 .TP 23n
49 \fRZIP_FL_RECOMPRESS\fR
50 When adding the data from
51 \fIsrcarchive\fR,
52 re-compress it using the current settings instead of copying the
53 compressed data.
54 .SH "RETURN VALUES"
55 Upon successful completion, the created source is returned.
56 Otherwise,
57 \fRNULL\fR
58 is returned and the error code in
59 \fIarchive\fR
60 is set to indicate the error.
61 .SH "ERRORS"
62 \fBzip_source_zip\fR()
63 fails if:
64 .TP 19n
65 [\fRZIP_ER_CHANGED\fR]
66 Unchanged data was requested, but it is not available.
67 .TP 19n
68 [\fRZIP_ER_INVAL\fR]
69 \fIsrcarchive\fR,
70 \fIsrcidx\fR,
71 \fIstart\fR,
72 or
73 \fIlen\fR
74 are invalid.
75 .TP 19n
76 [\fRZIP_ER_MEMORY\fR]
77 Required memory could not be allocated.
78 .PD 0
79 .PP
80 Additionally, it can return all error codes from
81 \fBzip_stat_index\fR()
82 and
83 \fBzip_fopen_index\fR().
84 .PD
85 .SH "SEE ALSO"
86 libzip(3),
87 zip_add(3),
88 zip_replace(3),
89 zip_source(3)
90 .SH "AUTHORS"
91 Dieter Baron <\fIdillo@nih.at\fR>
92 and
93 Thomas Klausner <\fItk@giga.or.at\fR>