1ZIP_SOURCE_FILEP(3)      BSD Library Functions Manual      ZIP_SOURCE_FILEP(3)
2

NAME

4     zip_source_filep, zip_source_filep_create — create data source from FILE
5     *
6

LIBRARY

8     libzip (-lzip)
9

SYNOPSIS

11     #include <zip.h>
12
13     zip_source_t *
14     zip_source_filep(zip_t *archive, FILE *file, zip_uint64_t start,
15         zip_int64_t len);
16
17     zip_source_t *
18     zip_source_filep_create(FILE *file, zip_uint64_t start, zip_int64_t len,
19         zip_error_t *error);
20

DESCRIPTION

22     The functions zip_source_filep() and zip_source_filep_create() create a
23     zip source from a file stream.  They read len bytes from offset start
24     from the open file stream file.  If len is 0 or -1, the whole file
25     (starting from start) is used.
26
27     If the file stream supports seeking, the source can be used to open a
28     read-only zip archive from.
29
30     The file stream is closed when the source is being freed, usually by
31     zip_close(3).
32

RETURN VALUES

34     Upon successful completion, the created source is returned.  Otherwise,
35     NULL is returned and the error code in archive or error is set to indi‐
36     cate the error.
37

ERRORS

39     zip_source_filep() fails if:
40
41     [ZIP_ER_INVAL]     file, start, or len are invalid.
42
43     [ZIP_ER_MEMORY]    Required memory could not be allocated.
44

SEE ALSO

46     libzip(3), zip_file_add(3), zip_file_replace(3), zip_source(3)
47

HISTORY

49     zip_source_filep() and zip_source_filep_create() were added in libzip
50     1.0.
51

AUTHORS

53     Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
54
55BSD                            December 18, 2017                           BSD
Impressum