1ZIP_SET_DEFAULT_PASSW... BSD Library Functions Manual ZIP_SET_DEFAULT_PASSW...
2
4 zip_set_default_password — set default password for encrypted files in
5 zip
6
8 libzip (-lzip)
9
11 #include <zip.h>
12
13 int
14 zip_set_default_password(zip_t *archive, const char *password);
15
17 The zip_set_default_password() function sets the default password used
18 when accessing encrypted files. If password is NULL, the default pass‐
19 word is unset.
20
21 If you prefer a different password for single files, use
22 zip_fopen_encrypted(3) instead of zip_fopen(3). Usually, however, the
23 same password is used for every file in an zip archive.
24
26 Upon successful completion 0 is returned. Otherwise, -1 is returned and
27 the error information in archive is set to indicate the error.
28
30 zip_set_default_password() fails if:
31
32 [ZIP_ER_MEMORY] Required memory could not be allocated.
33
35 libzip(3), zip_fopen(3), zip_fopen_encrypted(3)
36
38 zip_set_default_password() was added in libzip 0.10.
39
41 Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
42
43BSD December 18, 2017 BSD