"Fossies" - the Fresh Open Source Software Archive

Member "libzip-1.6.0/man/zip_file_extra_fields_count.mdoc" (24 Jan 2020, 3907 Bytes) of package /linux/misc/libzip-1.6.0.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "zip_file_extra_fields_count.mdoc": 1.3.2_vs_1.4.0.

    1 .\" zip_file_extra_fields_count.mdoc -- count extra field for file in zip
    2 .\" Copyright (C) 2012-2017 Dieter Baron and Thomas Klausner
    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 .\"
   32 .Dd December 18, 2017
   33 .Dt ZIP_FILE_EXTRA_FIELDS_COUNT 3
   34 .Os
   35 .Sh NAME
   36 .Nm zip_file_extra_fields_count ,
   37 .Nm zip_file_extra_fields_count_by_id
   38 .Nd count extra fields for file in zip
   39 .Sh LIBRARY
   40 libzip (-lzip)
   41 .Sh SYNOPSIS
   42 .In zip.h
   43 .Ft zip_int16_t
   44 .Fn zip_file_extra_fields_count "zip_t *archive" "zip_uint64_t index" "zip_flags_t flags"
   45 .Ft zip_int16_t
   46 .Fn zip_file_extra_fields_count_by_id "zip_t *archive" "zip_uint64_t index" "zip_uint16_t extra_field_id" "zip_flags_t flags"
   47 .Sh DESCRIPTION
   48 The
   49 .Fn zip_file_extra_fields_count
   50 function counts the extra fields for the file at position
   51 .Ar index
   52 in the zip archive.
   53 .Pp
   54 The following
   55 .Ar flags
   56 are supported:
   57 .Bl -tag -width ZIP_FL_CENTRALXX -offset indent
   58 .It Dv ZIP_FL_CENTRAL
   59 Count extra fields from the archive's central directory.
   60 .It Dv ZIP_FL_LOCAL
   61 Count extra fields from the local file headers.
   62 .It Dv ZIP_FL_UNCHANGED
   63 Count the original unchanged extra fields, ignoring any changes made.
   64 .El
   65 .Pp
   66 The
   67 .Fn zip_file_extra_fields_count_by_id
   68 function counts the extra fields with ID (two-byte signature)
   69 .Ar extra_field_id .
   70 The other arguments are the same as for
   71 .Fn zip_file_extra_fields_count .
   72 .Pp
   73 Extra fields that are the same in the central directory and the local file
   74 header are merged into one.
   75 Therefore, the counts with
   76 .Dv ZIP_FL_CENTRAL
   77 and
   78 .Dv ZIP_FL_LOCAL
   79 do not need to add up to the same value as when given
   80 .Dv ZIP_FL_CENTRAL|ZIP_FL_LOCAL
   81 at the same time.
   82 .Sh RETURN VALUES
   83 Upon successful completion, the requested number of extra fields is returned.
   84 Otherwise, \-1 is returned and the error code in
   85 .Ar archive
   86 is set to indicate the error.
   87 .Sh ERRORS
   88 .Fn zip_file_extra_fields_count
   89 and
   90 .Fn zip_file_extra_fields_count_by_id
   91 fail if:
   92 .Bl -tag -width Er
   93 .It Bq Er ZIP_ER_NOENT
   94 .Ar index
   95 is not a valid file index in
   96 .Ar archive .
   97 .\" TODO: _zip_read_local_ef errors
   98 .El
   99 .Sh SEE ALSO
  100 .Xr libzip 3 ,
  101 .Xr zip_file_extra_field_delete 3 ,
  102 .Xr zip_file_extra_field_get 3 ,
  103 .Xr zip_file_extra_field_set 3
  104 .Sh HISTORY
  105 .Fn zip_file_extra_fields_count
  106 and
  107 .Fn zip_file_extra_fields_count_by_id
  108 were added in libzip 0.11.
  109 .Sh AUTHORS
  110 .An -nosplit
  111 .An Dieter Baron Aq Mt dillo@nih.at
  112 and
  113 .An Thomas Klausner Aq Mt tk@giga.or.at