blob: 17d3f7e8c2049682fafe7102b3fcf0c2f7a22b06 [file] [log] [blame]
Thomas Klausner4edcedc2017-12-06 12:43:04 +01001.TH "ZIP_FILE_EXTRA_FIELDS_COUNT" "3" "February 20, 2013" "NiH" "Library Functions Manual"
2.nh
3.if n .ad l
4.SH "NAME"
5\fBzip_file_extra_fields_count\fR,
6\fBzip_file_extra_fields_count_by_id\fR
7\- count extra fields for file in zip
8.SH "LIBRARY"
9libzip (-lzip)
10.SH "SYNOPSIS"
11\fB#include <zip.h>\fR
12.sp
13\fIzip_int16_t\fR
14.PD 0
15.HP 4n
16\fBzip_file_extra_fields_count\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_flags_t\ flags\fR);
17.PD
18.PP
19\fIzip_int16_t\fR
20.PD 0
21.HP 4n
22\fBzip_file_extra_fields_count_by_id\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_uint16_t\ extra_field_id\fR, \fIzip_flags_t\ flags\fR);
23.PD
24.SH "DESCRIPTION"
25The
26\fBzip_file_extra_fields_count\fR()
27function counts the extra fields for the file at position
28\fIindex\fR
29in the zip archive.
30.PP
31The following
32\fIflags\fR
33are supported:
34.RS 6n
35.TP 18n
36\fRZIP_FL_CENTRAL\fR
37Count extra fields from the archive's central directory.
38.TP 18n
39\fRZIP_FL_LOCAL\fR
40Count extra fields from the local file headers.
41.TP 18n
42\fRZIP_FL_UNCHANGED\fR
43Count the original unchanged extra fields, ignoring any changes made.
44.RE
45.PP
46The
47\fBzip_file_extra_fields_count_by_id\fR()
48function counts the extra fields with ID (two-byte signature)
49\fIextra_field_id\fR.
50The other arguments are the same as for
51\fBzip_file_extra_fields_count\fR().
52.PP
53Extra fields that are the same in the central directory and the local file
54header are merged into one.
55Therefore, the counts with
56\fRZIP_FL_CENTRAL\fR
57and
58\fRZIP_FL_LOCAL\fR
59do not need to add up to the same value as when given
60\fRZIP_FL_CENTRAL|ZIP_FL_LOCAL\fR
61at the same time.
62.SH "RETURN VALUES"
63Upon successful completion, the requested number of extra fields is returned.
64Otherwise, \-1 is returned and the error code in
65\fIarchive\fR
66is set to indicate the error.
67.SH "ERRORS"
68\fBzip_file_extra_fields_count\fR()
69and
70\fBzip_file_extra_fields_count_by_id\fR()
71fail if:
72.TP 19n
73[\fRZIP_ER_NOENT\fR]
74\fIindex\fR
75is not a valid file index in
76\fIarchive\fR.
77.SH "SEE ALSO"
78libzip(3),
79zip_file_extra_field_delete(3),
80zip_file_extra_field_get(3),
81zip_file_extra_field_set(3)
82.SH "AUTHORS"
83Dieter Baron <\fIdillo@nih.at\fR>
84and
85Thomas Klausner <\fItk@giga.or.at\fR>