libarchive_changes.3 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. .TH LIBARCHIVE_CHANGES 3 "December 23, 2011" ""
  2. .SH NAME
  3. .ad l
  4. \fB\%libarchive_changes\fP
  5. \- changes in libarchive interface
  6. .SH CHANGES IN LIBARCHIVE 3
  7. .ad l
  8. This page describes user-visible changes in libarchive3, and lists
  9. public functions and other symbols changed, deprecated or removed
  10. in libarchive3, along with their replacements if any.
  11. .SS Multiple Filters
  12. Libarchive2 permitted a single (input or output) filter active
  13. on an archive.
  14. Libarchive3 extends this into a variable-length stack.
  15. Where
  16. \fB\%archive_write_set_compression_XXX\fP()
  17. would replace any existing filter,
  18. \fB\%archive_write_add_filter_XXX\fP()
  19. extends the write pipeline with another filter.
  20. .SS Character Set Handling
  21. Libarchive2 assumed that the local platform uses
  22. Tn Unicode
  23. as the native
  24. Tn wchar_t
  25. encoding, which is true on
  26. Tn Windows,
  27. modern
  28. Tn Linux,
  29. and a few other systems, but is certainly not universal.
  30. As a result, pax format archives were written incorrectly on some
  31. systems, since pax format requires
  32. Tn UTF-8
  33. and libarchive 2 incorrectly
  34. assumed that
  35. Tn wchar_t
  36. strings can be easily converted to
  37. Tn UTF-8.
  38. .PP
  39. Libarchive3 uses the standard iconv library to convert between character
  40. sets and is introducing the notion of a
  41. ``default character set for the archive''.
  42. To support this,
  43. Tn archive_entry
  44. objects can now be bound to a particular archive when they are created.
  45. The automatic character set conversions performed by
  46. Tn archive_entry
  47. objects when reading and writing filenames, usernames, and other strings
  48. will now use an appropriate default character set:
  49. .PP
  50. If the
  51. Tn archive_entry
  52. object is bound to an archive, it will use the
  53. default character set for that archive.
  54. .PP
  55. The platform default character encoding (as returned by
  56. \fB\%nl_langinfo\fP(\fI\%CHARSET\fP, \fI\%)\fP)
  57. will be used if nothing else is specified.
  58. .PP
  59. Libarchive3 also introduces charset options to many of the archive
  60. readers and writers to control the character set that will be used for
  61. filenames written in those archives.
  62. When possible, this will be set automatically based on information in
  63. the archive itself.
  64. Combining this with the notion of a default character set for the
  65. archive should allow you to configure libarchive to read archives from
  66. other platforms and have the filenames and other information
  67. transparently converted to the character encoding suitable for your
  68. application.
  69. .SS Prototype Changes
  70. These changes break binary compatibility; libarchive3 has a new shared
  71. library version to reflect these changes.
  72. The library now uses portable wide types such as
  73. Tn int64_t
  74. instead of less-portable types such as
  75. Tn off_t,
  76. Tn gid_t,
  77. Tn uid_t,
  78. and
  79. Tn ino_t.
  80. .PP
  81. There are a few cases where these changes will affect your source code:
  82. .RS 5
  83. .IP \(bu
  84. In some cases, libarchive's wider types will introduce the possibility
  85. of truncation: for example, on a system with a 16-bit
  86. Tn uid_t, you risk having uid
  87. .RS 4
  88. 65536
  89. .RE
  90. be truncated to uid
  91. .RS 4
  92. 0,
  93. .RE
  94. which can cause serious security problems.
  95. .IP \(bu
  96. Typedef function pointer types will be incompatible.
  97. For example, if you define custom skip callbacks, you may have to use
  98. code similar to the following if you want to support building against
  99. libarchive2 and libarchive3:
  100. .RS 4
  101. .nf
  102. #if ARCHIVE_VERSION_NUMBER < 3000000
  103. typedef off_t myoff_t;
  104. #else
  105. typedef int64_t myoff_t;
  106. #endif
  107. myoff_t
  108. my_skip_function(struct archive *a, void *v, myoff_t o)
  109. {
  110. ... implementation ...
  111. }
  112. .RE
  113. .RE
  114. .PP
  115. Affected functions:
  116. .PP
  117. .RS 5
  118. .IP \(bu
  119. \fB\%archive_entry_gid\fP(),
  120. \fB\%archive_entry_set_gid\fP()
  121. .IP \(bu
  122. \fB\%archive_entry_uid\fP(),
  123. \fB\%archive_entry_set_uid\fP()
  124. .IP \(bu
  125. \fB\%archive_entry_ino\fP(),
  126. \fB\%archive_entry_set_ino\fP()
  127. .IP \(bu
  128. \fB\%archive_read_data_block\fP(),
  129. \fB\%archive_write_data_block\fP()
  130. .IP \(bu
  131. \fB\%archive_read_disk_gname\fP(),
  132. \fB\%archive_read_disk_uname\fP()
  133. .IP \(bu
  134. \fB\%archive_read_disk_set_gname_lookup\fP(),
  135. \fB\%archive_read_disk_set_group_lookup\fP(),
  136. \fB\%archive_read_disk_set_uname_lookup\fP(),
  137. \fB\%archive_read_disk_set_user_lookup\fP()
  138. .IP \(bu
  139. \fB\%archive_skip_callback\fP()
  140. .IP \(bu
  141. \fB\%archive_read_extract_set_skip_file\fP(),
  142. \fB\%archive_write_disk_set_skip_file\fP(),
  143. \fB\%archive_write_set_skip_file\fP()
  144. .IP \(bu
  145. \fB\%archive_write_disk_set_group_lookup\fP(),
  146. \fB\%archive_write_disk_set_user_lookup\fP()
  147. .RE
  148. .PP
  149. Where these functions or their arguments took or returned
  150. Tn gid_t,
  151. Tn ino_t,
  152. Tn off_t,
  153. or
  154. Tn uid_t
  155. they now take or return
  156. Tn int64_t
  157. or equivalent.
  158. .SS Deprecated Symbols
  159. Symbols deprecated in libarchive3 will be removed in libarchive4.
  160. These symbols, along with their replacements if any, are listed below:
  161. .RS 5
  162. .TP
  163. \fB\%archive_position_compressed\fP(), \fB\%archive_position_uncompressed\fP()
  164. \fB\%archive_filter_bytes\fP()
  165. .TP
  166. \fB\%archive_compression\fP()
  167. \fB\%archive_filter_code\fP()
  168. .TP
  169. \fB\%archive_compression_name\fP()
  170. \fB\%archive_filter_name\fP()
  171. .TP
  172. \fB\%archive_read_finish\fP(), \fB\%archive_write_finish\fP()
  173. \fB\%archive_read_free\fP(),
  174. \fB\%archive_write_free\fP()
  175. .TP
  176. \fB\%archive_read_open_file\fP(), \fB\%archive_write_open_file\fP()
  177. \fB\%archive_read_open_filename\fP(),
  178. \fB\%archive_write_open_filename\fP()
  179. .TP
  180. \fB\%archive_read_support_compression_all\fP()
  181. \fB\%archive_read_support_filter_all\fP()
  182. .TP
  183. \fB\%archive_read_support_compression_bzip2\fP()
  184. \fB\%archive_read_support_filter_bzip2\fP()
  185. .TP
  186. \fB\%archive_read_support_compression_compress\fP()
  187. \fB\%archive_read_support_filter_compress\fP()
  188. .TP
  189. \fB\%archive_read_support_compression_gzip\fP()
  190. \fB\%archive_read_support_filter_gzip\fP()
  191. .TP
  192. \fB\%archive_read_support_compression_lzip\fP()
  193. \fB\%archive_read_support_filter_lzip\fP()
  194. .TP
  195. \fB\%archive_read_support_compression_lzma\fP()
  196. \fB\%archive_read_support_filter_lzma\fP()
  197. .TP
  198. \fB\%archive_read_support_compression_none\fP()
  199. \fB\%archive_read_support_filter_none\fP()
  200. .TP
  201. \fB\%archive_read_support_compression_program\fP()
  202. \fB\%archive_read_support_filter_program\fP()
  203. .TP
  204. \fB\%archive_read_support_compression_program_signature\fP()
  205. \fB\%archive_read_support_filter_program_signature\fP()
  206. .TP
  207. \fB\%archive_read_support_compression_rpm\fP()
  208. \fB\%archive_read_support_filter_rpm\fP()
  209. .TP
  210. \fB\%archive_read_support_compression_uu\fP()
  211. \fB\%archive_read_support_filter_uu\fP()
  212. .TP
  213. \fB\%archive_read_support_compression_xz\fP()
  214. \fB\%archive_read_support_filter_xz\fP()
  215. .TP
  216. \fB\%archive_write_set_compression_bzip2\fP()
  217. \fB\%archive_write_add_filter_bzip2\fP()
  218. .TP
  219. \fB\%archive_write_set_compression_compress\fP()
  220. \fB\%archive_write_add_filter_compress\fP()
  221. .TP
  222. \fB\%archive_write_set_compression_gzip\fP()
  223. \fB\%archive_write_add_filter_gzip\fP()
  224. .TP
  225. \fB\%archive_write_set_compression_lzip\fP()
  226. \fB\%archive_write_add_filter_lzip\fP()
  227. .TP
  228. \fB\%archive_write_set_compression_lzma\fP()
  229. \fB\%archive_write_add_filter_lzma\fP()
  230. .TP
  231. \fB\%archive_write_set_compression_none\fP()
  232. \fB\%archive_write_add_filter_none\fP()
  233. .TP
  234. \fB\%archive_write_set_compression_program\fP()
  235. \fB\%archive_write_add_filter_program\fP()
  236. .TP
  237. \fB\%archive_write_set_compression_filter\fP()
  238. \fB\%archive_write_add_filter_filter\fP()
  239. .RE
  240. .SS Removed Symbols
  241. These symbols, listed below along with their replacements if any,
  242. were deprecated in libarchive2, and are not part of libarchive3.
  243. .RS 5
  244. .TP
  245. \fB\%archive_api_feature\fP()
  246. \fB\%archive_version_number\fP()
  247. .TP
  248. \fB\%archive_api_version\fP()
  249. \fB\%archive_version_number\fP()
  250. .TP
  251. \fB\%archive_version\fP()
  252. \fB\%archive_version_string\fP()
  253. .TP
  254. \fB\%archive_version_stamp\fP()
  255. \fB\%archive_version_number\fP()
  256. .TP
  257. \fB\%archive_read_set_filter_options\fP()
  258. \fB\%archive_read_set_options\fP()
  259. or
  260. \fB\%archive_read_set_filter_option\fP()
  261. .TP
  262. \fB\%archive_read_set_format_options\fP()
  263. \fB\%archive_read_set_options\fP()
  264. or
  265. \fB\%archive_read_set_format_option\fP()
  266. .TP
  267. \fB\%archive_write_set_filter_options\fP()
  268. \fB\%archive_write_set_options\fP()
  269. or
  270. \fB\%archive_write_set_filter_option\fP()
  271. .TP
  272. \fB\%archive_write_set_format_options\fP()
  273. \fB\%archive_write_set_options\fP()
  274. or
  275. \fB\%archive_write_set_format_option\fP()
  276. .TP
  277. .BR ARCHIVE_API_FEATURE
  278. .BR ARCHIVE_VERSION_NUMBER
  279. .TP
  280. .BR ARCHIVE_API_VERSION
  281. .BR ARCHIVE_VERSION_NUMBER
  282. .TP
  283. .BR ARCHIVE_VERSION_STAMP
  284. .BR ARCHIVE_VERSION_NUMBER
  285. .TP
  286. .BR ARCHIVE_LIBRARY_VERSION
  287. .BR ARCHIVE_VERSION_STRING
  288. .TP
  289. .BR ARCHIVE_COMPRESSION_NONE
  290. .BR ARCHIVE_FILTER_NONE
  291. .TP
  292. .BR ARCHIVE_COMPRESSION_GZIP
  293. .BR ARCHIVE_FILTER_GZIP
  294. .TP
  295. .BR ARCHIVE_COMPRESSION_BZIP2
  296. .BR ARCHIVE_FILTER_BZIP2
  297. .TP
  298. .BR ARCHIVE_COMPRESSION_COMPRESS
  299. .BR ARCHIVE_FILTER_COMPRESS
  300. .TP
  301. .BR ARCHIVE_COMPRESSION_PROGRAM
  302. .BR ARCHIVE_FILTER_PROGRAM
  303. .TP
  304. .BR ARCHIVE_COMPRESSION_LZMA
  305. .BR ARCHIVE_FILTER_LZMA
  306. .TP
  307. .BR ARCHIVE_COMPRESSION_XZ
  308. .BR ARCHIVE_FILTER_XZ
  309. .TP
  310. .BR ARCHIVE_COMPRESSION_UU
  311. .BR ARCHIVE_FILTER_UU
  312. .TP
  313. .BR ARCHIVE_COMPRESSION_RPM
  314. .BR ARCHIVE_FILTER_RPM
  315. .TP
  316. .BR ARCHIVE_COMPRESSION_LZIP
  317. .BR ARCHIVE_FILTER_LZIP
  318. .TP
  319. .BR ARCHIVE_BYTES_PER_RECORD
  320. .RS 4
  321. 512
  322. .RE
  323. .TP
  324. .BR ARCHIVE_DEFAULT_BYTES_PER_BLOCK
  325. .RS 4
  326. 10240
  327. .RE
  328. .RE
  329. .SH SEE ALSO
  330. .ad l
  331. \fBarchive_read\fP(3),
  332. \fBarchive_read_filter\fP(3),
  333. \fBarchive_read_format\fP(3),
  334. \fBarchive_read_set_options\fP(3),
  335. \fBarchive_util\fP(3),
  336. \fBarchive_write\fP(3),
  337. \fBarchive_write_filter\fP(3),
  338. \fBarchive_write_format\fP(3),
  339. \fBarchive_write_set_options\fP(3),
  340. \fBlibarchive\fP(3)