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.\" 264657548dSMartin Matuska.Dd February 2, 2012 27e2f3482bSMartin Matuska.Dt ARCHIVE_ENTRY 3 28caf54c4fSMartin Matuska.Os 29caf54c4fSMartin Matuska.Sh NAME 30caf54c4fSMartin Matuska.Nm archive_entry_clear , 31caf54c4fSMartin Matuska.Nm archive_entry_clone , 32caf54c4fSMartin Matuska.Nm archive_entry_free , 33*f057565eSMartin Matuska.Nm archive_entry_new 346c95142eSMartin Matuska.Nd functions for managing archive entry descriptions 35fd082e96SMartin Matuska.Sh LIBRARY 36fd082e96SMartin MatuskaStreaming Archive Library (libarchive, -larchive) 37caf54c4fSMartin Matuska.Sh SYNOPSIS 38caf54c4fSMartin Matuska.In archive_entry.h 39caf54c4fSMartin Matuska.Ft "struct archive_entry *" 40caf54c4fSMartin Matuska.Fn archive_entry_clear "struct archive_entry *" 41caf54c4fSMartin Matuska.Ft struct archive_entry * 42caf54c4fSMartin Matuska.Fn archive_entry_clone "struct archive_entry *" 43caf54c4fSMartin Matuska.Ft void 44caf54c4fSMartin Matuska.Fn archive_entry_free "struct archive_entry *" 45caf54c4fSMartin Matuska.Ft struct archive_entry * 46caf54c4fSMartin Matuska.Fn archive_entry_new "void" 47caf54c4fSMartin Matuska.Sh DESCRIPTION 48caf54c4fSMartin MatuskaThese functions create and manipulate data objects that 49caf54c4fSMartin Matuskarepresent entries within an archive. 50caf54c4fSMartin MatuskaYou can think of a 51caf54c4fSMartin Matuska.Tn struct archive_entry 52caf54c4fSMartin Matuskaas a heavy-duty version of 53caf54c4fSMartin Matuska.Tn struct stat : 54caf54c4fSMartin Matuskait includes everything from 55caf54c4fSMartin Matuska.Tn struct stat 56caf54c4fSMartin Matuskaplus associated pathname, textual group and user names, etc. 57caf54c4fSMartin MatuskaThese objects are used by 58caf54c4fSMartin Matuska.Xr libarchive 3 59caf54c4fSMartin Matuskato represent the metadata associated with a particular 60caf54c4fSMartin Matuskaentry in an archive. 61caf54c4fSMartin Matuska.Ss Create and Destroy 62caf54c4fSMartin MatuskaThere are functions to allocate, destroy, clear, and copy 63caf54c4fSMartin Matuska.Va archive_entry 64caf54c4fSMartin Matuskaobjects: 65caf54c4fSMartin Matuska.Bl -tag -compact -width indent 66caf54c4fSMartin Matuska.It Fn archive_entry_clear 67caf54c4fSMartin MatuskaErases the object, resetting all internal fields to the 68caf54c4fSMartin Matuskasame state as a newly-created object. 69caf54c4fSMartin MatuskaThis is provided to allow you to quickly recycle objects 70caf54c4fSMartin Matuskawithout thrashing the heap. 71caf54c4fSMartin Matuska.It Fn archive_entry_clone 72caf54c4fSMartin MatuskaA deep copy operation; all text fields are duplicated. 73caf54c4fSMartin Matuska.It Fn archive_entry_free 74caf54c4fSMartin MatuskaReleases the 75caf54c4fSMartin Matuska.Tn struct archive_entry 76caf54c4fSMartin Matuskaobject. 77caf54c4fSMartin Matuska.It Fn archive_entry_new 78caf54c4fSMartin MatuskaAllocate and return a blank 79caf54c4fSMartin Matuska.Tn struct archive_entry 80caf54c4fSMartin Matuskaobject. 81caf54c4fSMartin Matuska.El 826c95142eSMartin Matuska.Ss Function groups 836c95142eSMartin MatuskaDue to high number of functions, the accessor functions can be found in 846c95142eSMartin Matuskaman pages grouped by the purpose. 856c95142eSMartin Matuska.Bl -tag -width ".Xr archive_entry_perms 3" 866c95142eSMartin Matuska.It Xr archive_entry_acl 3 876c95142eSMartin MatuskaAccess Control List manipulation 886c95142eSMartin Matuska.It Xr archive_entry_paths 3 896c95142eSMartin MatuskaPath name manipulation 906c95142eSMartin Matuska.It Xr archive_entry_perms 3 916c95142eSMartin MatuskaUser, group and mode manipulation 926c95142eSMartin Matuska.It Xr archive_entry_stat 3 936c95142eSMartin MatuskaFunctions not in the other groups and copying to/from 946c95142eSMartin Matuska.Vt struct stat . 956c95142eSMartin Matuska.It Xr archive_entry_time 3 966c95142eSMartin MatuskaTime field manipulation 976c95142eSMartin Matuska.El 986c95142eSMartin Matuska.Pp 996c95142eSMartin MatuskaMost of the functions set or read entries in an object. 100caf54c4fSMartin MatuskaSuch functions have one of the following forms: 101caf54c4fSMartin Matuska.Bl -tag -compact -width indent 102caf54c4fSMartin Matuska.It Fn archive_entry_set_XXXX 103caf54c4fSMartin MatuskaStores the provided data in the object. 104caf54c4fSMartin MatuskaIn particular, for strings, the pointer is stored, 105caf54c4fSMartin Matuskanot the referenced string. 106caf54c4fSMartin Matuska.It Fn archive_entry_copy_XXXX 107caf54c4fSMartin MatuskaAs above, except that the referenced data is copied 108caf54c4fSMartin Matuskainto the object. 109caf54c4fSMartin Matuska.It Fn archive_entry_XXXX 110caf54c4fSMartin MatuskaReturns the specified data. 111caf54c4fSMartin MatuskaIn the case of strings, a const-qualified pointer to 112caf54c4fSMartin Matuskathe string is returned. 113caf54c4fSMartin Matuska.El 114caf54c4fSMartin MatuskaString data can be set or accessed as wide character strings 115caf54c4fSMartin Matuskaor normal 116caf54c4fSMartin Matuska.Va char 117caf54c4fSMartin Matuskastrings. 118caf54c4fSMartin MatuskaThe functions that use wide character strings are suffixed with 119caf54c4fSMartin Matuska.Cm _w . 120caf54c4fSMartin MatuskaNote that these are different representations of the same data: 121caf54c4fSMartin MatuskaFor example, if you store a narrow string and read the corresponding 122caf54c4fSMartin Matuskawide string, the object will transparently convert formats 123caf54c4fSMartin Matuskausing the current locale. 124caf54c4fSMartin MatuskaSimilarly, if you store a wide string and then store a 125caf54c4fSMartin Matuskanarrow string for the same data, the previously-set wide string will 126caf54c4fSMartin Matuskabe discarded in favor of the new data. 127caf54c4fSMartin Matuska.\" .Sh EXAMPLE 128caf54c4fSMartin Matuska.\" .Sh RETURN VALUES 129caf54c4fSMartin Matuska.\" .Sh ERRORS 130caf54c4fSMartin Matuska.Sh SEE ALSO 1316c95142eSMartin Matuska.Xr archive_entry_acl 3 , 1326c95142eSMartin Matuska.Xr archive_entry_paths 3 , 1336c95142eSMartin Matuska.Xr archive_entry_perms 3 , 134*f057565eSMartin Matuska.Xr archive_entry_time 3 , 135*f057565eSMartin Matuska.Xr libarchive 3 136caf54c4fSMartin Matuska.Sh HISTORY 137caf54c4fSMartin MatuskaThe 138caf54c4fSMartin Matuska.Nm libarchive 139caf54c4fSMartin Matuskalibrary first appeared in 140caf54c4fSMartin Matuska.Fx 5.3 . 141caf54c4fSMartin Matuska.Sh AUTHORS 142caf54c4fSMartin Matuska.An -nosplit 143caf54c4fSMartin MatuskaThe 144caf54c4fSMartin Matuska.Nm libarchive 145caf54c4fSMartin Matuskalibrary was written by 146caf54c4fSMartin Matuska.An Tim Kientzle Aq kientzle@acm.org . 147caf54c4fSMartin Matuska.\" .Sh BUGS 148