Thomas Klausner | 0f83122 | 2012-06-24 02:26:17 +0200 | [diff] [blame] | 1 | .\" zip_file_extra_field_delete.mdoc -- delete extra field for file in zip |
Thomas Klausner | df77dc6 | 2016-12-31 13:40:32 +0100 | [diff] [blame] | 2 | .\" Copyright (C) 2012-2016 Dieter Baron and Thomas Klausner |
Thomas Klausner | 0f83122 | 2012-06-24 02:26:17 +0200 | [diff] [blame] | 3 | .\" |
| 4 | .\" This file is part of libzip, a library to manipulate ZIP files. |
| 5 | .\" The authors can be contacted at <libzip@nih.at> |
| 6 | .\" |
| 7 | .\" Redistribution and use in source and binary forms, with or without |
| 8 | .\" modification, are permitted provided that the following conditions |
| 9 | .\" are met: |
| 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 |
| 15 | .\" distribution. |
| 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. |
| 19 | .\" |
| 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. |
| 31 | .\" |
Thomas Klausner | 4fc7881 | 2013-07-31 16:43:17 +0200 | [diff] [blame] | 32 | .Dd July 31, 2013 |
Thomas Klausner | 0f83122 | 2012-06-24 02:26:17 +0200 | [diff] [blame] | 33 | .Dt ZIP_FILE_EXTRA_FIELD_DELETE 3 |
| 34 | .Os |
| 35 | .Sh NAME |
| 36 | .Nm zip_file_extra_field_delete , |
| 37 | .Nm zip_file_extra_field_delete_by_id |
| 38 | .Nd delete extra field for file in zip |
| 39 | .Sh LIBRARY |
| 40 | libzip (-lzip) |
| 41 | .Sh SYNOPSIS |
| 42 | .In zip.h |
| 43 | .Ft int |
Thomas Klausner | 9874efb | 2016-12-30 01:32:09 +0100 | [diff] [blame] | 44 | .Fn zip_file_extra_field_delete "zip_t *archive" "zip_uint64_t index" "zip_uint16_t extra_field_index" "zip_flags_t flags" |
Thomas Klausner | 0f83122 | 2012-06-24 02:26:17 +0200 | [diff] [blame] | 45 | .Ft int |
Thomas Klausner | 9874efb | 2016-12-30 01:32:09 +0100 | [diff] [blame] | 46 | .Fn zip_file_extra_field_delete_by_id "zip_t *archive" "zip_uint64_t index" "zip_uint16_t extra_field_id" "zip_uint16_t extra_field_index" "zip_flags_t flags" |
Thomas Klausner | 0f83122 | 2012-06-24 02:26:17 +0200 | [diff] [blame] | 47 | .Sh DESCRIPTION |
| 48 | The |
| 49 | .Fn zip_file_extra_field_delete |
| 50 | function deletes the extra field with index |
| 51 | .Ar extra_field_index |
| 52 | for the file at position |
| 53 | .Ar index |
| 54 | in the zip archive. |
| 55 | .Pp |
Thomas Klausner | 35d5a58 | 2012-06-25 12:20:30 +0200 | [diff] [blame] | 56 | If |
Thomas Klausner | 4fc7881 | 2013-07-31 16:43:17 +0200 | [diff] [blame] | 57 | .Ar extra_field_index |
Thomas Klausner | 35d5a58 | 2012-06-25 12:20:30 +0200 | [diff] [blame] | 58 | is |
| 59 | .Dv ZIP_EXTRA_FIELD_ALL , |
| 60 | then all extra fields will be deleted. |
| 61 | .Pp |
Thomas Klausner | 23c3032 | 2013-02-20 12:32:39 +0100 | [diff] [blame] | 62 | The following |
| 63 | .Ar flags |
| 64 | are supported: |
Thomas Klausner | 954d591 | 2012-06-25 12:18:19 +0200 | [diff] [blame] | 65 | .Bl -tag -width ZIP_FL_CENTRALXX -offset indent |
| 66 | .It Dv ZIP_FL_CENTRAL |
Thomas Klausner | 23c3032 | 2013-02-20 12:32:39 +0100 | [diff] [blame] | 67 | Delete extra fields from the archive's central directory. |
Thomas Klausner | 954d591 | 2012-06-25 12:18:19 +0200 | [diff] [blame] | 68 | .It Dv ZIP_FL_LOCAL |
Thomas Klausner | 23c3032 | 2013-02-20 12:32:39 +0100 | [diff] [blame] | 69 | Delete extra fields from the local file headers. |
Thomas Klausner | 0f83122 | 2012-06-24 02:26:17 +0200 | [diff] [blame] | 70 | .El |
| 71 | .Pp |
| 72 | The |
| 73 | .Fn zip_file_extra_field_delete_by_id |
| 74 | function deletes the extra field with ID (two-byte signature) |
| 75 | .Ar extra_field_id |
| 76 | and index |
| 77 | .Ar extra_field_index |
| 78 | (in other words, the |
| 79 | .Ar extra_field_index Ns No 'th |
| 80 | extra field with ID |
| 81 | .Ar extra_field_id ) |
| 82 | The other arguments are the same as for |
Thomas Klausner | 35d5a58 | 2012-06-25 12:20:30 +0200 | [diff] [blame] | 83 | .Fn zip_file_extra_field_delete |
| 84 | .Dv ( ZIP_EXTRA_FIELD_ALL |
Thomas Klausner | 4fc7881 | 2013-07-31 16:43:17 +0200 | [diff] [blame] | 85 | will delete all extra fields of the specified ID). |
| 86 | .Pp |
| 87 | Please note that due to the library design, the index of an extra |
| 88 | field may be different between central directory and local file |
| 89 | headers. |
| 90 | For this reason, it is not allowed to specify both |
| 91 | .Dv ZIP_FL_CENTRAL |
| 92 | and |
| 93 | .Dv ZIP_FL_LOCAL |
| 94 | in |
| 95 | .Ar flags , |
| 96 | except when deleting all extra fields (i.e., |
| 97 | .Ar extra_field_index |
| 98 | being |
| 99 | .Dv ZIP_EXTRA_FIELD_ALL ) . |
Thomas Klausner | 0f83122 | 2012-06-24 02:26:17 +0200 | [diff] [blame] | 100 | .Sh RETURN VALUES |
| 101 | Upon successful completion 0 is returned. |
| 102 | Otherwise, \-1 is returned and the error code in |
| 103 | .Ar archive |
| 104 | is set to indicate the error. |
| 105 | .Sh ERRORS |
| 106 | .Fn zip_file_extra_field_delete |
| 107 | and |
| 108 | .Fn zip_file_extra_field_delete_by_id |
| 109 | fail if: |
| 110 | .Bl -tag -width Er |
| 111 | .It Bq Er ZIP_ER_NOENT |
| 112 | .Ar index |
| 113 | is not a valid file index in |
| 114 | .Ar archive . |
| 115 | .El |
| 116 | .Sh SEE ALSO |
| 117 | .Xr libzip 3 , |
| 118 | .Xr zip_file_extra_field_get 3 , |
| 119 | .Xr zip_file_extra_field_set 3 , |
| 120 | .Xr zip_file_extra_fields_count 3 |
| 121 | .Sh AUTHORS |
| 122 | .An -nosplit |
Thomas Klausner | 0acbab4 | 2013-07-28 23:29:08 +0200 | [diff] [blame] | 123 | .An Dieter Baron Aq Mt dillo@nih.at |
Thomas Klausner | 0f83122 | 2012-06-24 02:26:17 +0200 | [diff] [blame] | 124 | and |
Thomas Klausner | 0acbab4 | 2013-07-28 23:29:08 +0200 | [diff] [blame] | 125 | .An Thomas Klausner Aq Mt tk@giga.or.at |