xref: /freebsd/contrib/libarchive/libarchive/archive_entry.3 (revision fd082e96c469d04c399fc0556f40cb7152ee9148)
1caf54c4fSMartin Matuska.\" Copyright (c) 2003-2007 Tim Kientzle
26c95142eSMartin Matuska.\" Copyright (c) 2010 Joerg Sonnenberger
3caf54c4fSMartin Matuska.\" All rights reserved.
4caf54c4fSMartin Matuska.\"
5caf54c4fSMartin Matuska.\" Redistribution and use in source and binary forms, with or without
6caf54c4fSMartin Matuska.\" modification, are permitted provided that the following conditions
7caf54c4fSMartin Matuska.\" are met:
8caf54c4fSMartin Matuska.\" 1. Redistributions of source code must retain the above copyright
9caf54c4fSMartin Matuska.\"    notice, this list of conditions and the following disclaimer.
10caf54c4fSMartin Matuska.\" 2. Redistributions in binary form must reproduce the above copyright
11caf54c4fSMartin Matuska.\"    notice, this list of conditions and the following disclaimer in the
12caf54c4fSMartin Matuska.\"    documentation and/or other materials provided with the distribution.
13caf54c4fSMartin Matuska.\"
14caf54c4fSMartin Matuska.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15caf54c4fSMartin Matuska.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16caf54c4fSMartin Matuska.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17caf54c4fSMartin Matuska.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18caf54c4fSMartin Matuska.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19caf54c4fSMartin Matuska.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20caf54c4fSMartin Matuska.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21caf54c4fSMartin Matuska.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22caf54c4fSMartin Matuska.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23caf54c4fSMartin Matuska.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24caf54c4fSMartin Matuska.\" SUCH DAMAGE.
25caf54c4fSMartin Matuska.\"
266c22d9efSMartin Matuska.\" $FreeBSD$
27caf54c4fSMartin Matuska.\"
28*fd082e96SMartin Matuska.Dd Feburary 2, 2012
29e2f3482bSMartin Matuska.Dt ARCHIVE_ENTRY 3
30caf54c4fSMartin Matuska.Os
31caf54c4fSMartin Matuska.Sh NAME
32caf54c4fSMartin Matuska.Nm archive_entry_clear ,
33caf54c4fSMartin Matuska.Nm archive_entry_clone ,
34caf54c4fSMartin Matuska.Nm archive_entry_free ,
35caf54c4fSMartin Matuska.Nm archive_entry_new ,
366c95142eSMartin Matuska.Nd functions for managing archive entry descriptions
37*fd082e96SMartin Matuska.Sh LIBRARY
38*fd082e96SMartin MatuskaStreaming Archive Library (libarchive, -larchive)
39caf54c4fSMartin Matuska.Sh SYNOPSIS
40caf54c4fSMartin Matuska.In archive_entry.h
41caf54c4fSMartin Matuska.Ft "struct archive_entry *"
42caf54c4fSMartin Matuska.Fn archive_entry_clear "struct archive_entry *"
43caf54c4fSMartin Matuska.Ft struct archive_entry *
44caf54c4fSMartin Matuska.Fn archive_entry_clone "struct archive_entry *"
45caf54c4fSMartin Matuska.Ft void
46caf54c4fSMartin Matuska.Fn archive_entry_free "struct archive_entry *"
47caf54c4fSMartin Matuska.Ft struct archive_entry *
48caf54c4fSMartin Matuska.Fn archive_entry_new "void"
49caf54c4fSMartin Matuska.Sh DESCRIPTION
50caf54c4fSMartin MatuskaThese functions create and manipulate data objects that
51caf54c4fSMartin Matuskarepresent entries within an archive.
52caf54c4fSMartin MatuskaYou can think of a
53caf54c4fSMartin Matuska.Tn struct archive_entry
54caf54c4fSMartin Matuskaas a heavy-duty version of
55caf54c4fSMartin Matuska.Tn struct stat :
56caf54c4fSMartin Matuskait includes everything from
57caf54c4fSMartin Matuska.Tn struct stat
58caf54c4fSMartin Matuskaplus associated pathname, textual group and user names, etc.
59caf54c4fSMartin MatuskaThese objects are used by
60caf54c4fSMartin Matuska.Xr libarchive 3
61caf54c4fSMartin Matuskato represent the metadata associated with a particular
62caf54c4fSMartin Matuskaentry in an archive.
63caf54c4fSMartin Matuska.Ss Create and Destroy
64caf54c4fSMartin MatuskaThere are functions to allocate, destroy, clear, and copy
65caf54c4fSMartin Matuska.Va archive_entry
66caf54c4fSMartin Matuskaobjects:
67caf54c4fSMartin Matuska.Bl -tag -compact -width indent
68caf54c4fSMartin Matuska.It Fn archive_entry_clear
69caf54c4fSMartin MatuskaErases the object, resetting all internal fields to the
70caf54c4fSMartin Matuskasame state as a newly-created object.
71caf54c4fSMartin MatuskaThis is provided to allow you to quickly recycle objects
72caf54c4fSMartin Matuskawithout thrashing the heap.
73caf54c4fSMartin Matuska.It Fn archive_entry_clone
74caf54c4fSMartin MatuskaA deep copy operation; all text fields are duplicated.
75caf54c4fSMartin Matuska.It Fn archive_entry_free
76caf54c4fSMartin MatuskaReleases the
77caf54c4fSMartin Matuska.Tn struct archive_entry
78caf54c4fSMartin Matuskaobject.
79caf54c4fSMartin Matuska.It Fn archive_entry_new
80caf54c4fSMartin MatuskaAllocate and return a blank
81caf54c4fSMartin Matuska.Tn struct archive_entry
82caf54c4fSMartin Matuskaobject.
83caf54c4fSMartin Matuska.El
846c95142eSMartin Matuska.Ss Function groups
856c95142eSMartin MatuskaDue to high number of functions, the accessor functions can be found in
866c95142eSMartin Matuskaman pages grouped by the purpose.
876c95142eSMartin Matuska.Bl -tag -width ".Xr archive_entry_perms 3"
886c95142eSMartin Matuska.It Xr archive_entry_acl 3
896c95142eSMartin MatuskaAccess Control List manipulation
906c95142eSMartin Matuska.It Xr archive_entry_paths 3
916c95142eSMartin MatuskaPath name manipulation
926c95142eSMartin Matuska.It Xr archive_entry_perms 3
936c95142eSMartin MatuskaUser, group and mode manipulation
946c95142eSMartin Matuska.It Xr archive_entry_stat 3
956c95142eSMartin MatuskaFunctions not in the other groups and copying to/from
966c95142eSMartin Matuska.Vt struct stat .
976c95142eSMartin Matuska.It Xr archive_entry_time 3
986c95142eSMartin MatuskaTime field manipulation
996c95142eSMartin Matuska.El
1006c95142eSMartin Matuska.Pp
1016c95142eSMartin MatuskaMost of the functions set or read entries in an object.
102caf54c4fSMartin MatuskaSuch functions have one of the following forms:
103caf54c4fSMartin Matuska.Bl -tag -compact -width indent
104caf54c4fSMartin Matuska.It Fn archive_entry_set_XXXX
105caf54c4fSMartin MatuskaStores the provided data in the object.
106caf54c4fSMartin MatuskaIn particular, for strings, the pointer is stored,
107caf54c4fSMartin Matuskanot the referenced string.
108caf54c4fSMartin Matuska.It Fn archive_entry_copy_XXXX
109caf54c4fSMartin MatuskaAs above, except that the referenced data is copied
110caf54c4fSMartin Matuskainto the object.
111caf54c4fSMartin Matuska.It Fn archive_entry_XXXX
112caf54c4fSMartin MatuskaReturns the specified data.
113caf54c4fSMartin MatuskaIn the case of strings, a const-qualified pointer to
114caf54c4fSMartin Matuskathe string is returned.
115caf54c4fSMartin Matuska.El
116caf54c4fSMartin MatuskaString data can be set or accessed as wide character strings
117caf54c4fSMartin Matuskaor normal
118caf54c4fSMartin Matuska.Va char
119caf54c4fSMartin Matuskastrings.
120caf54c4fSMartin MatuskaThe functions that use wide character strings are suffixed with
121caf54c4fSMartin Matuska.Cm _w .
122caf54c4fSMartin MatuskaNote that these are different representations of the same data:
123caf54c4fSMartin MatuskaFor example, if you store a narrow string and read the corresponding
124caf54c4fSMartin Matuskawide string, the object will transparently convert formats
125caf54c4fSMartin Matuskausing the current locale.
126caf54c4fSMartin MatuskaSimilarly, if you store a wide string and then store a
127caf54c4fSMartin Matuskanarrow string for the same data, the previously-set wide string will
128caf54c4fSMartin Matuskabe discarded in favor of the new data.
129caf54c4fSMartin Matuska.Pp
130caf54c4fSMartin Matuska.\" .Sh EXAMPLE
131caf54c4fSMartin Matuska.\" .Sh RETURN VALUES
132caf54c4fSMartin Matuska.\" .Sh ERRORS
133caf54c4fSMartin Matuska.Sh SEE ALSO
1346c95142eSMartin Matuska.Xr archive 3 ,
1356c95142eSMartin Matuska.Xr archive_entry_acl 3 ,
1366c95142eSMartin Matuska.Xr archive_entry_paths 3 ,
1376c95142eSMartin Matuska.Xr archive_entry_perms 3 ,
1386c95142eSMartin Matuska.Xr archive_entry_time 3
139caf54c4fSMartin Matuska.Sh HISTORY
140caf54c4fSMartin MatuskaThe
141caf54c4fSMartin Matuska.Nm libarchive
142caf54c4fSMartin Matuskalibrary first appeared in
143caf54c4fSMartin Matuska.Fx 5.3 .
144caf54c4fSMartin Matuska.Sh AUTHORS
145caf54c4fSMartin Matuska.An -nosplit
146caf54c4fSMartin MatuskaThe
147caf54c4fSMartin Matuska.Nm libarchive
148caf54c4fSMartin Matuskalibrary was written by
149caf54c4fSMartin Matuska.An Tim Kientzle Aq kientzle@acm.org .
150caf54c4fSMartin Matuska.\" .Sh BUGS
151