Import libarchive-3.0.2.
[dragonfly.git] / contrib / libarchive / libarchive / archive_entry_paths.3
1 .\" Copyright (c) 2010 Joerg Sonnenberger
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
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.
12 .\"
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
23 .\" SUCH DAMAGE.
24 .\"
25 .Dd February 22, 2010
26 .Dt ARCHIVE_ENTRY_PATHS 3
27 .Os
28 .Sh NAME
29 .Nm archive_entry_hardlink ,
30 .Nm archive_entry_hardlink_w ,
31 .Nm archive_entry_set_hardlink ,
32 .Nm archive_entry_copy_hardlink ,
33 .Nm archive_entry_copy_hardlink_w ,
34 .Nm archve_entry_update_hardlink_utf8 ,
35 .Nm archive_entry_set_link ,
36 .Nm archive_entry_copy_link ,
37 .Nm archive_entry_copy_link_w ,
38 .Nm archve_entry_update_link_utf8 ,
39 .Nm archive_entry_pathname ,
40 .Nm archive_entry_pathname_w ,
41 .Nm archive_entry_set_pathname ,
42 .Nm archive_entry_copy_pathname ,
43 .Nm archive_entry_copy_pathname_w ,
44 .Nm archve_entry_update_pathname_utf8 ,
45 .Nm archive_entry_sourcepath ,
46 .Nm archive_entry_copy_sourcepath ,
47 .Nm archive_entry_symlink,
48 .Nm archive_entry_symlink_w,
49 .Nm archive_entry_set_symlink ,
50 .Nm archive_entry_copy_symlink ,
51 .Nm archive_entry_copy_symlink_w ,
52 .Nm archve_entry_update_symlink_utf8
53 .Nd functions for manipulating path names in archive entry descriptions
54 .Sh SYNOPSIS
55 .In archive_entry.h
56 .Ft const char *
57 .Fn archive_entry_hardlink "struct archive_entry *a"
58 .Ft const wchar_t *
59 .Fn archive_entry_hardlink_w "struct archive_entry *a"
60 .Ft void
61 .Fn archive_entry_set_hardlink "struct archive_entry *a" "const char *path"
62 .Ft void
63 .Fn archive_entry_copy_hardlink "struct archive_entry *a" "const char *path"
64 .Ft void
65 .Fn archive_entry_copy_hardlink_w "struct archive_entry *a "const wchar_t *path"
66 .Ft int
67 .Fn archive_entry_update_hardlink_utf8 "struct archive_entry *a" "const char *path"
68 .Ft void
69 .Fn archive_entry_set_link "struct archive_entry *a" "const char *path"
70 .Ft void
71 .Fn archive_entry_copy_link "struct archive_entry *a" " const char *path"
72 .Ft void
73 .Fn archive_entry_copy_link_w "struct archive_entry *a" " const wchar_t *path"
74 .Ft int
75 .Fn archive_entry_update_link_utf8 "struct archive_entry *a" " const char *path"
76 .Ft const char *
77 .Fn archive_entry_pathname "struct archive_entry *a"
78 .Ft const wchar_t *
79 .Fn archive_entry_pathname_w "struct archive_entry *a"
80 .Ft void
81 .Fn archive_entry_set_pathname "struct archive_entry *a" "const char *path"
82 .Ft void
83 .Fn archive_entry_copy_pathname "struct archive_entry *a" "const char *path"
84 .Ft void
85 .Fn archive_entry_copy_pathname_w "struct archive_entry *a" "const wchar_t *path"
86 .Ft int
87 .Fn archive_entry_update_pathname_utf8 "struct archive_entry *a" "const char *path"
88 .Ft const char *
89 .Fn archive_entry_sourcepath "struct archive_entry *a"
90 .Ft void
91 .Fn archive_entry_copy_sourcepath "struct archive_entry *a" "const char *path"
92 .Ft const char *
93 .Fn archive_entry_symlink "struct archive_entry *a"
94 .Ft const wchar_t *
95 .Fn archive_entry_symlink_w "struct archive_entry *a"
96 .Ft void
97 .Fn archive_entry_set_symlink "struct archive_entry *a" "const char *path"
98 .Ft void
99 .Fn archive_entry_copy_symlink "struct archive_entry *a" "const char *path"
100 .Ft void
101 .Fn archive_entry_copy_symlink_w "struct archive_entry *a" "const wchar_t *path"
102 .Ft int
103 .Fn archive_entry_update_symlink_utf8 "struct archive_entry *a" "const char *path"
104 .Sh DESCRIPTION
105 Path names supported by
106 .Xr archive_entry 3 :
107 .Bl -tag -width "sourcepath" -compact
108 .It hardlink
109 Destination of the hardlink.
110 .It link
111 Update only.
112 For a symlink, update the destination.
113 Otherwise, make the entry a hardlink and alter
114 the destination for that.
115 .It pathname
116 Path in the archive
117 .It sourcepath
118 Path on the disk for use by
119 .Xr archive_read_disk 3 .
120 .It symlink
121 Destination of the symbolic link.
122 .El
123 .Pp
124 Path names can be provided in one of three different ways:
125 .Bl -tag -width "wchar_t *"
126 .It char *
127 Multibyte strings in the current locale.
128 .It wchar_t *
129 Wide character strings in the current locale.
130 The accessor functions are named
131 .Fn XXX_w .
132 .It UTF-8
133 Unicode strings encoded as UTF-8.
134 This are convience functions to update both the multibyte and wide
135 character strings at the same time.
136 .El
137 .Pp
138 The sourcepath is a pure filesystem concept and never stored in an
139 archive directly.
140 .Pp
141 For that reason, it is only available as multibyte string.
142 The link path is a convience function for conditionally setting
143 hardlink or symlink destination.
144 It doesn't have a corresponding get accessor function.
145 .Pp
146 .Fn archive_entry_set_XXX
147 is an alias for 
148 .Fn archive_entry_copy_XXX .
149 .Sh SEE ALSO
150 .Xr archive 3 ,
151 .Xr archive_entry 3