Imported Upstream version 1.1.3
[platform/upstream/libzip.git] / man / zip_set_file_compression.man
1 .TH "ZIP_SET_FILE_COMPRESSION" "3" "May 1, 2012" "NiH" "Library Functions Manual"
2 .nh
3 .if n .ad l
4 .SH "NAME"
5 \fBzip_set_file_compression\fR
6 \- set compression method for file 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_file_compression\fR(\fIzip_t\ *archive\fR, \fIzip_uint64_t\ index\fR, \fIzip_int32_t\ comp\fR, \fIzip_uint32_t\ comp_flags\fR);
16 .PD
17 .SH "DESCRIPTION"
18 The
19 \fBzip_set_file_compression\fR()
20 function sets the compression method for the file at position
21 \fIindex\fR
22 in the zip archive to
23 \fIcomp\fR
24 with the compression method specific
25 \fIcomp_flags\fR.
26 The
27 \fIcomp\fR
28 is the same as returned by
29 zip_stat(3).
30 For the
31 \fIcomp\fR
32 argument, currently only the following values are supported:
33 .TP 19n
34 \fRZIP_CM_DEFAULT\fR
35 default compression; currently the same as
36 \fRZIP_CM_DEFLATE\fR.
37 .TP 19n
38 \fRZIP_CM_STORE\fR
39 Store the file uncompressed.
40 .TP 19n
41 \fRZIP_CM_DEFLATE\fR
42 Deflate the file with the
43 zlib(3)
44 algorithm and default options
45 .PP
46 The
47 \fIcomp_flags\fR
48 argument is currently ignored.
49 .PP
50 The current compression method for a file in a zip archive can be
51 determined using
52 zip_stat(3).
53 .SH "RETURN VALUES"
54 Upon successful completion 0 is returned.
55 Otherwise, \-1 is returned and the error information in
56 \fIarchive\fR
57 is set to indicate the error.
58 .SH "ERRORS"
59 \fBzip_set_file_compression\fR()
60 fails if:
61 .TP 19n
62 [\fRZIP_ER_INVAL\fR]
63 \fIindex\fR
64 is not a valid file index in
65 \fIarchive\fR,
66 or the argument combination is invalid.
67 .TP 19n
68 [\fRZIP_ER_COMPNOTSUPP\fR]
69 Unsupported compression method requested.
70 .TP 19n
71 [\fRZIP_ER_RDONLY\fR]
72 Read-only zip file, no changes allowed.
73 .SH "SEE ALSO"
74 libzip(3),
75 zip_stat(3)
76 .SH "AUTHORS"
77 Dieter Baron <\fIdillo@nih.at\fR>
78 and
79 Thomas Klausner <\fItk@giga.or.at\fR>