Blame libarchive/archive_entry.3

Packit Service 1d0348
.\" Copyright (c) 2003-2007 Tim Kientzle
Packit Service 1d0348
.\" Copyright (c) 2010 Joerg Sonnenberger
Packit Service 1d0348
.\" All rights reserved.
Packit Service 1d0348
.\"
Packit Service 1d0348
.\" Redistribution and use in source and binary forms, with or without
Packit Service 1d0348
.\" modification, are permitted provided that the following conditions
Packit Service 1d0348
.\" are met:
Packit Service 1d0348
.\" 1. Redistributions of source code must retain the above copyright
Packit Service 1d0348
.\"    notice, this list of conditions and the following disclaimer.
Packit Service 1d0348
.\" 2. Redistributions in binary form must reproduce the above copyright
Packit Service 1d0348
.\"    notice, this list of conditions and the following disclaimer in the
Packit Service 1d0348
.\"    documentation and/or other materials provided with the distribution.
Packit Service 1d0348
.\"
Packit Service 1d0348
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
Packit Service 1d0348
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit Service 1d0348
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Packit Service 1d0348
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
Packit Service 1d0348
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit Service 1d0348
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Packit Service 1d0348
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Packit Service 1d0348
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
Packit Service 1d0348
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
Packit Service 1d0348
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
Packit Service 1d0348
.\" SUCH DAMAGE.
Packit Service 1d0348
.\"
Packit Service 1d0348
.\" $FreeBSD$
Packit Service 1d0348
.\"
Packit Service 1d0348
.Dd February 2, 2012
Packit Service 1d0348
.Dt ARCHIVE_ENTRY 3
Packit Service 1d0348
.Os
Packit Service 1d0348
.Sh NAME
Packit Service 1d0348
.Nm archive_entry_clear ,
Packit Service 1d0348
.Nm archive_entry_clone ,
Packit Service 1d0348
.Nm archive_entry_free ,
Packit Service 1d0348
.Nm archive_entry_new ,
Packit Service 1d0348
.Nd functions for managing archive entry descriptions
Packit Service 1d0348
.Sh LIBRARY
Packit Service 1d0348
Streaming Archive Library (libarchive, -larchive)
Packit Service 1d0348
.Sh SYNOPSIS
Packit Service 1d0348
.In archive_entry.h
Packit Service 1d0348
.Ft "struct archive_entry *"
Packit Service 1d0348
.Fn archive_entry_clear "struct archive_entry *"
Packit Service 1d0348
.Ft struct archive_entry *
Packit Service 1d0348
.Fn archive_entry_clone "struct archive_entry *"
Packit Service 1d0348
.Ft void
Packit Service 1d0348
.Fn archive_entry_free "struct archive_entry *"
Packit Service 1d0348
.Ft struct archive_entry *
Packit Service 1d0348
.Fn archive_entry_new "void"
Packit Service 1d0348
.Sh DESCRIPTION
Packit Service 1d0348
These functions create and manipulate data objects that
Packit Service 1d0348
represent entries within an archive.
Packit Service 1d0348
You can think of a
Packit Service 1d0348
.Tn struct archive_entry
Packit Service 1d0348
as a heavy-duty version of
Packit Service 1d0348
.Tn struct stat :
Packit Service 1d0348
it includes everything from
Packit Service 1d0348
.Tn struct stat
Packit Service 1d0348
plus associated pathname, textual group and user names, etc.
Packit Service 1d0348
These objects are used by
Packit Service 1d0348
.Xr libarchive 3
Packit Service 1d0348
to represent the metadata associated with a particular
Packit Service 1d0348
entry in an archive.
Packit Service 1d0348
.Ss Create and Destroy
Packit Service 1d0348
There are functions to allocate, destroy, clear, and copy
Packit Service 1d0348
.Va archive_entry
Packit Service 1d0348
objects:
Packit Service 1d0348
.Bl -tag -compact -width indent
Packit Service 1d0348
.It Fn archive_entry_clear
Packit Service 1d0348
Erases the object, resetting all internal fields to the
Packit Service 1d0348
same state as a newly-created object.
Packit Service 1d0348
This is provided to allow you to quickly recycle objects
Packit Service 1d0348
without thrashing the heap.
Packit Service 1d0348
.It Fn archive_entry_clone
Packit Service 1d0348
A deep copy operation; all text fields are duplicated.
Packit Service 1d0348
.It Fn archive_entry_free
Packit Service 1d0348
Releases the
Packit Service 1d0348
.Tn struct archive_entry
Packit Service 1d0348
object.
Packit Service 1d0348
.It Fn archive_entry_new
Packit Service 1d0348
Allocate and return a blank
Packit Service 1d0348
.Tn struct archive_entry
Packit Service 1d0348
object.
Packit Service 1d0348
.El
Packit Service 1d0348
.Ss Function groups
Packit Service 1d0348
Due to high number of functions, the accessor functions can be found in
Packit Service 1d0348
man pages grouped by the purpose.
Packit Service 1d0348
.Bl -tag -width ".Xr archive_entry_perms 3"
Packit Service 1d0348
.It Xr archive_entry_acl 3
Packit Service 1d0348
Access Control List manipulation
Packit Service 1d0348
.It Xr archive_entry_paths 3
Packit Service 1d0348
Path name manipulation
Packit Service 1d0348
.It Xr archive_entry_perms 3
Packit Service 1d0348
User, group and mode manipulation
Packit Service 1d0348
.It Xr archive_entry_stat 3
Packit Service 1d0348
Functions not in the other groups and copying to/from
Packit Service 1d0348
.Vt struct stat .
Packit Service 1d0348
.It Xr archive_entry_time 3
Packit Service 1d0348
Time field manipulation
Packit Service 1d0348
.El
Packit Service 1d0348
.Pp
Packit Service 1d0348
Most of the functions set or read entries in an object.
Packit Service 1d0348
Such functions have one of the following forms:
Packit Service 1d0348
.Bl -tag -compact -width indent
Packit Service 1d0348
.It Fn archive_entry_set_XXXX
Packit Service 1d0348
Stores the provided data in the object.
Packit Service 1d0348
In particular, for strings, the pointer is stored,
Packit Service 1d0348
not the referenced string.
Packit Service 1d0348
.It Fn archive_entry_copy_XXXX
Packit Service 1d0348
As above, except that the referenced data is copied
Packit Service 1d0348
into the object.
Packit Service 1d0348
.It Fn archive_entry_XXXX
Packit Service 1d0348
Returns the specified data.
Packit Service 1d0348
In the case of strings, a const-qualified pointer to
Packit Service 1d0348
the string is returned.
Packit Service 1d0348
.El
Packit Service 1d0348
String data can be set or accessed as wide character strings
Packit Service 1d0348
or normal
Packit Service 1d0348
.Va char
Packit Service 1d0348
strings.
Packit Service 1d0348
The functions that use wide character strings are suffixed with
Packit Service 1d0348
.Cm _w .
Packit Service 1d0348
Note that these are different representations of the same data:
Packit Service 1d0348
For example, if you store a narrow string and read the corresponding
Packit Service 1d0348
wide string, the object will transparently convert formats
Packit Service 1d0348
using the current locale.
Packit Service 1d0348
Similarly, if you store a wide string and then store a
Packit Service 1d0348
narrow string for the same data, the previously-set wide string will
Packit Service 1d0348
be discarded in favor of the new data.
Packit Service 1d0348
.Pp
Packit Service 1d0348
.\" .Sh EXAMPLE
Packit Service 1d0348
.\" .Sh RETURN VALUES
Packit Service 1d0348
.\" .Sh ERRORS
Packit Service 1d0348
.Sh SEE ALSO
Packit Service 1d0348
.Xr archive_entry_acl 3 ,
Packit Service 1d0348
.Xr archive_entry_paths 3 ,
Packit Service 1d0348
.Xr archive_entry_perms 3 ,
Packit Service 1d0348
.Xr archive_entry_time 3
Packit Service 1d0348
.Xr libarchive 3 ,
Packit Service 1d0348
.Sh HISTORY
Packit Service 1d0348
The
Packit Service 1d0348
.Nm libarchive
Packit Service 1d0348
library first appeared in
Packit Service 1d0348
.Fx 5.3 .
Packit Service 1d0348
.Sh AUTHORS
Packit Service 1d0348
.An -nosplit
Packit Service 1d0348
The
Packit Service 1d0348
.Nm libarchive
Packit Service 1d0348
library was written by
Packit Service 1d0348
.An Tim Kientzle Aq kientzle@acm.org .
Packit Service 1d0348
.\" .Sh BUGS