Imported Upstream version 1.1.3
[platform/upstream/libzip.git] / man / zip_set_default_password.man
1 .TH "ZIP_SET_DEFAULT_PASSWORD" "3" "January 3, 2011" "NiH" "Library Functions Manual"
2 .nh
3 .if n .ad l
4 .SH "NAME"
5 \fBzip_set_default_password\fR
6 \- set default password for encrypted files in zip
7 .SH "LIBRARY"
8 libzip (-lzip)
9 .SH "SYNOPSIS"
10 \fB#include <zip.h>\fR
11 .sp
12 \fIint\fR
13 .PD 0
14 .HP 4n
15 \fBzip_set_default_password\fR(\fIzip_t\ *archive\fR, \fIconst\ char\ *password\fR);
16 .PD
17 .SH "DESCRIPTION"
18 The
19 \fBzip_set_default_password\fR()
20 function sets the default password used when accessing encrypted files.
21 If
22 \fIpassword\fR
23 is
24 \fRNULL\fR,
25 the default password is unset.
26 .PP
27 If you prefer a different password for single files, use
28 zip_fopen_encrypted(3)
29 instead of
30 zip_fopen(3).
31 Usually, however, the same password is used for every file in an
32 zip archive.
33 .SH "RETURN VALUES"
34 Upon successful completion 0 is returned.
35 Otherwise, \-1 is returned and the error information in
36 \fIarchive\fR
37 is set to indicate the error.
38 .SH "ERRORS"
39 \fBzip_set_default_password\fR()
40 fails if:
41 .TP 19n
42 [\fRZIP_ER_MEMORY\fR]
43 Required memory could not be allocated.
44 .SH "SEE ALSO"
45 libzip(3),
46 zip_fopen(3),
47 zip_fopen_encrypted(3)
48 .SH "AUTHORS"
49 Dieter Baron <\fIdillo@nih.at\fR>
50 and
51 Thomas Klausner <\fItk@giga.or.at\fR>