Imported Upstream version 1.1.3
[platform/upstream/libzip.git] / man / zip_file_extra_field_delete.man
1 .TH "ZIP_FILE_EXTRA_FIELD_DELETE" "3" "July 31, 2013" "NiH" "Library Functions Manual"
2 .nh
3 .if n .ad l
4 .SH "NAME"
5 \fBzip_file_extra_field_delete\fR,
6 \fBzip_file_extra_field_delete_by_id\fR
7 \- delete extra field for file in zip
8 .SH "LIBRARY"
9 libzip (-lzip)
10 .SH "SYNOPSIS"
11 \fB#include <zip.h>\fR
12 .sp
13 \fIint\fR
14 .PD 0
15 .HP 4n
16 \fBzip_file_extra_field_delete\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_uint16_t\ extra_field_index\fR, \fIzip_flags_t\ flags\fR);
17 .PD
18 .PP
19 \fIint\fR
20 .PD 0
21 .HP 4n
22 \fBzip_file_extra_field_delete_by_id\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_uint16_t\ extra_field_id\fR, \fIzip_uint16_t\ extra_field_index\fR, \fIzip_flags_t\ flags\fR);
23 .PD
24 .SH "DESCRIPTION"
25 The
26 \fBzip_file_extra_field_delete\fR()
27 function deletes the extra field with index
28 \fIextra_field_index\fR
29 for the file at position
30 \fIindex\fR
31 in the zip archive.
32 .PP
33 If
34 \fIextra_field_index\fR
35 is
36 \fRZIP_EXTRA_FIELD_ALL\fR,
37 then all extra fields will be deleted.
38 .PP
39 The following
40 \fIflags\fR
41 are supported:
42 .RS 6n
43 .TP 18n
44 \fRZIP_FL_CENTRAL\fR
45 Delete extra fields from the archive's central directory.
46 .TP 18n
47 \fRZIP_FL_LOCAL\fR
48 Delete extra fields from the local file headers.
49 .RE
50 .PP
51 The
52 \fBzip_file_extra_field_delete_by_id\fR()
53 function deletes the extra field with ID (two-byte signature)
54 \fIextra_field_id\fR
55 and index
56 \fIextra_field_index\fR
57 (in other words, the
58 \fIextra_field_index\fR'th
59 extra field with ID
60 \fIextra_field_id\fR)
61 The other arguments are the same as for
62 \fBzip_file_extra_field_delete\fR()
63 (\fRZIP_EXTRA_FIELD_ALL\fR
64 will delete all extra fields of the specified ID).
65 .PP
66 Please note that due to the library design, the index of an extra
67 field may be different between central directory and local file
68 headers.
69 For this reason, it is not allowed to specify both
70 \fRZIP_FL_CENTRAL\fR
71 and
72 \fRZIP_FL_LOCAL\fR
73 in
74 \fIflags\fR,
75 except when deleting all extra fields (i.e.,
76 \fIextra_field_index\fR
77 being
78 \fRZIP_EXTRA_FIELD_ALL\fR).
79 .SH "RETURN VALUES"
80 Upon successful completion 0 is returned.
81 Otherwise, \-1 is returned and the error code in
82 \fIarchive\fR
83 is set to indicate the error.
84 .SH "ERRORS"
85 \fBzip_file_extra_field_delete\fR()
86 and
87 \fBzip_file_extra_field_delete_by_id\fR()
88 fail if:
89 .TP 19n
90 [\fRZIP_ER_NOENT\fR]
91 \fIindex\fR
92 is not a valid file index in
93 \fIarchive\fR.
94 .SH "SEE ALSO"
95 libzip(3),
96 zip_file_extra_field_get(3),
97 zip_file_extra_field_set(3),
98 zip_file_extra_fields_count(3)
99 .SH "AUTHORS"
100 Dieter Baron <\fIdillo@nih.at\fR>
101 and
102 Thomas Klausner <\fItk@giga.or.at\fR>