1ZIP_SOURCE_BUFFER(3) BSD Library Functions Manual ZIP_SOURCE_BUFFER(3)
2
4 zip_source_buffer, zip_source_buffer_create — create zip data source from
5 buffer
6
8 libzip (-lzip)
9
11 #include <zip.h>
12
13 zip_source_t *
14 zip_source_buffer(zip_t *archive, const void *data, zip_uint64_t len,
15 int freep);
16
17 zip_source_t *
18 zip_source_buffer_create(const void *data, zip_uint64_t len, int freep,
19 zip_error_t *error);
20
22 The functions zip_source_buffer() and zip_source_buffer_create() create a
23 zip source from the buffer data of size len. If freep is non-zero, the
24 buffer will be freed when it is no longer needed. data must remain valid
25 for the lifetime of the created source.
26
27 The source can be used to open a zip archive from.
28
30 Upon successful completion, the created source is returned. Otherwise,
31 NULL is returned and the error code in archive or error is set to indi‐
32 cate the error.
33
35 zip_source_buffer() and zip_source_buffer_create() fail if:
36
37 [ZIP_ER_INVAL] len is greater than zero and data is NULL.
38
39 [ZIP_ER_MEMORY] Required memory could not be allocated.
40
42 libzip(3), zip_file_add(3), zip_file_replace(3), zip_open_from_source(3),
43 zip_source(3)
44
46 zip_source_buffer() and zip_source_buffer_create() were added in libzip
47 1.0.
48
50 Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
51
52BSD December 18, 2017 BSD