1ZIP_SOURCE_FILEP(3) BSD Library Functions Manual ZIP_SOURCE_FILEP(3)
2
4 zip_source_filep, zip_source_filep_create — create data source from FILE
5 *
6
8 libzip (-lzip)
9
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
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. For a description of the len argument,
25 see zip_source_file(3).
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
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
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
46 libzip(3), zip_file_add(3), zip_file_replace(3), zip_source(3),
47 zip_source_file(3)
48
50 zip_source_filep() and zip_source_filep_create() were added in libzip
51 1.0.
52
53 ZIP_LENGTH_TO_END and ZIP_LENGTH_UNCHECKED were added in libzip 1.10.1.
54
56 Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
57
58BSD June 30, 2023 BSD