summaryrefslogtreecommitdiff
path: root/archivers/libarchive/files/doc/man/archive_util.3
blob: e41c59f56e8030e873e67c65d5990cbe3d4063d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
.TH archive_util 3 "January 8, 2005" ""
.SH NAME
\fBarchive_clear_error\fP,
\fBarchive_compression\fP,
\fBarchive_compression_name\fP,
\fBarchive_copy_error\fP,
\fBarchive_errno\fP,
\fBarchive_error_string\fP,
\fBarchive_format\fP,
\fBarchive_format_name\fP,
\fBarchive_set_error\fP
\- libarchive utility functions
.SH SYNOPSIS
\fB#include <archive.h>\fP
.br
\fIvoid\fP
.RE
.nh
\fBarchive_clear_error\fP
.hy
("struct archive *");
\fIint\fP
.RE
.nh
\fBarchive_compression\fP
.hy
("struct archive *");
\fIconst char *\fP
.RE
.nh
\fBarchive_compression_name\fP
.hy
("struct archive *");
\fIvoid\fP
.RE
.nh
\fBarchive_copy_error\fP
.hy
("struct archive *" "struct archive *");
\fIint\fP
.RE
.nh
\fBarchive_errno\fP
.hy
("struct archive *");
\fIconst char *\fP
.RE
.nh
\fBarchive_error_string\fP
.hy
("struct archive *");
\fIint\fP
.RE
.nh
\fBarchive_format\fP
.hy
("struct archive *");
\fIconst char *\fP
.RE
.nh
\fBarchive_format_name\fP
.hy
("struct archive *");
\fIvoid\fP
.RE
.nh
\fBarchive_set_error\fP
.hy
("struct archive *" "int error_code" "const char *fmt" "...");
.SH DESCRIPTION
These functions provide access to various information about the
Tn struct archive
object used in the
\fBlibarchive\fP(3)
library.
.TP
.nh
\fBarchive_clear_error\fP
.hy
();
Clears any error information left over from a previous call.
Not generally used in client code.
.TP
.nh
\fBarchive_compression\fP
.hy
();
Returns a numeric code indicating the current compression.
This value is set by
.nh
\fBarchive_read_open\fP
.hy
(.);
.TP
.nh
\fBarchive_compression_name\fP
.hy
();
Returns a text description of the current compression suitable for display.
.TP
.nh
\fBarchive_copy_error\fP
.hy
();
Copies error information from one archive to another.
.TP
.nh
\fBarchive_errno\fP
.hy
();
Returns a numeric error code (see
\fBerrno\fP(2))
indicating the reason for the most recent error return.
.TP
.nh
\fBarchive_error_string\fP
.hy
();
Returns a textual error message suitable for display.
The error message here is usually more specific than that
obtained from passing the result of
.nh
\fBarchive_errno\fP
.hy
();
to
\fBstrerror\fP(3).
.TP
.nh
\fBarchive_format\fP
.hy
();
Returns a numeric code indicating the format of the current
archive entry.
This value is set by a successful call to
.nh
\fBarchive_read_next_header\fP
.hy
(.);
Note that it is common for this value to change from
entry to entry.
For example, a tar archive might have several entries that
utilize GNU tar extensions and several entries that do not.
These entries will have different format codes.
.TP
.nh
\fBarchive_format_name\fP
.hy
();
A textual description of the format of the current entry.
.TP
.nh
\fBarchive_set_error\fP
.hy
();
Sets the numeric error code and error description that will be returned
by
.nh
\fBarchive_errno\fP
.hy
();
and
.nh
\fBarchive_error_string\fP
.hy
(.);
This function should be used within I/O callbacks to set system-specific
error codes and error descriptions.
This function accepts a printf-like format string and arguments.
However, you should be careful to use only the following printf
format specifiers:
``%c'',
``%d'',
``%jd'',
``%jo'',
``%ju'',
``%jx'',
``%ld'',
``%lo'',
``%lu'',
``%lx'',
``%o'',
``%u'',
``%s'',
``%x'',
``%%''.
Field-width specifiers and other printf features are
not uniformly supported and should not be used.
.SH SEE ALSO
\fBarchive_read\fP(3),
\fBarchive_write\fP(3),
\fBlibarchive\fP(3),
\fBprintf\fP(3)
.SH HISTORY
The
\fBlibarchive\fP
library first appeared in
FreeBSD 5.3.
.SH AUTHORS
-nosplit
The
\fBlibarchive\fP
library was written by
Tim Kientzle <kientzle@acm.org.>