1 .\" zip_file_extra_field_get.mdoc -- get extra field for file in zip
2 .\" Copyright (C) 2012-2016 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_FIELD_GET 3
36 .Nm zip_file_extra_field_get ,
37 .Nm zip_file_extra_field_get_by_id
38 .Nd get extra field for file in zip
43 .Ft const zip_uint8_t *
44 .Fn zip_file_extra_field_get "zip_t *archive" "zip_uint64_t index" "zip_uint16_t extra_field_index" "zip_uint16_t *idp" "zip_uint16_t *lenp" "zip_flags_t flags"
45 .Ft const zip_uint8_t *
46 .Fn zip_file_extra_field_get_by_id "zip_t *archive" "zip_uint64_t index" "zip_uint16_t extra_field_id" "zip_uint16_t extra_field_index" "zip_uint16_t *lenp" "zip_flags_t flags"
49 .Fn zip_file_extra_field_get
50 function returns the extra field with index
52 for the file at position
55 This pointer should not be modified or
57 and becomes invalid when
64 the integer to which it points will be set to the ID (two-byte
65 signature) of the selected extra field.
70 the integer to which it points will be set to the length of the
76 should be passed since only the extra field data is returned (i.e.,
77 neither the ID nor the length, if the
81 arguments are not provided).
86 .Bl -tag -width ZIP_FL_UNCHANGEDXX -offset indent
88 Return extra fields from the archive's central directory.
90 Return extra fields from the local file headers.
91 .It Dv ZIP_FL_UNCHANGED
92 Return the original unchanged extra fields, ignoring any changes made.
96 .Fn zip_file_extra_field_get_by_id
97 function returns the extra field with ID (two-byte signature)
100 .Ar extra_field_index
102 .Ar extra_field_index Ns No 'th
105 The other arguments are the same as for
106 .Fn zip_file_extra_field_get .
108 Upon successful completion, a pointer to an extra field is returned,
111 if there is no extra field with that
112 .Ar extra_field_index
113 for the file with index
117 is returned and the error code in
119 is set to indicate the error.
121 .Fn zip_file_extra_field_get
123 .Fn zip_file_extra_field_get_by_id
126 .It Bq Er ZIP_ER_NOENT
128 is not a valid file index in
131 .Ar extra_field_index
132 is not a valid extra file index (for ID
133 .Ar extra_field_id ) .
137 .Xr zip_file_extra_field_delete 3 ,
138 .Xr zip_file_extra_field_set 3 ,
139 .Xr zip_file_extra_fields_count 3
142 .An Dieter Baron Aq Mt dillo@nih.at
144 .An Thomas Klausner Aq Mt tk@giga.or.at
146 Please note that the extra field IDs 0x0001 (ZIP64 extension),
147 0x6375 (Infozip UTF-8 comment), and
148 0x7075 (Infozip UTF-8 file name) can not be read using
149 .Fn zip_file_extra_field_get
150 since they are used by