Blame doc/wiki/ManPageArchiveUtil3.wiki

Packit 08bd4c
ARCHIVE_UTIL(3) manual page 
Packit 08bd4c
== NAME == 
Packit 08bd4c
'''archive_clear_error''', 
Packit 08bd4c
'''archive_compression''', 
Packit 08bd4c
'''archive_compression_name''', 
Packit 08bd4c
'''archive_copy_error''', 
Packit 08bd4c
'''archive_errno''', 
Packit 08bd4c
'''archive_error_string''', 
Packit 08bd4c
'''archive_file_count''', 
Packit 08bd4c
'''archive_filter_code''', 
Packit 08bd4c
'''archive_filter_count''', 
Packit 08bd4c
'''archive_filter_name''', 
Packit 08bd4c
'''archive_format''', 
Packit 08bd4c
'''archive_format_name''', 
Packit 08bd4c
'''archive_position''', 
Packit 08bd4c
'''archive_set_error''' 
Packit 08bd4c
- libarchive utility functions 
Packit 08bd4c
== LIBRARY == 
Packit 08bd4c
Streaming Archive Library (libarchive, -larchive) 
Packit 08bd4c
== SYNOPSIS == 
Packit 08bd4c
'''<nowiki>#include <archive.h></nowiki>''' 
Packit 08bd4c

Packit 08bd4c
''void'' 
Packit 08bd4c

Packit 08bd4c
'''archive_clear_error'''(''struct archive *''); 
Packit 08bd4c

Packit 08bd4c
''int'' 
Packit 08bd4c

Packit 08bd4c
'''archive_compression'''(''struct archive *''); 
Packit 08bd4c

Packit 08bd4c
''const char *'' 
Packit 08bd4c

Packit 08bd4c
'''archive_compression_name'''(''struct archive *''); 
Packit 08bd4c

Packit 08bd4c
''void'' 
Packit 08bd4c

Packit 08bd4c
'''archive_copy_error'''(''struct archive *'', ''struct archive *''); 
Packit 08bd4c

Packit 08bd4c
''int'' 
Packit 08bd4c

Packit 08bd4c
'''archive_errno'''(''struct archive *''); 
Packit 08bd4c

Packit 08bd4c
''const char *'' 
Packit 08bd4c

Packit 08bd4c
'''archive_error_string'''(''struct archive *''); 
Packit 08bd4c

Packit 08bd4c
''int'' 
Packit 08bd4c

Packit 08bd4c
'''archive_file_count'''(''struct archive *''); 
Packit 08bd4c

Packit 08bd4c
''int'' 
Packit 08bd4c

Packit 08bd4c
'''archive_filter_code'''(''struct archive *'', ''int''); 
Packit 08bd4c

Packit 08bd4c
''int'' 
Packit 08bd4c

Packit 08bd4c
'''archive_filter_count'''(''struct archive *'', ''int''); 
Packit 08bd4c

Packit 08bd4c
''const char *'' 
Packit 08bd4c

Packit 08bd4c
'''archive_filter_name'''(''struct archive *'', ''int''); 
Packit 08bd4c

Packit 08bd4c
''int'' 
Packit 08bd4c

Packit 08bd4c
'''archive_format'''(''struct archive *''); 
Packit 08bd4c

Packit 08bd4c
''const char *'' 
Packit 08bd4c

Packit 08bd4c
'''archive_format_name'''(''struct archive *''); 
Packit 08bd4c

Packit 08bd4c
''int64_t'' 
Packit 08bd4c

Packit 08bd4c
'''archive_position'''(''struct archive *'', ''int''); 
Packit 08bd4c

Packit 08bd4c
''void'' 
Packit 08bd4c

