1ZIP_SOURCE_STAT(3) BSD Library Functions Manual ZIP_SOURCE_STAT(3)
2
4 zip_source_stat — get information about zip_source
5
7 libzip (-lzip)
8
10 #include <zip.h>
11
12 int
13 zip_source_stat(zip_source_t *source, zip_stat_t *sb);
14
16 The zip_source_stat() function obtains information about the zip source
17 source
18
19 The sb argument is a pointer to a struct zip_source_stat (shown below),
20 into which information about the zip source is placed.
21
22 struct zip_source_stat {
23 zip_uint64_t valid; /* which fields have valid values */
24 const char *name; /* name of the file */
25 zip_uint64_t index; /* index within archive */
26 zip_uint64_t size; /* size of file (uncompressed) */
27 zip_uint64_t comp_size; /* size of file (compressed) */
28 time_t mtime; /* modification time */
29 zip_uint32_t crc; /* crc of file data */
30 zip_uint16_t comp_method; /* compression method used */
31 zip_uint16_t encryption_method; /* encryption method used */
32 zip_uint32_t flags; /* reserved for future use */
33 };
34 The structure pointed to by sb must be initialized with zip_stat_init(3)
35 before calling zip_source_stat().
36
37 The valid field of the structure specifies which other fields are valid.
38 Check if the flag defined by the following defines are in valid before
39 accessing the fields:
40 ZIP_STAT_NAME name
41 ZIP_STAT_INDEX index
42 ZIP_STAT_SIZE size
43 ZIP_STAT_COMP_SIZE comp_size
44 ZIP_STAT_MTIME mtime
45 ZIP_STAT_CRC crc
46 ZIP_STAT_COMP_METHOD comp_method
47 ZIP_STAT_ENCRYPTION_METHOD encryption_method
48 ZIP_STAT_FLAGS flags
49
50 NOTE: Some fields may only be filled out after all data has been read
51 from the source, for example the crc or size fields.
52
54 Upon successful completion 0 is returned. Otherwise, -1 is returned and
55 the error information in source is set to indicate the error.
56
58 libzip(3), zip_source(3)
59
61 zip_source_stat() was added in libzip 1.0.
62
64 Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
65
66BSD December 18, 2017 BSD