1archive_util(3) BSD Library Functions Manual archive_util(3)
2
4 archive_clear_error, archive_compression, archive_compression_name,
5 archive_copy_error, archive_errno, archive_error_string,
6 archive_file_count, archive_format, archive_format_name,
7 archive_set_error — libarchive utility functions
8
10 #include <archive.h>
11
12 void
13 archive_clear_error(struct archive *);
14
15 int
16 archive_compression(struct archive *);
17
18 const char *
19 archive_compression_name(struct archive *);
20
21 void
22 archive_copy_error(struct archive *, struct archive *);
23
24 int
25 archive_errno(struct archive *);
26
27 const char *
28 archive_error_string(struct archive *);
29
30 int
31 archive_file_count(struct archive *);
32
33 int
34 archive_format(struct archive *);
35
36 const char *
37 archive_format_name(struct archive *);
38
39 void
40 archive_set_error(struct archive *, int error_code, const char *fmt,
41 ...);
42
44 These functions provide access to various information about the struct
45 archive object used in the libarchive(3) library.
46 archive_clear_error()
47 Clears any error information left over from a previous call. Not
48 generally used in client code.
49 archive_compression()
50 Returns a numeric code indicating the current compression. This
51 value is set by archive_read_open().
52 archive_compression_name()
53 Returns a text description of the current compression suitable
54 for display.
55 archive_copy_error()
56 Copies error information from one archive to another.
57 archive_errno()
58 Returns a numeric error code (see errno(2)) indicating the reason
59 for the most recent error return.
60 archive_error_string()
61 Returns a textual error message suitable for display. The error
62 message here is usually more specific than that obtained from
63 passing the result of archive_errno() to strerror(3).
64 archive_file_count()
65 Returns a count of the number of files processed by this archive
66 object. The count is incremented by calls to
67 archive_write_header or archive_read_next_header.
68 archive_format()
69 Returns a numeric code indicating the format of the current ar‐
70 chive entry. This value is set by a successful call to
71 archive_read_next_header(). Note that it is common for this
72 value to change from entry to entry. For example, a tar archive
73 might have several entries that utilize GNU tar extensions and
74 several entries that do not. These entries will have different
75 format codes.
76 archive_format_name()
77 A textual description of the format of the current entry.
78 archive_set_error()
79 Sets the numeric error code and error description that will be
80 returned by archive_errno() and archive_error_string(). This
81 function should be used within I/O callbacks to set system-spe‐
82 cific error codes and error descriptions. This function accepts
83 a printf-like format string and arguments. However, you should
84 be careful to use only the following printf format specifiers:
85 “%c”, “%d”, “%jd”, “%jo”, “%ju”, “%jx”, “%ld”, “%lo”, “%lu”,
86 “%lx”, “%o”, “%u”, “%s”, “%x”, “%%”. Field-width specifiers and
87 other printf features are not uniformly supported and should not
88 be used.
89
91 archive_read(3), archive_write(3), libarchive(3), printf(3)
92
94 The libarchive library first appeared in FreeBSD 5.3.
95
97 The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
98
99BSD January 8, 2005 BSD