7e26c44d7b0c7476d2bb61342bb1121f7582fde9
[platform/upstream/libzip.git] / man / zip_source_buffer.man
1 .TH "ZIP_SOURCE_BUFFER" "3" "October 17, 2014" "NiH" "Library Functions Manual"
2 .nh
3 .if n .ad l
4 .SH "NAME"
5 \fBzip_source_buffer\fR
6 \- create zip data source from buffer
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_buffer\fR(\fIzip_t\ *archive\fR, \fIconst\ void\ *data\fR, \fIzip_uint64_t\ len\fR, \fIint\ freep\fR);
16 .PD
17 .PP
18 \fIzip_source_t *\fR
19 .PD 0
20 .HP 4n
21 \fBzip_source_buffer_create\fR(\fIconst\ void\ *data\fR, \fIzip_uint64_t\ len\fR, \fIint\ freep\fR, \fIzip_error_t\ *error\fR);
22 .PD
23 .SH "DESCRIPTION"
24 The functions
25 \fBzip_source_buffer\fR()
26 and
27 \fBzip_source_buffer_create\fR()
28 create a zip source from the buffer
29 \fIdata\fR
30 of size
31 \fIlen\fR.
32 If
33 \fIfreep\fR
34 is non-zero, the buffer will be freed when it is no longer needed.
35 \fIdata\fR
36 must remain valid for the lifetime of the created source.
37 .PP
38 The source can be used to open a zip archive from.
39 .SH "RETURN VALUES"
40 Upon successful completion, the created source is returned.
41 Otherwise,
42 \fRNULL\fR
43 is returned and the error code in
44 \fIarchive\fR
45 or
46 \fIerror\fR
47 is set to indicate the error.
48 .SH "ERRORS"
49 \fBzip_source_buffer\fR()
50 and
51 \fBzip_source_buffer_create\fR()
52 fail if:
53 .TP 19n
54 [\fRZIP_ER_INVAL\fR]
55 \fIlen\fR
56 is greater than zero and
57 \fIdata\fR
58 is
59 \fRNULL\fR.
60 .TP 19n
61 [\fRZIP_ER_MEMORY\fR]
62 Required memory could not be allocated.
63 .SH "SEE ALSO"
64 libzip(3),
65 zip_add(3),
66 zip_open_from_source(3),
67 zip_replace(3),
68 zip_source(3)
69 .SH "AUTHORS"
70 Dieter Baron <\fIdillo@nih.at\fR>
71 and
72 Thomas Klausner <\fItk@giga.or.at\fR>