1 .\" Copyright (c) 2010 Joerg Sonnenberger
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
29 .Nm archive_entry_stat ,
30 .Nm archive_entry_copy_stat ,
31 .Nm archive_entry_filetype ,
32 .Nm archive_entry_set_filetype ,
33 .Nm archive_entry_mode ,
34 .Nm archive_entry_set_mode ,
35 .Nm archive_entry_size ,
36 .Nm archive_entry_size_is_set ,
37 .Nm archive_entry_set_size ,
38 .Nm archive_entry_unset_size ,
39 .Nm archive_entry_dev ,
40 .Nm archive_entry_set_dev ,
41 .Nm archive_entry_dev_is_set ,
42 .Nm archive_entry_devmajor ,
43 .Nm archive_entry_set_devmajor ,
44 .Nm archive_entry_devminor ,
45 .Nm archive_entry_set_devminor ,
46 .Nm archive_entry_ino ,
47 .Nm archive_entry_set_ino ,
48 .Nm archive_entry_ino_is_set ,
49 .Nm archive_entry_ino64 ,
50 .Nm archive_entry_set_ino64 ,
51 .Nm archive_entry_nlink ,
52 .Nm archive_entry_rdev ,
53 .Nm archive_entry_set_rdev ,
54 .Nm archive_entry_rdevmajor ,
55 .Nm archive_entry_set_rdevmajor ,
56 .Nm archive_entry_rdevminor ,
57 .Nm archive_entry_set_rdevminor ,
58 .Nd accessor functions for manipulating archive entry descriptions
61 .Ft const struct stat *
62 .Fn archive_entry_stat "struct archive_entry *a"
64 .Fn archive_entry_copy_stat "struct archive_entry *a" "const struct stat *sb"
66 .Fn archive_entry_filetype "struct archive_entry *a"
68 .Fn archive_entry_set_filetype "struct archive_entry *a" "unsigned int type"
70 .Fn archive_entry_mode "struct archive_entry *a"
72 .Fn archive_entry_set_mode "struct archive_entry *a" "mode_t mode"
74 .Fn archive_entry_size "struct archive_entry *a"
76 .Fn archive_entry_size_is_set "struct archive_entry *a"
78 .Fn archive_entry_set_size "struct archive_entry *a" "int64_t size"
80 .Fn archive_entry_unset_size "struct archive_entry *a"
82 .Fn archive_entry_dev "struct archive_entry *a"
84 .Fn archive_entry_set_dev "struct archive_entry *a" "dev_t dev"
86 .Fn archive_entry_dev_is_set "struct archive_entry *a"
88 .Fn archive_entry_devmajor "struct archive_entry *a"
90 .Fn archive_entry_set_devmajor "struct archive_entry *a" "dev_t major"
92 .Fn archive_entry_devminor "struct archive_entry *a"
94 .Fn archive_entry_set_devminor "struct archive_entry *a" "dev_t minor"
96 .Fn archive_entry_ino "struct archive_entry *a"
98 .Fn archive_entry_set_ino "struct archive_entry *a" "unsigned long ino"
100 .Fn archive_entry_ino_is_set "struct archive_entry *a"
102 .Fn archive_entry_ino64 "struct archive_entry *a"
104 .Fn archive_entry_set_ino64 "struct archive_entry *a" "int64_t ino"
106 .Fn archive_entry_nlink "struct archive_entry *a"
108 .Fn archive_entry_set_nlink "struct archive_entry *a" "unsigned int count"
110 .Fn archive_entry_rdev "struct archive_entry *a"
112 .Fn archive_entry_rdevmajor "struct archive_entry *a"
114 .Fn archive_entry_rdevminor "struct archive_entry *a"
116 .Fn archive_entry_set_rdev "struct archive_entry *a" "dev_t dev"
118 .Fn archive_entry_set_rdevmajor "struct archive_entry *a" "dev_t major"
120 .Fn archive_entry_set_rdevminor "struct archive_entry *a" "dev_t minor"
122 .Ss Copying to and from Vt struct stat
124 .Fn archive_entry_stat
125 converts the various fields stored in the archive entry to the format
128 The return value remains valid until either
129 .Fn archive_entry_clear
131 .Fn archive_entry_free
133 It is not affected by calls to the set accessor functions.
134 It currently sets the following values in
149 and high-precision information for time-related fields
150 will be included on platforms that support it.
153 .Fn archive_entry_copy_stat
154 copies fields from the platform's
156 Fields not provided by
159 .Ss General accessor functions
161 .Fn archive_entry_filetype
163 .Fn archive_entry_set_filetype
164 get respectively set the filetype.
165 The file type is one of the following constants:
166 .Bl -tag -width "AE_IFSOCK" -compact -offset indent
182 Not all file types are supported by all platforms.
183 The constants used by
185 may have different numeric values from the
186 corresponding constants above.
189 .Fn archive_entry_mode
191 .Fn archive_entry_set_mode
192 get/set a combination of file type and permissions and provide the
196 .Fn archive_entry_filetype
198 .Fn archive_entry_perm
200 .Fn archive_entry_set_filetype
202 .Fn archive_entry_set_perm
203 for setting is recommended.
206 .Fn archive_entry_size
207 returns the file size, if it has been set, and 0 otherwise.
208 .Fn archive_entry_size
209 can be used to query that status.
210 .Fn archive_entry_set_size
212 .Fn archive_entry_unset_size
213 set and unset the size, respectively.
215 The number of references (hardlinks) can be obtained by calling
216 .Fn archive_entry_nlinks
218 .Fn archive_entry_set_nlinks .
219 .Ss Identifying unique files
221 .Fn archive_entry_dev
223 .Fn archive_entry_ino64
225 .Xr archive_entry_linkify 3
227 The pair of device and inode is suppossed to identify hardlinked files.
229 The device major and minor number can be obtained independently using
230 .Fn archive_entry_devmajor
232 .Fn archive_entry_devminor .
233 The device can be set either via
234 .Fn archive_entry_set_dev
235 or by the combination of major and minor number using
236 .Fn archive_entry_set_devmajor
238 .Fn archive_entry_set_devminor .
240 The inode number can be obtained using
241 .Fn archive_entry_ino .
242 This is a legacy interface that uses the platform
244 which may be very small.
245 To set the inode number,
246 .Fn archive_entry_set_ino64
247 is the preferred interface.
248 .Ss Accessor functions for block and character devices
249 Block and character devices are characterised either using a device number
250 or a pair of major and minor number.
251 The combined device number can be obtained with
252 .Fn archive_device_rdev
254 .Fn archive_device_set_rdev .
255 The major and minor numbers are accessed by
256 .Fn archive_device_rdevmajor ,
257 .Fn archive_device_rdevminor
258 .Fn archive_device_set_rdevmajor
260 .Fn archive_device_set_rdevminor .
262 The process of splitting the combined device number into major and
263 minor number and the reverse process of combing them differs between
265 Some archive formats use the combined form, while other formats use
269 .Xr archive_entry_acl 3 ,
270 .Xr archive_entry_perms 3 ,
271 .Xr archive_entry_time 3 ,