Blame libarchive/archive_entry.3

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