de-errno
[dragonfly.git] / contrib / libarchive / archive_util.3
1 .\" Copyright (c) 2003-2004 Tim Kientzle
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD: src/lib/libarchive/archive_util.3,v 1.2 2004/07/04 21:15:37 ru Exp $
26 .\"
27 .Dd October 1, 2003
28 .Dt archive_util 3
29 .Os
30 .Sh NAME
31 .Nm archive_compression ,
32 .Nm archive_compression_name ,
33 .Nm archive_errno ,
34 .Nm archive_error_string ,
35 .Nm archive_format ,
36 .Nm archive_format_name ,
37 .Nm archive_set_error
38 .Nd libarchive utility functions
39 .Sh SYNOPSIS
40 .In archive.h
41 .Ft int
42 .Fn archive_compression "struct archive *"
43 .Ft const char *
44 .Fn archive_compression_name "struct archive *"
45 .Ft int
46 .Fn archive_errno "struct archive *"
47 .Ft const char *
48 .Fn archive_error_string "struct archive *"
49 .Ft int
50 .Fn archive_format "struct archive *"
51 .Ft const char *
52 .Fn archive_format_name "struct archive *"
53 .Ft int
54 .Fn archive_set_error "struct archive *" "int error_code" "const char *fmt" "..."
55 .Sh DESCRIPTION
56 These functions provide access to various information about the
57 .Tn struct archive
58 object used in the
59 .Xr libarchive 3
60 library.
61 .Bl -tag -compact -width indent
62 .It Fn archive_compression
63 Returns a numeric code indicating the current compression.
64 This value is set by
65 .Fn archive_read_open .
66 .It Fn archive_compression_name
67 Returns a text description of the current compression suitable for display.
68 .It Fn archive_errno
69 Returns a numeric error code (see
70 .Xr errno 2 )
71 indicating the reason for the most recent error return.
72 .It Fn archive_error_string
73 Returns a textual error message suitable for display.
74 The error message here is usually more specific than that
75 obtained from passing the result of
76 .Fn archive_errno
77 to
78 .Xr strerror 3 .
79 .It Fn archive_format
80 Returns a numeric code indicating the format of the current
81 archive entry.
82 This value is set by a successful call to
83 .Fn archive_read_next_header .
84 Note that it is common for this value to change from
85 entry to entry.
86 For example, a tar archive might have several entries that
87 utilize GNU tar extensions and several entries that do not.
88 These entries will have different format codes.
89 .It Fn archive_format_name
90 A textual description of the format of the current entry.
91 .It Fn archive_set_error
92 Sets the numeric error code and error description that will be returned
93 by
94 .Fn archive_errno
95 and
96 .Fn archive_error_string .
97 This function is sometimes useful within I/O callbacks.
98 .El
99 .Sh SEE ALSO
100 .Xr archive_read 3 ,
101 .Xr archive_write 3 ,
102 .Xr libarchive 3
103 .Sh HISTORY
104 The
105 .Nm libarchive
106 library first appeared in
107 .Fx 5.3 .
108 .Sh AUTHORS
109 .An -nosplit
110 The
111 .Nm libarchive
112 library was written by
113 .An Tim Kientzle Aq kientzle@acm.org .