.Nm archive_read_open_fd ,
.Nm archive_read_open_FILE ,
.Nm archive_read_open_filename ,
+.Nm archive_read_open_filenames ,
.Nm archive_read_open_memory
.Nd functions for reading streaming archives
.Sh LIBRARY
.Fa "size_t block_size"
.Fc
.Ft int
+.Fo archive_read_open_filenames
+.Fa "struct archive *"
+.Fa "const char **filenames"
+.Fa "size_t block_size"
+.Fc
+.Ft int
.Fn archive_read_open_memory "struct archive *" "const void *buff" "size_t size"
.Sh DESCRIPTION
.Bl -tag -compact -width indent
except that it accepts a simple filename and a block size.
A NULL filename represents standard input.
This function is safe for use with tape drives or other blocked devices.
+.It Fn archive_read_open_filenames
+Like
+.Fn archive_read_open ,
+except that it accepts a NULL-terminated array of filenames to open in
+sequence (as would be created by the
+.Xr split 1
+command) and a block size.
+A NULL filename at the beginning of the array represents standard input.
+This function is safe for use with tape drives or other blocked devices.
.It Fn archive_read_open_memory
Like
.Fn archive_read_open ,
.Nm archive_errno ,
.Nm archive_error_string ,
.Nm archive_file_count ,
+.Nm archive_filter_bytes ,
.Nm archive_filter_code ,
.Nm archive_filter_count ,
.Nm archive_filter_name ,
.Nm archive_format ,
.Nm archive_format_name ,
-.Nm archive_position ,
+.Nm archive_free ,
+.Nm archive_position_compressed ,
+.Nm archive_position_uncompressed ,
.Nm archive_set_error
.Nd libarchive utility functions
.Sh LIBRARY
.Fn archive_error_string "struct archive *"
.Ft int
.Fn archive_file_count "struct archive *"
+.Ft int64_t
+.Fn archive_filter_bytes "struct archive *" "int"
.Ft int
.Fn archive_filter_code "struct archive *" "int"
.Ft int
.Fn archive_format "struct archive *"
.Ft const char *
.Fn archive_format_name "struct archive *"
+.Ft int
+.Fn archive_free "struct archive *"
+.Ft int64_t
+.Fn archive_position_compressed "struct archive *"
.Ft int64_t
-.Fn archive_position "struct archive *" "int"
+.Fn archive_position_uncompressed "struct archive *"
.Ft void
.Fo archive_set_error
.Fa "struct archive *"
filter 1 is the uudecode filter,
and filter 2 is the pseudo-filter that wraps the archive read functions.
In this case, requesting
-.Fn archive_position a -1
+.Fn archive_filter_bytes a -1
would be a synonym for
-.Fn archive_position a 2
+.Fn archive_filter_bytes a 2
which would return the number of bytes currently read from the archive, while
-.Fn archive_position a 1
+.Fn archive_filter_bytes a 1
would return the number of bytes after uudecoding, and
-.Fn archive_position a 0
+.Fn archive_filter_bytes a 0
would return the number of bytes after decompression.
.It Fn archive_filter_name
Returns a textual name identifying the indicated filter.
These entries will have different format codes.
.It Fn archive_format_name
A textual description of the format of the current entry.
-.It Fn archive_position
+.It Fn archive_free
+Closes the archive if necessary, then releases all resources.
+.It Fn archive_filter_bytes
Returns the number of bytes read from or written to the indicated filter.
In particular,
-.Fn archive_position a 0
+.Fn archive_filter_bytes a 0
returns the number of bytes read or written by the format handler, while
-.Fn archive_position a -1
+.Fn archive_filter_bytes a -1
returns the number of bytes read or written to the archive.
See
.Fn archive_filter_count
for details of the numbering here.
+.It Fn archive_position_compressed
+Synonym for
+.Fn archive_filter_bytes a -1 .
+.It Fn archive_position_uncompressed
+Synonym for
+.Fn archive_filter_bytes a 0 .
.It Fn archive_set_error
Sets the numeric error code and error description that will be returned
by
.Ft int
.Fn archive_write_add_filter_b64encode "struct archive *"
.Ft int
+.Fn archive_write_add_filter_by_name "struct archive *" "const char *name"
+.Ft int
.Fn archive_write_add_filter_bzip2 "struct archive *"
.Ft int
.Fn archive_write_add_filter_compress "struct archive *"
.Xc
The output will be encoded as specified.
The encoded output is always properly blocked.
+.It Fn archive_write_add_filter_by_name
+Sets the corresponding filter based on the common name.
.It Fn archive_write_add_filter_none
This is never necessary.
It is provided only for backwards compatibility.
.Sh RETURN VALUES
These functions return
.Cm ARCHIVE_OK
+.Po or
+.Cm ARCHIVE_WARN
+if an external program had to be executed to handle the filter
+.Pc
on success, or
.Cm ARCHIVE_FATAL .
.\"
.Fn archive_write_set_format_filter_by_ext
.Fn archive_write_set_format_filter_by_ext_def
.Xc
-Sets both filters and format based on the output filename.
+Sets both filters and format based on the output filename, optionally
+referring to a default extension if the supplied filename does not have a
+known one.
Supported extensions: .7z, .zip, .jar, .cpio, .iso, .a, .ar, .tar, .tgz, .tar.gz, .tar.bz2, .tar.xz
.It Xo
.Fn archive_write_set_format_7zip