libarchive_changes.3.txt 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. LIBARCHIVE_CHANGES(3) BSD Library Functions Manual LIBARCHIVE_CHANGES(3)
  2. NAME
  3. libarchive_changes — changes in libarchive interface
  4. CHANGES IN LIBARCHIVE 3
  5. This page describes user-visible changes in libarchive3, and lists public
  6. functions and other symbols changed, deprecated or removed in
  7. libarchive3, along with their replacements if any.
  8. Multiple Filters
  9. Libarchive2 permitted a single (input or output) filter active on an ar‐
  10. chive. Libarchive3 extends this into a variable-length stack. Where
  11. archive_write_set_compression_XXX() would replace any existing filter,
  12. archive_write_add_filter_XXX() extends the write pipeline with another
  13. filter.
  14. Character Set Handling
  15. Libarchive2 assumed that the local platform uses Unicode as the native
  16. wchar_t encoding, which is true on Windows, modern Linux, and a few other
  17. systems, but is certainly not universal. As a result, pax format ar‐
  18. chives were written incorrectly on some systems, since pax format re‐
  19. quires UTF-8 and libarchive 2 incorrectly assumed that wchar_t strings
  20. can be easily converted to UTF-8.
  21. Libarchive3 uses the standard iconv library to convert between character
  22. sets and is introducing the notion of a “default character set for the
  23. archive”. To support this, archive_entry objects can now be bound to a
  24. particular archive when they are created. The automatic character set
  25. conversions performed by archive_entry objects when reading and writing
  26. filenames, usernames, and other strings will now use an appropriate de‐
  27. fault character set:
  28. If the archive_entry object is bound to an archive, it will use the de‐
  29. fault character set for that archive.
  30. The platform default character encoding (as returned by
  31. nl_langinfo(CHARSET)) will be used if nothing else is specified.
  32. Libarchive3 also introduces charset options to many of the archive read‐
  33. ers and writers to control the character set that will be used for file‐
  34. names written in those archives. When possible, this will be set auto‐
  35. matically based on information in the archive itself. Combining this
  36. with the notion of a default character set for the archive should allow
  37. you to configure libarchive to read archives from other platforms and
  38. have the filenames and other information transparently converted to the
  39. character encoding suitable for your application.
  40. Prototype Changes
  41. These changes break binary compatibility; libarchive3 has a new shared
  42. library version to reflect these changes. The library now uses portable
  43. wide types such as int64_t instead of less-portable types such as off_t,
  44. gid_t, uid_t, and ino_t.
  45. There are a few cases where these changes will affect your source code:
  46. • In some cases, libarchive's wider types will introduce the possibil‐
  47. ity of truncation: for example, on a system with a 16-bit uid_t, you
  48. risk having uid 65536 be truncated to uid 0, which can cause serious
  49. security problems.
  50. • Typedef function pointer types will be incompatible. For example,
  51. if you define custom skip callbacks, you may have to use code simi‐
  52. lar to the following if you want to support building against
  53. libarchive2 and libarchive3:
  54. #if ARCHIVE_VERSION_NUMBER < 3000000
  55. typedef off_t myoff_t;
  56. #else
  57. typedef int64_t myoff_t;
  58. #endif
  59. myoff_t
  60. my_skip_function(struct archive *a, void *v, myoff_t o)
  61. {
  62. ... implementation ...
  63. }
  64. Affected functions:
  65. • archive_entry_gid(), archive_entry_set_gid()
  66. • archive_entry_uid(), archive_entry_set_uid()
  67. • archive_entry_ino(), archive_entry_set_ino()
  68. • archive_read_data_block(), archive_write_data_block()
  69. • archive_read_disk_gname(), archive_read_disk_uname()
  70. • archive_read_disk_set_gname_lookup(),
  71. archive_read_disk_set_group_lookup(),
  72. archive_read_disk_set_uname_lookup(),
  73. archive_read_disk_set_user_lookup()
  74. • archive_skip_callback()
  75. • archive_read_extract_set_skip_file(),
  76. archive_write_disk_set_skip_file(), archive_write_set_skip_file()
  77. • archive_write_disk_set_group_lookup(),
  78. archive_write_disk_set_user_lookup()
  79. Where these functions or their arguments took or returned gid_t, ino_t,
  80. off_t, or uid_t they now take or return int64_t or equivalent.
  81. Deprecated Symbols
  82. Symbols deprecated in libarchive3 will be removed in libarchive4. These
  83. symbols, along with their replacements if any, are listed below:
  84. archive_position_compressed(), archive_position_uncompressed()
  85. archive_filter_bytes()
  86. archive_compression()
  87. archive_filter_code()
  88. archive_compression_name()
  89. archive_filter_name()
  90. archive_read_finish(), archive_write_finish()
  91. archive_read_free(), archive_write_free()
  92. archive_read_open_file(), archive_write_open_file()
  93. archive_read_open_filename(), archive_write_open_filename()
  94. archive_read_support_compression_all()
  95. archive_read_support_filter_all()
  96. archive_read_support_compression_bzip2()
  97. archive_read_support_filter_bzip2()
  98. archive_read_support_compression_compress()
  99. archive_read_support_filter_compress()
  100. archive_read_support_compression_gzip()
  101. archive_read_support_filter_gzip()
  102. archive_read_support_compression_lzip()
  103. archive_read_support_filter_lzip()
  104. archive_read_support_compression_lzma()
  105. archive_read_support_filter_lzma()
  106. archive_read_support_compression_none()
  107. archive_read_support_filter_none()
  108. archive_read_support_compression_program()
  109. archive_read_support_filter_program()
  110. archive_read_support_compression_program_signature()
  111. archive_read_support_filter_program_signature()
  112. archive_read_support_compression_rpm()
  113. archive_read_support_filter_rpm()
  114. archive_read_support_compression_uu()
  115. archive_read_support_filter_uu()
  116. archive_read_support_compression_xz()
  117. archive_read_support_filter_xz()
  118. archive_write_set_compression_bzip2()
  119. archive_write_add_filter_bzip2()
  120. archive_write_set_compression_compress()
  121. archive_write_add_filter_compress()
  122. archive_write_set_compression_gzip()
  123. archive_write_add_filter_gzip()
  124. archive_write_set_compression_lzip()
  125. archive_write_add_filter_lzip()
  126. archive_write_set_compression_lzma()
  127. archive_write_add_filter_lzma()
  128. archive_write_set_compression_none()
  129. archive_write_add_filter_none()
  130. archive_write_set_compression_program()
  131. archive_write_add_filter_program()
  132. archive_write_set_compression_filter()
  133. archive_write_add_filter_filter()
  134. Removed Symbols
  135. These symbols, listed below along with their replacements if any, were
  136. deprecated in libarchive2, and are not part of libarchive3.
  137. archive_api_feature()
  138. archive_version_number()
  139. archive_api_version()
  140. archive_version_number()
  141. archive_version()
  142. archive_version_string()
  143. archive_version_stamp()
  144. archive_version_number()
  145. archive_read_set_filter_options()
  146. archive_read_set_options() or archive_read_set_filter_option()
  147. archive_read_set_format_options()
  148. archive_read_set_options() or archive_read_set_format_option()
  149. archive_write_set_filter_options()
  150. archive_write_set_options() or archive_write_set_filter_option()
  151. archive_write_set_format_options()
  152. archive_write_set_options() or archive_write_set_format_option()
  153. ARCHIVE_API_FEATURE
  154. ARCHIVE_VERSION_NUMBER
  155. ARCHIVE_API_VERSION
  156. ARCHIVE_VERSION_NUMBER
  157. ARCHIVE_VERSION_STAMP
  158. ARCHIVE_VERSION_NUMBER
  159. ARCHIVE_LIBRARY_VERSION
  160. ARCHIVE_VERSION_STRING
  161. ARCHIVE_COMPRESSION_NONE
  162. ARCHIVE_FILTER_NONE
  163. ARCHIVE_COMPRESSION_GZIP
  164. ARCHIVE_FILTER_GZIP
  165. ARCHIVE_COMPRESSION_BZIP2
  166. ARCHIVE_FILTER_BZIP2
  167. ARCHIVE_COMPRESSION_COMPRESS
  168. ARCHIVE_FILTER_COMPRESS
  169. ARCHIVE_COMPRESSION_PROGRAM
  170. ARCHIVE_FILTER_PROGRAM
  171. ARCHIVE_COMPRESSION_LZMA
  172. ARCHIVE_FILTER_LZMA
  173. ARCHIVE_COMPRESSION_XZ
  174. ARCHIVE_FILTER_XZ
  175. ARCHIVE_COMPRESSION_UU
  176. ARCHIVE_FILTER_UU
  177. ARCHIVE_COMPRESSION_RPM
  178. ARCHIVE_FILTER_RPM
  179. ARCHIVE_COMPRESSION_LZIP
  180. ARCHIVE_FILTER_LZIP
  181. ARCHIVE_BYTES_PER_RECORD
  182. 512
  183. ARCHIVE_DEFAULT_BYTES_PER_BLOCK
  184. 10240
  185. SEE ALSO
  186. archive_read(3), archive_read_filter(3), archive_read_format(3),
  187. archive_read_set_options(3), archive_util(3), archive_write(3),
  188. archive_write_filter(3), archive_write_format(3),
  189. archive_write_set_options(3), libarchive(3)
  190. BSD December 23, 2011 BSD