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 2, 2012
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 archive_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 archive_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 archive_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 archive_entry_update_symlink_utf8
53.Nd functions for manipulating path names in archive entry descriptions
54.Sh LIBRARY
55Streaming Archive Library (libarchive, -larchive)
56.Sh SYNOPSIS
57.In archive_entry.h
58.Ft const char *
59.Fn archive_entry_hardlink "struct archive_entry *a"
60.Ft const wchar_t *
61.Fn archive_entry_hardlink_w "struct archive_entry *a"
62.Ft void
63.Fn archive_entry_set_hardlink "struct archive_entry *a" "const char *path"
64.Ft void
65.Fn archive_entry_copy_hardlink "struct archive_entry *a" "const char *path"
66.Ft void
67.Fn archive_entry_copy_hardlink_w "struct archive_entry *a "const wchar_t *path"
68.Ft int
69.Fn archive_entry_update_hardlink_utf8 "struct archive_entry *a" "const char *path"
70.Ft void
71.Fn archive_entry_set_link "struct archive_entry *a" "const char *path"
72.Ft void
73.Fn archive_entry_copy_link "struct archive_entry *a" " const char *path"
74.Ft void
75.Fn archive_entry_copy_link_w "struct archive_entry *a" " const wchar_t *path"
76.Ft int
77.Fn archive_entry_update_link_utf8 "struct archive_entry *a" " const char *path"
78.Ft const char *
79.Fn archive_entry_pathname "struct archive_entry *a"
80.Ft const wchar_t *
81.Fn archive_entry_pathname_w "struct archive_entry *a"
82.Ft void
83.Fn archive_entry_set_pathname "struct archive_entry *a" "const char *path"
84.Ft void
85.Fn archive_entry_copy_pathname "struct archive_entry *a" "const char *path"
86.Ft void
87.Fn archive_entry_copy_pathname_w "struct archive_entry *a" "const wchar_t *path"
88.Ft int
89.Fn archive_entry_update_pathname_utf8 "struct archive_entry *a" "const char *path"
90.Ft const char *
91.Fn archive_entry_sourcepath "struct archive_entry *a"
92.Ft void
93.Fn archive_entry_copy_sourcepath "struct archive_entry *a" "const char *path"
94.Ft const char *
95.Fn archive_entry_symlink "struct archive_entry *a"
96.Ft const wchar_t *
97.Fn archive_entry_symlink_w "struct archive_entry *a"
98.Ft void
99.Fn archive_entry_set_symlink "struct archive_entry *a" "const char *path"
100.Ft void
101.Fn archive_entry_copy_symlink "struct archive_entry *a" "const char *path"
102.Ft void
103.Fn archive_entry_copy_symlink_w "struct archive_entry *a" "const wchar_t *path"
104.Ft int
105.Fn archive_entry_update_symlink_utf8 "struct archive_entry *a" "const char *path"
106.Sh DESCRIPTION
107Path names supported by
108.Xr archive_entry 3 :
109.Bl -tag -width "sourcepath" -compact
110.It hardlink
111Destination of the hardlink.
112.It link
113Update only.
114For a symlink, update the destination.
115Otherwise, make the entry a hardlink and alter
116the destination for that.
117.It pathname
118Path in the archive
119.It sourcepath
120Path on the disk for use by
121.Xr archive_read_disk 3 .
122.It symlink
123Destination of the symbolic link.
124.El
125.Pp
126Path names can be provided in one of three different ways:
127.Bl -tag -width "wchar_t *"
128.It char *
129Multibyte strings in the current locale.
130.It wchar_t *
131Wide character strings in the current locale.
132The accessor functions are named
133.Fn XXX_w .
134.It UTF-8
135Unicode strings encoded as UTF-8.
136These are convenience functions to update both the multibyte and wide
137character strings at the same time.
138.El
139.Pp
140The sourcepath is a pure filesystem concept and never stored in an
141archive directly.
142.Pp
143For that reason, it is only available as multibyte string.
144The link path is a convenience function for conditionally setting
145hardlink or symlink destination.
146It doesn't have a corresponding get accessor function.
147.Pp
148.Fn archive_entry_set_XXX
149is an alias for
150.Fn archive_entry_copy_XXX .
151.Sh SEE ALSO
152.Xr archive_entry 3 ,
153.Xr libarchive 3
154