Imported Upstream version 0.10.1
[platform/upstream/libzip.git] / man / zip_get_file_comment.man
1 .\" zip_get_file_comment.mdoc \-- get comment for file in zip
2 .\" Copyright (C) 2006-2009 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 .TH ZIP_GET_FILE_COMMENT 3 "March 10, 2009" NiH
33 .SH "NAME"
34 zip_get_file_comment \- get comment for file in zip
35 .SH "LIBRARY"
36 libzip (-lzip)
37 .SH "SYNOPSIS"
38 #include <zip.h>
39 .PP
40 const char *
41 zip_get_file_comment(struct zip *archive, zip_uint64_t index, int *lenp, int flags);
42 .SH "DESCRIPTION"
43 The
44 zip_get_file_comment
45 function returns the comment for the file at position
46 \fBindex\fR
47 in the zip archive.
48 This pointer should not be modified or
49 free(3)
50 Ap d.
51 If
52 \fBlenp\fR
53 is not
54 \fBNULL,\fR
55 the integer to which it points will be set to the length of the
56 comment.
57 If
58 \fBflags\fR
59 is set to
60 \fBZIP_FL_UNCHANGED,\fR
61 the original unchanged comment is returned.
62 .SH "RETURN VALUES"
63 Upon successful completion, a pointer to the comment is returned,
64 or
65 \fBNULL\fR
66 if there is no comment.
67 In case of an error,
68 \fBNULL\fR
69 is returned and the error code in
70 \fBarchive\fR
71 is set to indicate the error.
72 .SH "ERRORS"
73 zip_get_file_comment
74 fails if:
75 .RS
76 .TP 4
77 [ZIP_ER_INVAL]
78 \fBindex\fR
79 is not a valid file index in
80 \fBarchive.\fR
81 .SH "SEE ALSO"
82 libzip(3),
83 zip_get_archive_comment(3)
84 .SH "AUTHORS"
85
86 Dieter Baron <dillo@giga.or.at>
87 and
88 Thomas Klausner <tk@giga.or.at>