Thomas Klausner | 4edcedc | 2017-12-06 12:43:04 +0100 | [diff] [blame] | 1 | .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" |
| 9 | libzip (-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" |
| 25 | The |
| 26 | \fBzip_file_extra_fields_count\fR() |
| 27 | function counts the extra fields for the file at position |
| 28 | \fIindex\fR |
| 29 | in the zip archive. |
| 30 | .PP |
| 31 | The following |
| 32 | \fIflags\fR |
| 33 | are supported: |
| 34 | .RS 6n |
| 35 | .TP 18n |
| 36 | \fRZIP_FL_CENTRAL\fR |
| 37 | Count extra fields from the archive's central directory. |
| 38 | .TP 18n |
| 39 | \fRZIP_FL_LOCAL\fR |
| 40 | Count extra fields from the local file headers. |
| 41 | .TP 18n |
| 42 | \fRZIP_FL_UNCHANGED\fR |
| 43 | Count the original unchanged extra fields, ignoring any changes made. |
| 44 | .RE |
| 45 | .PP |
| 46 | The |
| 47 | \fBzip_file_extra_fields_count_by_id\fR() |
| 48 | function counts the extra fields with ID (two-byte signature) |
| 49 | \fIextra_field_id\fR. |
| 50 | The other arguments are the same as for |
| 51 | \fBzip_file_extra_fields_count\fR(). |
| 52 | .PP |
| 53 | Extra fields that are the same in the central directory and the local file |
| 54 | header are merged into one. |
| 55 | Therefore, the counts with |
| 56 | \fRZIP_FL_CENTRAL\fR |
| 57 | and |
| 58 | \fRZIP_FL_LOCAL\fR |
| 59 | do not need to add up to the same value as when given |
| 60 | \fRZIP_FL_CENTRAL|ZIP_FL_LOCAL\fR |
| 61 | at the same time. |
| 62 | .SH "RETURN VALUES" |
| 63 | Upon successful completion, the requested number of extra fields is returned. |
| 64 | Otherwise, \-1 is returned and the error code in |
| 65 | \fIarchive\fR |
| 66 | is set to indicate the error. |
| 67 | .SH "ERRORS" |
| 68 | \fBzip_file_extra_fields_count\fR() |
| 69 | and |
| 70 | \fBzip_file_extra_fields_count_by_id\fR() |
| 71 | fail if: |
| 72 | .TP 19n |
| 73 | [\fRZIP_ER_NOENT\fR] |
| 74 | \fIindex\fR |
| 75 | is not a valid file index in |
| 76 | \fIarchive\fR. |
| 77 | .SH "SEE ALSO" |
| 78 | libzip(3), |
| 79 | zip_file_extra_field_delete(3), |
| 80 | zip_file_extra_field_get(3), |
| 81 | zip_file_extra_field_set(3) |
| 82 | .SH "AUTHORS" |
| 83 | Dieter Baron <\fIdillo@nih.at\fR> |
| 84 | and |
| 85 | Thomas Klausner <\fItk@giga.or.at\fR> |