1 .\" Copyright (c) 2003-2004 Tim Kientzle
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 .\" $FreeBSD: src/lib/libarchive/archive_entry.3,v 1.9 2004/08/08 07:39:19 kientzle Exp $
31 .Nm archive_entry_acl_add_entry ,
32 .Nm archive_entry_acl_add_entry_w ,
33 .Nm archive_entry_acl_clear ,
34 .Nm archive_entry_acl_count ,
35 .Nm archive_entry_acl_next ,
36 .Nm archive_entry_acl_next_w ,
37 .Nm archive_entry_acl_reset ,
38 .Nm archive_entry_acl_text_w ,
39 .Nm archive_entry_atime ,
40 .Nm archive_entry_atime_nsec ,
41 .Nm archive_entry_clear ,
42 .Nm archive_entry_clone ,
43 .Nm archive_entry_copy_fflags_text_w ,
44 .Nm archive_entry_copy_gname_w ,
45 .Nm archive_entry_copy_hardlink ,
46 .Nm archive_entry_copy_hardlink_w ,
47 .Nm archive_entry_copy_pathname_w ,
48 .Nm archive_entry_copy_stat ,
49 .Nm archive_entry_copy_symlink_w ,
50 .Nm archive_entry_copy_uname_w ,
51 .Nm archive_entry_dev ,
52 .Nm archive_entry_fflags ,
53 .Nm archive_entry_fflags_text ,
54 .Nm archive_entry_free ,
55 .Nm archive_entry_gid ,
56 .Nm archive_entry_gname ,
57 .Nm archive_entry_hardlink ,
58 .Nm archive_entry_ino ,
59 .Nm archive_entry_mode ,
60 .Nm archive_entry_mtime ,
61 .Nm archive_entry_mtime_nsec ,
62 .Nm archive_entry_new ,
63 .Nm archive_entry_pathname ,
64 .Nm archive_entry_pathname_w ,
65 .Nm archive_entry_rdev ,
66 .Nm archive_entry_rdevmajor ,
67 .Nm archive_entry_rdevminor ,
68 .Nm archive_entry_set_fflags ,
69 .Nm archive_entry_set_gid ,
70 .Nm archive_entry_set_gname ,
71 .Nm archive_entry_set_hardlink ,
72 .Nm archive_entry_set_link ,
73 .Nm archive_entry_set_mode ,
74 .Nm archive_entry_set_mtime ,
75 .Nm archive_entry_set_pathname ,
76 .Nm archive_entry_set_rdevmajor ,
77 .Nm archive_entry_set_rdevminor ,
78 .Nm archive_entry_set_size ,
79 .Nm archive_entry_set_symlink ,
80 .Nm archive_entry_set_uid ,
81 .Nm archive_entry_set_uname ,
82 .Nm archive_entry_size ,
83 .Nm archive_entry_stat ,
84 .Nm archive_entry_symlink ,
85 .Nm archive_entry_uid ,
86 .Nm archive_entry_uname
87 .Nd functions for manipulating archive entry descriptions
91 .Fn archive_entry_acl_add_entry "struct archive_entry *" "int type" "int permset" "int tag" "int qual" "const char *name"
93 .Fn archive_entry_acl_add_entry_w "struct archive_entry *" "int type" "int permset" "int tag" "int qual" "const wchar_t *name"
95 .Fn archive_entry_acl_clear "struct archive_entry *"
97 .Fn archive_entry_acl_count "struct archive_entry *" "int type"
99 .Fn archive_entry_acl_next "struct archive_entry *" "int want_type" "int *type" "int *permset" "int *tag" "int *qual" "const char **name"
101 .Fn archive_entry_acl_next_w "struct archive_entry *" "int want_type" "int *type" "int *permset" "int *tag" "int *qual" "const wchar_t **name"
103 .Fn archive_entry_acl_reset "struct archive_entry *"
105 .Fn archive_entry_acl_text_w "struct archive_entry *" "int flags"
107 .Fn archive_entry_atime "struct archive_entry *"
109 .Fn archive_entry_atime_nsec "struct archive_entry *"
111 .Fn archive_entry_clear "struct archive_entry *"
112 .Ft struct archive_entry *
113 .Fn archive_entry_clone "struct archive_entry *"
115 .Fn archive_entry_copy_fflags_text_w "struct archive_entry *" "const wchar_t *"
117 .Fn archive_entry_copy_gname_w "struct archive_entry *" "const wchar_t *"
119 .Fn archive_entry_copy_hardlink "struct archive_entry *" "const char *"
121 .Fn archive_entry_copy_hardlink_w "struct archive_entry *" "const wchar_t *"
123 .Fn archive_entry_copy_pathname_w "struct archive_entry *" "const wchar_t *"
125 .Fn archive_entry_copy_stat "struct archive_entry *" "struct stat *"
127 .Fn archive_entry_copy_symlink_w "struct archive_entry *" "const wchar_t *"
129 .Fn archive_entry_copy_uname_w "struct archive_entry *" "const wchar_t *"
131 .Fn archive_entry_dev "struct archive_entry *"
133 .Fn archive_entry_fflags "struct archive_entry *" "unsigned long *set" "unsigned long *clear"
135 .Fn archive_entry_fflags_text "struct archive_entry *"
137 .Fn archive_entry_free "struct archive_entry *"
139 .Fn archive_entry_gname "struct archive_entry *"
141 .Fn archive_entry_hardlink "struct archive_entry *"
143 .Fn archive_entry_ino "struct archive_entry *"
145 .Fn archive_entry_mode "struct archive_entry *"
147 .Fn archive_entry_mtime "struct archive_entry *"
149 .Fn archive_entry_mtime_nsec "struct archive_entry *"
150 .Ft struct archive_entry *
151 .Fn archive_entry_new "void"
153 .Fn archive_entry_pathname "struct archive_entry *"
155 .Fn archive_entry_pathname_w "struct archive_entry *"
157 .Fn archive_entry_rdev "struct archive_entry *"
159 .Fn archive_entry_rdevmajor "struct archive_entry *"
161 .Fn archive_entry_rdevminor "struct archive_entry *"
163 .Fn archive_entry_set_fflags "struct archive_entry *" "unsigned long set" "unsigned long clear"
165 .Fn archive_entry_set_gid "struct archive_entry *" "gid_t"
167 .Fn archive_entry_set_gname "struct archive_entry *" "const char *"
169 .Fn archive_entry_set_hardlink "struct archive_entry *" "const char *"
171 .Fn archive_entry_set_link "struct archive_entry *" "const char *"
173 .Fn archive_entry_set_mode "struct archive_entry *" "mode_t"
175 .Fn archive_entry_set_mtime "struct archive_entry *" "time_t" "long nanos"
177 .Fn archive_entry_set_pathname "struct archive_entry *" "const char *"
179 .Fn archive_entry_set_rdevmajor "struct archive_entry *" "dev_t"
181 .Fn archive_entry_set_rdevminor "struct archive_entry *" "dev_t"
183 .Fn archive_entry_set_size "struct archive_entry *" "int64_t"
185 .Fn archive_entry_set_symlink "struct archive_entry *" "const char *"
187 .Fn archive_entry_set_uid "struct archive_entry *" "uid_t"
189 .Fn archive_entry_set_uname "struct archive_entry *" "const char *"
191 .Fn archive_entry_size "struct archive_entry *"
192 .Ft const struct stat *
193 .Fn archive_entry_stat "struct archive_entry *"
195 .Fn archive_entry_symlink "struct archive_entry *"
197 .Fn archive_entry_uname "struct archive_entry *"
199 These functions create and manipulate data objects that
200 represent entries within an archive.
202 .Tn struct archive_entry
203 as a heavy-duty version of
205 it includes everything from
207 plus associated pathname, textual group and user names, etc.
208 These objects are used by
210 to represent the metadata associated with a particular
212 .Ss Create and Destroy
213 There are functions to allocate, destroy, clear, and copy
216 .Bl -tag -compact -width indent
217 .It Fn archive_entry_clear
218 Erases the object, resetting all internal fields to the
219 same state as a newly-created object.
220 This is provided to allow you to quickly recycle objects
221 without thrashing the heap.
222 .It Fn archive_entry_clone
223 A deep copy operation; all text fields are duplicated.
224 .It Fn archive_entry_free
226 .Tn struct archive_entry
228 .It Fn archive_entry_new
229 Allocate and return a blank
230 .Tn struct archive_entry
233 .Ss Set and Get Functions
234 Most of the functions here set or read entries in an object.
235 Such functions have one of the following forms:
236 .Bl -tag -compact -width indent
237 .It Fn archive_entry_set_XXXX
238 Stores the provided data in the object.
239 In particular, for strings, the pointer is stored,
240 not the referenced string.
241 .It Fn archive_entry_copy_XXXX
242 As above, except that the referenced data is copied
244 .It Fn archive_entry_XXXX
245 Returns the specified data.
246 In the case of strings, a const-qualified pointer to
247 the string is returned.
249 String data can be set or accessed as wide character strings
253 The funtions that use wide character strings are suffixed with
255 Note that these are different representations of the same data:
256 For example, if you store a narrow string and read the corresponding
257 wide string, the object will transparently convert formats
258 using the current locale.
259 Similarly, if you store a wide string and then store a
260 narrow string for the same data, the previously-set wide string will
261 be discarded in favor of the new data.
263 There are a few set/get functions that merit additional description:
264 .Bl -tag -compact -width indent
265 .It Fn archive_entry_set_link
266 This function sets the symlink field if it is already set.
267 Otherwise, it sets the hardlink field.
270 File flags are transparently converted between a bitmap
271 representation and a textual format.
272 For example, if you set the bitmap and ask for text, the library
273 will build a canonical text format.
274 However, if you set a text format and request a text format,
275 you will get back the same text, even if it is ill-formed.
276 If you need to canonicalize a textual flags string, you should first set the
277 text form, then request the bitmap form, then use that to set the bitmap form.
278 Setting the bitmap format will clear the internal text representation
279 and force it to be reconstructed when you next request the text form.
281 The bitmap format consists of two integers, one containing bits
282 that should be set, the other specifying bits that should be
284 Bits not mentioned in either bitmap will be ignored.
285 Usually, the bitmap of bits to be cleared will be set to zero.
286 In unusual circumstances, you can force a fully-specified set
287 of file flags by setting the bitmap of flags to clear to the complement
288 of the bitmap of flags to set.
291 which only includes names for set bits.)
292 Converting a bitmap to a textual string is a platform-specific
293 operation; bits that are not meaningful on the current platform
296 The canonical text format is a comma-separated list of flag names.
298 .Fn archive_entry_copy_fflags_text_w
299 function parses the provided text and sets the internal bitmap values.
300 This is a platform-specific operation; names that are not meaningful
301 on the current platform will be ignored.
302 The function returns a pointer to the start of the first name that was not
303 recognized, or NULL if every name was recognized.
304 Note that every name--including names that follow an unrecognized name--will
305 be evaluated, and the bitmaps will be set to reflect every name that is
307 (In particular, this differs from
309 which stops parsing at the first unrecognized name.)
311 XXX This needs serious help.
315 .Dq Access Control List
316 (ACL) is a list of permissions that grant access to particular users or
317 groups beyond what would normally be provided by standard POSIX mode bits.
318 The ACL handling here addresses some deficiencies in the POSIX.1e draft 17 ACL
320 In particular, POSIX.1e draft 17 specifies several different formats, but
321 none of those formats include both textual user/group names and numeric
324 XXX explain ACL stuff XXX
326 .\" .Sh RETURN VALUES
333 library first appeared in
339 library was written by
340 .An Tim Kientzle Aq kientzle@acm.org .