Blame doc/text/archive_util.3.txt

Packit 08bd4c
ARCHIVE_UTIL(3) 	 BSD Library Functions Manual	       ARCHIVE_UTIL(3)
Packit 08bd4c
Packit 08bd4c
NAME
Packit 08bd4c
     archive_clear_error, archive_compression, archive_compression_name,
Packit 08bd4c
     archive_copy_error, archive_errno, archive_error_string,
Packit 08bd4c
     archive_file_count, archive_filter_code, archive_filter_count,
Packit 08bd4c
     archive_filter_name, archive_format, archive_format_name,
Packit 08bd4c
     archive_position, archive_set_error — libarchive utility functions
Packit 08bd4c
Packit 08bd4c
LIBRARY
Packit 08bd4c
     Streaming Archive Library (libarchive, -larchive)
Packit 08bd4c
Packit 08bd4c
SYNOPSIS
Packit 08bd4c
     #include <archive.h>
Packit 08bd4c
Packit 08bd4c
     void
Packit 08bd4c
     archive_clear_error(struct archive *);
Packit 08bd4c
Packit 08bd4c
     int
Packit 08bd4c
     archive_compression(struct archive *);
Packit 08bd4c
Packit 08bd4c
     const char *
Packit 08bd4c
     archive_compression_name(struct archive *);
Packit 08bd4c
Packit 08bd4c
     void
Packit 08bd4c
     archive_copy_error(struct archive *, struct archive *);
Packit 08bd4c
Packit 08bd4c
     int
Packit 08bd4c
     archive_errno(struct archive *);
Packit 08bd4c
Packit 08bd4c
     const char *
Packit 08bd4c
     archive_error_string(struct archive *);
Packit 08bd4c
Packit 08bd4c
     int
Packit 08bd4c
     archive_file_count(struct archive *);
Packit 08bd4c
Packit 08bd4c
     int
Packit 08bd4c
     archive_filter_code(struct archive *, int);
Packit 08bd4c
Packit 08bd4c
     int
Packit 08bd4c
     archive_filter_count(struct archive *, int);
Packit 08bd4c
Packit 08bd4c
     const char *
Packit 08bd4c
     archive_filter_name(struct archive *, int);
Packit 08bd4c
Packit 08bd4c
     int
Packit 08bd4c
     archive_format(struct archive *);
Packit 08bd4c
Packit 08bd4c
     const char *
Packit 08bd4c
     archive_format_name(struct archive *);
Packit 08bd4c
Packit 08bd4c
     int64_t
Packit 08bd4c
     archive_position(struct archive *, int);
Packit 08bd4c
Packit 08bd4c
     void
Packit 08bd4c
     archive_set_error(struct archive *, int error_code, const char *fmt,
Packit 08bd4c
	 ...);
Packit 08bd4c
Packit 08bd4c
DESCRIPTION
Packit 08bd4c
     These functions provide access to various information about the struct
Packit 08bd4c
     archive object used in the libarchive(3) library.
Packit 08bd4c
     archive_clear_error()
Packit 08bd4c
	     Clears any error information left over from a previous call.  Not
Packit 08bd4c
	     generally used in client code.
Packit 08bd4c
     archive_compression()
Packit 08bd4c
	     Synonym for archive_filter_code(a,(0)).
Packit 08bd4c
     archive_compression_name()
Packit 08bd4c
	     Synonym for archive_filter_name(a,(0)).
Packit 08bd4c
     archive_copy_error()
Packit 08bd4c
	     Copies error information from one archive to another.
Packit 08bd4c
     archive_errno()
Packit 08bd4c
	     Returns a numeric error code (see errno(2)) indicating the reason
Packit 08bd4c
	     for the most recent error return.	Note that this can not be
Packit 08bd4c
	     reliably used to detect whether an error has occurred.  It should
Packit 08bd4c
	     be used only after another libarchive function has returned an
Packit 08bd4c
	     error status.
Packit 08bd4c
     archive_error_string()
Packit 08bd4c
	     Returns a textual error message suitable for display.  The error
Packit 08bd4c
	     message here is usually more specific than that obtained from
Packit 08bd4c
	     passing the result of archive_errno() to strerror(3).
Packit 08bd4c
     archive_file_count()
Packit 08bd4c
	     Returns a count of the number of files processed by this archive
Packit 08bd4c
	     object.  The count is incremented by calls to
Packit 08bd4c
	     archive_write_header(3) or archive_read_next_header(3).
Packit 08bd4c
     archive_filter_code()