Packit 08bd4c
'''archive_set_error'''(''struct archive *'', ''int error_code'', ''const char *fmt'', ''...''); 
Packit 08bd4c
== DESCRIPTION == 
Packit 08bd4c
These functions provide access to various information about the 
Packit 08bd4c
'''struct archive''' 
Packit 08bd4c
object used in the 
Packit 08bd4c
[[ManPageibarchive3]] 
Packit 08bd4c
library. 
Packit 08bd4c
Packit 08bd4c
'''archive_clear_error'''()
Packit 08bd4c
Clears any error information left over from a previous call. 
Packit 08bd4c
Not generally used in client code. 
Packit 08bd4c
'''archive_compression'''()
Packit 08bd4c
Synonym for 
Packit 08bd4c
'''archive_filter_code(a,'''(''0)''). 
Packit 08bd4c
'''archive_compression_name'''()
Packit 08bd4c
Synonym for 
Packit 08bd4c
'''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 
Packit 08bd4c
[[errno(2)|http://www.freebsd.org/cgi/man.cgi?query=errno&sektion=2]]) 
Packit 08bd4c
indicating the reason for the most recent error return. 
Packit 08bd4c
Note that this can not be reliably used to detect whether an 
Packit 08bd4c
error has occurred. 
Packit 08bd4c
It should be used only after another libarchive function 
Packit 08bd4c
has returned an error status. 
Packit 08bd4c
'''archive_error_string'''()
Packit 08bd4c
Returns a textual error message suitable for display. 
Packit 08bd4c
The error message here is usually more specific than that 
Packit 08bd4c
obtained from passing the result of 
Packit 08bd4c
'''archive_errno'''() 
Packit 08bd4c
to 
Packit 08bd4c
[[strerror(3)|http://www.freebsd.org/cgi/man.cgi?query=strerror&sektion=3]]. 
Packit 08bd4c
'''archive_file_count'''()
Packit 08bd4c
Returns a count of the number of files processed by this archive object. 
Packit 08bd4c
The count is incremented by calls to 
Packit 08bd4c
[[ManPagerchiveriteeader3]] 
Packit 08bd4c
or 
Packit 08bd4c
[[ManPagerchiveeadexteader3]]. 
Packit 08bd4c
'''archive_filter_code'''()
Packit 08bd4c
Returns a numeric code identifying the indicated filter. 
Packit 08bd4c
See 
Packit 08bd4c
'''archive_filter_count'''() 
Packit 08bd4c
for details of the numbering. 
Packit 08bd4c
'''archive_filter_count'''()
Packit 08bd4c
Returns the number of filters in the current pipeline. 
Packit 08bd4c
For read archive handles, these filters are added automatically 
Packit 08bd4c
by the automatic format detection. 
Packit 08bd4c
For write archive handles, these filters are added by calls to the various 
Packit 08bd4c
'''archive_write_add_filter_XXX'''() 
Packit 08bd4c
functions. 
Packit 08bd4c
Filters in the resulting pipeline are numbered so that filter 0 
Packit 08bd4c
is the filter closest to the format handler. 
Packit 08bd4c
As a convenience, functions that expect a filter number will 
Packit 08bd4c
accept -1 as a synonym for the highest-numbered filter. 
Packit 08bd4c
Packit 08bd4c
For example, when reading a uuencoded gzipped tar archive, there 
Packit 08bd4c
are three filters: 
Packit 08bd4c
filter 0 is the gunzip filter, 
Packit 08bd4c
filter 1 is the uudecode filter, 
Packit 08bd4c
and filter 2 is the pseudo-filter that wraps the archive read functions. 
Packit 08bd4c
In this case, requesting 
Packit 08bd4c
'''archive_position(a,'''(''-1)'') 
Packit 08bd4c
would be a synonym for 
Packit 08bd4c
'''archive_position(a,'''(''2)'') 
Packit 08bd4c
which would return the number of bytes currently read from the archive, while 
Packit 08bd4c
'''archive_position(a,'''(''1)'') 
Packit 08bd4c
would return the number of bytes after uudecoding, and 
Packit 08bd4c
'''archive_position(a,'''(''0)'') 
Packit 08bd4c
would return the number of bytes after decompression. 
Packit 08bd4c
'''archive_filter_name'''()
Packit 08bd4c
Returns a textual name identifying the indicated filter. 
Packit 08bd4c
See 
Packit 08bd4c
'''archive_filter_count'''() 
Packit 08bd4c
for details of the numbering. 
Packit 08bd4c
'''archive_format'''()
Packit 08bd4c
Returns a numeric code indicating the format of the current 
Packit 08bd4c
archive entry. 
Packit 08bd4c
This value is set by a successful call to 
Packit 08bd4c
'''archive_read_next_header'''(). 
Packit 08bd4c
Note that it is common for this value to change from 
Packit 08bd4c
entry to entry. 
Packit 08bd4c
For example, a tar archive might have several entries that 
Packit 08bd4c
utilize GNU tar extensions and several entries that do not. 
Packit 08bd4c
These entries will have different 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 filter. 
Packit 08bd4c
In particular, 
Packit 08bd4c
'''archive_position(a,'''(''0)'') 
Packit 08bd4c
returns the number of bytes read or written by the format handler, while 
Packit 08bd4c
'''archive_position(a,'''(''-1)'') 
Packit 08bd4c
returns the number of bytes read or written to the archive. 
Packit 08bd4c
See 
Packit 08bd4c
'''archive_filter_count'''() 
Packit 08bd4c
for details of the numbering here. 
Packit 08bd4c
'''archive_set_error'''()
Packit 08bd4c
Sets the numeric error code and error description that will be returned 
Packit 08bd4c
by 
Packit 08bd4c
'''archive_errno'''() 
Packit 08bd4c
and 
Packit 08bd4c
'''archive_error_string'''(). 
Packit 08bd4c
This function should be used within I/O callbacks to set system-specific 
Packit 08bd4c
error codes and error descriptions. 
Packit 08bd4c
This function accepts a printf-like format string and arguments. 
Packit 08bd4c
However, you should be careful to use only the following printf 
Packit 08bd4c
format specifiers: 
Packit 08bd4c
"%c", 
Packit 08bd4c
"%d", 
Packit 08bd4c
"%jd", 
Packit 08bd4c
"%jo", 
Packit 08bd4c
"%ju", 
Packit 08bd4c
"%jx", 
Packit 08bd4c
"%ld", 
Packit 08bd4c
"%lo", 
Packit 08bd4c
"%lu", 
Packit 08bd4c
"%lx", 
Packit 08bd4c
"%o", 
Packit 08bd4c
"%u", 
Packit 08bd4c
"%s", 
Packit 08bd4c
"%x", 
Packit 08bd4c
"%%". 
Packit 08bd4c
Field-width specifiers and other printf features are 
Packit 08bd4c
not uniformly supported and should not be used. 
Packit 08bd4c
 
Packit 08bd4c
== SEE ALSO == 
Packit 08bd4c
[[ManPagerchiveead3]], 
Packit 08bd4c
[[ManPagerchiverite3]], 
Packit 08bd4c
[[ManPageibarchive3]], 
Packit 08bd4c
[[printf(3)|http://www.freebsd.org/cgi/man.cgi?query=printf&sektion=3]] 
Packit 08bd4c
== HISTORY == 
Packit 08bd4c
The 
Packit 08bd4c
'''libarchive''' 
Packit 08bd4c
library first appeared in 
Packit 08bd4c
FreeBSD 5.3. 
Packit 08bd4c
== AUTHORS == 
Packit 08bd4c
The 
Packit 08bd4c
'''libarchive''' 
Packit 08bd4c
library was written by 
Packit 08bd4c
Tim Kientzle  <kientzle@acm.org.>