1ZIP_NAME_LOCATE(3)       BSD Library Functions Manual       ZIP_NAME_LOCATE(3)
2

NAME

4     zip_name_locate — get index of file by name
5

LIBRARY

7     libzip (-lzip)
8

SYNOPSIS

10     #include <zip.h>
11
12     zip_int64_t
13     zip_name_locate(zip_t *archive, const char *fname, zip_flags_t flags);
14

DESCRIPTION

16     The zip_name_locate() function returns the index of the file named fname
17     in archive.  If archive does not contain a file with that name, -1 is
18     returned.  The flags are specified by or'ing the following values, or 0
19     for none of them.
20
21           ZIP_FL_NOCASE  Ignore case distinctions.  (Will only work well if
22                          the file names are ASCII.)  With this flag,
23                          zip_name_locate() will be slow for archives with
24                          many files.
25
26           ZIP_FL_NODIR   Ignore directory part of file name in archive.  With
27                          this flag, zip_name_locate() will be slow for ar‐
28                          chives with many files.
29
30           ZIP_FL_ENC_RAW
31                          Compare against the unmodified names as it is in the
32                          ZIP archive.
33
34           ZIP_FL_ENC_GUESS
35                          (Default.)  Guess the encoding of the name in the
36                          ZIP archive and convert it to UTF-8, if necessary,
37                          before comparing.
38
39           ZIP_FL_ENC_STRICT
40                          Follow the ZIP specification and expect CP-437
41                          encoded names in the ZIP archive (except if they are
42                          explicitly marked as UTF-8).  Convert it to UTF-8
43                          before comparing.
44     Note: ASCII is a subset of both CP-437 and UTF-8.
45

RETURN VALUES

47     zip_name_locate() returns the index of the file named fname or -1, if
48     archive does not contain an entry of that name.
49

ERRORS

51     zip_name_locate() fails if:
52
53     [ZIP_ER_INVAL]     One of the arguments is invalid.
54
55     [ZIP_ER_MEMORY]    Required memory could not be allocated.
56
57     [ZIP_ER_NOENT]     No entry of the name fname is found in the archive.
58

SEE ALSO

60     libzip(3), zip_get_name(3)
61

HISTORY

63     zip_name_locate() was added in libzip 0.6.  In libzip 0.11 the return
64     type was changed from int to zip_int64_t.  In libzip 0.11 the type of
65     flags was changed from int to zip_flags_t.
66

AUTHORS

68     Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
69
70BSD                            December 18, 2017                           BSD
Impressum