1ZIP_FILE_EXTRA_FIELDS... BSD Library Functions Manual ZIP_FILE_EXTRA_FIELDS...
2

NAME

4     zip_file_extra_fields_count, zip_file_extra_fields_count_by_id — count
5     extra fields for file in zip
6

LIBRARY

8     libzip (-lzip)
9

SYNOPSIS

11     #include <zip.h>
12
13     zip_int16_t
14     zip_file_extra_fields_count(zip_t *archive, zip_uint64_t index,
15         zip_flags_t flags);
16
17     zip_int16_t
18     zip_file_extra_fields_count_by_id(zip_t *archive, zip_uint64_t index,
19         zip_uint16_t extra_field_id, zip_flags_t flags);
20

DESCRIPTION

22     The zip_file_extra_fields_count() function counts the extra fields for
23     the file at position index in the zip archive.
24
25     The following flags are supported:
26
27           ZIP_FL_CENTRAL    Count extra fields from the archive's central
28                             directory.
29
30           ZIP_FL_LOCAL      Count extra fields from the local file headers.
31
32           ZIP_FL_UNCHANGED  Count the original unchanged extra fields, ignor‐
33                             ing any changes made.
34
35     The zip_file_extra_fields_count_by_id() function counts the extra fields
36     with ID (two-byte signature) extra_field_id.  The other arguments are the
37     same as for zip_file_extra_fields_count().
38
39     Extra fields that are the same in the central directory and the local
40     file header are merged into one.  Therefore, the counts with
41     ZIP_FL_CENTRAL and ZIP_FL_LOCAL do not need to add up to the same value
42     as when given ZIP_FL_CENTRAL|ZIP_FL_LOCAL at the same time.
43

RETURN VALUES

45     Upon successful completion, the requested number of extra fields is
46     returned.  Otherwise, -1 is returned and the error code in archive is set
47     to indicate the error.
48

ERRORS

50     zip_file_extra_fields_count() and zip_file_extra_fields_count_by_id()
51     fail if:
52
53     [ZIP_ER_NOENT]     index is not a valid file index in archive.
54

SEE ALSO

56     libzip(3), zip_file_extra_field_delete(3), zip_file_extra_field_get(3),
57     zip_file_extra_field_set(3)
58

HISTORY

60     zip_file_extra_fields_count() and zip_file_extra_fields_count_by_id()
61     were added in libzip 0.11.
62

AUTHORS

64     Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
65
66BSD                            December 18, 2017                           BSD
Impressum