Dieter Baron | 973b5dc | 2003-10-06 02:52:23 +0000 | [diff] [blame] | 1 | .\" Converted with mdoc2man 0.2 |
Thomas Klausner | 3dd81d8 | 2005-06-09 19:01:53 +0000 | [diff] [blame] | 2 | .\" from NiH: zip_stat.mdoc,v 1.4 2005/06/09 18:50:27 wiz Exp |
| 3 | .\" $NiH: zip_stat.mdoc,v 1.4 2005/06/09 18:50:27 wiz Exp $ |
Dieter Baron | 973b5dc | 2003-10-06 02:52:23 +0000 | [diff] [blame] | 4 | .\" |
Thomas Klausner | 201d1b2 | 2003-12-27 22:51:30 +0000 | [diff] [blame] | 5 | .\" zip_stat.mdoc \-- get information about file |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 6 | .\" Copyright (C) 2003, 2004 Dieter Baron and Thomas Klausner |
Dieter Baron | 973b5dc | 2003-10-06 02:52:23 +0000 | [diff] [blame] | 7 | .\" |
| 8 | .\" This file is part of libzip, a library to manipulate ZIP archives. |
| 9 | .\" The authors can be contacted at <nih@giga.or.at> |
| 10 | .\" |
| 11 | .\" Redistribution and use in source and binary forms, with or without |
| 12 | .\" modification, are permitted provided that the following conditions |
| 13 | .\" are met: |
| 14 | .\" 1. Redistributions of source code must retain the above copyright |
| 15 | .\" notice, this list of conditions and the following disclaimer. |
| 16 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| 17 | .\" notice, this list of conditions and the following disclaimer in |
| 18 | .\" the documentation and/or other materials provided with the |
| 19 | .\" distribution. |
| 20 | .\" 3. The names of the authors may not be used to endorse or promote |
| 21 | .\" products derived from this software without specific prior |
| 22 | .\" written permission. |
| 23 | .\" |
| 24 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS |
| 25 | .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 26 | .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 27 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY |
| 28 | .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 29 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
| 30 | .\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 31 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER |
| 32 | .\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 33 | .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 34 | .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 35 | .\" |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 36 | .TH ZIP_STAT 3 "April 14, 2004" NiH |
Dieter Baron | 973b5dc | 2003-10-06 02:52:23 +0000 | [diff] [blame] | 37 | .SH "NAME" |
| 38 | zip_stat , \- .Nm zip_stat_index |
| 39 | get information about file |
| 40 | .SH "LIBRARY" |
Thomas Klausner | 201d1b2 | 2003-12-27 22:51:30 +0000 | [diff] [blame] | 41 | libzip (-lzip) |
Dieter Baron | 973b5dc | 2003-10-06 02:52:23 +0000 | [diff] [blame] | 42 | .SH "SYNOPSIS" |
| 43 | .In zip.h |
| 44 | .Ft int |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 45 | .Fn zip_stat "struct zip *archive" "const char *fname" "int flags" "struct zip_stat *sb" |
Dieter Baron | 973b5dc | 2003-10-06 02:52:23 +0000 | [diff] [blame] | 46 | .Ft int |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 47 | .Fn zip_stat_index "struct zip *archive" "int index" "int flags" "struct zip_stat *sb" |
Dieter Baron | 973b5dc | 2003-10-06 02:52:23 +0000 | [diff] [blame] | 48 | .SH "DESCRIPTION" |
| 49 | The |
| 50 | .Fn zip_stat |
| 51 | function obtains information about the file named |
| 52 | \fBfname\fR |
| 53 | in |
| 54 | \fBarchive.\fR |
| 55 | The |
| 56 | \fBflags\fR |
| 57 | argument specifies how the name lookup should be done. |
| 58 | Its values are described in |
| 59 | zip_name_locate(3). |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 60 | Also, |
Thomas Klausner | 6b4002c | 2005-05-20 22:00:03 +0000 | [diff] [blame] | 61 | \fBZIP_FL_UNCHANGED\fR |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 62 | may be |
Thomas Klausner | 6b4002c | 2005-05-20 22:00:03 +0000 | [diff] [blame] | 63 | .I or'ed |
Dieter Baron | b2ed74d | 2004-04-14 14:01:31 +0000 | [diff] [blame] | 64 | to it to request information about the original file in the archive, |
| 65 | ignoring any changes made. |
Dieter Baron | 973b5dc | 2003-10-06 02:52:23 +0000 | [diff] [blame] | 66 | .PP |
| 67 | The |
| 68 | .Fn zip_stat_index |
| 69 | function obtains information about the file at position |
| 70 | \fBindex.\fR |
| 71 | .PP |
| 72 | The |
| 73 | \fBsb\fR |
| 74 | argument is a pointer to a |
| 75 | .Ft struct zip_stat |
| 76 | (shown below), into which information about the file is placed. |
| 77 | .Bd \-literal |
| 78 | struct zip_stat { |
| 79 | const char *name; /* name of the file */ |
| 80 | int index; /* index within archive */ |
| 81 | unsigned int crc; /* crc of file data */ |
| 82 | unsigned int size; /* size of file (uncompressed) */ |
| 83 | time_t mtime; /* modification time */ |
| 84 | unsigned int comp_size; /* size of file (compressed) */ |
| 85 | unsigned short comp_method; /* compression method used */ |
| 86 | }; |
| 87 | .SH "RETURN VALUES" |
| 88 | Upon successful completion 0 is returned. |
Thomas Klausner | 201d1b2 | 2003-12-27 22:51:30 +0000 | [diff] [blame] | 89 | Otherwise, \-1 is returned and the error information in |
Dieter Baron | 973b5dc | 2003-10-06 02:52:23 +0000 | [diff] [blame] | 90 | \fBarchive\fR |
| 91 | is set to indicate the error. |
| 92 | .SH "ERRORS" |
| 93 | The function |
| 94 | .Fn zip_stat |
| 95 | can fail for any of the errors specified for the routine |
| 96 | zip_name_locate(3). |
| 97 | .PP |
| 98 | The function |
| 99 | .Fn zip_stata_index |
| 100 | fails and sets the error information to |
Thomas Klausner | d0147e9 | 2004-11-17 21:55:17 +0000 | [diff] [blame] | 101 | .Er ZIP_ER_INVAL |
Dieter Baron | 973b5dc | 2003-10-06 02:52:23 +0000 | [diff] [blame] | 102 | if |
| 103 | \fBindex\fR |
| 104 | is invalid. |
Thomas Klausner | d0147e9 | 2004-11-17 21:55:17 +0000 | [diff] [blame] | 105 | .\" XXX: ZIP_ER_CHANGED |
Dieter Baron | 973b5dc | 2003-10-06 02:52:23 +0000 | [diff] [blame] | 106 | .SH "SEE ALSO" |
Thomas Klausner | 3dd81d8 | 2005-06-09 19:01:53 +0000 | [diff] [blame] | 107 | libzip(3), |
Dieter Baron | 973b5dc | 2003-10-06 02:52:23 +0000 | [diff] [blame] | 108 | zip_name_locate(3) |