summaryrefslogtreecommitdiff
path: root/archivers/libarchive/files/doc/man/archive_util.3
blob: 60375aff195135062f462c69b92733b9a57b40cf (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
.TH archive_util 3 "January 8, 2005" ""
.SH NAME
.ad l
\fB\%archive_clear_error\fP,
\fB\%archive_compression\fP,
\fB\%archive_compression_name\fP,
\fB\%archive_copy_error\fP,
\fB\%archive_errno\fP,
\fB\%archive_error_string\fP,
\fB\%archive_file_count\fP,
\fB\%archive_format\fP,
\fB\%archive_format_name\fP,
\fB\%archive_set_error\fP
\- libarchive utility functions
.SH SYNOPSIS
.ad l
\fB#include <archive.h>\fP
.br
\fIvoid\fP
.br
\fB\%archive_clear_error\fP(\fI\%struct\ archive\ *\fP);
.br
\fIint\fP
.br
\fB\%archive_compression\fP(\fI\%struct\ archive\ *\fP);
.br
\fIconst char *\fP
.br
\fB\%archive_compression_name\fP(\fI\%struct\ archive\ *\fP);
.br
\fIvoid\fP
.br
\fB\%archive_copy_error\fP(\fI\%struct\ archive\ *\fP, \fI\%struct\ archive\ *\fP);
.br
\fIint\fP
.br
\fB\%archive_errno\fP(\fI\%struct\ archive\ *\fP);
.br
\fIconst char *\fP
.br
\fB\%archive_error_string\fP(\fI\%struct\ archive\ *\fP);
.br
\fIint\fP
.br
\fB\%archive_file_count\fP(\fI\%struct\ archive\ *\fP);
.br
\fIint\fP
.br
\fB\%archive_format\fP(\fI\%struct\ archive\ *\fP);
.br
\fIconst char *\fP
.br
\fB\%archive_format_name\fP(\fI\%struct\ archive\ *\fP);
.br
\fIvoid\fP
.br
\fB\%archive_set_error\fP(\fI\%struct\ archive\ *\fP, \fI\%int\ error_code\fP, \fI\%const\ char\ *fmt\fP, \fI\%...\fP);
.SH DESCRIPTION
.ad l
These functions provide access to various information about the
Tn struct archive
object used in the
\fBlibarchive\fP(3)
library.
.RS 5
.TP
\fB\%archive_clear_error\fP()
Clears any error information left over from a previous call.
Not generally used in client code.
.TP
\fB\%archive_compression\fP()
Returns a numeric code indicating the current compression.
This value is set by
\fB\%archive_read_open\fP().
.TP
\fB\%archive_compression_name\fP()
Returns a text description of the current compression suitable for display.
.TP
\fB\%archive_copy_error\fP()
Copies error information from one archive to another.
.TP
\fB\%archive_errno\fP()
Returns a numeric error code (see
\fBerrno\fP(2))
indicating the reason for the most recent error return.
.TP
\fB\%archive_error_string\fP()
Returns a textual error message suitable for display.
The error message here is usually more specific than that
obtained from passing the result of
\fB\%archive_errno\fP()
to
\fBstrerror\fP(3).
.TP
\fB\%archive_file_count\fP()
Returns a count of the number of files processed by this archive object.
The count is incremented by calls to
\fBarchive_write_header\fP()
or
\fBarchive_read_next_header\fP(.)
.TP
\fB\%archive_format\fP()
Returns a numeric code indicating the format of the current
archive entry.
This value is set by a successful call to
\fB\%archive_read_next_header\fP().
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
\fB\%archive_format_name\fP()
A textual description of the format of the current entry.
.TP
\fB\%archive_set_error\fP()
Sets the numeric error code and error description that will be returned
by
\fB\%archive_errno\fP()
and
\fB\%archive_error_string\fP().
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.
.RE
.SH SEE ALSO
.ad l
\fBarchive_read\fP(3),
\fBarchive_write\fP(3),
\fBlibarchive\fP(3),
\fBprintf\fP(3)
.SH HISTORY
.ad l
The
\fB\%libarchive\fP
library first appeared in
FreeBSD 5.3.
.SH AUTHORS
.ad l
-nosplit
The
\fB\%libarchive\fP
library was written by
Tim Kientzle \%<kientzle@acm.org.>