Imported Upstream version 0.10.1
[platform/upstream/libzip.git] / man / zip_set_default_password.man
1 .\" zip_set_default_password.mdoc \-- set default password for zip
2 .\" Copyright (C) 2011 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_SET_DEFAULT_PASSWORD 3 "January 3, 2011" NiH
33 .SH "NAME"
34 zip_set_default_password \- set default password for encrypted files in zip
35 .SH "LIBRARY"
36 libzip (-lzip)
37 .SH "SYNOPSIS"
38 #include <zip.h>
39 .PP
40 int
41 zip_set_default_password(struct zip *archive, const char *password);
42 .SH "DESCRIPTION"
43 The
44 zip_set_default_password
45 function sets the default password used when accessing encrypted files.
46 If
47 \fBpassword\fR
48 is
49 \fBNULL,\fR
50 the default password is unset.
51 .PP
52 If you prefer a different password for single files, use
53 zip_fopen_encrypted(3)
54 instead of
55 zip_fopen(3).
56 Usually, however, the same password is used for every file in an
57 zip archive.
58 .SH "RETURN VALUES"
59 Upon successful completion 0 is returned.
60 Otherwise, \-1 is returned and the error information in
61 \fBarchive\fR
62 is set to indicate the error.
63 .SH "ERRORS"
64 zip_set_default_password
65 fails if:
66 .RS
67 .TP 4
68 [ZIP_ER_MEMORY]
69 Required memory could not be allocated.
70 .RE
71 .SH "SEE ALSO"
72 libzip(3),
73 zip_fopen(3),
74 zip_fopen_encrypted(3)
75 .SH "AUTHORS"
76
77 Dieter Baron <dillo@giga.or.at>
78 and
79 Thomas Klausner <tk@giga.or.at>