summaryrefslogtreecommitdiff
path: root/archivers/libarchive/files/doc/wiki/ManPageLibarchiveChanges3.wiki
blob: c73e9b21d37907172a86e9bf359cd2dc527e1e05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
LIBARCHIVE_CHANGES(3) manual page 
== NAME == 
'''libarchive_changes''' 
- changes in libarchive interface 
== CHANGES IN LIBARCHIVE 3 == 
This page describes user-visible changes in libarchive3, and lists 
public functions and other symbols changed, deprecated or removed 
in libarchive3, along with their replacements if any. 

=== Multiple Filters=== 
Libarchive2 permitted a single (input or output) filter active 
on an archive. 
Libarchive3 extends this into a variable-length stack. 
Where 
'''archive_write_set_compression_XXX'''() 
would replace any existing filter, 
'''archive_write_add_filter_XXX'''() 
extends the write pipeline with another filter. 
=== Character Set Handling=== 
Libarchive2 assumed that the local platform uses 
'''Unicode''' 
as the native 
'''wchar_t''' 
encoding, which is true on 
'''Windows ,''' 
modern 
'''Linux ,''' 
and a few other systems, but is certainly not universal. 
As a result, pax format archives were written incorrectly on some 
systems, since pax format requires 
'''UTF-8''' 
and libarchive 2 incorrectly 
assumed that 
'''wchar_t''' 
strings can be easily converted to 
'''UTF-8 .''' 

Libarchive3 uses the standard iconv library to convert between character 
sets and is introducing the notion of a 
"default character set for the archive". 
To support this, 
'''archive_entry''' 
objects can now be bound to a particular archive when they are created. 
The automatic character set conversions performed by 
'''archive_entry''' 
objects when reading and writing filenames, usernames, and other strings 
will now use an appropriate default character set: 

If the 
'''archive_entry''' 
object is bound to an archive, it will use the 
default character set for that archive. 

The platform default character encoding (as returned by 
'''nl_langinfo'''(''CHARSET'', '')'') 
will be used if nothing else is specified. 

Libarchive3 also introduces charset options to many of the archive 
readers and writers to control the character set that will be used for 
filenames written in those archives. 
When possible, this will be set automatically based on information in 
the archive itself. 
Combining this with the notion of a default character set for the 
archive should allow you to configure libarchive to read archives from 
other platforms and have the filenames and other information 
transparently converted to the character encoding suitable for your 
application. 
=== Prototype Changes=== 
These changes break binary compatibility; libarchive3 has a new shared 
library version to reflect these changes. 
The library now uses portable wide types such as 
'''int64_t''' 
instead of less-portable types such as 
'''off_t ,''' 
'''gid_t ,''' 
'''uid_t ,''' 
and 
'''ino_t .''' 

There are a few cases where these changes will affect your source code: 
<ul> 
<li> 
In some cases, libarchive's wider types will introduce the possibility 
of truncation: for example, on a system with a 16-bit 
'''uid_t , you risk having uid''' 
```text
65536 
```
be truncated to uid 
```text
0, 
```
which can cause serious security problems. 
</li><li> 
Typedef function pointer types will be incompatible. 
For example, if you define custom skip callbacks, you may have to use 
code similar to the following if you want to support building against 
libarchive2 and libarchive3: 
```text
#if ARCHIVE_VERSION_NUMBER < 3000000
typedef off_t myoff_t;
#else
typedef int64_t myoff_t;
#endif
myoff_t
my_skip_function(struct archive *a, void *v, myoff_t o)
{
    ... implementation ...
}
```
</li></ul> 

Affected functions: 

<ul> 
<li> 
'''archive_entry_gid'''(), 
'''archive_entry_set_gid'''() 
</li><li> 
'''archive_entry_uid'''(), 
'''archive_entry_set_uid'''() 
</li><li> 
'''archive_entry_ino'''(), 
'''archive_entry_set_ino'''() 
</li><li> 
'''archive_read_data_block'''(), 
'''archive_write_data_block'''() 
</li><li> 
'''archive_read_disk_gname'''(), 
'''archive_read_disk_uname'''() 
</li><li> 
'''archive_read_disk_set_gname_lookup'''(), 
'''archive_read_disk_set_group_lookup'''(), 
'''archive_read_disk_set_uname_lookup'''(), 
'''archive_read_disk_set_user_lookup'''() 
</li><li> 
'''archive_skip_callback'''() 
</li><li> 
'''archive_read_extract_set_skip_file'''(), 
'''archive_write_disk_set_skip_file'''(), 
'''archive_write_set_skip_file'''() 
</li><li> 
'''archive_write_disk_set_group_lookup'''(), 
'''archive_write_disk_set_user_lookup'''() 
</li></ul> 

