1ZIP_SOURCE_BUFFER_FRA... BSD Library Functions Manual ZIP_SOURCE_BUFFER_FRA...
2

NAME

4     zip_source_buffer_fragment, zip_source_buffer_fragment_create — create
5     zip data source from multiple buffer
6

LIBRARY

8     libzip (-lzip)
9

SYNOPSIS

11     #include <zip.h>
12
13     zip_source_t *
14     zip_source_buffer_fragment(zip_t *archive,
15         zip_buffer_fragment_t *fragments, zip_uint64_t nfragments,
16         int freep);
17
18     zip_source_t *
19     zip_source_buffer_fragment_create(zip_buffer_fragment_t *fragments,
20         zip_uint64_t nfragments, int freep, zip_error_t *error);
21

DESCRIPTION

23     The functions zip_source_buffer_fragment() and
24     zip_source_buffer_fragment_create() create a zip source from the data in
25     fragments.  nfragments specifies the number of fragments.  If freep is
26     non-zero, the data will be freed when it is no longer needed.
27
28     struct zip_stat {
29         zip_uint8_t *data;    /* pointer to the actual data */
30         zip_uint64_t length;  /* length of this fragment */
31     };
32
33     The data fragments point to must remain valid for the lifetime of the
34     created source.  fragments itself can be discarded once the source is
35     created.
36
37     The source can be used to open a zip archive from.
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_buffer() and zip_source_buffer_create() fail if:
46
47     [ZIP_ER_INVAL]     nfragments is greater than zero and fragments is NULL.
48
49     [ZIP_ER_MEMORY]    Required memory could not be allocated.
50

SEE ALSO

52     libzip(3), zip_file_add(3), zip_file_replace(3), zip_open_from_source(3),
53     zip_source(3)
54

HISTORY

56     zip_source_buffer_fragment() and zip_source_buffer_fragment_create() were
57     added in libzip 1.4.0.
58

AUTHORS

60     Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
61
62BSD                            December 18, 2017                           BSD
Impressum