.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 Fo archive_set_error Fa "struct archive *" Fa "int error_code" Fa "const char *fmt" Fa "..." Fc .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.>