Imported Upstream version 3.3.1
[platform/upstream/libarchive.git] / doc / wiki / ManPageArchiveEntry3.wiki
1 ARCHIVE_ENTRY(3) manual page 
2 == NAME == 
3 '''archive_entry_clear''', 
4 '''archive_entry_clone''', 
5 '''archive_entry_free''', 
6 '''archive_entry_new''', 
7 - functions for managing archive entry descriptions 
8 == LIBRARY == 
9 Streaming Archive Library (libarchive, -larchive) 
10 == SYNOPSIS == 
11 '''<nowiki>#include <archive_entry.h></nowiki>''' 
12 <br> 
13 ''struct archive_entry *'' 
14 <br> 
15 '''archive_entry_clear'''(''struct archive_entry *''); 
16 <br> 
17 ''struct archive_entry *'' 
18 <br> 
19 '''archive_entry_clone'''(''struct archive_entry *''); 
20 <br> 
21 ''void'' 
22 <br> 
23 '''archive_entry_free'''(''struct archive_entry *''); 
24 <br> 
25 ''struct archive_entry *'' 
26 <br> 
27 '''archive_entry_new'''(''void''); 
28 == DESCRIPTION == 
29 These functions create and manipulate data objects that 
30 represent entries within an archive. 
31 You can think of a 
32 '''struct archive_entry''' 
33 as a heavy-duty version of 
34 '''struct stat :''' 
35 it includes everything from 
36 '''struct stat''' 
37 plus associated pathname, textual group and user names, etc. 
38 These objects are used by 
39 [[ManPageLibarchive3]] 
40 to represent the metadata associated with a particular 
41 entry in an archive. 
42 === Create and Destroy=== 
43 There are functions to allocate, destroy, clear, and copy 
44 ''archive_entry'' 
45 objects: 
46 <dl> 
47 <dt>'''archive_entry_clear'''()</dt><dd> 
48 Erases the object, resetting all internal fields to the 
49 same state as a newly-created object. 
50 This is provided to allow you to quickly recycle objects 
51 without thrashing the heap. 
52 </dd><dt>'''archive_entry_clone'''()</dt><dd> 
53 A deep copy operation; all text fields are duplicated. 
54 </dd><dt>'''archive_entry_free'''()</dt><dd> 
55 Releases the 
56 '''struct archive_entry''' 
57 object. 
58 </dd><dt>'''archive_entry_new'''()</dt><dd> 
59 Allocate and return a blank 
60 '''struct archive_entry''' 
61 object. 
62 </dd></dl> 
63 === Function groups=== 
64 Due to high number of functions, the accessor functions can be found in 
65 man pages grouped by the purpose. 
66 <dl> 
67 <dt>[[ManPageArchiveEntryAcl3]]</dt><dd> 
68 Access Control List manipulation 
69 </dd><dt>[[ManPageArchiveEntryPaths3]]</dt><dd> 
70 Path name manipulation 
71 </dd><dt>[[ManPageArchiveEntryPerms3]]</dt><dd> 
72 User, group and mode manipulation 
73 </dd><dt>[[ManPageArchiveEntryStat3]]</dt><dd> 
74 Functions not in the other groups and copying to/from 
75 ''struct'' stat. 
76 </dd><dt>[[ManPageArchiveEntryTime3]]</dt><dd> 
77 Time field manipulation 
78 </dd></dl> 
79
80 Most of the functions set or read entries in an object. 
81 Such functions have one of the following forms: 
82 <dl> 
83 <dt>'''archive_entry_set_XXXX'''()</dt><dd> 
84 Stores the provided data in the object. 
85 In particular, for strings, the pointer is stored, 
86 not the referenced string. 
87 </dd><dt>'''archive_entry_copy_XXXX'''()</dt><dd> 
88 As above, except that the referenced data is copied 
89 into the object. 
90 </dd><dt>'''archive_entry_XXXX'''()</dt><dd> 
91 Returns the specified data. 
92 In the case of strings, a const-qualified pointer to 
93 the string is returned. 
94 </dd></dl> 
95 String data can be set or accessed as wide character strings 
96 or normal 
97 ''char'' 
98 strings. 
99 The functions that use wide character strings are suffixed with 
100 '''_w'''. 
101 Note that these are different representations of the same data: 
102 For example, if you store a narrow string and read the corresponding 
103 wide string, the object will transparently convert formats 
104 using the current locale. 
105 Similarly, if you store a wide string and then store a 
106 narrow string for the same data, the previously-set wide string will 
107 be discarded in favor of the new data. 
108
109 == SEE ALSO == 
110 [[ManPageArchiveEntryAcl3]], 
111 [[ManPageArchiveEntryPaths3]], 
112 [[ManPageArchiveEntryPerms3]], 
113 [[ManPageArchiveEntryTime3]] 
114 [[ManPageLibarchive3]], 
115 == HISTORY == 
116 The 
117 '''libarchive''' 
118 library first appeared in 
119 FreeBSD 5.3. 
120 == AUTHORS == 
121 The 
122 '''libarchive''' 
123 library was written by 
124 Tim Kientzle  &lt;kientzle@acm.org.&gt;