1
.\" zip_file_extra_fields_count.mdoc -- count extra field for file in zip
2
.\" Copyright (C) 2012-2013 Dieter Baron and Thomas Klausner
4
.\" This file is part of libzip, a library to manipulate ZIP files.
5
.\" The authors can be contacted at <libzip@nih.at>
7
.\" Redistribution and use in source and binary forms, with or without
8
.\" modification, are permitted provided that the following conditions
10
.\" 1. Redistributions of source code must retain the above copyright
11
.\" notice, this list of conditions and the following disclaimer.
12
.\" 2. Redistributions in binary form must reproduce the above copyright
13
.\" notice, this list of conditions and the following disclaimer in
14
.\" the documentation and/or other materials provided with the
16
.\" 3. The names of the authors may not be used to endorse or promote
17
.\" products derived from this software without specific prior
18
.\" written permission.
20
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
21
.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
24
.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
26
.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
28
.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
30
.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
.Dt ZIP_FILE_EXTRA_FIELDS_COUNT 3
36
.Nm zip_file_extra_fields_count ,
37
.Nm zip_file_extra_fields_count_by_id
38
.Nd count extra fields for file in zip
44
.Fn zip_file_extra_fields_count "struct zip *archive" "zip_uint64_t index" \
47
.Fn zip_file_extra_fields_count_by_id "struct zip *archive" "zip_uint64_t index" \
48
"zip_uint16_t extra_field_id" "zip_flags_t flags"
51
.Fn zip_file_extra_fields_count
52
function counts the extra fields for the file at position
59
.Bl -tag -width ZIP_FL_CENTRALXX -offset indent
61
Count extra fields from the archive's central directory.
63
Count extra fields from the local file headers.
64
.It Dv ZIP_FL_UNCHANGED
65
Count the original unchanged extra fields, ignoring any changes made.
69
.Fn zip_file_extra_fields_count_by_id
70
function counts the extra fields with ID (two-byte signature)
72
The other arguments are the same as for
73
.Fn zip_file_extra_fields_count .
75
Extra fields that are the same in the central directory and the local file
76
header are merged into one.
77
Therefore, the counts with
81
do not need to add up to the same value as when given
82
.Dv ZIP_FL_CENTRAL|ZIP_FL_LOCAL
85
Upon successful completion, the requested number of extra fields is returned.
86
Otherwise, \-1 is returned and the error code in
88
is set to indicate the error.
90
.Fn zip_file_extra_fields_count
92
.Fn zip_file_extra_fields_count_by_id
95
.It Bq Er ZIP_ER_NOENT
97
is not a valid file index in
99
.\" TODO: _zip_read_local_ef errors
103
.Xr zip_file_extra_field_delete 3 ,
104
.Xr zip_file_extra_field_get 3 ,
105
.Xr zip_file_extra_field_set 3
108
.An Dieter Baron Aq Mt dillo@nih.at
110
.An Thomas Klausner Aq Mt tk@giga.or.at