Packit 08bd4c
	     Returns a numeric code identifying the indicated filter.  See
Packit 08bd4c
	     archive_filter_count() for details of the numbering.
Packit 08bd4c
     archive_filter_count()
Packit 08bd4c
	     Returns the number of filters in the current pipeline.  For read
Packit 08bd4c
	     archive handles, these filters are added automatically by the
Packit 08bd4c
	     automatic format detection.  For write archive handles, these
Packit 08bd4c
	     filters are added by calls to the various
Packit 08bd4c
	     archive_write_add_filter_XXX() functions.	Filters in the result‐
Packit 08bd4c
	     ing pipeline are numbered so that filter 0 is the filter closest
Packit 08bd4c
	     to the format handler.  As a convenience, functions that expect a
Packit 08bd4c
	     filter number will accept -1 as a synonym for the highest-num‐
Packit 08bd4c
	     bered filter.
Packit 08bd4c
Packit 08bd4c
	     For example, when reading a uuencoded gzipped tar archive, there
Packit 08bd4c
	     are three filters: filter 0 is the gunzip filter, filter 1 is the
Packit 08bd4c
	     uudecode filter, and filter 2 is the pseudo-filter that wraps the
Packit 08bd4c
	     archive read functions.  In this case, requesting
Packit 08bd4c
	     archive_position(a,(-1)) would be a synonym for
Packit 08bd4c
	     archive_position(a,(2)) which would return the number of bytes
Packit 08bd4c
	     currently read from the archive, while archive_position(a,(1))
Packit 08bd4c
	     would return the number of bytes after uudecoding, and
Packit 08bd4c
	     archive_position(a,(0)) would return the number of bytes after
Packit 08bd4c
	     decompression.
Packit 08bd4c
     archive_filter_name()
Packit 08bd4c
	     Returns a textual name identifying the indicated filter.  See
Packit 08bd4c
	     archive_filter_count() for details of the numbering.
Packit 08bd4c
     archive_format()
Packit 08bd4c
	     Returns a numeric code indicating the format of the current ar‐
Packit 08bd4c
	     chive entry.  This value is set by a successful call to
Packit 08bd4c
	     archive_read_next_header().  Note that it is common for this
Packit 08bd4c
	     value to change from entry to entry.  For example, a tar archive
Packit 08bd4c
	     might have several entries that utilize GNU tar extensions and
Packit 08bd4c
	     several entries that do not.  These entries will have different
Packit 08bd4c
	     format codes.
Packit 08bd4c
     archive_format_name()
Packit 08bd4c
	     A textual description of the format of the current entry.
Packit 08bd4c
     archive_position()
Packit 08bd4c
	     Returns the number of bytes read from or written to the indicated
Packit 08bd4c
	     filter.  In particular, archive_position(a,(0)) returns the num‐
Packit 08bd4c
	     ber of bytes read or written by the format handler, while
Packit 08bd4c
	     archive_position(a,(-1)) returns the number of bytes read or
Packit 08bd4c
	     written to the archive.  See archive_filter_count() for details
Packit 08bd4c
	     of the numbering here.
Packit 08bd4c
     archive_set_error()
Packit 08bd4c
	     Sets the numeric error code and error description that will be
Packit 08bd4c
	     returned by archive_errno() and archive_error_string().  This
Packit 08bd4c
	     function should be used within I/O callbacks to set system-spe‐
Packit 08bd4c
	     cific error codes and error descriptions.	This function accepts
Packit 08bd4c
	     a printf-like format string and arguments.  However, you should
Packit 08bd4c
	     be careful to use only the following printf format specifiers:
Packit 08bd4c
	     “%c”, “%d”, “%jd”, “%jo”, “%ju”, “%jx”, “%ld”, “%lo”, “%lu”,
Packit 08bd4c
	     “%lx”, “%o”, “%u”, “%s”, “%x”, “%%”.  Field-width specifiers and
Packit 08bd4c
	     other printf features are not uniformly supported and should not
Packit 08bd4c
	     be used.
Packit 08bd4c
Packit 08bd4c
SEE ALSO
Packit 08bd4c
     archive_read(3), archive_write(3), libarchive(3), printf(3)
Packit 08bd4c
Packit 08bd4c
HISTORY
Packit 08bd4c
     The libarchive library first appeared in FreeBSD 5.3.
Packit 08bd4c
Packit 08bd4c
AUTHORS
Packit 08bd4c
     The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
Packit 08bd4c
Packit 08bd4c
BSD			       February 2, 2012 			   BSD