Where these functions or their arguments took or returned 
'''gid_t ,''' 
'''ino_t ,''' 
'''off_t ,''' 
or 
'''uid_t''' 
they now take or return 
'''int64_t''' 
or equivalent. 
=== Deprecated Symbols=== 
Symbols deprecated in libarchive3 will be removed in libarchive4. 
These symbols, along with their replacements if any, are listed below: 
<dl> 
<dt>'''archive_position_compressed'''(), '''archive_position_uncompressed'''()</dt><dd> 
'''archive_filter_bytes'''() 
</dd><dt>'''archive_compression'''()</dt><dd> 
'''archive_filter_code'''() 
</dd><dt>'''archive_compression_name'''()</dt><dd> 
'''archive_filter_name'''() 
</dd><dt>'''archive_read_finish'''(), '''archive_write_finish'''()</dt><dd> 
'''archive_read_free'''(), 
'''archive_write_free'''() 
</dd><dt>'''archive_read_open_file'''(), '''archive_write_open_file'''()</dt><dd> 
'''archive_read_open_filename'''(), 
'''archive_write_open_filename'''() 
</dd><dt>'''archive_read_support_compression_all'''()</dt><dd> 
'''archive_read_support_filter_all'''() 
</dd><dt>'''archive_read_support_compression_bzip2'''()</dt><dd> 
'''archive_read_support_filter_bzip2'''() 
</dd><dt>'''archive_read_support_compression_compress'''()</dt><dd> 
'''archive_read_support_filter_compress'''() 
</dd><dt>'''archive_read_support_compression_gzip'''()</dt><dd> 
'''archive_read_support_filter_gzip'''() 
</dd><dt>'''archive_read_support_compression_lzip'''()</dt><dd> 
'''archive_read_support_filter_lzip'''() 
</dd><dt>'''archive_read_support_compression_lzma'''()</dt><dd> 
'''archive_read_support_filter_lzma'''() 
</dd><dt>'''archive_read_support_compression_none'''()</dt><dd> 
'''archive_read_support_filter_none'''() 
</dd><dt>'''archive_read_support_compression_program'''()</dt><dd> 
'''archive_read_support_filter_program'''() 
</dd><dt>'''archive_read_support_compression_program_signature'''()</dt><dd> 
'''archive_read_support_filter_program_signature'''() 
</dd><dt>'''archive_read_support_compression_rpm'''()</dt><dd> 
'''archive_read_support_filter_rpm'''() 
</dd><dt>'''archive_read_support_compression_uu'''()</dt><dd> 
'''archive_read_support_filter_uu'''() 
</dd><dt>'''archive_read_support_compression_xz'''()</dt><dd> 
'''archive_read_support_filter_xz'''() 
</dd><dt>'''archive_write_set_compression_bzip2'''()</dt><dd> 
'''archive_write_add_filter_bzip2'''() 
</dd><dt>'''archive_write_set_compression_compress'''()</dt><dd> 
'''archive_write_add_filter_compress'''() 
</dd><dt>'''archive_write_set_compression_gzip'''()</dt><dd> 
'''archive_write_add_filter_gzip'''() 
</dd><dt>'''archive_write_set_compression_lzip'''()</dt><dd> 
'''archive_write_add_filter_lzip'''() 
</dd><dt>'''archive_write_set_compression_lzma'''()</dt><dd> 
'''archive_write_add_filter_lzma'''() 
</dd><dt>'''archive_write_set_compression_none'''()</dt><dd> 
'''archive_write_add_filter_none'''() 
</dd><dt>'''archive_write_set_compression_program'''()</dt><dd> 
'''archive_write_add_filter_program'''() 
</dd><dt>'''archive_write_set_compression_filter'''()</dt><dd> 
'''archive_write_add_filter_filter'''() 
</dd></dl> 
=== Removed Symbols=== 
These symbols, listed below along with their replacements if any, 
were deprecated in libarchive2, and are not part of libarchive3. 
<dl> 
<dt>'''archive_api_feature'''()</dt><dd> 
'''archive_version_number'''() 
</dd><dt>'''archive_api_version'''()</dt><dd> 
'''archive_version_number'''() 
</dd><dt>'''archive_version'''()</dt><dd> 
'''archive_version_string'''() 
</dd><dt>'''archive_version_stamp'''()</dt><dd> 
'''archive_version_number'''() 
</dd><dt>'''archive_read_set_filter_options'''()</dt><dd> 
'''archive_read_set_options'''() 
or 
'''archive_read_set_filter_option'''() 
</dd><dt>'''archive_read_set_format_options'''()</dt><dd> 
'''archive_read_set_options'''() 
or 
'''archive_read_set_format_option'''() 
</dd><dt>'''archive_write_set_filter_options'''()</dt><dd> 
'''archive_write_set_options'''() 
or 
'''archive_write_set_filter_option'''() 
</dd><dt>'''archive_write_set_format_options'''()</dt><dd> 
'''archive_write_set_options'''() 
or 
'''archive_write_set_format_option'''() 
</dd><dt></dt><dd> 
ARCHIVE_API_FEATURE 
ARCHIVE_VERSION_NUMBER 
</dd><dt></dt><dd> 
ARCHIVE_API_VERSION 
ARCHIVE_VERSION_NUMBER 
</dd><dt></dt><dd> 
ARCHIVE_VERSION_STAMP 
ARCHIVE_VERSION_NUMBER 
</dd><dt></dt><dd> 
ARCHIVE_LIBRARY_VERSION 
ARCHIVE_VERSION_STRING 
</dd><dt></dt><dd> 
ARCHIVE_COMPRESSION_NONE 
ARCHIVE_FILTER_NONE 
</dd><dt></dt><dd> 
ARCHIVE_COMPRESSION_GZIP 
ARCHIVE_FILTER_GZIP 
</dd><dt></dt><dd> 
ARCHIVE_COMPRESSION_BZIP2 
ARCHIVE_FILTER_BZIP2 
</dd><dt></dt><dd> 
ARCHIVE_COMPRESSION_COMPRESS 
ARCHIVE_FILTER_COMPRESS 
</dd><dt></dt><dd> 
ARCHIVE_COMPRESSION_PROGRAM 
ARCHIVE_FILTER_PROGRAM 
</dd><dt></dt><dd> 
ARCHIVE_COMPRESSION_LZMA 
ARCHIVE_FILTER_LZMA 
</dd><dt></dt><dd> 
ARCHIVE_COMPRESSION_XZ 
ARCHIVE_FILTER_XZ 
</dd><dt></dt><dd> 
ARCHIVE_COMPRESSION_UU 
ARCHIVE_FILTER_UU 
</dd><dt></dt><dd> 
ARCHIVE_COMPRESSION_RPM 
ARCHIVE_FILTER_RPM 
</dd><dt></dt><dd> 
ARCHIVE_COMPRESSION_LZIP 
ARCHIVE_FILTER_LZIP 
</dd><dt></dt><dd> 
ARCHIVE_BYTES_PER_RECORD 
```text
512 
```
</dd><dt></dt><dd> 
ARCHIVE_DEFAULT_BYTES_PER_BLOCK 
```text
10240 
```
</dd></dl> 
== SEE ALSO == 
[[ManPageLibarchive3]], 
[[ManPageArchiveRead3]], 
[[ManPageArchiveReadFilter3]], 
[[ManPageArchiveReadFormat3]], 
[[ManPageArchiveReadSetOptions3]], 
[[ManPageArchiveWrite3]], 
[[ManPageArchiveWriteFilter3]], 
[[ManPageArchiveWriteFormat3]], 
[[ManPageArchiveWriteSetOptions3]], 
[[ManPageArchiveUtil3]]