Imported Upstream version 3.3.1 90/134790/1 upstream/3.3.1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 20 Jun 2017 05:06:59 +0000 (14:06 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 20 Jun 2017 05:07:05 +0000 (14:07 +0900)
Change-Id: I9c3de13e364430ac1236158419acf99f66e343c0
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
227 files changed:
CMakeLists.txt
Makefile.am
Makefile.in
NEWS
build/autogen.sh
build/cmake/config.h.in
build/version
cat/test/CMakeLists.txt
cat/test/main.c [deleted file]
cat/test/test.h
cat/test/test_version.c
config.h.in
configure
configure.ac
cpio/test/CMakeLists.txt
cpio/test/main.c [deleted file]
cpio/test/test.h
cpio/test/test_option_version.c
doc/html/Makefile
doc/html/archive_entry.3.html
doc/html/archive_entry_acl.3.html
doc/html/archive_entry_linkify.3.html
doc/html/archive_entry_paths.3.html
doc/html/archive_entry_perms.3.html
doc/html/archive_entry_stat.3.html
doc/html/archive_entry_time.3.html
doc/html/archive_read.3.html
doc/html/archive_read_add_passphrase.3.html
doc/html/archive_read_data.3.html
doc/html/archive_read_disk.3.html
doc/html/archive_read_extract.3.html
doc/html/archive_read_filter.3.html
doc/html/archive_read_format.3.html
doc/html/archive_read_free.3.html
doc/html/archive_read_header.3.html
doc/html/archive_read_new.3.html
doc/html/archive_read_open.3.html
doc/html/archive_read_set_options.3.html
doc/html/archive_util.3.html
doc/html/archive_write.3.html
doc/html/archive_write_blocksize.3.html
doc/html/archive_write_data.3.html
doc/html/archive_write_disk.3.html
doc/html/archive_write_filter.3.html
doc/html/archive_write_finish_entry.3.html
doc/html/archive_write_format.3.html
doc/html/archive_write_free.3.html
doc/html/archive_write_header.3.html
doc/html/archive_write_new.3.html
doc/html/archive_write_open.3.html
doc/html/archive_write_set_options.3.html
doc/html/archive_write_set_passphrase.3.html
doc/html/bsdcpio.1.html
doc/html/bsdtar.1.html
doc/html/cpio.5.html
doc/html/libarchive-formats.5.html
doc/html/libarchive.3.html
doc/html/libarchive_changes.3.html
doc/html/libarchive_internals.3.html
doc/html/mtree.5.html
doc/html/tar.5.html
doc/man/Makefile
doc/man/bsdtar.1
doc/pdf/Makefile
doc/pdf/archive_entry.3.pdf
doc/pdf/archive_entry_acl.3.pdf
doc/pdf/archive_entry_linkify.3.pdf
doc/pdf/archive_entry_paths.3.pdf
doc/pdf/archive_entry_perms.3.pdf
doc/pdf/archive_entry_stat.3.pdf
doc/pdf/archive_entry_time.3.pdf
doc/pdf/archive_read.3.pdf
doc/pdf/archive_read_add_passphrase.3.pdf
doc/pdf/archive_read_data.3.pdf
doc/pdf/archive_read_disk.3.pdf
doc/pdf/archive_read_extract.3.pdf
doc/pdf/archive_read_filter.3.pdf
doc/pdf/archive_read_format.3.pdf
doc/pdf/archive_read_free.3.pdf
doc/pdf/archive_read_header.3.pdf
doc/pdf/archive_read_new.3.pdf
doc/pdf/archive_read_open.3.pdf
doc/pdf/archive_read_set_options.3.pdf
doc/pdf/archive_util.3.pdf
doc/pdf/archive_write.3.pdf
doc/pdf/archive_write_blocksize.3.pdf
doc/pdf/archive_write_data.3.pdf
doc/pdf/archive_write_disk.3.pdf
doc/pdf/archive_write_filter.3.pdf
doc/pdf/archive_write_finish_entry.3.pdf
doc/pdf/archive_write_format.3.pdf
doc/pdf/archive_write_free.3.pdf
doc/pdf/archive_write_header.3.pdf
doc/pdf/archive_write_new.3.pdf
doc/pdf/archive_write_open.3.pdf
doc/pdf/archive_write_set_options.3.pdf
doc/pdf/archive_write_set_passphrase.3.pdf
doc/pdf/bsdcpio.1.pdf
doc/pdf/bsdtar.1.pdf
doc/pdf/cpio.5.pdf
doc/pdf/libarchive-formats.5.pdf
doc/pdf/libarchive.3.pdf
doc/pdf/libarchive_changes.3.pdf
doc/pdf/libarchive_internals.3.pdf
doc/pdf/mtree.5.pdf
doc/pdf/tar.5.pdf
doc/text/Makefile
doc/text/archive_entry.3.txt
doc/text/archive_entry_acl.3.txt
doc/text/archive_entry_linkify.3.txt
doc/text/archive_entry_paths.3.txt
doc/text/archive_entry_perms.3.txt
doc/text/archive_entry_stat.3.txt
doc/text/archive_entry_time.3.txt
doc/text/archive_read.3.txt
doc/text/archive_read_add_passphrase.3.txt
doc/text/archive_read_data.3.txt
doc/text/archive_read_disk.3.txt
doc/text/archive_read_extract.3.txt
doc/text/archive_read_filter.3.txt
doc/text/archive_read_format.3.txt
doc/text/archive_read_free.3.txt
doc/text/archive_read_header.3.txt
doc/text/archive_read_new.3.txt
doc/text/archive_read_open.3.txt
doc/text/archive_read_set_options.3.txt
doc/text/archive_util.3.txt
doc/text/archive_write.3.txt
doc/text/archive_write_blocksize.3.txt
doc/text/archive_write_data.3.txt
doc/text/archive_write_disk.3.txt
doc/text/archive_write_filter.3.txt
doc/text/archive_write_finish_entry.3.txt
doc/text/archive_write_format.3.txt
doc/text/archive_write_free.3.txt
doc/text/archive_write_header.3.txt
doc/text/archive_write_new.3.txt
doc/text/archive_write_open.3.txt
doc/text/archive_write_set_options.3.txt
doc/text/archive_write_set_passphrase.3.txt
doc/text/bsdcpio.1.txt
doc/text/bsdtar.1.txt
doc/text/cpio.5.txt
doc/text/libarchive-formats.5.txt
doc/text/libarchive.3.txt
doc/text/libarchive_changes.3.txt
doc/text/libarchive_internals.3.txt
doc/text/mtree.5.txt
doc/text/tar.5.txt
doc/wiki/Makefile
doc/wiki/ManPageArchiveEntry3.wiki
doc/wiki/ManPageArchiveEntryAcl3.wiki
doc/wiki/ManPageArchiveEntryLinkify3.wiki
doc/wiki/ManPageArchiveEntryPaths3.wiki
doc/wiki/ManPageArchiveEntryPerms3.wiki
doc/wiki/ManPageArchiveEntryStat3.wiki
doc/wiki/ManPageArchiveEntryTime3.wiki
doc/wiki/ManPageArchiveRead3.wiki
doc/wiki/ManPageArchiveReadAddPassphrase3.wiki
doc/wiki/ManPageArchiveReadData3.wiki
doc/wiki/ManPageArchiveReadDisk3.wiki
doc/wiki/ManPageArchiveReadExtract3.wiki
doc/wiki/ManPageArchiveReadFilter3.wiki
doc/wiki/ManPageArchiveReadFormat3.wiki
doc/wiki/ManPageArchiveReadFree3.wiki
doc/wiki/ManPageArchiveReadHeader3.wiki
doc/wiki/ManPageArchiveReadNew3.wiki
doc/wiki/ManPageArchiveReadOpen3.wiki
doc/wiki/ManPageArchiveReadSetOptions3.wiki
doc/wiki/ManPageArchiveUtil3.wiki
doc/wiki/ManPageArchiveWrite3.wiki
doc/wiki/ManPageArchiveWriteBlocksize3.wiki
doc/wiki/ManPageArchiveWriteData3.wiki
doc/wiki/ManPageArchiveWriteDisk3.wiki
doc/wiki/ManPageArchiveWriteFilter3.wiki
doc/wiki/ManPageArchiveWriteFinishEntry3.wiki
doc/wiki/ManPageArchiveWriteFormat3.wiki
doc/wiki/ManPageArchiveWriteFree3.wiki
doc/wiki/ManPageArchiveWriteHeader3.wiki
doc/wiki/ManPageArchiveWriteNew3.wiki
doc/wiki/ManPageArchiveWriteOpen3.wiki
doc/wiki/ManPageArchiveWriteSetOptions3.wiki
doc/wiki/ManPageArchiveWriteSetPassphrase3.wiki
doc/wiki/ManPageBsdcpio1.wiki
doc/wiki/ManPageBsdtar1.wiki
doc/wiki/ManPageLibarchive3.wiki
doc/wiki/ManPageLibarchiveChanges3.wiki
doc/wiki/ManPageLibarchiveFormats5.wiki
doc/wiki/ManPageLibarchiveInternals3.wiki
libarchive/archive.h
libarchive/archive_digest_private.h
libarchive/archive_entry.c
libarchive/archive_entry.h
libarchive/archive_hmac.c
libarchive/archive_read_disk_entry_from_file.c
libarchive/archive_read_disk_posix.c
libarchive/archive_read_disk_private.h
libarchive/archive_read_disk_windows.c
libarchive/archive_read_support_format_warc.c
libarchive/archive_write_disk_posix.c
libarchive/archive_write_set_format_iso9660.c
libarchive/test/CMakeLists.txt
libarchive/test/test.h
libarchive/test/test_acl_nfs4.c
libarchive/test/test_acl_pax.c
libarchive/test/test_acl_platform_posix1e.c
libarchive/test/test_acl_posix1e.c
libarchive/test/test_acl_text.c
libarchive/test/test_archive_api_feature.c
libarchive/test/test_compat_solaris_tar_acl.c
libarchive/test/test_compat_star_acl.c
libarchive/test/test_fuzz.c
libarchive/test/test_read_disk.c
libarchive/test/test_read_disk_directory_traversals.c
tar/bsdtar.1
tar/bsdtar.c
tar/bsdtar.h
tar/cmdline.c
tar/read.c
tar/test/CMakeLists.txt
tar/test/main.c [deleted file]
tar/test/test.h
tar/test/test_version.c
tar/util.c
tar/write.c
test_utils/test_common.h [new file with mode: 0644]
test_utils/test_main.c [moved from libarchive/test/main.c with 92% similarity]

index eb36b5b..1ca9d8f 100644 (file)
@@ -15,7 +15,7 @@ endif()
 #   RelWithDebInfo : Release build with Debug Info
 #   MinSizeRel     : Release Min Size build
 IF(NOT CMAKE_BUILD_TYPE)
-  SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE)
+  SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE)
 ENDIF(NOT CMAKE_BUILD_TYPE)
 # Set a value type to properly display CMAKE_BUILD_TYPE on GUI if the
 # value type is "UNINITIALIZED".
@@ -44,13 +44,13 @@ SET(CMAKE_MACOSX_RPATH ON)
 #
 FILE(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/build/version _version)
 STRING(REGEX REPLACE
- "^([0-9])[0-9][0-9][0-9][0-9][0-9][0-9][a-z]?$" "\\1" _major ${_version})
+ "^([0-9])[0-9][0-9][0-9][0-9][0-9][0-9][a-z]*$" "\\1" _major ${_version})
 STRING(REGEX REPLACE
- "^[0-9]([0-9][0-9][0-9])[0-9][0-9][0-9][a-z]?$" "\\1" _minor ${_version})
+ "^[0-9]([0-9][0-9][0-9])[0-9][0-9][0-9][a-z]*$" "\\1" _minor ${_version})
 STRING(REGEX REPLACE
- "^[0-9][0-9][0-9][0-9]([0-9][0-9][0-9])[a-z]?$" "\\1" _revision ${_version})
+ "^[0-9][0-9][0-9][0-9]([0-9][0-9][0-9])[a-z]*$" "\\1" _revision ${_version})
 STRING(REGEX REPLACE
- "^[0-9][0-9][0-9][0-9][0-9][0-9][0-9]([a-z]?)$" "\\1" _quality ${_version})
+ "^[0-9][0-9][0-9][0-9][0-9][0-9][0-9]([a-z]*)$" "\\1" _quality ${_version})
 SET(_version_number ${_major}${_minor}${_revision})
 STRING(REGEX REPLACE "[0]*([^0]*[0-9])$" "\\1" _trimmed_minor ${_minor})
 STRING(REGEX REPLACE "[0]*([^0]*[0-9])$" "\\1" _trimmed_revision ${_revision})
@@ -462,6 +462,8 @@ ENDIF()
 IF(LIBLZMA_FOUND)
   SET(HAVE_LIBLZMA 1)
   SET(HAVE_LZMA_H 1)
+  SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR})
+  SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES})
   INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS})
   LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES})
   # Test if a macro is needed for the library.
@@ -570,6 +572,11 @@ LA_CHECK_INCLUDE_FILE("limits.h" HAVE_LIMITS_H)
 LA_CHECK_INCLUDE_FILE("linux/types.h" HAVE_LINUX_TYPES_H)
 LA_CHECK_INCLUDE_FILE("linux/fiemap.h" HAVE_LINUX_FIEMAP_H)
 LA_CHECK_INCLUDE_FILE("linux/fs.h" HAVE_LINUX_FS_H)
+
+CHECK_C_SOURCE_COMPILES("#include <sys/ioctl.h>
+#include <linux/fs.h>
+int main(void) { return FS_IOC_GETFLAGS; }" HAVE_WORKING_FS_IOC_GETFLAGS)
+
 LA_CHECK_INCLUDE_FILE("linux/magic.h" HAVE_LINUX_MAGIC_H)
 LA_CHECK_INCLUDE_FILE("locale.h" HAVE_LOCALE_H)
 LA_CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H)
index dd33f84..f22a918 100644 (file)
@@ -310,7 +310,9 @@ pkgconfig_DATA = build/pkgconfig/libarchive.pc
 # Sources needed by all test programs
 test_utils_SOURCES= \
        test_utils/test_utils.c \
-       test_utils/test_utils.h
+       test_utils/test_utils.h \
+       test_utils/test_main.c \
+       test_utils/test_common.h
 
 #
 #
@@ -320,7 +322,6 @@ test_utils_SOURCES= \
 libarchive_test_SOURCES= \
        $(libarchive_la_SOURCES) \
        $(test_utils_SOURCES) \
-       libarchive/test/main.c \
        libarchive/test/read_open_memory.c \
        libarchive/test/test.h \
        libarchive/test/test_acl_nfs4.c \
@@ -586,7 +587,13 @@ libarchive_test_SOURCES= \
        libarchive/test/test_write_read_format_zip.c \
        libarchive/test/test_zip_filename_encoding.c
 
-libarchive_test_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_srcdir)/test_utils -I$(top_builddir)/libarchive/test -DLIBARCHIVE_STATIC $(PLATFORMCPPFLAGS)
+libarchive_test_CPPFLAGS= \
+       -I$(top_srcdir)/libarchive \
+       -I$(top_srcdir)/libarchive/test \
+       -I$(top_srcdir)/test_utils \
+       -I$(top_builddir)/libarchive/test \
+       -DLIBARCHIVE_STATIC $(PLATFORMCPPFLAGS)
+
 libarchive_test_LDADD= $(LTLIBICONV)
 
 # The "list.h" file just lists all of the tests defined in all of the sources.
@@ -918,7 +925,6 @@ endif
 
 bsdtar_test_SOURCES= \
        $(test_utils_SOURCES) \
-       tar/test/main.c \
        tar/test/test.h \
        tar/test/test_0.c \
        tar/test/test_basic.c \
@@ -981,7 +987,8 @@ bsdtar_test_SOURCES= \
 bsdtar_test_CPPFLAGS=\
        -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
        -I$(top_srcdir)/test_utils \
-       -I$(top_srcdir)/tar -I$(top_builddir)/tar/test \
+       -I$(top_srcdir)/tar -I$(top_srcdir)/tar/test \
+       -I$(top_builddir)/tar/test \
        $(PLATFORMCPPFLAGS)
 
 tar/test/list.h: Makefile
@@ -1076,7 +1083,6 @@ endif
 bsdcpio_test_SOURCES= \
        $(test_utils_SOURCES) \
        cpio/cmdline.c \
-       cpio/test/main.c \
        cpio/test/test.h \
        cpio/test/test_0.c \
        cpio/test/test_basic.c \
@@ -1128,7 +1134,8 @@ bsdcpio_test_SOURCES= \
 bsdcpio_test_CPPFLAGS= \
        -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
        -I$(top_srcdir)/test_utils \
-       -I$(top_srcdir)/cpio -I$(top_builddir)/cpio/test \
+       -I$(top_srcdir)/cpio -I$(top_srcdir)/cpio/test \
+       -I$(top_builddir)/cpio/test \
        $(PLATFORMCPPFLAGS)
 bsdcpio_test_LDADD=libarchive_fe.la
 
@@ -1223,7 +1230,6 @@ endif
 
 bsdcat_test_SOURCES= \
        $(test_utils_SOURCES) \
-       cat/test/main.c \
        cat/test/test.h \
        cat/test/test_0.c \
        cat/test/test_empty_gz.c \
@@ -1244,7 +1250,8 @@ bsdcat_test_SOURCES= \
 bsdcat_test_CPPFLAGS= \
        -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
        -I$(top_srcdir)/test_utils \
-       -I$(top_srcdir)/cat -I$(top_builddir)/cat/test \
+       -I$(top_srcdir)/cat -I$(top_srcdir)/cat/test \
+       -I$(top_builddir)/cat/test \
        $(PLATFORMCPPFLAGS)
 bsdcat_test_LDADD=libarchive_fe.la
 
index 78aa3e3..3755fab 100644 (file)
@@ -441,9 +441,9 @@ bsdcat_OBJECTS = $(am_bsdcat_OBJECTS)
 bsdcat_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(bsdcat_LDFLAGS) $(LDFLAGS) -o $@
-am__objects_3 = test_utils/bsdcat_test-test_utils.$(OBJEXT)
+am__objects_3 = test_utils/bsdcat_test-test_utils.$(OBJEXT) \
+       test_utils/bsdcat_test-test_main.$(OBJEXT)
 am_bsdcat_test_OBJECTS = $(am__objects_3) \
-       cat/test/bsdcat_test-main.$(OBJEXT) \
        cat/test/bsdcat_test-test_0.$(OBJEXT) \
        cat/test/bsdcat_test-test_empty_gz.$(OBJEXT) \
        cat/test/bsdcat_test-test_empty_lz4.$(OBJEXT) \
@@ -471,10 +471,10 @@ bsdcpio_OBJECTS = $(am_bsdcpio_OBJECTS)
 bsdcpio_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(bsdcpio_LDFLAGS) $(LDFLAGS) -o $@
-am__objects_5 = test_utils/bsdcpio_test-test_utils.$(OBJEXT)
+am__objects_5 = test_utils/bsdcpio_test-test_utils.$(OBJEXT) \
+       test_utils/bsdcpio_test-test_main.$(OBJEXT)
 am_bsdcpio_test_OBJECTS = $(am__objects_5) \
        cpio/bsdcpio_test-cmdline.$(OBJEXT) \
-       cpio/test/bsdcpio_test-main.$(OBJEXT) \
        cpio/test/bsdcpio_test-test_0.$(OBJEXT) \
        cpio/test/bsdcpio_test-test_basic.$(OBJEXT) \
        cpio/test/bsdcpio_test-test_cmdline.$(OBJEXT) \
@@ -538,9 +538,9 @@ bsdtar_OBJECTS = $(am_bsdtar_OBJECTS)
 bsdtar_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
        $(bsdtar_LDFLAGS) $(LDFLAGS) -o $@
-am__objects_7 = test_utils/bsdtar_test-test_utils.$(OBJEXT)
+am__objects_7 = test_utils/bsdtar_test-test_utils.$(OBJEXT) \
+       test_utils/bsdtar_test-test_main.$(OBJEXT)
 am_bsdtar_test_OBJECTS = $(am__objects_7) \
-       tar/test/bsdtar_test-main.$(OBJEXT) \
        tar/test/bsdtar_test-test_0.$(OBJEXT) \
        tar/test/bsdtar_test-test_basic.$(OBJEXT) \
        tar/test/bsdtar_test-test_copy.$(OBJEXT) \
@@ -731,9 +731,10 @@ am__libarchive_test_SOURCES_DIST = libarchive/archive_acl.c \
        libarchive/archive_windows.h libarchive/archive_windows.c \
        libarchive/archive_write_disk_windows.c \
        libarchive/filter_fork_windows.c test_utils/test_utils.c \
-       test_utils/test_utils.h libarchive/test/main.c \
-       libarchive/test/read_open_memory.c libarchive/test/test.h \
-       libarchive/test/test_acl_nfs4.c libarchive/test/test_acl_pax.c \
+       test_utils/test_utils.h test_utils/test_main.c \
+       test_utils/test_common.h libarchive/test/read_open_memory.c \
+       libarchive/test/test.h libarchive/test/test_acl_nfs4.c \
+       libarchive/test/test_acl_pax.c \
        libarchive/test/test_acl_platform_nfs4.c \
        libarchive/test/test_acl_platform_posix1e.c \
        libarchive/test/test_acl_posix1e.c \
@@ -1112,9 +1113,9 @@ am__objects_9 = libarchive/libarchive_test-archive_acl.$(OBJEXT) \
        libarchive/libarchive_test-archive_write_set_passphrase.$(OBJEXT) \
        libarchive/libarchive_test-filter_fork_posix.$(OBJEXT) \
        libarchive/libarchive_test-xxhash.$(OBJEXT) $(am__objects_8)
-am__objects_10 = test_utils/libarchive_test-test_utils.$(OBJEXT)
+am__objects_10 = test_utils/libarchive_test-test_utils.$(OBJEXT) \
+       test_utils/libarchive_test-test_main.$(OBJEXT)
 am_libarchive_test_OBJECTS = $(am__objects_9) $(am__objects_10) \
-       libarchive/test/libarchive_test-main.$(OBJEXT) \
        libarchive/test/libarchive_test-read_open_memory.$(OBJEXT) \
        libarchive/test/libarchive_test-test_acl_nfs4.$(OBJEXT) \
        libarchive/test/libarchive_test-test_acl_pax.$(OBJEXT) \
@@ -2048,7 +2049,9 @@ pkgconfig_DATA = build/pkgconfig/libarchive.pc
 # Sources needed by all test programs
 test_utils_SOURCES = \
        test_utils/test_utils.c \
-       test_utils/test_utils.h
+       test_utils/test_utils.h \
+       test_utils/test_main.c \
+       test_utils/test_common.h
 
 
 #
@@ -2059,7 +2062,6 @@ test_utils_SOURCES = \
 libarchive_test_SOURCES = \
        $(libarchive_la_SOURCES) \
        $(test_utils_SOURCES) \
-       libarchive/test/main.c \
        libarchive/test/read_open_memory.c \
        libarchive/test/test.h \
        libarchive/test/test_acl_nfs4.c \
@@ -2325,7 +2327,13 @@ libarchive_test_SOURCES = \
        libarchive/test/test_write_read_format_zip.c \
        libarchive/test/test_zip_filename_encoding.c
 
-libarchive_test_CPPFLAGS = -I$(top_srcdir)/libarchive -I$(top_srcdir)/test_utils -I$(top_builddir)/libarchive/test -DLIBARCHIVE_STATIC $(PLATFORMCPPFLAGS)
+libarchive_test_CPPFLAGS = \
+       -I$(top_srcdir)/libarchive \
+       -I$(top_srcdir)/libarchive/test \
+       -I$(top_srcdir)/test_utils \
+       -I$(top_builddir)/libarchive/test \
+       -DLIBARCHIVE_STATIC $(PLATFORMCPPFLAGS)
+
 libarchive_test_LDADD = $(LTLIBICONV)
 libarchive_TESTS_ENVIRONMENT = LIBARCHIVE_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/libarchive/test LRZIP=NOCONFIG
 libarchive_test_EXTRA_DIST = \
@@ -2623,7 +2631,6 @@ bsdtar_EXTRA_DIST = \
 #
 bsdtar_test_SOURCES = \
        $(test_utils_SOURCES) \
-       tar/test/main.c \
        tar/test/test.h \
        tar/test/test_0.c \
        tar/test/test_basic.c \
@@ -2686,7 +2693,8 @@ bsdtar_test_SOURCES = \
 bsdtar_test_CPPFLAGS = \
        -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
        -I$(top_srcdir)/test_utils \
-       -I$(top_srcdir)/tar -I$(top_builddir)/tar/test \
+       -I$(top_srcdir)/tar -I$(top_srcdir)/tar/test \
+       -I$(top_builddir)/tar/test \
        $(PLATFORMCPPFLAGS)
 
 @BUILD_BSDTAR_FALSE@bsdtar_test_programs = 
@@ -2751,7 +2759,6 @@ bsdcpio_EXTRA_DIST = \
 bsdcpio_test_SOURCES = \
        $(test_utils_SOURCES) \
        cpio/cmdline.c \
-       cpio/test/main.c \
        cpio/test/test.h \
        cpio/test/test_0.c \
        cpio/test/test_basic.c \
@@ -2803,7 +2810,8 @@ bsdcpio_test_SOURCES = \
 bsdcpio_test_CPPFLAGS = \
        -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
        -I$(top_srcdir)/test_utils \
-       -I$(top_srcdir)/cpio -I$(top_builddir)/cpio/test \
+       -I$(top_srcdir)/cpio -I$(top_srcdir)/cpio/test \
+       -I$(top_builddir)/cpio/test \
        $(PLATFORMCPPFLAGS)
 
 bsdcpio_test_LDADD = libarchive_fe.la
@@ -2871,7 +2879,6 @@ bsdcat_EXTRA_DIST = \
 #
 bsdcat_test_SOURCES = \
        $(test_utils_SOURCES) \
-       cat/test/main.c \
        cat/test/test.h \
        cat/test/test_0.c \
        cat/test/test_empty_gz.c \
@@ -2892,7 +2899,8 @@ bsdcat_test_SOURCES = \
 bsdcat_test_CPPFLAGS = \
        -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
        -I$(top_srcdir)/test_utils \
-       -I$(top_srcdir)/cat -I$(top_builddir)/cat/test \
+       -I$(top_srcdir)/cat -I$(top_srcdir)/cat/test \
+       -I$(top_builddir)/cat/test \
        $(PLATFORMCPPFLAGS)
 
 bsdcat_test_LDADD = libarchive_fe.la
@@ -3418,14 +3426,15 @@ test_utils/$(DEPDIR)/$(am__dirstamp):
 test_utils/bsdcat_test-test_utils.$(OBJEXT):  \
        test_utils/$(am__dirstamp) \
        test_utils/$(DEPDIR)/$(am__dirstamp)
+test_utils/bsdcat_test-test_main.$(OBJEXT):  \
+       test_utils/$(am__dirstamp) \
+       test_utils/$(DEPDIR)/$(am__dirstamp)
 cat/test/$(am__dirstamp):
        @$(MKDIR_P) cat/test
        @: > cat/test/$(am__dirstamp)
 cat/test/$(DEPDIR)/$(am__dirstamp):
        @$(MKDIR_P) cat/test/$(DEPDIR)
        @: > cat/test/$(DEPDIR)/$(am__dirstamp)
-cat/test/bsdcat_test-main.$(OBJEXT): cat/test/$(am__dirstamp) \
-       cat/test/$(DEPDIR)/$(am__dirstamp)
 cat/test/bsdcat_test-test_0.$(OBJEXT): cat/test/$(am__dirstamp) \
        cat/test/$(DEPDIR)/$(am__dirstamp)
 cat/test/bsdcat_test-test_empty_gz.$(OBJEXT):  \
@@ -3479,6 +3488,9 @@ bsdcpio$(EXEEXT): $(bsdcpio_OBJECTS) $(bsdcpio_DEPENDENCIES) $(EXTRA_bsdcpio_DEP
 test_utils/bsdcpio_test-test_utils.$(OBJEXT):  \
        test_utils/$(am__dirstamp) \
        test_utils/$(DEPDIR)/$(am__dirstamp)
+test_utils/bsdcpio_test-test_main.$(OBJEXT):  \
+       test_utils/$(am__dirstamp) \
+       test_utils/$(DEPDIR)/$(am__dirstamp)
 cpio/bsdcpio_test-cmdline.$(OBJEXT): cpio/$(am__dirstamp) \
        cpio/$(DEPDIR)/$(am__dirstamp)
 cpio/test/$(am__dirstamp):
@@ -3487,8 +3499,6 @@ cpio/test/$(am__dirstamp):
 cpio/test/$(DEPDIR)/$(am__dirstamp):
        @$(MKDIR_P) cpio/test/$(DEPDIR)
        @: > cpio/test/$(DEPDIR)/$(am__dirstamp)
-cpio/test/bsdcpio_test-main.$(OBJEXT): cpio/test/$(am__dirstamp) \
-       cpio/test/$(DEPDIR)/$(am__dirstamp)
 cpio/test/bsdcpio_test-test_0.$(OBJEXT): cpio/test/$(am__dirstamp) \
        cpio/test/$(DEPDIR)/$(am__dirstamp)
 cpio/test/bsdcpio_test-test_basic.$(OBJEXT):  \
@@ -3614,14 +3624,15 @@ bsdtar$(EXEEXT): $(bsdtar_OBJECTS) $(bsdtar_DEPENDENCIES) $(EXTRA_bsdtar_DEPENDE
 test_utils/bsdtar_test-test_utils.$(OBJEXT):  \
        test_utils/$(am__dirstamp) \
        test_utils/$(DEPDIR)/$(am__dirstamp)
+test_utils/bsdtar_test-test_main.$(OBJEXT):  \
+       test_utils/$(am__dirstamp) \
+       test_utils/$(DEPDIR)/$(am__dirstamp)
 tar/test/$(am__dirstamp):
        @$(MKDIR_P) tar/test
        @: > tar/test/$(am__dirstamp)
 tar/test/$(DEPDIR)/$(am__dirstamp):
        @$(MKDIR_P) tar/test/$(DEPDIR)
        @: > tar/test/$(DEPDIR)/$(am__dirstamp)
-tar/test/bsdtar_test-main.$(OBJEXT): tar/test/$(am__dirstamp) \
-       tar/test/$(DEPDIR)/$(am__dirstamp)
 tar/test/bsdtar_test-test_0.$(OBJEXT): tar/test/$(am__dirstamp) \
        tar/test/$(DEPDIR)/$(am__dirstamp)
 tar/test/bsdtar_test-test_basic.$(OBJEXT): tar/test/$(am__dirstamp) \
@@ -4097,15 +4108,15 @@ libarchive/libarchive_test-filter_fork_windows.$(OBJEXT):  \
 test_utils/libarchive_test-test_utils.$(OBJEXT):  \
        test_utils/$(am__dirstamp) \
        test_utils/$(DEPDIR)/$(am__dirstamp)
+test_utils/libarchive_test-test_main.$(OBJEXT):  \
+       test_utils/$(am__dirstamp) \
+       test_utils/$(DEPDIR)/$(am__dirstamp)
 libarchive/test/$(am__dirstamp):
        @$(MKDIR_P) libarchive/test
        @: > libarchive/test/$(am__dirstamp)
 libarchive/test/$(DEPDIR)/$(am__dirstamp):
        @$(MKDIR_P) libarchive/test/$(DEPDIR)
        @: > libarchive/test/$(DEPDIR)/$(am__dirstamp)
-libarchive/test/libarchive_test-main.$(OBJEXT):  \
-       libarchive/test/$(am__dirstamp) \
-       libarchive/test/$(DEPDIR)/$(am__dirstamp)
 libarchive/test/libarchive_test-read_open_memory.$(OBJEXT):  \
        libarchive/test/$(am__dirstamp) \
        libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -4920,7 +4931,6 @@ distclean-compile:
 
 @AMDEP_TRUE@@am__include@ @am__quote@cat/$(DEPDIR)/bsdcat-bsdcat.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@cat/$(DEPDIR)/bsdcat-cmdline.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@cat/test/$(DEPDIR)/bsdcat_test-main.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@cat/test/$(DEPDIR)/bsdcat_test-test_0.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@cat/test/$(DEPDIR)/bsdcat_test-test_empty_gz.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@cat/test/$(DEPDIR)/bsdcat_test-test_empty_lz4.Po@am__quote@
@@ -4940,7 +4950,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio-cpio.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio-cpio_windows.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@cpio/$(DEPDIR)/bsdcpio_test-cmdline.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-main.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_0.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_basic.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@cpio/test/$(DEPDIR)/bsdcpio_test-test_cmdline.Po@am__quote@
@@ -5223,7 +5232,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-filter_fork_windows.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/libarchive_test-xxhash.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@libarchive/$(DEPDIR)/xxhash.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-main.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-read_open_memory.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_acl_nfs4.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@libarchive/test/$(DEPDIR)/libarchive_test-test_acl_pax.Po@am__quote@
@@ -5498,7 +5506,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-subst.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-util.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@tar/$(DEPDIR)/bsdtar-write.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-main.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_0.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_basic.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_copy.Po@am__quote@
@@ -5556,9 +5563,13 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_symlink_dir.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_version.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@tar/test/$(DEPDIR)/bsdtar_test-test_windows.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test_utils/$(DEPDIR)/bsdcat_test-test_main.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@test_utils/$(DEPDIR)/bsdcat_test-test_utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test_utils/$(DEPDIR)/bsdcpio_test-test_main.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@test_utils/$(DEPDIR)/bsdcpio_test-test_utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test_utils/$(DEPDIR)/bsdtar_test-test_main.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@test_utils/$(DEPDIR)/bsdtar_test-test_utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@test_utils/$(DEPDIR)/libarchive_test-test_main.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@test_utils/$(DEPDIR)/libarchive_test-test_utils.Po@am__quote@
 
 .c.o:
@@ -5648,19 +5659,19 @@ test_utils/bsdcat_test-test_utils.obj: test_utils/test_utils.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdcat_test-test_utils.obj `if test -f 'test_utils/test_utils.c'; then $(CYGPATH_W) 'test_utils/test_utils.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_utils.c'; fi`
 
-cat/test/bsdcat_test-main.o: cat/test/main.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cat/test/bsdcat_test-main.o -MD -MP -MF cat/test/$(DEPDIR)/bsdcat_test-main.Tpo -c -o cat/test/bsdcat_test-main.o `test -f 'cat/test/main.c' || echo '$(srcdir)/'`cat/test/main.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) cat/test/$(DEPDIR)/bsdcat_test-main.Tpo cat/test/$(DEPDIR)/bsdcat_test-main.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='cat/test/main.c' object='cat/test/bsdcat_test-main.o' libtool=no @AMDEPBACKSLASH@
+test_utils/bsdcat_test-test_main.o: test_utils/test_main.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/bsdcat_test-test_main.o -MD -MP -MF test_utils/$(DEPDIR)/bsdcat_test-test_main.Tpo -c -o test_utils/bsdcat_test-test_main.o `test -f 'test_utils/test_main.c' || echo '$(srcdir)/'`test_utils/test_main.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/bsdcat_test-test_main.Tpo test_utils/$(DEPDIR)/bsdcat_test-test_main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='test_utils/test_main.c' object='test_utils/bsdcat_test-test_main.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cat/test/bsdcat_test-main.o `test -f 'cat/test/main.c' || echo '$(srcdir)/'`cat/test/main.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdcat_test-test_main.o `test -f 'test_utils/test_main.c' || echo '$(srcdir)/'`test_utils/test_main.c
 
-cat/test/bsdcat_test-main.obj: cat/test/main.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cat/test/bsdcat_test-main.obj -MD -MP -MF cat/test/$(DEPDIR)/bsdcat_test-main.Tpo -c -o cat/test/bsdcat_test-main.obj `if test -f 'cat/test/main.c'; then $(CYGPATH_W) 'cat/test/main.c'; else $(CYGPATH_W) '$(srcdir)/cat/test/main.c'; fi`
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) cat/test/$(DEPDIR)/bsdcat_test-main.Tpo cat/test/$(DEPDIR)/bsdcat_test-main.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='cat/test/main.c' object='cat/test/bsdcat_test-main.obj' libtool=no @AMDEPBACKSLASH@
+test_utils/bsdcat_test-test_main.obj: test_utils/test_main.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/bsdcat_test-test_main.obj -MD -MP -MF test_utils/$(DEPDIR)/bsdcat_test-test_main.Tpo -c -o test_utils/bsdcat_test-test_main.obj `if test -f 'test_utils/test_main.c'; then $(CYGPATH_W) 'test_utils/test_main.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_main.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/bsdcat_test-test_main.Tpo test_utils/$(DEPDIR)/bsdcat_test-test_main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='test_utils/test_main.c' object='test_utils/bsdcat_test-test_main.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cat/test/bsdcat_test-main.obj `if test -f 'cat/test/main.c'; then $(CYGPATH_W) 'cat/test/main.c'; else $(CYGPATH_W) '$(srcdir)/cat/test/main.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdcat_test-test_main.obj `if test -f 'test_utils/test_main.c'; then $(CYGPATH_W) 'test_utils/test_main.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_main.c'; fi`
 
 cat/test/bsdcat_test-test_0.o: cat/test/test_0.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cat/test/bsdcat_test-test_0.o -MD -MP -MF cat/test/$(DEPDIR)/bsdcat_test-test_0.Tpo -c -o cat/test/bsdcat_test-test_0.o `test -f 'cat/test/test_0.c' || echo '$(srcdir)/'`cat/test/test_0.c
@@ -5928,6 +5939,20 @@ test_utils/bsdcpio_test-test_utils.obj: test_utils/test_utils.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdcpio_test-test_utils.obj `if test -f 'test_utils/test_utils.c'; then $(CYGPATH_W) 'test_utils/test_utils.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_utils.c'; fi`
 
+test_utils/bsdcpio_test-test_main.o: test_utils/test_main.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/bsdcpio_test-test_main.o -MD -MP -MF test_utils/$(DEPDIR)/bsdcpio_test-test_main.Tpo -c -o test_utils/bsdcpio_test-test_main.o `test -f 'test_utils/test_main.c' || echo '$(srcdir)/'`test_utils/test_main.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/bsdcpio_test-test_main.Tpo test_utils/$(DEPDIR)/bsdcpio_test-test_main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='test_utils/test_main.c' object='test_utils/bsdcpio_test-test_main.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdcpio_test-test_main.o `test -f 'test_utils/test_main.c' || echo '$(srcdir)/'`test_utils/test_main.c
+
+test_utils/bsdcpio_test-test_main.obj: test_utils/test_main.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/bsdcpio_test-test_main.obj -MD -MP -MF test_utils/$(DEPDIR)/bsdcpio_test-test_main.Tpo -c -o test_utils/bsdcpio_test-test_main.obj `if test -f 'test_utils/test_main.c'; then $(CYGPATH_W) 'test_utils/test_main.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_main.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/bsdcpio_test-test_main.Tpo test_utils/$(DEPDIR)/bsdcpio_test-test_main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='test_utils/test_main.c' object='test_utils/bsdcpio_test-test_main.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdcpio_test-test_main.obj `if test -f 'test_utils/test_main.c'; then $(CYGPATH_W) 'test_utils/test_main.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_main.c'; fi`
+
 cpio/bsdcpio_test-cmdline.o: cpio/cmdline.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio_test-cmdline.o -MD -MP -MF cpio/$(DEPDIR)/bsdcpio_test-cmdline.Tpo -c -o cpio/bsdcpio_test-cmdline.o `test -f 'cpio/cmdline.c' || echo '$(srcdir)/'`cpio/cmdline.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) cpio/$(DEPDIR)/bsdcpio_test-cmdline.Tpo cpio/$(DEPDIR)/bsdcpio_test-cmdline.Po
@@ -5942,20 +5967,6 @@ cpio/bsdcpio_test-cmdline.obj: cpio/cmdline.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio_test-cmdline.obj `if test -f 'cpio/cmdline.c'; then $(CYGPATH_W) 'cpio/cmdline.c'; else $(CYGPATH_W) '$(srcdir)/cpio/cmdline.c'; fi`
 
-cpio/test/bsdcpio_test-main.o: cpio/test/main.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-main.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-main.Tpo -c -o cpio/test/bsdcpio_test-main.o `test -f 'cpio/test/main.c' || echo '$(srcdir)/'`cpio/test/main.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) cpio/test/$(DEPDIR)/bsdcpio_test-main.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-main.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='cpio/test/main.c' object='cpio/test/bsdcpio_test-main.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-main.o `test -f 'cpio/test/main.c' || echo '$(srcdir)/'`cpio/test/main.c
-
-cpio/test/bsdcpio_test-main.obj: cpio/test/main.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-main.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-main.Tpo -c -o cpio/test/bsdcpio_test-main.obj `if test -f 'cpio/test/main.c'; then $(CYGPATH_W) 'cpio/test/main.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/main.c'; fi`
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) cpio/test/$(DEPDIR)/bsdcpio_test-main.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-main.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='cpio/test/main.c' object='cpio/test/bsdcpio_test-main.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-main.obj `if test -f 'cpio/test/main.c'; then $(CYGPATH_W) 'cpio/test/main.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/main.c'; fi`
-
 cpio/test/bsdcpio_test-test_0.o: cpio/test/test_0.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_0.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_0.Tpo -c -o cpio/test/bsdcpio_test-test_0.o `test -f 'cpio/test/test_0.c' || echo '$(srcdir)/'`cpio/test/test_0.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) cpio/test/$(DEPDIR)/bsdcpio_test-test_0.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_0.Po
@@ -6726,19 +6737,19 @@ test_utils/bsdtar_test-test_utils.obj: test_utils/test_utils.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdtar_test-test_utils.obj `if test -f 'test_utils/test_utils.c'; then $(CYGPATH_W) 'test_utils/test_utils.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_utils.c'; fi`
 
-tar/test/bsdtar_test-main.o: tar/test/main.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-main.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-main.Tpo -c -o tar/test/bsdtar_test-main.o `test -f 'tar/test/main.c' || echo '$(srcdir)/'`tar/test/main.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) tar/test/$(DEPDIR)/bsdtar_test-main.Tpo tar/test/$(DEPDIR)/bsdtar_test-main.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='tar/test/main.c' object='tar/test/bsdtar_test-main.o' libtool=no @AMDEPBACKSLASH@
+test_utils/bsdtar_test-test_main.o: test_utils/test_main.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/bsdtar_test-test_main.o -MD -MP -MF test_utils/$(DEPDIR)/bsdtar_test-test_main.Tpo -c -o test_utils/bsdtar_test-test_main.o `test -f 'test_utils/test_main.c' || echo '$(srcdir)/'`test_utils/test_main.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/bsdtar_test-test_main.Tpo test_utils/$(DEPDIR)/bsdtar_test-test_main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='test_utils/test_main.c' object='test_utils/bsdtar_test-test_main.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-main.o `test -f 'tar/test/main.c' || echo '$(srcdir)/'`tar/test/main.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdtar_test-test_main.o `test -f 'test_utils/test_main.c' || echo '$(srcdir)/'`test_utils/test_main.c
 
-tar/test/bsdtar_test-main.obj: tar/test/main.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-main.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-main.Tpo -c -o tar/test/bsdtar_test-main.obj `if test -f 'tar/test/main.c'; then $(CYGPATH_W) 'tar/test/main.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/main.c'; fi`
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) tar/test/$(DEPDIR)/bsdtar_test-main.Tpo tar/test/$(DEPDIR)/bsdtar_test-main.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='tar/test/main.c' object='tar/test/bsdtar_test-main.obj' libtool=no @AMDEPBACKSLASH@
+test_utils/bsdtar_test-test_main.obj: test_utils/test_main.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/bsdtar_test-test_main.obj -MD -MP -MF test_utils/$(DEPDIR)/bsdtar_test-test_main.Tpo -c -o test_utils/bsdtar_test-test_main.obj `if test -f 'test_utils/test_main.c'; then $(CYGPATH_W) 'test_utils/test_main.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_main.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/bsdtar_test-test_main.Tpo test_utils/$(DEPDIR)/bsdtar_test-test_main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='test_utils/test_main.c' object='test_utils/bsdtar_test-test_main.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-main.obj `if test -f 'tar/test/main.c'; then $(CYGPATH_W) 'tar/test/main.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/main.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdtar_test-test_main.obj `if test -f 'test_utils/test_main.c'; then $(CYGPATH_W) 'test_utils/test_main.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_main.c'; fi`
 
 tar/test/bsdtar_test-test_0.o: tar/test/test_0.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_0.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_0.Tpo -c -o tar/test/bsdtar_test-test_0.o `test -f 'tar/test/test_0.c' || echo '$(srcdir)/'`tar/test/test_0.c
@@ -9204,19 +9215,19 @@ test_utils/libarchive_test-test_utils.obj: test_utils/test_utils.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/libarchive_test-test_utils.obj `if test -f 'test_utils/test_utils.c'; then $(CYGPATH_W) 'test_utils/test_utils.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_utils.c'; fi`
 
-libarchive/test/libarchive_test-main.o: libarchive/test/main.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-main.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-main.Tpo -c -o libarchive/test/libarchive_test-main.o `test -f 'libarchive/test/main.c' || echo '$(srcdir)/'`libarchive/test/main.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-main.Tpo libarchive/test/$(DEPDIR)/libarchive_test-main.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='libarchive/test/main.c' object='libarchive/test/libarchive_test-main.o' libtool=no @AMDEPBACKSLASH@
+test_utils/libarchive_test-test_main.o: test_utils/test_main.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/libarchive_test-test_main.o -MD -MP -MF test_utils/$(DEPDIR)/libarchive_test-test_main.Tpo -c -o test_utils/libarchive_test-test_main.o `test -f 'test_utils/test_main.c' || echo '$(srcdir)/'`test_utils/test_main.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/libarchive_test-test_main.Tpo test_utils/$(DEPDIR)/libarchive_test-test_main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='test_utils/test_main.c' object='test_utils/libarchive_test-test_main.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-main.o `test -f 'libarchive/test/main.c' || echo '$(srcdir)/'`libarchive/test/main.c
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/libarchive_test-test_main.o `test -f 'test_utils/test_main.c' || echo '$(srcdir)/'`test_utils/test_main.c
 
-libarchive/test/libarchive_test-main.obj: libarchive/test/main.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-main.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-main.Tpo -c -o libarchive/test/libarchive_test-main.obj `if test -f 'libarchive/test/main.c'; then $(CYGPATH_W) 'libarchive/test/main.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/main.c'; fi`
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-main.Tpo libarchive/test/$(DEPDIR)/libarchive_test-main.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='libarchive/test/main.c' object='libarchive/test/libarchive_test-main.obj' libtool=no @AMDEPBACKSLASH@
+test_utils/libarchive_test-test_main.obj: test_utils/test_main.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/libarchive_test-test_main.obj -MD -MP -MF test_utils/$(DEPDIR)/libarchive_test-test_main.Tpo -c -o test_utils/libarchive_test-test_main.obj `if test -f 'test_utils/test_main.c'; then $(CYGPATH_W) 'test_utils/test_main.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_main.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/libarchive_test-test_main.Tpo test_utils/$(DEPDIR)/libarchive_test-test_main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='test_utils/test_main.c' object='test_utils/libarchive_test-test_main.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-main.obj `if test -f 'libarchive/test/main.c'; then $(CYGPATH_W) 'libarchive/test/main.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/main.c'; fi`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/libarchive_test-test_main.obj `if test -f 'test_utils/test_main.c'; then $(CYGPATH_W) 'test_utils/test_main.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_main.c'; fi`
 
 libarchive/test/libarchive_test-read_open_memory.o: libarchive/test/read_open_memory.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-read_open_memory.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-read_open_memory.Tpo -c -o libarchive/test/libarchive_test-read_open_memory.o `test -f 'libarchive/test/read_open_memory.c' || echo '$(srcdir)/'`libarchive/test/read_open_memory.c
diff --git a/NEWS b/NEWS
index 907ab67..281c176 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+Feb 26, 2017: libarchive 3.3.1 released
+    Security & Feature release
+
 Feb 19, 2017: libarchive 3.3.0 released
     Security & Feature release
 
index 64767b6..e720e9b 100755 (executable)
@@ -51,6 +51,7 @@ perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_N\]),.*\)/$1,['"$VN"'])/' conf
 # Remove developer CFLAGS if a release build is being made
 if [ -n "${MAKE_LIBARCHIVE_RELEASE}" ]; then
   perl -p -i -e "s/^(DEV_CFLAGS.*)/# \$1/" Makefile.am
+  perl -p -i -e 's/CMAKE_BUILD_TYPE "[A-Za-z]*"/CMAKE_BUILD_TYPE "Release"/' CMakeLists.txt
 fi
 
 set -xe
index ec64d99..923a78e 100644 (file)
@@ -1099,6 +1099,9 @@ typedef uint64_t uintmax_t;
 /* Define to 1 if you have a working EXT2_IOC_GETFLAGS */
 #cmakedefine HAVE_WORKING_EXT2_IOC_GETFLAGS 1
 
+/* Define to 1 if you have a working FS_IOC_GETFLAGS */
+#cmakedefine HAVE_WORKING_FS_IOC_GETFLAGS 1
+
 /* Define to 1 if you have the <zlib.h> header file. */
 #cmakedefine HAVE_ZLIB_H 1
 
index a000b30..ef83457 100644 (file)
@@ -1 +1 @@
-3003000
+3003001
index c4642ae..7f1ce5e 100644 (file)
@@ -6,7 +6,7 @@
 IF(ENABLE_CAT AND ENABLE_TEST)
   SET(bsdcat_test_SOURCES
     ../../test_utils/test_utils.c
-    main.c
+    ../../test_utils/test_main.c
     test.h
     test_0.c
     test_empty_gz.c
@@ -54,6 +54,7 @@ IF(ENABLE_CAT AND ENABLE_TEST)
   INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
   INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/test_utils)
+  INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/cat/test)
 
   # Experimental new test handling
   ADD_CUSTOM_TARGET(run_bsdcat_test
diff --git a/cat/test/main.c b/cat/test/main.c
deleted file mode 100644 (file)
index cdfdd9b..0000000
+++ /dev/null
@@ -1,3072 +0,0 @@
-/*
- * Copyright (c) 2003-2009 Tim Kientzle
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "test.h"
-#include "test_utils.h"
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <errno.h>
-#ifdef HAVE_ICONV_H
-#include <iconv.h>
-#endif
-/*
- * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.
- * As the include guards don't agree, the order of include is important.
- */
-#ifdef HAVE_LINUX_EXT2_FS_H
-#include <linux/ext2_fs.h>      /* for Linux file flags */
-#endif
-#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__)
-#include <ext2fs/ext2_fs.h>     /* Linux file flags, broken on Cygwin */
-#endif
-#include <limits.h>
-#include <locale.h>
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#include <stdarg.h>
-#include <time.h>
-
-/*
- * This same file is used pretty much verbatim for all test harnesses.
- *
- * The next few lines are the only differences.
- * TODO: Move this into a separate configuration header, have all test
- * suites share one copy of this file.
- */
-#define KNOWNREF       "test_expand.Z.uu"
-#define ENVBASE "BSDCAT"  /* Prefix for environment variables. */
-#define        PROGRAM "bsdcat"  /* Name of program being tested. */
-#define PROGRAM_ALIAS "cat" /* Generic alias for program */
-#undef LIBRARY           /* Not testing a library. */
-#undef EXTRA_DUMP        /* How to dump extra data */
-#undef EXTRA_ERRNO       /* How to dump errno */
-/* How to generate extra version info. */
-#define        EXTRA_VERSION    (systemf("%s --version", testprog) ? "" : "")
-
-/*
- *
- * Windows support routines
- *
- * Note: Configuration is a tricky issue.  Using HAVE_* feature macros
- * in the test harness is dangerous because they cover up
- * configuration errors.  The classic example of this is omitting a
- * configure check.  If libarchive and libarchive_test both look for
- * the same feature macro, such errors are hard to detect.  Platform
- * macros (e.g., _WIN32 or __GNUC__) are a little better, but can
- * easily lead to very messy code.  It's best to limit yourself
- * to only the most generic programming techniques in the test harness
- * and thus avoid conditionals altogether.  Where that's not possible,
- * try to minimize conditionals by grouping platform-specific tests in
- * one place (e.g., test_acl_freebsd) or by adding new assert()
- * functions (e.g., assertMakeHardlink()) to cover up platform
- * differences.  Platform-specific coding in libarchive_test is often
- * a symptom that some capability is missing from libarchive itself.
- */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#include <io.h>
-#include <direct.h>
-#include <windows.h>
-#ifndef F_OK
-#define F_OK (0)
-#endif
-#ifndef S_ISDIR
-#define S_ISDIR(m)  ((m) & _S_IFDIR)
-#endif
-#ifndef S_ISREG
-#define S_ISREG(m)  ((m) & _S_IFREG)
-#endif
-#if !defined(__BORLANDC__)
-#define access _access
-#undef chdir
-#define chdir _chdir
-#endif
-#ifndef fileno
-#define fileno _fileno
-#endif
-/*#define fstat _fstat64*/
-#if !defined(__BORLANDC__)
-#define getcwd _getcwd
-#endif
-#define lstat stat
-/*#define lstat _stat64*/
-/*#define stat _stat64*/
-#define rmdir _rmdir
-#if !defined(__BORLANDC__)
-#define strdup _strdup
-#define umask _umask
-#endif
-#define int64_t __int64
-#endif
-
-#if defined(HAVE__CrtSetReportMode)
-# include <crtdbg.h>
-#endif
-
-mode_t umasked(mode_t expected_mode)
-{
-       mode_t mode = umask(0);
-       umask(mode);
-       return expected_mode & ~mode;
-}
-
-/* Path to working directory for current test */
-const char *testworkdir;
-#ifdef PROGRAM
-/* Pathname of exe to be tested. */
-const char *testprogfile;
-/* Name of exe to use in printf-formatted command strings. */
-/* On Windows, this includes leading/trailing quotes. */
-const char *testprog;
-#endif
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-static void    *GetFunctionKernel32(const char *);
-static int      my_CreateSymbolicLinkA(const char *, const char *, int);
-static int      my_CreateHardLinkA(const char *, const char *);
-static int      my_GetFileInformationByName(const char *,
-                    BY_HANDLE_FILE_INFORMATION *);
-
-static void *
-GetFunctionKernel32(const char *name)
-{
-       static HINSTANCE lib;
-       static int set;
-       if (!set) {
-               set = 1;
-               lib = LoadLibrary("kernel32.dll");
-       }
-       if (lib == NULL) {
-               fprintf(stderr, "Can't load kernel32.dll?!\n");
-               exit(1);
-       }
-       return (void *)GetProcAddress(lib, name);
-}
-
-static int
-my_CreateSymbolicLinkA(const char *linkname, const char *target, int flags)
-{
-       static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, DWORD);
-       static int set;
-       if (!set) {
-               set = 1;
-               f = GetFunctionKernel32("CreateSymbolicLinkA");
-       }
-       return f == NULL ? 0 : (*f)(linkname, target, flags);
-}
-
-static int
-my_CreateHardLinkA(const char *linkname, const char *target)
-{
-       static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES);
-       static int set;
-       if (!set) {
-               set = 1;
-               f = GetFunctionKernel32("CreateHardLinkA");
-       }
-       return f == NULL ? 0 : (*f)(linkname, target, NULL);
-}
-
-static int
-my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi)
-{
-       HANDLE h;
-       int r;
-
-       memset(bhfi, 0, sizeof(*bhfi));
-       h = CreateFile(path, FILE_READ_ATTRIBUTES, 0, NULL,
-               OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
-       if (h == INVALID_HANDLE_VALUE)
-               return (0);
-       r = GetFileInformationByHandle(h, bhfi);
-       CloseHandle(h);
-       return (r);
-}
-#endif
-
-#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__)
-static void
-invalid_parameter_handler(const wchar_t * expression,
-    const wchar_t * function, const wchar_t * file,
-    unsigned int line, uintptr_t pReserved)
-{
-       /* nop */
-}
-#endif
-
-/*
- *
- * OPTIONS FLAGS
- *
- */
-
-/* Enable core dump on failure. */
-static int dump_on_failure = 0;
-/* Default is to remove temp dirs and log data for successful tests. */
-static int keep_temp_files = 0;
-/* Default is to run the specified tests once and report errors. */
-static int until_failure = 0;
-/* Default is to just report pass/fail for each test. */
-static int verbosity = 0;
-#define        VERBOSITY_SUMMARY_ONLY -1 /* -q */
-#define VERBOSITY_PASSFAIL 0   /* Default */
-#define VERBOSITY_LIGHT_REPORT 1 /* -v */
-#define VERBOSITY_FULL 2 /* -vv */
-/* A few places generate even more output for verbosity > VERBOSITY_FULL,
- * mostly for debugging the test harness itself. */
-/* Cumulative count of assertion failures. */
-static int failures = 0;
-/* Cumulative count of reported skips. */
-static int skips = 0;
-/* Cumulative count of assertions checked. */
-static int assertions = 0;
-
-/* Directory where uuencoded reference files can be found. */
-static const char *refdir;
-
-/*
- * Report log information selectively to console and/or disk log.
- */
-static int log_console = 0;
-static FILE *logfile;
-static void
-vlogprintf(const char *fmt, va_list ap)
-{
-#ifdef va_copy
-       va_list lfap;
-       va_copy(lfap, ap);
-#endif
-       if (log_console)
-               vfprintf(stdout, fmt, ap);
-       if (logfile != NULL)
-#ifdef va_copy
-               vfprintf(logfile, fmt, lfap);
-       va_end(lfap);
-#else
-               vfprintf(logfile, fmt, ap);
-#endif
-}
-
-static void
-logprintf(const char *fmt, ...)
-{
-       va_list ap;
-       va_start(ap, fmt);
-       vlogprintf(fmt, ap);
-       va_end(ap);
-}
-
-/* Set up a message to display only if next assertion fails. */
-static char msgbuff[4096];
-static const char *msg, *nextmsg;
-void
-failure(const char *fmt, ...)
-{
-       va_list ap;
-       if (fmt == NULL) {
-               nextmsg = NULL;
-       } else {
-               va_start(ap, fmt);
-               vsprintf(msgbuff, fmt, ap);
-               va_end(ap);
-               nextmsg = msgbuff;
-       }
-}
-
-/*
- * Copy arguments into file-local variables.
- * This was added to permit vararg assert() functions without needing
- * variadic wrapper macros.  Turns out that the vararg capability is almost
- * never used, so almost all of the vararg assertions can be simplified
- * by removing the vararg capability and reworking the wrapper macro to
- * pass __FILE__, __LINE__ directly into the function instead of using
- * this hook.  I suspect this machinery is used so rarely that we
- * would be better off just removing it entirely.  That would simplify
- * the code here noticeably.
- */
-static const char *skipping_filename;
-static int skipping_line;
-void skipping_setup(const char *filename, int line)
-{
-       skipping_filename = filename;
-       skipping_line = line;
-}
-
-/* Called at the beginning of each assert() function. */
-static void
-assertion_count(const char *file, int line)
-{
-       (void)file; /* UNUSED */
-       (void)line; /* UNUSED */
-       ++assertions;
-       /* Proper handling of "failure()" message. */
-       msg = nextmsg;
-       nextmsg = NULL;
-       /* Uncomment to print file:line after every assertion.
-        * Verbose, but occasionally useful in tracking down crashes. */
-       /* printf("Checked %s:%d\n", file, line); */
-}
-
-/*
- * For each test source file, we remember how many times each
- * assertion was reported.  Cleared before each new test,
- * used by test_summarize().
- */
-static struct line {
-       int count;
-       int skip;
-}  failed_lines[10000];
-const char *failed_filename;
-
-/* Count this failure, setup up log destination and handle initial report. */
-static void
-failure_start(const char *filename, int line, const char *fmt, ...)
-{
-       va_list ap;
-
-       /* Record another failure for this line. */
-       ++failures;
-       failed_filename = filename;
-       failed_lines[line].count++;
-
-       /* Determine whether to log header to console. */
-       switch (verbosity) {
-       case VERBOSITY_LIGHT_REPORT:
-               log_console = (failed_lines[line].count < 2);
-               break;
-       default:
-               log_console = (verbosity >= VERBOSITY_FULL);
-       }
-
-       /* Log file:line header for this failure */
-       va_start(ap, fmt);
-#if _MSC_VER
-       logprintf("%s(%d): ", filename, line);
-#else
-       logprintf("%s:%d: ", filename, line);
-#endif
-       vlogprintf(fmt, ap);
-       va_end(ap);
-       logprintf("\n");
-
-       if (msg != NULL && msg[0] != '\0') {
-               logprintf("   Description: %s\n", msg);
-               msg = NULL;
-       }
-
-       /* Determine whether to log details to console. */
-       if (verbosity == VERBOSITY_LIGHT_REPORT)
-               log_console = 0;
-}
-
-/* Complete reporting of failed tests. */
-/*
- * The 'extra' hook here is used by libarchive to include libarchive
- * error messages with assertion failures.  It could also be used
- * to add strerror() output, for example.  Just define the EXTRA_DUMP()
- * macro appropriately.
- */
-static void
-failure_finish(void *extra)
-{
-       (void)extra; /* UNUSED (maybe) */
-#ifdef EXTRA_DUMP
-       if (extra != NULL) {
-               logprintf("    errno: %d\n", EXTRA_ERRNO(extra));
-               logprintf("   detail: %s\n", EXTRA_DUMP(extra));
-       }
-#endif
-
-       if (dump_on_failure) {
-               fprintf(stderr,
-                   " *** forcing core dump so failure can be debugged ***\n");
-               abort();
-       }
-}
-
-/* Inform user that we're skipping some checks. */
-void
-test_skipping(const char *fmt, ...)
-{
-       char buff[1024];
-       va_list ap;
-
-       va_start(ap, fmt);
-       vsprintf(buff, fmt, ap);
-       va_end(ap);
-       /* Use failure() message if set. */
-       msg = nextmsg;
-       nextmsg = NULL;
-       /* failure_start() isn't quite right, but is awfully convenient. */
-       failure_start(skipping_filename, skipping_line, "SKIPPING: %s", buff);
-       --failures; /* Undo failures++ in failure_start() */
-       /* Don't failure_finish() here. */
-       /* Mark as skip, so doesn't count as failed test. */
-       failed_lines[skipping_line].skip = 1;
-       ++skips;
-}
-
-/*
- *
- * ASSERTIONS
- *
- */
-
-/* Generic assert() just displays the failed condition. */
-int
-assertion_assert(const char *file, int line, int value,
-    const char *condition, void *extra)
-{
-       assertion_count(file, line);
-       if (!value) {
-               failure_start(file, line, "Assertion failed: %s", condition);
-               failure_finish(extra);
-       }
-       return (value);
-}
-
-/* chdir() and report any errors */
-int
-assertion_chdir(const char *file, int line, const char *pathname)
-{
-       assertion_count(file, line);
-       if (chdir(pathname) == 0)
-               return (1);
-       failure_start(file, line, "chdir(\"%s\")", pathname);
-       failure_finish(NULL);
-       return (0);
-
-}
-
-/* Verify two integers are equal. */
-int
-assertion_equal_int(const char *file, int line,
-    long long v1, const char *e1, long long v2, const char *e2, void *extra)
-{
-       assertion_count(file, line);
-       if (v1 == v2)
-               return (1);
-       failure_start(file, line, "%s != %s", e1, e2);
-       logprintf("      %s=%lld (0x%llx, 0%llo)\n", e1, v1, v1, v1);
-       logprintf("      %s=%lld (0x%llx, 0%llo)\n", e2, v2, v2, v2);
-       failure_finish(extra);
-       return (0);
-}
-
-/*
- * Utility to convert a single UTF-8 sequence.
- */
-static int
-_utf8_to_unicode(uint32_t *pwc, const char *s, size_t n)
-{
-       static const char utf8_count[256] = {
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 00 - 0F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 10 - 1F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 20 - 2F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 30 - 3F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 40 - 4F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 50 - 5F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 60 - 6F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 70 - 7F */
-                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 80 - 8F */
-                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 90 - 9F */
-                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* A0 - AF */
-                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* B0 - BF */
-                0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* C0 - CF */
-                2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* D0 - DF */
-                3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,/* E0 - EF */
-                4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */
-       };
-       int ch;
-       int cnt;
-       uint32_t wc;
-
-       *pwc = 0;
-
-       /* Sanity check. */
-       if (n == 0)
-               return (0);
-       /*
-        * Decode 1-4 bytes depending on the value of the first byte.
-        */
-       ch = (unsigned char)*s;
-       if (ch == 0)
-               return (0); /* Standard:  return 0 for end-of-string. */
-       cnt = utf8_count[ch];
-
-       /* Invalid sequence or there are not plenty bytes. */
-       if (n < (size_t)cnt)
-               return (-1);
-
-       /* Make a Unicode code point from a single UTF-8 sequence. */
-       switch (cnt) {
-       case 1: /* 1 byte sequence. */
-               *pwc = ch & 0x7f;
-               return (cnt);
-       case 2: /* 2 bytes sequence. */
-               if ((s[1] & 0xc0) != 0x80) return (-1);
-               *pwc = ((ch & 0x1f) << 6) | (s[1] & 0x3f);
-               return (cnt);
-       case 3: /* 3 bytes sequence. */
-               if ((s[1] & 0xc0) != 0x80) return (-1);
-               if ((s[2] & 0xc0) != 0x80) return (-1);
-               wc = ((ch & 0x0f) << 12)
-                   | ((s[1] & 0x3f) << 6)
-                   | (s[2] & 0x3f);
-               if (wc < 0x800)
-                       return (-1);/* Overlong sequence. */
-               break;
-       case 4: /* 4 bytes sequence. */
-               if (n < 4)
-                       return (-1);
-               if ((s[1] & 0xc0) != 0x80) return (-1);
-               if ((s[2] & 0xc0) != 0x80) return (-1);
-               if ((s[3] & 0xc0) != 0x80) return (-1);
-               wc = ((ch & 0x07) << 18)
-                   | ((s[1] & 0x3f) << 12)
-                   | ((s[2] & 0x3f) << 6)
-                   | (s[3] & 0x3f);
-               if (wc < 0x10000)
-                       return (-1);/* Overlong sequence. */
-               break;
-       default:
-               return (-1);
-       }
-
-       /* The code point larger than 0x10FFFF is not legal
-        * Unicode values. */
-       if (wc > 0x10FFFF)
-               return (-1);
-       /* Correctly gets a Unicode, returns used bytes. */
-       *pwc = wc;
-       return (cnt);
-}
-
-static void strdump(const char *e, const char *p, int ewidth, int utf8)
-{
-       const char *q = p;
-
-       logprintf("      %*s = ", ewidth, e);
-       if (p == NULL) {
-               logprintf("NULL\n");
-               return;
-       }
-       logprintf("\"");
-       while (*p != '\0') {
-               unsigned int c = 0xff & *p++;
-               switch (c) {
-               case '\a': logprintf("\\a"); break;
-               case '\b': logprintf("\\b"); break;
-               case '\n': logprintf("\\n"); break;
-               case '\r': logprintf("\\r"); break;
-               default:
-                       if (c >= 32 && c < 127)
-                               logprintf("%c", c);
-                       else
-                               logprintf("\\x%02X", c);
-               }
-       }
-       logprintf("\"");
-       logprintf(" (length %d)", q == NULL ? -1 : (int)strlen(q));
-
-       /*
-        * If the current string is UTF-8, dump its code points.
-        */
-       if (utf8) {
-               size_t len;
-               uint32_t uc;
-               int n;
-               int cnt = 0;
-
-               p = q;
-               len = strlen(p);
-               logprintf(" [");
-               while ((n = _utf8_to_unicode(&uc, p, len)) > 0) {
-                       if (p != q)
-                               logprintf(" ");
-                       logprintf("%04X", uc);
-                       p += n;
-                       len -= n;
-                       cnt++;
-               }
-               logprintf("]");
-               logprintf(" (count %d", cnt);
-               if (n < 0) {
-                       logprintf(",unknown %d bytes", len);
-               }
-               logprintf(")");
-
-       }
-       logprintf("\n");
-}
-
-/* Verify two strings are equal, dump them if not. */
-int
-assertion_equal_string(const char *file, int line,
-    const char *v1, const char *e1,
-    const char *v2, const char *e2,
-    void *extra, int utf8)
-{
-       int l1, l2;
-
-       assertion_count(file, line);
-       if (v1 == v2 || (v1 != NULL && v2 != NULL && strcmp(v1, v2) == 0))
-               return (1);
-       failure_start(file, line, "%s != %s", e1, e2);
-       l1 = (int)strlen(e1);
-       l2 = (int)strlen(e2);
-       if (l1 < l2)
-               l1 = l2;
-       strdump(e1, v1, l1, utf8);
-       strdump(e2, v2, l1, utf8);
-       failure_finish(extra);
-       return (0);
-}
-
-static void
-wcsdump(const char *e, const wchar_t *w)
-{
-       logprintf("      %s = ", e);
-       if (w == NULL) {
-               logprintf("(null)");
-               return;
-       }
-       logprintf("\"");
-       while (*w != L'\0') {
-               unsigned int c = *w++;
-               if (c >= 32 && c < 127)
-                       logprintf("%c", c);
-               else if (c < 256)
-                       logprintf("\\x%02X", c);
-               else if (c < 0x10000)
-                       logprintf("\\u%04X", c);
-               else
-                       logprintf("\\U%08X", c);
-       }
-       logprintf("\"\n");
-}
-
-#ifndef HAVE_WCSCMP
-static int
-wcscmp(const wchar_t *s1, const wchar_t *s2)
-{
-
-       while (*s1 == *s2++) {
-               if (*s1++ == L'\0')
-                       return 0;
-       }
-       if (*s1 > *--s2)
-               return 1;
-       else
-               return -1;
-}
-#endif
-
-/* Verify that two wide strings are equal, dump them if not. */
-int
-assertion_equal_wstring(const char *file, int line,
-    const wchar_t *v1, const char *e1,
-    const wchar_t *v2, const char *e2,
-    void *extra)
-{
-       assertion_count(file, line);
-       if (v1 == v2)
-               return (1);
-       if (v1 != NULL && v2 != NULL && wcscmp(v1, v2) == 0)
-               return (1);
-       failure_start(file, line, "%s != %s", e1, e2);
-       wcsdump(e1, v1);
-       wcsdump(e2, v2);
-       failure_finish(extra);
-       return (0);
-}
-
-/*
- * Pretty standard hexdump routine.  As a bonus, if ref != NULL, then
- * any bytes in p that differ from ref will be highlighted with '_'
- * before and after the hex value.
- */
-static void
-hexdump(const char *p, const char *ref, size_t l, size_t offset)
-{
-       size_t i, j;
-       char sep;
-
-       if (p == NULL) {
-               logprintf("(null)\n");
-               return;
-       }
-       for(i=0; i < l; i+=16) {
-               logprintf("%04x", (unsigned)(i + offset));
-               sep = ' ';
-               for (j = 0; j < 16 && i + j < l; j++) {
-                       if (ref != NULL && p[i + j] != ref[i + j])
-                               sep = '_';
-                       logprintf("%c%02x", sep, 0xff & (int)p[i+j]);
-                       if (ref != NULL && p[i + j] == ref[i + j])
-                               sep = ' ';
-               }
-               for (; j < 16; j++) {
-                       logprintf("%c  ", sep);
-                       sep = ' ';
-               }
-               logprintf("%c", sep);
-               for (j=0; j < 16 && i + j < l; j++) {
-                       int c = p[i + j];
-                       if (c >= ' ' && c <= 126)
-                               logprintf("%c", c);
-                       else
-                               logprintf(".");
-               }
-               logprintf("\n");
-       }
-}
-
-/* Verify that two blocks of memory are the same, display the first
- * block of differences if they're not. */
-int
-assertion_equal_mem(const char *file, int line,
-    const void *_v1, const char *e1,
-    const void *_v2, const char *e2,
-    size_t l, const char *ld, void *extra)
-{
-       const char *v1 = (const char *)_v1;
-       const char *v2 = (const char *)_v2;
-       size_t offset;
-
-       assertion_count(file, line);
-       if (v1 == v2 || (v1 != NULL && v2 != NULL && memcmp(v1, v2, l) == 0))
-               return (1);
-       if (v1 == NULL || v2 == NULL)
-               return (0);
-
-       failure_start(file, line, "%s != %s", e1, e2);
-       logprintf("      size %s = %d\n", ld, (int)l);
-       /* Dump 48 bytes (3 lines) so that the first difference is
-        * in the second line. */
-       offset = 0;
-       while (l > 64 && memcmp(v1, v2, 32) == 0) {
-               /* Two lines agree, so step forward one line. */
-               v1 += 16;
-               v2 += 16;
-               l -= 16;
-               offset += 16;
-       }
-       logprintf("      Dump of %s\n", e1);
-       hexdump(v1, v2, l < 128 ? l : 128, offset);
-       logprintf("      Dump of %s\n", e2);
-       hexdump(v2, v1, l < 128 ? l : 128, offset);
-       logprintf("\n");
-       failure_finish(extra);
-       return (0);
-}
-
-/* Verify that a block of memory is filled with the specified byte. */
-int
-assertion_memory_filled_with(const char *file, int line,
-    const void *_v1, const char *vd,
-    size_t l, const char *ld,
-    char b, const char *bd, void *extra)
-{
-       const char *v1 = (const char *)_v1;
-       size_t c = 0;
-       size_t i;
-       (void)ld; /* UNUSED */
-
-       assertion_count(file, line);
-
-       for (i = 0; i < l; ++i) {
-               if (v1[i] == b) {
-                       ++c;
-               }
-       }
-       if (c == l)
-               return (1);
-
-       failure_start(file, line, "%s (size %d) not filled with %s", vd, (int)l, bd);
-       logprintf("   Only %d bytes were correct\n", (int)c);
-       failure_finish(extra);
-       return (0);
-}
-
-/* Verify that the named file exists and is empty. */
-int
-assertion_empty_file(const char *filename, int line, const char *f1)
-{
-       char buff[1024];
-       struct stat st;
-       ssize_t s;
-       FILE *f;
-
-       assertion_count(filename, line);
-
-       if (stat(f1, &st) != 0) {
-               failure_start(filename, line, "Stat failed: %s", f1);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (st.st_size == 0)
-               return (1);
-
-       failure_start(filename, line, "File should be empty: %s", f1);
-       logprintf("    File size: %d\n", (int)st.st_size);
-       logprintf("    Contents:\n");
-       f = fopen(f1, "rb");
-       if (f == NULL) {
-               logprintf("    Unable to open %s\n", f1);
-       } else {
-               s = ((off_t)sizeof(buff) < st.st_size) ?
-                   (ssize_t)sizeof(buff) : (ssize_t)st.st_size;
-               s = fread(buff, 1, s, f);
-               hexdump(buff, NULL, s, 0);
-               fclose(f);
-       }
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Verify that the named file exists and is not empty. */
-int
-assertion_non_empty_file(const char *filename, int line, const char *f1)
-{
-       struct stat st;
-
-       assertion_count(filename, line);
-
-       if (stat(f1, &st) != 0) {
-               failure_start(filename, line, "Stat failed: %s", f1);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (st.st_size == 0) {
-               failure_start(filename, line, "File empty: %s", f1);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (1);
-}
-
-/* Verify that two files have the same contents. */
-/* TODO: hexdump the first bytes that actually differ. */
-int
-assertion_equal_file(const char *filename, int line, const char *fn1, const char *fn2)
-{
-       char buff1[1024];
-       char buff2[1024];
-       FILE *f1, *f2;
-       int n1, n2;
-
-       assertion_count(filename, line);
-
-       f1 = fopen(fn1, "rb");
-       f2 = fopen(fn2, "rb");
-       if (f1 == NULL || f2 == NULL) {
-               if (f1) fclose(f1);
-               if (f2) fclose(f2);
-               return (0);
-       }
-       for (;;) {
-               n1 = (int)fread(buff1, 1, sizeof(buff1), f1);
-               n2 = (int)fread(buff2, 1, sizeof(buff2), f2);
-               if (n1 != n2)
-                       break;
-               if (n1 == 0 && n2 == 0) {
-                       fclose(f1);
-                       fclose(f2);
-                       return (1);
-               }
-               if (memcmp(buff1, buff2, n1) != 0)
-                       break;
-       }
-       fclose(f1);
-       fclose(f2);
-       failure_start(filename, line, "Files not identical");
-       logprintf("  file1=\"%s\"\n", fn1);
-       logprintf("  file2=\"%s\"\n", fn2);
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Verify that the named file does exist. */
-int
-assertion_file_exists(const char *filename, int line, const char *f)
-{
-       assertion_count(filename, line);
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       if (!_access(f, 0))
-               return (1);
-#else
-       if (!access(f, F_OK))
-               return (1);
-#endif
-       failure_start(filename, line, "File should exist: %s", f);
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Verify that the named file doesn't exist. */
-int
-assertion_file_not_exists(const char *filename, int line, const char *f)
-{
-       assertion_count(filename, line);
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       if (_access(f, 0))
-               return (1);
-#else
-       if (access(f, F_OK))
-               return (1);
-#endif
-       failure_start(filename, line, "File should not exist: %s", f);
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Compare the contents of a file to a block of memory. */
-int
-assertion_file_contents(const char *filename, int line, const void *buff, int s, const char *fn)
-{
-       char *contents;
-       FILE *f;
-       int n;
-
-       assertion_count(filename, line);
-
-       f = fopen(fn, "rb");
-       if (f == NULL) {
-               failure_start(filename, line,
-                   "File should exist: %s", fn);
-               failure_finish(NULL);
-               return (0);
-       }
-       contents = malloc(s * 2);
-       n = (int)fread(contents, 1, s * 2, f);
-       fclose(f);
-       if (n == s && memcmp(buff, contents, s) == 0) {
-               free(contents);
-               return (1);
-       }
-       failure_start(filename, line, "File contents don't match");
-       logprintf("  file=\"%s\"\n", fn);
-       if (n > 0)
-               hexdump(contents, buff, n > 512 ? 512 : n, 0);
-       else {
-               logprintf("  File empty, contents should be:\n");
-               hexdump(buff, NULL, s > 512 ? 512 : s, 0);
-       }
-       failure_finish(NULL);
-       free(contents);
-       return (0);
-}
-
-/* Check the contents of a text file, being tolerant of line endings. */
-int
-assertion_text_file_contents(const char *filename, int line, const char *buff, const char *fn)
-{
-       char *contents;
-       const char *btxt, *ftxt;
-       FILE *f;
-       int n, s;
-
-       assertion_count(filename, line);
-       f = fopen(fn, "r");
-       if (f == NULL) {
-               failure_start(filename, line,
-                   "File doesn't exist: %s", fn);
-               failure_finish(NULL);
-               return (0);
-       }
-       s = (int)strlen(buff);
-       contents = malloc(s * 2 + 128);
-       n = (int)fread(contents, 1, s * 2 + 128 - 1, f);
-       if (n >= 0)
-               contents[n] = '\0';
-       fclose(f);
-       /* Compare texts. */
-       btxt = buff;
-       ftxt = (const char *)contents;
-       while (*btxt != '\0' && *ftxt != '\0') {
-               if (*btxt == *ftxt) {
-                       ++btxt;
-                       ++ftxt;
-                       continue;
-               }
-               if (btxt[0] == '\n' && ftxt[0] == '\r' && ftxt[1] == '\n') {
-                       /* Pass over different new line characters. */
-                       ++btxt;
-                       ftxt += 2;
-                       continue;
-               }
-               break;
-       }
-       if (*btxt == '\0' && *ftxt == '\0') {
-               free(contents);
-               return (1);
-       }
-       failure_start(filename, line, "Contents don't match");
-       logprintf("  file=\"%s\"\n", fn);
-       if (n > 0) {
-               hexdump(contents, buff, n, 0);
-               logprintf("  expected\n", fn);
-               hexdump(buff, contents, s, 0);
-       } else {
-               logprintf("  File empty, contents should be:\n");
-               hexdump(buff, NULL, s, 0);
-       }
-       failure_finish(NULL);
-       free(contents);
-       return (0);
-}
-
-/* Verify that a text file contains the specified lines, regardless of order */
-/* This could be more efficient if we sorted both sets of lines, etc, but
- * since this is used only for testing and only ever deals with a dozen or so
- * lines at a time, this relatively crude approach is just fine. */
-int
-assertion_file_contains_lines_any_order(const char *file, int line,
-    const char *pathname, const char *lines[])
-{
-       char *buff;
-       size_t buff_size;
-       size_t expected_count, actual_count, i, j;
-       char **expected = NULL;
-       char *p, **actual = NULL;
-       char c;
-       int expected_failure = 0, actual_failure = 0;
-
-       assertion_count(file, line);
-
-       buff = slurpfile(&buff_size, "%s", pathname);
-       if (buff == NULL) {
-               failure_start(pathname, line, "Can't read file: %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-
-       /* Make a copy of the provided lines and count up the expected
-        * file size. */
-       for (i = 0; lines[i] != NULL; ++i) {
-       }
-       expected_count = i;
-       if (expected_count) {
-               expected = malloc(sizeof(char *) * expected_count);
-               if (expected == NULL) {
-                       failure_start(pathname, line, "Can't allocate memory");
-                       failure_finish(NULL);
-                       free(expected);
-                       return (0);
-               }
-               for (i = 0; lines[i] != NULL; ++i) {
-                       expected[i] = strdup(lines[i]);
-               }
-       }
-
-       /* Break the file into lines */
-       actual_count = 0;
-       for (c = '\0', p = buff; p < buff + buff_size; ++p) {
-               if (*p == '\x0d' || *p == '\x0a')
-                       *p = '\0';
-               if (c == '\0' && *p != '\0')
-                       ++actual_count;
-               c = *p;
-       }
-       if (actual_count) {
-               actual = calloc(sizeof(char *), actual_count);
-               if (actual == NULL) {
-                       failure_start(pathname, line, "Can't allocate memory");
-                       failure_finish(NULL);
-                       free(expected);
-                       return (0);
-               }
-               for (j = 0, p = buff; p < buff + buff_size;
-                   p += 1 + strlen(p)) {
-                       if (*p != '\0') {
-                               actual[j] = p;
-                               ++j;
-                       }
-               }
-       }
-
-       /* Erase matching lines from both lists */
-       for (i = 0; i < expected_count; ++i) {
-               if (expected[i] == NULL)
-                       continue;
-               for (j = 0; j < actual_count; ++j) {
-                       if (actual[j] == NULL)
-                               continue;
-                       if (strcmp(expected[i], actual[j]) == 0) {
-                               free(expected[i]);
-                               expected[i] = NULL;
-                               actual[j] = NULL;
-                               break;
-                       }
-               }
-       }
-
-       /* If there's anything left, it's a failure */
-       for (i = 0; i < expected_count; ++i) {
-               if (expected[i] != NULL)
-                       ++expected_failure;
-       }
-       for (j = 0; j < actual_count; ++j) {
-               if (actual[j] != NULL)
-                       ++actual_failure;
-       }
-       if (expected_failure == 0 && actual_failure == 0) {
-               free(buff);
-               free(expected);
-               free(actual);
-               return (1);
-       }
-       failure_start(file, line, "File doesn't match: %s", pathname);
-       for (i = 0; i < expected_count; ++i) {
-               if (expected[i] != NULL) {
-                       logprintf("  Expected but not present: %s\n", expected[i]);
-                       free(expected[i]);
-               }
-       }
-       for (j = 0; j < actual_count; ++j) {
-               if (actual[j] != NULL)
-                       logprintf("  Present but not expected: %s\n", actual[j]);
-       }
-       failure_finish(NULL);
-       free(buff);
-       free(expected);
-       free(actual);
-       return (0);
-}
-
-/* Verify that a text file does not contains the specified strings */
-int
-assertion_file_contains_no_invalid_strings(const char *file, int line,
-    const char *pathname, const char *strings[])
-{
-       char *buff;
-       int i;
-
-       buff = slurpfile(NULL, "%s", pathname);
-       if (buff == NULL) {
-               failure_start(file, line, "Can't read file: %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-
-       for (i = 0; strings[i] != NULL; ++i) {
-               if (strstr(buff, strings[i]) != NULL) {
-                       failure_start(file, line, "Invalid string in %s: %s", pathname,
-                           strings[i]);
-                       failure_finish(NULL);
-                       free(buff);
-                       return(0);
-               }
-       }
-
-       free(buff);
-       return (0);
-}
-
-/* Test that two paths point to the same file. */
-/* As a side-effect, asserts that both files exist. */
-static int
-is_hardlink(const char *file, int line,
-    const char *path1, const char *path2)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       BY_HANDLE_FILE_INFORMATION bhfi1, bhfi2;
-       int r;
-
-       assertion_count(file, line);
-       r = my_GetFileInformationByName(path1, &bhfi1);
-       if (r == 0) {
-               failure_start(file, line, "File %s can't be inspected?", path1);
-               failure_finish(NULL);
-               return (0);
-       }
-       r = my_GetFileInformationByName(path2, &bhfi2);
-       if (r == 0) {
-               failure_start(file, line, "File %s can't be inspected?", path2);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (bhfi1.dwVolumeSerialNumber == bhfi2.dwVolumeSerialNumber
-               && bhfi1.nFileIndexHigh == bhfi2.nFileIndexHigh
-               && bhfi1.nFileIndexLow == bhfi2.nFileIndexLow);
-#else
-       struct stat st1, st2;
-       int r;
-
-       assertion_count(file, line);
-       r = lstat(path1, &st1);
-       if (r != 0) {
-               failure_start(file, line, "File should exist: %s", path1);
-               failure_finish(NULL);
-               return (0);
-       }
-       r = lstat(path2, &st2);
-       if (r != 0) {
-               failure_start(file, line, "File should exist: %s", path2);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (st1.st_ino == st2.st_ino && st1.st_dev == st2.st_dev);
-#endif
-}
-
-int
-assertion_is_hardlink(const char *file, int line,
-    const char *path1, const char *path2)
-{
-       if (is_hardlink(file, line, path1, path2))
-               return (1);
-       failure_start(file, line,
-           "Files %s and %s are not hardlinked", path1, path2);
-       failure_finish(NULL);
-       return (0);
-}
-
-int
-assertion_is_not_hardlink(const char *file, int line,
-    const char *path1, const char *path2)
-{
-       if (!is_hardlink(file, line, path1, path2))
-               return (1);
-       failure_start(file, line,
-           "Files %s and %s should not be hardlinked", path1, path2);
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Verify a/b/mtime of 'pathname'. */
-/* If 'recent', verify that it's within last 10 seconds. */
-static int
-assertion_file_time(const char *file, int line,
-    const char *pathname, long t, long nsec, char type, int recent)
-{
-       long long filet, filet_nsec;
-       int r;
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#define EPOC_TIME      (116444736000000000ULL)
-       FILETIME fxtime, fbirthtime, fatime, fmtime;
-       ULARGE_INTEGER wintm;
-       HANDLE h;
-       fxtime.dwLowDateTime = 0;
-       fxtime.dwHighDateTime = 0;
-
-       assertion_count(file, line);
-       /* Note: FILE_FLAG_BACKUP_SEMANTICS applies to open
-        * a directory file. If not, CreateFile() will fail when
-        * the pathname is a directory. */
-       h = CreateFile(pathname, FILE_READ_ATTRIBUTES, 0, NULL,
-           OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
-       if (h == INVALID_HANDLE_VALUE) {
-               failure_start(file, line, "Can't access %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       r = GetFileTime(h, &fbirthtime, &fatime, &fmtime);
-       switch (type) {
-       case 'a': fxtime = fatime; break;
-       case 'b': fxtime = fbirthtime; break;
-       case 'm': fxtime = fmtime; break;
-       }
-       CloseHandle(h);
-       if (r == 0) {
-               failure_start(file, line, "Can't GetFileTime %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       wintm.LowPart = fxtime.dwLowDateTime;
-       wintm.HighPart = fxtime.dwHighDateTime;
-       filet = (wintm.QuadPart - EPOC_TIME) / 10000000;
-       filet_nsec = ((wintm.QuadPart - EPOC_TIME) % 10000000) * 100;
-       nsec = (nsec / 100) * 100; /* Round the request */
-#else
-       struct stat st;
-
-       assertion_count(file, line);
-       r = lstat(pathname, &st);
-       if (r != 0) {
-               failure_start(file, line, "Can't stat %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       switch (type) {
-       case 'a': filet = st.st_atime; break;
-       case 'm': filet = st.st_mtime; break;
-       case 'b': filet = 0; break;
-       default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
-               exit(1);
-       }
-#if defined(__FreeBSD__)
-       switch (type) {
-       case 'a': filet_nsec = st.st_atimespec.tv_nsec; break;
-       case 'b': filet = st.st_birthtime;
-               /* FreeBSD filesystems that don't support birthtime
-                * (e.g., UFS1) always return -1 here. */
-               if (filet == -1) {
-                       return (1);
-               }
-               filet_nsec = st.st_birthtimespec.tv_nsec; break;
-       case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break;
-       default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
-               exit(1);
-       }
-       /* FreeBSD generally only stores to microsecond res, so round. */
-       filet_nsec = (filet_nsec / 1000) * 1000;
-       nsec = (nsec / 1000) * 1000;
-#else
-       filet_nsec = nsec = 0;  /* Generic POSIX only has whole seconds. */
-       if (type == 'b') return (1); /* Generic POSIX doesn't have birthtime */
-#if defined(__HAIKU__)
-       if (type == 'a') return (1); /* Haiku doesn't have atime. */
-#endif
-#endif
-#endif
-       if (recent) {
-               /* Check that requested time is up-to-date. */
-               time_t now = time(NULL);
-               if (filet < now - 10 || filet > now + 1) {
-                       failure_start(file, line,
-                           "File %s has %ctime %lld, %lld seconds ago\n",
-                           pathname, type, filet, now - filet);
-                       failure_finish(NULL);
-                       return (0);
-               }
-       } else if (filet != t || filet_nsec != nsec) {
-               failure_start(file, line,
-                   "File %s has %ctime %lld.%09lld, expected %lld.%09lld",
-                   pathname, type, filet, filet_nsec, t, nsec);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (1);
-}
-
-/* Verify atime of 'pathname'. */
-int
-assertion_file_atime(const char *file, int line,
-    const char *pathname, long t, long nsec)
-{
-       return assertion_file_time(file, line, pathname, t, nsec, 'a', 0);
-}
-
-/* Verify atime of 'pathname' is up-to-date. */
-int
-assertion_file_atime_recent(const char *file, int line, const char *pathname)
-{
-       return assertion_file_time(file, line, pathname, 0, 0, 'a', 1);
-}
-
-/* Verify birthtime of 'pathname'. */
-int
-assertion_file_birthtime(const char *file, int line,
-    const char *pathname, long t, long nsec)
-{
-       return assertion_file_time(file, line, pathname, t, nsec, 'b', 0);
-}
-
-/* Verify birthtime of 'pathname' is up-to-date. */
-int
-assertion_file_birthtime_recent(const char *file, int line,
-    const char *pathname)
-{
-       return assertion_file_time(file, line, pathname, 0, 0, 'b', 1);
-}
-
-/* Verify mode of 'pathname'. */
-int
-assertion_file_mode(const char *file, int line, const char *pathname, int expected_mode)
-{
-       int mode;
-       int r;
-
-       assertion_count(file, line);
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       failure_start(file, line, "assertFileMode not yet implemented for Windows");
-       (void)mode; /* UNUSED */
-       (void)r; /* UNUSED */
-#else
-       {
-               struct stat st;
-               r = lstat(pathname, &st);
-               mode = (int)(st.st_mode & 0777);
-       }
-       if (r == 0 && mode == expected_mode)
-                       return (1);
-       failure_start(file, line, "File %s has mode %o, expected %o",
-           pathname, mode, expected_mode);
-#endif
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Verify mtime of 'pathname'. */
-int
-assertion_file_mtime(const char *file, int line,
-    const char *pathname, long t, long nsec)
-{
-       return assertion_file_time(file, line, pathname, t, nsec, 'm', 0);
-}
-
-/* Verify mtime of 'pathname' is up-to-date. */
-int
-assertion_file_mtime_recent(const char *file, int line, const char *pathname)
-{
-       return assertion_file_time(file, line, pathname, 0, 0, 'm', 1);
-}
-
-/* Verify number of links to 'pathname'. */
-int
-assertion_file_nlinks(const char *file, int line,
-    const char *pathname, int nlinks)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       BY_HANDLE_FILE_INFORMATION bhfi;
-       int r;
-
-       assertion_count(file, line);
-       r = my_GetFileInformationByName(pathname, &bhfi);
-       if (r != 0 && bhfi.nNumberOfLinks == (DWORD)nlinks)
-               return (1);
-       failure_start(file, line, "File %s has %d links, expected %d",
-           pathname, bhfi.nNumberOfLinks, nlinks);
-       failure_finish(NULL);
-       return (0);
-#else
-       struct stat st;
-       int r;
-
-       assertion_count(file, line);
-       r = lstat(pathname, &st);
-       if (r == 0 && (int)st.st_nlink == nlinks)
-               return (1);
-       failure_start(file, line, "File %s has %d links, expected %d",
-           pathname, st.st_nlink, nlinks);
-       failure_finish(NULL);
-       return (0);
-#endif
-}
-
-/* Verify size of 'pathname'. */
-int
-assertion_file_size(const char *file, int line, const char *pathname, long size)
-{
-       int64_t filesize;
-       int r;
-
-       assertion_count(file, line);
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       {
-               BY_HANDLE_FILE_INFORMATION bhfi;
-               r = !my_GetFileInformationByName(pathname, &bhfi);
-               filesize = ((int64_t)bhfi.nFileSizeHigh << 32) + bhfi.nFileSizeLow;
-       }
-#else
-       {
-               struct stat st;
-               r = lstat(pathname, &st);
-               filesize = st.st_size;
-       }
-#endif
-       if (r == 0 && filesize == size)
-                       return (1);
-       failure_start(file, line, "File %s has size %ld, expected %ld",
-           pathname, (long)filesize, (long)size);
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Assert that 'pathname' is a dir.  If mode >= 0, verify that too. */
-int
-assertion_is_dir(const char *file, int line, const char *pathname, int mode)
-{
-       struct stat st;
-       int r;
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       (void)mode; /* UNUSED */
-#endif
-       assertion_count(file, line);
-       r = lstat(pathname, &st);
-       if (r != 0) {
-               failure_start(file, line, "Dir should exist: %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (!S_ISDIR(st.st_mode)) {
-               failure_start(file, line, "%s is not a dir", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-#if !defined(_WIN32) || defined(__CYGWIN__)
-       /* Windows doesn't handle permissions the same way as POSIX,
-        * so just ignore the mode tests. */
-       /* TODO: Can we do better here? */
-       if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) {
-               failure_start(file, line, "Dir %s has wrong mode", pathname);
-               logprintf("  Expected: 0%3o\n", mode);
-               logprintf("  Found: 0%3o\n", st.st_mode & 07777);
-               failure_finish(NULL);
-               return (0);
-       }
-#endif
-       return (1);
-}
-
-/* Verify that 'pathname' is a regular file.  If 'mode' is >= 0,
- * verify that too. */
-int
-assertion_is_reg(const char *file, int line, const char *pathname, int mode)
-{
-       struct stat st;
-       int r;
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       (void)mode; /* UNUSED */
-#endif
-       assertion_count(file, line);
-       r = lstat(pathname, &st);
-       if (r != 0 || !S_ISREG(st.st_mode)) {
-               failure_start(file, line, "File should exist: %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-#if !defined(_WIN32) || defined(__CYGWIN__)
-       /* Windows doesn't handle permissions the same way as POSIX,
-        * so just ignore the mode tests. */
-       /* TODO: Can we do better here? */
-       if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) {
-               failure_start(file, line, "File %s has wrong mode", pathname);
-               logprintf("  Expected: 0%3o\n", mode);
-               logprintf("  Found: 0%3o\n", st.st_mode & 07777);
-               failure_finish(NULL);
-               return (0);
-       }
-#endif
-       return (1);
-}
-
-/* Check whether 'pathname' is a symbolic link.  If 'contents' is
- * non-NULL, verify that the symlink has those contents. */
-static int
-is_symlink(const char *file, int line,
-    const char *pathname, const char *contents)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       (void)pathname; /* UNUSED */
-       (void)contents; /* UNUSED */
-       assertion_count(file, line);
-       /* Windows sort-of has real symlinks, but they're only usable
-        * by privileged users and are crippled even then, so there's
-        * really not much point in bothering with this. */
-       return (0);
-#else
-       char buff[300];
-       struct stat st;
-       ssize_t linklen;
-       int r;
-
-       assertion_count(file, line);
-       r = lstat(pathname, &st);
-       if (r != 0) {
-               failure_start(file, line,
-                   "Symlink should exist: %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (!S_ISLNK(st.st_mode))
-               return (0);
-       if (contents == NULL)
-               return (1);
-       linklen = readlink(pathname, buff, sizeof(buff));
-       if (linklen < 0) {
-               failure_start(file, line, "Can't read symlink %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       buff[linklen] = '\0';
-       if (strcmp(buff, contents) != 0)
-               return (0);
-       return (1);
-#endif
-}
-
-/* Assert that path is a symlink that (optionally) contains contents. */
-int
-assertion_is_symlink(const char *file, int line,
-    const char *path, const char *contents)
-{
-       if (is_symlink(file, line, path, contents))
-               return (1);
-       if (contents)
-               failure_start(file, line, "File %s is not a symlink to %s",
-                   path, contents);
-       else
-               failure_start(file, line, "File %s is not a symlink", path);
-       failure_finish(NULL);
-       return (0);
-}
-
-
-/* Create a directory and report any errors. */
-int
-assertion_make_dir(const char *file, int line, const char *dirname, int mode)
-{
-       assertion_count(file, line);
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       (void)mode; /* UNUSED */
-       if (0 == _mkdir(dirname))
-               return (1);
-#else
-       if (0 == mkdir(dirname, mode)) {
-               if (0 == chmod(dirname, mode)) {
-                       assertion_file_mode(file, line, dirname, mode);
-                       return (1);
-               }
-       }
-#endif
-       failure_start(file, line, "Could not create directory %s", dirname);
-       failure_finish(NULL);
-       return(0);
-}
-
-/* Create a file with the specified contents and report any failures. */
-int
-assertion_make_file(const char *file, int line,
-    const char *path, int mode, int csize, const void *contents)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       /* TODO: Rework this to set file mode as well. */
-       FILE *f;
-       (void)mode; /* UNUSED */
-       assertion_count(file, line);
-       f = fopen(path, "wb");
-       if (f == NULL) {
-               failure_start(file, line, "Could not create file %s", path);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (contents != NULL) {
-               size_t wsize;
-
-               if (csize < 0)
-                       wsize = strlen(contents);
-               else
-                       wsize = (size_t)csize;
-               if (wsize != fwrite(contents, 1, wsize, f)) {
-                       fclose(f);
-                       failure_start(file, line,
-                           "Could not write file %s", path);
-                       failure_finish(NULL);
-                       return (0);
-               }
-       }
-       fclose(f);
-       return (1);
-#else
-       int fd;
-       assertion_count(file, line);
-       fd = open(path, O_CREAT | O_WRONLY, mode >= 0 ? mode : 0644);
-       if (fd < 0) {
-               failure_start(file, line, "Could not create %s", path);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (0 != chmod(path, mode)) {
-               failure_start(file, line, "Could not chmod %s", path);
-               failure_finish(NULL);
-               close(fd);
-               return (0);
-       }
-       if (contents != NULL) {
-               ssize_t wsize;
-
-               if (csize < 0)
-                       wsize = (ssize_t)strlen(contents);
-               else
-                       wsize = (ssize_t)csize;
-               if (wsize != write(fd, contents, wsize)) {
-                       close(fd);
-                       failure_start(file, line,
-                           "Could not write to %s", path);
-                       failure_finish(NULL);
-                       close(fd);
-                       return (0);
-               }
-       }
-       close(fd);
-       assertion_file_mode(file, line, path, mode);
-       return (1);
-#endif
-}
-
-/* Create a hardlink and report any failures. */
-int
-assertion_make_hardlink(const char *file, int line,
-    const char *newpath, const char *linkto)
-{
-       int succeeded;
-
-       assertion_count(file, line);
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       succeeded = my_CreateHardLinkA(newpath, linkto);
-#elif HAVE_LINK
-       succeeded = !link(linkto, newpath);
-#else
-       succeeded = 0;
-#endif
-       if (succeeded)
-               return (1);
-       failure_start(file, line, "Could not create hardlink");
-       logprintf("   New link: %s\n", newpath);
-       logprintf("   Old name: %s\n", linkto);
-       failure_finish(NULL);
-       return(0);
-}
-
-/* Create a symlink and report any failures. */
-int
-assertion_make_symlink(const char *file, int line,
-    const char *newpath, const char *linkto)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       int targetIsDir = 0;  /* TODO: Fix this */
-       assertion_count(file, line);
-       if (my_CreateSymbolicLinkA(newpath, linkto, targetIsDir))
-               return (1);
-#elif HAVE_SYMLINK
-       assertion_count(file, line);
-       if (0 == symlink(linkto, newpath))
-               return (1);
-#endif
-       failure_start(file, line, "Could not create symlink");
-       logprintf("   New link: %s\n", newpath);
-       logprintf("   Old name: %s\n", linkto);
-       failure_finish(NULL);
-       return(0);
-}
-
-/* Set umask, report failures. */
-int
-assertion_umask(const char *file, int line, int mask)
-{
-       assertion_count(file, line);
-       (void)file; /* UNUSED */
-       (void)line; /* UNUSED */
-       umask(mask);
-       return (1);
-}
-
-/* Set times, report failures. */
-int
-assertion_utimes(const char *file, int line,
-    const char *pathname, long at, long at_nsec, long mt, long mt_nsec)
-{
-       int r;
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#define WINTIME(sec, nsec) ((Int32x32To64(sec, 10000000) + EPOC_TIME)\
-        + (((nsec)/1000)*10))
-       HANDLE h;
-       ULARGE_INTEGER wintm;
-       FILETIME fatime, fmtime;
-       FILETIME *pat, *pmt;
-
-       assertion_count(file, line);
-       h = CreateFileA(pathname,GENERIC_READ | GENERIC_WRITE,
-                   FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
-                   FILE_FLAG_BACKUP_SEMANTICS, NULL);
-       if (h == INVALID_HANDLE_VALUE) {
-               failure_start(file, line, "Can't access %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-
-       if (at > 0 || at_nsec > 0) {
-               wintm.QuadPart = WINTIME(at, at_nsec);
-               fatime.dwLowDateTime = wintm.LowPart;
-               fatime.dwHighDateTime = wintm.HighPart;
-               pat = &fatime;
-       } else
-               pat = NULL;
-       if (mt > 0 || mt_nsec > 0) {
-               wintm.QuadPart = WINTIME(mt, mt_nsec);
-               fmtime.dwLowDateTime = wintm.LowPart;
-               fmtime.dwHighDateTime = wintm.HighPart;
-               pmt = &fmtime;
-       } else
-               pmt = NULL;
-       if (pat != NULL || pmt != NULL)
-               r = SetFileTime(h, NULL, pat, pmt);
-       else
-               r = 1;
-       CloseHandle(h);
-       if (r == 0) {
-               failure_start(file, line, "Can't SetFileTime %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (1);
-#else /* defined(_WIN32) && !defined(__CYGWIN__) */
-       struct stat st;
-       struct timeval times[2];
-
-#if !defined(__FreeBSD__)
-       mt_nsec = at_nsec = 0;  /* Generic POSIX only has whole seconds. */
-#endif
-       if (mt == 0 && mt_nsec == 0 && at == 0 && at_nsec == 0)
-               return (1);
-
-       r = lstat(pathname, &st);
-       if (r < 0) {
-               failure_start(file, line, "Can't stat %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-
-       if (mt == 0 && mt_nsec == 0) {
-               mt = st.st_mtime;
-#if defined(__FreeBSD__)
-               mt_nsec = st.st_mtimespec.tv_nsec;
-               /* FreeBSD generally only stores to microsecond res, so round. */
-               mt_nsec = (mt_nsec / 1000) * 1000;
-#endif
-       }
-       if (at == 0 && at_nsec == 0) {
-               at = st.st_atime;
-#if defined(__FreeBSD__)
-               at_nsec = st.st_atimespec.tv_nsec;
-               /* FreeBSD generally only stores to microsecond res, so round. */
-               at_nsec = (at_nsec / 1000) * 1000;
-#endif
-       }
-
-       times[1].tv_sec = mt;
-       times[1].tv_usec = mt_nsec / 1000;
-
-       times[0].tv_sec = at;
-       times[0].tv_usec = at_nsec / 1000;
-
-#ifdef HAVE_LUTIMES
-       r = lutimes(pathname, times);
-#else
-       r = utimes(pathname, times);
-#endif
-       if (r < 0) {
-               failure_start(file, line, "Can't utimes %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (1);
-#endif /* defined(_WIN32) && !defined(__CYGWIN__) */
-}
-
-/* Set nodump, report failures. */
-int
-assertion_nodump(const char *file, int line, const char *pathname)
-{
-#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP)
-       int r;
-
-       assertion_count(file, line);
-       r = chflags(pathname, UF_NODUMP);
-       if (r < 0) {
-               failure_start(file, line, "Can't set nodump %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-#elif defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS)\
-        && defined(EXT2_NODUMP_FL)
-       int fd, r, flags;
-
-       assertion_count(file, line);
-       fd = open(pathname, O_RDONLY | O_NONBLOCK);
-       if (fd < 0) {
-               failure_start(file, line, "Can't open %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       r = ioctl(fd, EXT2_IOC_GETFLAGS, &flags);
-       if (r < 0) {
-               failure_start(file, line, "Can't get flags %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       flags |= EXT2_NODUMP_FL;
-       r = ioctl(fd, EXT2_IOC_SETFLAGS, &flags);
-       if (r < 0) {
-               failure_start(file, line, "Can't set nodump %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       close(fd);
-#else
-       (void)pathname; /* UNUSED */
-       assertion_count(file, line);
-#endif
-       return (1);
-}
-
-/*
- *
- *  UTILITIES for use by tests.
- *
- */
-
-/*
- * Check whether platform supports symlinks.  This is intended
- * for tests to use in deciding whether to bother testing symlink
- * support; if the platform doesn't support symlinks, there's no point
- * in checking whether the program being tested can create them.
- *
- * Note that the first time this test is called, we actually go out to
- * disk to create and verify a symlink.  This is necessary because
- * symlink support is actually a property of a particular filesystem
- * and can thus vary between directories on a single system.  After
- * the first call, this returns the cached result from memory, so it's
- * safe to call it as often as you wish.
- */
-int
-canSymlink(void)
-{
-       /* Remember the test result */
-       static int value = 0, tested = 0;
-       if (tested)
-               return (value);
-
-       ++tested;
-       assertion_make_file(__FILE__, __LINE__, "canSymlink.0", 0644, 1, "a");
-       /* Note: Cygwin has its own symlink() emulation that does not
-        * use the Win32 CreateSymbolicLink() function. */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       value = my_CreateSymbolicLinkA("canSymlink.1", "canSymlink.0", 0)
-           && is_symlink(__FILE__, __LINE__, "canSymlink.1", "canSymlink.0");
-#elif HAVE_SYMLINK
-       value = (0 == symlink("canSymlink.0", "canSymlink.1"))
-           && is_symlink(__FILE__, __LINE__, "canSymlink.1","canSymlink.0");
-#endif
-       return (value);
-}
-
-/* Platform-dependent options for hiding the output of a subcommand. */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-static const char *redirectArgs = ">NUL 2>NUL"; /* Win32 cmd.exe */
-#else
-static const char *redirectArgs = ">/dev/null 2>/dev/null"; /* POSIX 'sh' */
-#endif
-/*
- * Can this platform run the bzip2 program?
- */
-int
-canBzip2(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("bzip2 -d -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the grzip program?
- */
-int
-canGrzip(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("grzip -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the gzip program?
- */
-int
-canGzip(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("gzip -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the lrzip program?
- */
-int
-canRunCommand(const char *cmd)
-{
-  static int tested = 0, value = 0;
-  if (!tested) {
-    tested = 1;
-    if (systemf("%s %s", cmd, redirectArgs) == 0)
-      value = 1;
-  }
-  return (value);
-}
-
-int
-canLrzip(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("lrzip -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the lz4 program?
- */
-int
-canLz4(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("lz4 -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the lzip program?
- */
-int
-canLzip(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("lzip -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the lzma program?
- */
-int
-canLzma(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("lzma -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the lzop program?
- */
-int
-canLzop(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("lzop -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the xz program?
- */
-int
-canXz(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("xz -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this filesystem handle nodump flags.
- */
-#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP)
-
-int
-canNodump(void)
-{
-       const char *path = "cannodumptest";
-       struct stat sb;
-
-       assertion_make_file(__FILE__, __LINE__, path, 0644, 0, NULL);
-       if (chflags(path, UF_NODUMP) < 0)
-               return (0);
-       if (stat(path, &sb) < 0)
-               return (0);
-       if (sb.st_flags & UF_NODUMP)
-               return (1);
-       return (0);
-}
-
-#elif defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS)\
-        && defined(EXT2_NODUMP_FL)
-
-int
-canNodump(void)
-{
-       const char *path = "cannodumptest";
-       int fd, r, flags;
-
-       assertion_make_file(__FILE__, __LINE__, path, 0644, 0, NULL);
-       fd = open(path, O_RDONLY | O_NONBLOCK);
-       if (fd < 0)
-               return (0);
-       r = ioctl(fd, EXT2_IOC_GETFLAGS, &flags);
-       if (r < 0)
-               return (0);
-       flags |= EXT2_NODUMP_FL;
-       r = ioctl(fd, EXT2_IOC_SETFLAGS, &flags);
-       if (r < 0)
-               return (0);
-       close(fd);
-       fd = open(path, O_RDONLY | O_NONBLOCK);
-       if (fd < 0)
-               return (0);
-       r = ioctl(fd, EXT2_IOC_GETFLAGS, &flags);
-       if (r < 0)
-               return (0);
-       close(fd);
-       if (flags & EXT2_NODUMP_FL)
-               return (1);
-       return (0);
-}
-
-#else
-
-int
-canNodump()
-{
-       return (0);
-}
-
-#endif
-
-/*
- * Sleep as needed; useful for verifying disk timestamp changes by
- * ensuring that the wall-clock time has actually changed before we
- * go back to re-read something from disk.
- */
-void
-sleepUntilAfter(time_t t)
-{
-       while (t >= time(NULL))
-#if defined(_WIN32) && !defined(__CYGWIN__)
-               Sleep(500);
-#else
-               sleep(1);
-#endif
-}
-
-/*
- * Call standard system() call, but build up the command line using
- * sprintf() conventions.
- */
-int
-systemf(const char *fmt, ...)
-{
-       char buff[8192];
-       va_list ap;
-       int r;
-
-       va_start(ap, fmt);
-       vsprintf(buff, fmt, ap);
-       if (verbosity > VERBOSITY_FULL)
-               logprintf("Cmd: %s\n", buff);
-       r = system(buff);
-       va_end(ap);
-       return (r);
-}
-
-/*
- * Slurp a file into memory for ease of comparison and testing.
- * Returns size of file in 'sizep' if non-NULL, null-terminates
- * data in memory for ease of use.
- */
-char *
-slurpfile(size_t * sizep, const char *fmt, ...)
-{
-       char filename[8192];
-       struct stat st;
-       va_list ap;
-       char *p;
-       ssize_t bytes_read;
-       FILE *f;
-       int r;
-
-       va_start(ap, fmt);
-       vsprintf(filename, fmt, ap);
-       va_end(ap);
-
-       f = fopen(filename, "rb");
-       if (f == NULL) {
-               /* Note: No error; non-existent file is okay here. */
-               return (NULL);
-       }
-       r = fstat(fileno(f), &st);
-       if (r != 0) {
-               logprintf("Can't stat file %s\n", filename);
-               fclose(f);
-               return (NULL);
-       }
-       p = malloc((size_t)st.st_size + 1);
-       if (p == NULL) {
-               logprintf("Can't allocate %ld bytes of memory to read file %s\n",
-                   (long int)st.st_size, filename);
-               fclose(f);
-               return (NULL);
-       }
-       bytes_read = fread(p, 1, (size_t)st.st_size, f);
-       if (bytes_read < st.st_size) {
-               logprintf("Can't read file %s\n", filename);
-               fclose(f);
-               free(p);
-               return (NULL);
-       }
-       p[st.st_size] = '\0';
-       if (sizep != NULL)
-               *sizep = (size_t)st.st_size;
-       fclose(f);
-       return (p);
-}
-
-/*
- * Slurp a file into memory for ease of comparison and testing.
- * Returns size of file in 'sizep' if non-NULL, null-terminates
- * data in memory for ease of use.
- */
-void
-dumpfile(const char *filename, void *data, size_t len)
-{
-       ssize_t bytes_written;
-       FILE *f;
-
-       f = fopen(filename, "wb");
-       if (f == NULL) {
-               logprintf("Can't open file %s for writing\n", filename);
-               return;
-       }
-       bytes_written = fwrite(data, 1, len, f);
-       if (bytes_written < (ssize_t)len)
-               logprintf("Can't write file %s\n", filename);
-       fclose(f);
-}
-
-/* Read a uuencoded file from the reference directory, decode, and
- * write the result into the current directory. */
-#define VALID_UUDECODE(c) (c >= 32 && c <= 96)
-#define        UUDECODE(c) (((c) - 0x20) & 0x3f)
-void
-extract_reference_file(const char *name)
-{
-       char buff[1024];
-       FILE *in, *out;
-
-       sprintf(buff, "%s/%s.uu", refdir, name);
-       in = fopen(buff, "r");
-       failure("Couldn't open reference file %s", buff);
-       assert(in != NULL);
-       if (in == NULL)
-               return;
-       /* Read up to and including the 'begin' line. */
-       for (;;) {
-               if (fgets(buff, sizeof(buff), in) == NULL) {
-                       /* TODO: This is a failure. */
-                       return;
-               }
-               if (memcmp(buff, "begin ", 6) == 0)
-                       break;
-       }
-       /* Now, decode the rest and write it. */
-       out = fopen(name, "wb");
-       while (fgets(buff, sizeof(buff), in) != NULL) {
-               char *p = buff;
-               int bytes;
-
-               if (memcmp(buff, "end", 3) == 0)
-                       break;
-
-               bytes = UUDECODE(*p++);
-               while (bytes > 0) {
-                       int n = 0;
-                       /* Write out 1-3 bytes from that. */
-                       if (bytes > 0) {
-                               assert(VALID_UUDECODE(p[0]));
-                               assert(VALID_UUDECODE(p[1]));
-                               n = UUDECODE(*p++) << 18;
-                               n |= UUDECODE(*p++) << 12;
-                               fputc(n >> 16, out);
-                               --bytes;
-                       }
-                       if (bytes > 0) {
-                               assert(VALID_UUDECODE(p[0]));
-                               n |= UUDECODE(*p++) << 6;
-                               fputc((n >> 8) & 0xFF, out);
-                               --bytes;
-                       }
-                       if (bytes > 0) {
-                               assert(VALID_UUDECODE(p[0]));
-                               n |= UUDECODE(*p++);
-                               fputc(n & 0xFF, out);
-                               --bytes;
-                       }
-               }
-       }
-       fclose(out);
-       fclose(in);
-}
-
-void
-copy_reference_file(const char *name)
-{
-       char buff[1024];
-       FILE *in, *out;
-       size_t rbytes;
-
-       sprintf(buff, "%s/%s", refdir, name);
-       in = fopen(buff, "rb");
-       failure("Couldn't open reference file %s", buff);
-       assert(in != NULL);
-       if (in == NULL)
-               return;
-       /* Now, decode the rest and write it. */
-       /* Not a lot of error checking here; the input better be right. */
-       out = fopen(name, "wb");
-       while ((rbytes = fread(buff, 1, sizeof(buff), in)) > 0) {
-               if (fwrite(buff, 1, rbytes, out) != rbytes) {
-                       logprintf("Error: fwrite\n");
-                       break;
-               }
-       }
-       fclose(out);
-       fclose(in);
-}
-
-int
-is_LargeInode(const char *file)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       BY_HANDLE_FILE_INFORMATION bhfi;
-       int r;
-
-       r = my_GetFileInformationByName(file, &bhfi);
-       if (r != 0)
-               return (0);
-       return (bhfi.nFileIndexHigh & 0x0000FFFFUL);
-#else
-       struct stat st;
-       int64_t ino;
-
-       if (stat(file, &st) < 0)
-               return (0);
-       ino = (int64_t)st.st_ino;
-       return (ino > 0xffffffff);
-#endif
-}
-
-void
-extract_reference_files(const char **names)
-{
-       while (names && *names)
-               extract_reference_file(*names++);
-}
-
-/*
- *
- * TEST management
- *
- */
-
-/*
- * "list.h" is simply created by "grep DEFINE_TEST test_*.c"; it has
- * a line like
- *      DEFINE_TEST(test_function)
- * for each test.
- */
-
-/* Use "list.h" to declare all of the test functions. */
-#undef DEFINE_TEST
-#define        DEFINE_TEST(name) void name(void);
-#include "list.h"
-
-/* Use "list.h" to create a list of all tests (functions and names). */
-#undef DEFINE_TEST
-#define        DEFINE_TEST(n) { n, #n, 0 },
-struct test_list_t tests[] = {
-       #include "list.h"
-};
-
-/*
- * Summarize repeated failures in the just-completed test.
- */
-static void
-test_summarize(int failed, int skips_num)
-{
-       unsigned int i;
-
-       switch (verbosity) {
-       case VERBOSITY_SUMMARY_ONLY:
-               printf(failed ? "E" : ".");
-               fflush(stdout);
-               break;
-       case VERBOSITY_PASSFAIL:
-               printf(failed ? "FAIL\n" : skips_num ? "ok (S)\n" : "ok\n");
-               break;
-       }
-
-       log_console = (verbosity == VERBOSITY_LIGHT_REPORT);
-
-       for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) {
-               if (failed_lines[i].count > 1 && !failed_lines[i].skip)
-                       logprintf("%s:%d: Summary: Failed %d times\n",
-                           failed_filename, i, failed_lines[i].count);
-       }
-       /* Clear the failure history for the next file. */
-       failed_filename = NULL;
-       memset(failed_lines, 0, sizeof(failed_lines));
-}
-
-/*
- * Actually run a single test, with appropriate setup and cleanup.
- */
-static int
-test_run(int i, const char *tmpdir)
-{
-       char workdir[1024];
-       char logfilename[64];
-       int failures_before = failures;
-       int skips_before = skips;
-       int oldumask;
-
-       switch (verbosity) {
-       case VERBOSITY_SUMMARY_ONLY: /* No per-test reports at all */
-               break;
-       case VERBOSITY_PASSFAIL: /* rest of line will include ok/FAIL marker */
-               printf("%3d: %-64s", i, tests[i].name);
-               fflush(stdout);
-               break;
-       default: /* Title of test, details will follow */
-               printf("%3d: %s\n", i, tests[i].name);
-       }
-
-       /* Chdir to the top-level work directory. */
-       if (!assertChdir(tmpdir)) {
-               fprintf(stderr,
-                   "ERROR: Can't chdir to top work dir %s\n", tmpdir);
-               exit(1);
-       }
-       /* Create a log file for this test. */
-       sprintf(logfilename, "%s.log", tests[i].name);
-       logfile = fopen(logfilename, "w");
-       fprintf(logfile, "%s\n\n", tests[i].name);
-       /* Chdir() to a work dir for this specific test. */
-       snprintf(workdir, sizeof(workdir), "%s/%s", tmpdir, tests[i].name);
-       testworkdir = workdir;
-       if (!assertMakeDir(testworkdir, 0755)
-           || !assertChdir(testworkdir)) {
-               fprintf(stderr,
-                   "ERROR: Can't chdir to work dir %s\n", testworkdir);
-               exit(1);
-       }
-       /* Explicitly reset the locale before each test. */
-       setlocale(LC_ALL, "C");
-       /* Record the umask before we run the test. */
-       umask(oldumask = umask(0));
-       /*
-        * Run the actual test.
-        */
-       (*tests[i].func)();
-       /*
-        * Clean up and report afterwards.
-        */
-       testworkdir = NULL;
-       /* Restore umask */
-       umask(oldumask);
-       /* Reset locale. */
-       setlocale(LC_ALL, "C");
-       /* Reset directory. */
-       if (!assertChdir(tmpdir)) {
-               fprintf(stderr, "ERROR: Couldn't chdir to temp dir %s\n",
-                   tmpdir);
-               exit(1);
-       }
-       /* Report per-test summaries. */
-       tests[i].failures = failures - failures_before;
-       test_summarize(tests[i].failures, skips - skips_before);
-       /* Close the per-test log file. */
-       fclose(logfile);
-       logfile = NULL;
-       /* If there were no failures, we can remove the work dir and logfile. */
-       if (tests[i].failures == 0) {
-               if (!keep_temp_files && assertChdir(tmpdir)) {
-#if defined(_WIN32) && !defined(__CYGWIN__)
-                       /* Make sure not to leave empty directories.
-                        * Sometimes a processing of closing files used by tests
-                        * is not done, then rmdir will be failed and it will
-                        * leave a empty test directory. So we should wait a few
-                        * seconds and retry rmdir. */
-                       int r, t;
-                       for (t = 0; t < 10; t++) {
-                               if (t > 0)
-                                       Sleep(1000);
-                               r = systemf("rmdir /S /Q %s", tests[i].name);
-                               if (r == 0)
-                                       break;
-                       }
-                       systemf("del %s", logfilename);
-#else
-                       systemf("rm -rf %s", tests[i].name);
-                       systemf("rm %s", logfilename);
-#endif
-               }
-       }
-       /* Return appropriate status. */
-       return (tests[i].failures);
-}
-
-/*
- *
- *
- * MAIN and support routines.
- *
- *
- */
-
-static void
-usage(const char *program)
-{
-       static const int limit = sizeof(tests) / sizeof(tests[0]);
-       int i;
-
-       printf("Usage: %s [options] <test> <test> ...\n", program);
-       printf("Default is to run all tests.\n");
-       printf("Otherwise, specify the numbers of the tests you wish to run.\n");
-       printf("Options:\n");
-       printf("  -d  Dump core after any failure, for debugging.\n");
-       printf("  -k  Keep all temp files.\n");
-       printf("      Default: temp files for successful tests deleted.\n");
-#ifdef PROGRAM
-       printf("  -p <path>  Path to executable to be tested.\n");
-       printf("      Default: path taken from " ENVBASE " environment variable.\n");
-#endif
-       printf("  -q  Quiet.\n");
-       printf("  -r <dir>   Path to dir containing reference files.\n");
-       printf("      Default: Current directory.\n");
-       printf("  -u  Keep running specifies tests until one fails.\n");
-       printf("  -v  Verbose.\n");
-       printf("Available tests:\n");
-       for (i = 0; i < limit; i++)
-               printf("  %d: %s\n", i, tests[i].name);
-       exit(1);
-}
-
-static char *
-get_refdir(const char *d)
-{
-       size_t tried_size, buff_size;
-       char *buff, *tried, *pwd = NULL, *p = NULL;
-
-#ifdef PATH_MAX
-       buff_size = PATH_MAX;
-#else
-       buff_size = 8192;
-#endif
-       buff = calloc(buff_size, 1);
-       if (buff == NULL) {
-               fprintf(stderr, "Unable to allocate memory\n");
-               exit(1);
-       }
-
-       /* Allocate a buffer to hold the various directories we checked. */
-       tried_size = buff_size * 2;
-       tried = calloc(tried_size, 1);
-       if (tried == NULL) {
-               fprintf(stderr, "Unable to allocate memory\n");
-               exit(1);
-       }
-
-       /* If a dir was specified, try that */
-       if (d != NULL) {
-               pwd = NULL;
-               snprintf(buff, buff_size, "%s", d);
-               p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-               if (p != NULL) goto success;
-               strncat(tried, buff, tried_size - strlen(tried) - 1);
-               strncat(tried, "\n", tried_size - strlen(tried) - 1);
-               goto failure;
-       }
-
-       /* Get the current dir. */
-#ifdef PATH_MAX
-       pwd = getcwd(NULL, PATH_MAX);/* Solaris getcwd needs the size. */
-#else
-       pwd = getcwd(NULL, 0);
-#endif
-       while (pwd[strlen(pwd) - 1] == '\n')
-               pwd[strlen(pwd) - 1] = '\0';
-
-       /* Look for a known file. */
-       snprintf(buff, buff_size, "%s", pwd);
-       p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-       if (p != NULL) goto success;
-       strncat(tried, buff, tried_size - strlen(tried) - 1);
-       strncat(tried, "\n", tried_size - strlen(tried) - 1);
-
-       snprintf(buff, buff_size, "%s/test", pwd);
-       p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-       if (p != NULL) goto success;
-       strncat(tried, buff, tried_size - strlen(tried) - 1);
-       strncat(tried, "\n", tried_size - strlen(tried) - 1);
-
-#if defined(LIBRARY)
-       snprintf(buff, buff_size, "%s/%s/test", pwd, LIBRARY);
-#else
-       snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM);
-#endif
-       p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-       if (p != NULL) goto success;
-       strncat(tried, buff, tried_size - strlen(tried) - 1);
-       strncat(tried, "\n", tried_size - strlen(tried) - 1);
-
-#if defined(PROGRAM_ALIAS)
-       snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM_ALIAS);
-       p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-       if (p != NULL) goto success;
-       strncat(tried, buff, tried_size - strlen(tried) - 1);
-       strncat(tried, "\n", tried_size - strlen(tried) - 1);
-#endif
-
-       if (memcmp(pwd, "/usr/obj", 8) == 0) {
-               snprintf(buff, buff_size, "%s", pwd + 8);
-               p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-               if (p != NULL) goto success;
-               strncat(tried, buff, tried_size - strlen(tried) - 1);
-               strncat(tried, "\n", tried_size - strlen(tried) - 1);
-
-               snprintf(buff, buff_size, "%s/test", pwd + 8);
-               p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-               if (p != NULL) goto success;
-               strncat(tried, buff, tried_size - strlen(tried) - 1);
-               strncat(tried, "\n", tried_size - strlen(tried) - 1);
-       }
-
-failure:
-       printf("Unable to locate known reference file %s\n", KNOWNREF);
-       printf("  Checked following directories:\n%s\n", tried);
-       printf("Use -r option to specify full path to reference directory\n");
-#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
-       DebugBreak();
-#endif
-       exit(1);
-
-success:
-       free(p);
-       free(pwd);
-       free(tried);
-
-       /* Copy result into a fresh buffer to reduce memory usage. */
-       p = strdup(buff);
-       free(buff);
-       return p;
-}
-
-int
-main(int argc, char **argv)
-{
-       static const int limit = sizeof(tests) / sizeof(tests[0]);
-       int test_set[sizeof(tests) / sizeof(tests[0])];
-       int i = 0, j = 0, tests_run = 0, tests_failed = 0, option;
-       time_t now;
-       char *refdir_alloc = NULL;
-       const char *progname;
-       char **saved_argv;
-       const char *tmp, *option_arg, *p;
-       char tmpdir[256], *pwd, *testprogdir, *tmp2 = NULL, *vlevel = NULL;
-       char tmpdir_timestamp[256];
-
-       (void)argc; /* UNUSED */
-
-       /* Get the current dir. */
-#ifdef PATH_MAX
-       pwd = getcwd(NULL, PATH_MAX);/* Solaris getcwd needs the size. */
-#else
-       pwd = getcwd(NULL, 0);
-#endif
-       while (pwd[strlen(pwd) - 1] == '\n')
-               pwd[strlen(pwd) - 1] = '\0';
-
-#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__)
-       /* To stop to run the default invalid parameter handler. */
-       _set_invalid_parameter_handler(invalid_parameter_handler);
-       /* Disable annoying assertion message box. */
-       _CrtSetReportMode(_CRT_ASSERT, 0);
-#endif
-
-       /*
-        * Name of this program, used to build root of our temp directory
-        * tree.
-        */
-       progname = p = argv[0];
-       if ((testprogdir = (char *)malloc(strlen(progname) + 1)) == NULL)
-       {
-               fprintf(stderr, "ERROR: Out of memory.");
-               exit(1);
-       }
-       strcpy(testprogdir, progname);
-       while (*p != '\0') {
-               /* Support \ or / dir separators for Windows compat. */
-               if (*p == '/' || *p == '\\')
-               {
-                       progname = p + 1;
-                       i = j;
-               }
-               ++p;
-               j++;
-       }
-       testprogdir[i] = '\0';
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       if (testprogdir[0] != '/' && testprogdir[0] != '\\' &&
-           !(((testprogdir[0] >= 'a' && testprogdir[0] <= 'z') ||
-              (testprogdir[0] >= 'A' && testprogdir[0] <= 'Z')) &&
-               testprogdir[1] == ':' &&
-               (testprogdir[2] == '/' || testprogdir[2] == '\\')))
-#else
-       if (testprogdir[0] != '/')
-#endif
-       {
-               /* Fixup path for relative directories. */
-               if ((testprogdir = (char *)realloc(testprogdir,
-                       strlen(pwd) + 1 + strlen(testprogdir) + 1)) == NULL)
-               {
-                       fprintf(stderr, "ERROR: Out of memory.");
-                       exit(1);
-               }
-               memmove(testprogdir + strlen(pwd) + 1, testprogdir,
-                   strlen(testprogdir) + 1);
-               memcpy(testprogdir, pwd, strlen(pwd));
-               testprogdir[strlen(pwd)] = '/';
-       }
-
-#ifdef PROGRAM
-       /* Get the target program from environment, if available. */
-       testprogfile = getenv(ENVBASE);
-#endif
-
-       if (getenv("TMPDIR") != NULL)
-               tmp = getenv("TMPDIR");
-       else if (getenv("TMP") != NULL)
-               tmp = getenv("TMP");
-       else if (getenv("TEMP") != NULL)
-               tmp = getenv("TEMP");
-       else if (getenv("TEMPDIR") != NULL)
-               tmp = getenv("TEMPDIR");
-       else
-               tmp = "/tmp";
-
-       /* Allow -d to be controlled through the environment. */
-       if (getenv(ENVBASE "_DEBUG") != NULL)
-               dump_on_failure = 1;
-
-       /* Allow -v to be controlled through the environment. */
-       if (getenv("_VERBOSITY_LEVEL") != NULL)
-       {
-               vlevel = getenv("_VERBOSITY_LEVEL");
-               verbosity = atoi(vlevel);
-               if (verbosity < VERBOSITY_SUMMARY_ONLY || verbosity > VERBOSITY_FULL)
-               {
-                       /* Unsupported verbosity levels are silently ignored */
-                       vlevel = NULL;
-                       verbosity = VERBOSITY_PASSFAIL;
-               }
-       }
-
-       /* Get the directory holding test files from environment. */
-       refdir = getenv(ENVBASE "_TEST_FILES");
-
-       /*
-        * Parse options, without using getopt(), which isn't available
-        * on all platforms.
-        */
-       ++argv; /* Skip program name */
-       while (*argv != NULL) {
-               if (**argv != '-')
-                       break;
-               p = *argv++;
-               ++p; /* Skip '-' */
-               while (*p != '\0') {
-                       option = *p++;
-                       option_arg = NULL;
-                       /* If 'opt' takes an argument, parse that. */
-                       if (option == 'p' || option == 'r') {
-                               if (*p != '\0')
-                                       option_arg = p;
-                               else if (*argv == NULL) {
-                                       fprintf(stderr,
-                                           "Option -%c requires argument.\n",
-                                           option);
-                                       usage(progname);
-                               } else
-                                       option_arg = *argv++;
-                               p = ""; /* End of this option word. */
-                       }
-
-                       /* Now, handle the option. */
-                       switch (option) {
-                       case 'd':
-                               dump_on_failure = 1;
-                               break;
-                       case 'k':
-                               keep_temp_files = 1;
-                               break;
-                       case 'p':
-#ifdef PROGRAM
-                               testprogfile = option_arg;
-#else
-                               fprintf(stderr, "-p option not permitted\n");
-                               usage(progname);
-#endif
-                               break;
-                       case 'q':
-                               if (!vlevel)
-                                       verbosity--;
-                               break;
-                       case 'r':
-                               refdir = option_arg;
-                               break;
-                       case 'u':
-                               until_failure++;
-                               break;
-                       case 'v':
-                               if (!vlevel)
-                                       verbosity++;
-                               break;
-                       default:
-                               fprintf(stderr, "Unrecognized option '%c'\n",
-                                   option);
-                               usage(progname);
-                       }
-               }
-       }
-
-       /*
-        * Sanity-check that our options make sense.
-        */
-#ifdef PROGRAM
-       if (testprogfile == NULL)
-       {
-               if ((tmp2 = (char *)malloc(strlen(testprogdir) + 1 +
-                       strlen(PROGRAM) + 1)) == NULL)
-               {
-                       fprintf(stderr, "ERROR: Out of memory.");
-                       exit(1);
-               }
-               strcpy(tmp2, testprogdir);
-               strcat(tmp2, "/");
-               strcat(tmp2, PROGRAM);
-               testprogfile = tmp2;
-       }
-
-       {
-               char *testprg;
-#if defined(_WIN32) && !defined(__CYGWIN__)
-               /* Command.com sometimes rejects '/' separators. */
-               testprg = strdup(testprogfile);
-               for (i = 0; testprg[i] != '\0'; i++) {
-                       if (testprg[i] == '/')
-                               testprg[i] = '\\';
-               }
-               testprogfile = testprg;
-#endif
-               /* Quote the name that gets put into shell command lines. */
-               testprg = malloc(strlen(testprogfile) + 3);
-               strcpy(testprg, "\"");
-               strcat(testprg, testprogfile);
-               strcat(testprg, "\"");
-               testprog = testprg;
-       }
-#endif
-
-#if !defined(_WIN32) && defined(SIGPIPE)
-       {   /* Ignore SIGPIPE signals */
-               struct sigaction sa;
-               sa.sa_handler = SIG_IGN;
-               sigemptyset(&sa.sa_mask);
-               sa.sa_flags = 0;
-               sigaction(SIGPIPE, &sa, NULL);
-       }
-#endif
-
-       /*
-        * Create a temp directory for the following tests.
-        * Include the time the tests started as part of the name,
-        * to make it easier to track the results of multiple tests.
-        */
-       now = time(NULL);
-       for (i = 0; ; i++) {
-               strftime(tmpdir_timestamp, sizeof(tmpdir_timestamp),
-                   "%Y-%m-%dT%H.%M.%S",
-                   localtime(&now));
-               sprintf(tmpdir, "%s/%s.%s-%03d", tmp, progname,
-                   tmpdir_timestamp, i);
-               if (assertMakeDir(tmpdir,0755))
-                       break;
-               if (i >= 999) {
-                       fprintf(stderr,
-                           "ERROR: Unable to create temp directory %s\n",
-                           tmpdir);
-                       exit(1);
-               }
-       }
-
-       /*
-        * If the user didn't specify a directory for locating
-        * reference files, try to find the reference files in
-        * the "usual places."
-        */
-       refdir = refdir_alloc = get_refdir(refdir);
-
-       /*
-        * Banner with basic information.
-        */
-       printf("\n");
-       printf("If tests fail or crash, details will be in:\n");
-       printf("   %s\n", tmpdir);
-       printf("\n");
-       if (verbosity > VERBOSITY_SUMMARY_ONLY) {
-               printf("Reference files will be read from: %s\n", refdir);
-#ifdef PROGRAM
-               printf("Running tests on: %s\n", testprog);
-#endif
-               printf("Exercising: ");
-               fflush(stdout);
-               printf("%s\n", EXTRA_VERSION);
-       } else {
-               printf("Running ");
-               fflush(stdout);
-       }
-
-       /*
-        * Run some or all of the individual tests.
-        */
-       saved_argv = argv;
-       do {
-               argv = saved_argv;
-               do {
-                       int test_num;
-
-                       test_num = get_test_set(test_set, limit, *argv, tests);
-                       if (test_num < 0) {
-                               printf("*** INVALID Test %s\n", *argv);
-                               free(refdir_alloc);
-                               free(testprogdir);
-                               usage(progname);
-                               return (1);
-                       }
-                       for (i = 0; i < test_num; i++) {
-                               tests_run++;
-                               if (test_run(test_set[i], tmpdir)) {
-                                       tests_failed++;
-                                       if (until_failure)
-                                               goto finish;
-                               }
-                       }
-                       if (*argv != NULL)
-                               argv++;
-               } while (*argv != NULL);
-       } while (until_failure);
-
-finish:
-       /* Must be freed after all tests run */
-       free(tmp2);
-       free(testprogdir);
-       free(pwd);
-
-       /*
-        * Report summary statistics.
-        */
-       if (verbosity > VERBOSITY_SUMMARY_ONLY) {
-               printf("\n");
-               printf("Totals:\n");
-               printf("  Tests run:         %8d\n", tests_run);
-               printf("  Tests failed:      %8d\n", tests_failed);
-               printf("  Assertions checked:%8d\n", assertions);
-               printf("  Assertions failed: %8d\n", failures);
-               printf("  Skips reported:    %8d\n", skips);
-       }
-       if (failures) {
-               printf("\n");
-               printf("Failing tests:\n");
-               for (i = 0; i < limit; ++i) {
-                       if (tests[i].failures)
-                               printf("  %d: %s (%d failures)\n", i,
-                                   tests[i].name, tests[i].failures);
-               }
-               printf("\n");
-               printf("Details for failing tests: %s\n", tmpdir);
-               printf("\n");
-       } else {
-               if (verbosity == VERBOSITY_SUMMARY_ONLY)
-                       printf("\n");
-               printf("%d tests passed, no failures\n", tests_run);
-       }
-
-       free(refdir_alloc);
-
-       /* If the final tmpdir is empty, we can remove it. */
-       /* This should be the usual case when all tests succeed. */
-       assertChdir("..");
-       rmdir(tmpdir);
-
-       return (tests_failed ? 1 : 0);
-}
index 3a23a05..350bcad 100644 (file)
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/usr.bin/tar/test/test.h,v 1.4 2008/08/21 07:04:57 kientzle Exp $
+ * $FreeBSD$
  */
 
 /* Every test program should #include "test.h" as the first thing. */
 
-/*
- * The goal of this file (and the matching test.c) is to
- * simplify the very repetitive test-*.c test programs.
- */
-#if defined(HAVE_CONFIG_H)
-/* Most POSIX platforms use the 'configure' script to build config.h */
-#include "config.h"
-#elif defined(__FreeBSD__)
-/* Building as part of FreeBSD system requires a pre-built config.h. */
-#include "config_freebsd.h"
-#elif defined(_WIN32) && !defined(__CYGWIN__)
-/* Win32 can't run the 'configure' script. */
-#include "config_windows.h"
-#else
-/* Warn if the library hasn't been (automatically or manually) configured. */
-#error Oops: No config.h and no pre-built configuration in test.h.
-#endif
-
-#include <sys/types.h>  /* Windows requires this before sys/stat.h */
-#include <sys/stat.h>
-
-#if HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-#ifdef HAVE_DIRECT_H
-#include <direct.h>
-#define dirent direct
-#endif
-#include <errno.h>
-#include <fcntl.h>
-#ifdef HAVE_IO_H
-#include <io.h>
-#endif
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <wchar.h>
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
-/*
- * System-specific tweaks.  We really want to minimize these
- * as much as possible, since they make it harder to understand
- * the mainline code.
- */
-
-/* Windows (including Visual Studio and MinGW but not Cygwin) */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#if !defined(__BORLANDC__)
-#undef chdir
-#define chdir _chdir
-#define strdup _strdup
-#endif
-#endif
-
-/* Visual Studio */
-#if defined(_MSC_VER) && _MSC_VER < 1900
-#define snprintf       sprintf_s
-#endif
-
-#if defined(__BORLANDC__)
-#pragma warn -8068     /* Constant out of range in comparison. */
-#endif
-
-/* Haiku OS and QNX */
-#if defined(__HAIKU__) || defined(__QNXNTO__)
-/* Haiku and QNX have typedefs in stdint.h (needed for int64_t) */
-#include <stdint.h>
-#endif
-
-/* Get a real definition for __FBSDID if we can */
-#if HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-
-/* If not, define it so as to avoid dangling semicolons. */
-#ifndef __FBSDID
-#define        __FBSDID(a)     struct _undefined_hack
-#endif
-
-#ifndef O_BINARY
-#define        O_BINARY 0
-#endif
-
-/*
- * Redefine DEFINE_TEST for use in defining the test functions.
- */
-#undef DEFINE_TEST
-#define DEFINE_TEST(name) void name(void); void name(void)
-
-/* An implementation of the standard assert() macro */
-#define assert(e)   assertion_assert(__FILE__, __LINE__, (e), #e, NULL)
-/* chdir() and error if it fails */
-#define assertChdir(path)  \
-  assertion_chdir(__FILE__, __LINE__, path)
-/* Assert two integers are the same.  Reports value of each one if not. */
-#define assertEqualInt(v1,v2) \
-  assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-/* Assert two strings are the same.  Reports value of each one if not. */
-#define assertEqualString(v1,v2)   \
-  assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 0)
-#define assertEqualUTF8String(v1,v2)   \
-  assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 1)
-/* As above, but v1 and v2 are wchar_t * */
-#define assertEqualWString(v1,v2)   \
-  assertion_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-/* As above, but raw blocks of bytes. */
-#define assertEqualMem(v1, v2, l)      \
-  assertion_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
-/* Assert that memory is full of a specified byte */
-#define assertMemoryFilledWith(v1, l, b)                                       \
-  assertion_memory_filled_with(__FILE__, __LINE__, (v1), #v1, (l), #l, (b), #b, NULL)
-/* Assert two files are the same. */
-#define assertEqualFile(f1, f2)        \
-  assertion_equal_file(__FILE__, __LINE__, (f1), (f2))
-/* Assert that a file is empty. */
-#define assertEmptyFile(pathname)      \
-  assertion_empty_file(__FILE__, __LINE__, (pathname))
-/* Assert that a file is not empty. */
-#define assertNonEmptyFile(pathname)           \
-  assertion_non_empty_file(__FILE__, __LINE__, (pathname))
-#define assertFileAtime(pathname, sec, nsec)   \
-  assertion_file_atime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileAtimeRecent(pathname)        \
-  assertion_file_atime_recent(__FILE__, __LINE__, pathname)
-#define assertFileBirthtime(pathname, sec, nsec)       \
-  assertion_file_birthtime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileBirthtimeRecent(pathname) \
-  assertion_file_birthtime_recent(__FILE__, __LINE__, pathname)
-/* Assert that a file exists; supports printf-style arguments. */
-#define assertFileExists(pathname) \
-  assertion_file_exists(__FILE__, __LINE__, pathname)
-/* Assert that a file exists. */
-#define assertFileNotExists(pathname) \
-  assertion_file_not_exists(__FILE__, __LINE__, pathname)
-/* Assert that file contents match a string. */
-#define assertFileContents(data, data_size, pathname) \
-  assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname)
-/* Verify that a file does not contain invalid strings */
-#define assertFileContainsNoInvalidStrings(pathname, strings) \
-  assertion_file_contains_no_invalid_strings(__FILE__, __LINE__, pathname, strings)
-#define assertFileMtime(pathname, sec, nsec)   \
-  assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileMtimeRecent(pathname) \
-  assertion_file_mtime_recent(__FILE__, __LINE__, pathname)
-#define assertFileNLinks(pathname, nlinks)  \
-  assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
-#define assertFileSize(pathname, size)  \
-  assertion_file_size(__FILE__, __LINE__, pathname, size)
-#define assertFileMode(pathname, mode)  \
-  assertion_file_mode(__FILE__, __LINE__, pathname, mode)
-#define assertTextFileContents(text, pathname) \
-  assertion_text_file_contents(__FILE__, __LINE__, text, pathname)
-#define assertFileContainsLinesAnyOrder(pathname, lines)       \
-  assertion_file_contains_lines_any_order(__FILE__, __LINE__, pathname, lines)
-#define assertIsDir(pathname, mode)            \
-  assertion_is_dir(__FILE__, __LINE__, pathname, mode)
-#define assertIsHardlink(path1, path2) \
-  assertion_is_hardlink(__FILE__, __LINE__, path1, path2)
-#define assertIsNotHardlink(path1, path2)      \
-  assertion_is_not_hardlink(__FILE__, __LINE__, path1, path2)
-#define assertIsReg(pathname, mode)            \
-  assertion_is_reg(__FILE__, __LINE__, pathname, mode)
-#define assertIsSymlink(pathname, contents)    \
-  assertion_is_symlink(__FILE__, __LINE__, pathname, contents)
-/* Create a directory, report error if it fails. */
-#define assertMakeDir(dirname, mode)   \
-  assertion_make_dir(__FILE__, __LINE__, dirname, mode)
-#define assertMakeFile(path, mode, contents) \
-  assertion_make_file(__FILE__, __LINE__, path, mode, -1, contents)
-#define assertMakeBinFile(path, mode, csize, contents) \
-  assertion_make_file(__FILE__, __LINE__, path, mode, csize, contents)
-#define assertMakeHardlink(newfile, oldfile)   \
-  assertion_make_hardlink(__FILE__, __LINE__, newfile, oldfile)
-#define assertMakeSymlink(newfile, linkto)     \
-  assertion_make_symlink(__FILE__, __LINE__, newfile, linkto)
-#define assertNodump(path)      \
-  assertion_nodump(__FILE__, __LINE__, path)
-#define assertUmask(mask)      \
-  assertion_umask(__FILE__, __LINE__, mask)
-#define assertUtimes(pathname, atime, atime_nsec, mtime, mtime_nsec)   \
-  assertion_utimes(__FILE__, __LINE__, pathname, atime, atime_nsec, mtime, mtime_nsec)
-
-/*
- * This would be simple with C99 variadic macros, but I don't want to
- * require that.  Instead, I insert a function call before each
- * skipping() call to pass the file and line information down.  Crude,
- * but effective.
- */
-#define skipping       \
-  skipping_setup(__FILE__, __LINE__);test_skipping
-
-/* Function declarations.  These are defined in test_utility.c. */
-void failure(const char *fmt, ...);
-int assertion_assert(const char *, int, int, const char *, void *);
-int assertion_chdir(const char *, int, const char *);
-int assertion_empty_file(const char *, int, const char *);
-int assertion_equal_file(const char *, int, const char *, const char *);
-int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *);
-int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *);
-int assertion_memory_filled_with(const char *, int, const void *, const char *, size_t, const char *, char, const char *, void *);
-int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *, int);
-int assertion_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
-int assertion_file_atime(const char *, int, const char *, long, long);
-int assertion_file_atime_recent(const char *, int, const char *);
-int assertion_file_birthtime(const char *, int, const char *, long, long);
-int assertion_file_birthtime_recent(const char *, int, const char *);
-int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
-int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **);
-int assertion_file_contents(const char *, int, const void *, int, const char *);
-int assertion_file_exists(const char *, int, const char *);
-int assertion_file_mode(const char *, int, const char *, int);
-int assertion_file_mtime(const char *, int, const char *, long, long);
-int assertion_file_mtime_recent(const char *, int, const char *);
-int assertion_file_nlinks(const char *, int, const char *, int);
-int assertion_file_not_exists(const char *, int, const char *);
-int assertion_file_size(const char *, int, const char *, long);
-int assertion_is_dir(const char *, int, const char *, int);
-int assertion_is_hardlink(const char *, int, const char *, const char *);
-int assertion_is_not_hardlink(const char *, int, const char *, const char *);
-int assertion_is_reg(const char *, int, const char *, int);
-int assertion_is_symlink(const char *, int, const char *, const char *);
-int assertion_make_dir(const char *, int, const char *, int);
-int assertion_make_file(const char *, int, const char *, int, int, const void *);
-int assertion_make_hardlink(const char *, int, const char *newpath, const char *);
-int assertion_make_symlink(const char *, int, const char *newpath, const char *);
-int assertion_nodump(const char *, int, const char *);
-int assertion_non_empty_file(const char *, int, const char *);
-int assertion_text_file_contents(const char *, int, const char *buff, const char *f);
-int assertion_umask(const char *, int, int);
-int assertion_utimes(const char *, int, const char *, long, long, long, long );
-
-void skipping_setup(const char *, int);
-void test_skipping(const char *fmt, ...);
-
-/* Like sprintf, then system() */
-int systemf(const char * fmt, ...);
-
-/* Delay until time() returns a value after this. */
-void sleepUntilAfter(time_t);
-
-/* Return true if this platform can create symlinks. */
-int canSymlink(void);
-
-/* Return true if this platform can run the "bzip2" program. */
-int canBzip2(void);
-
-/* Return true if this platform can run the "grzip" program. */
-int canGrzip(void);
-
-/* Return true if this platform can run the "gzip" program. */
-int canGzip(void);
-
-/* Return true if this platform can run the specified command. */
-int canRunCommand(const char *);
-
-/* Return true if this platform can run the "lrzip" program. */
-int canLrzip(void);
-
-/* Return true if this platform can run the "lz4" program. */
-int canLz4(void);
-
-/* Return true if this platform can run the "lzip" program. */
-int canLzip(void);
-
-/* Return true if this platform can run the "lzma" program. */
-int canLzma(void);
-
-/* Return true if this platform can run the "lzop" program. */
-int canLzop(void);
-
-/* Return true if this platform can run the "xz" program. */
-int canXz(void);
-
-/* Return true if this filesystem can handle nodump flags. */
-int canNodump(void);
-
-/* Return true if the file has large i-node number(>0xffffffff). */
-int is_LargeInode(const char *);
-
-/* Suck file into string allocated via malloc(). Call free() when done. */
-/* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
-char *slurpfile(size_t *, const char *fmt, ...);
-
-/* Dump block of bytes to a file. */
-void dumpfile(const char *filename, void *, size_t);
-
-/* Extracts named reference file to the current directory. */
-void extract_reference_file(const char *);
-/* Copies named reference file to the current directory. */
-void copy_reference_file(const char *);
-
-/* Extracts a list of files to the current directory.
- * List must be NULL terminated.
- */
-void extract_reference_files(const char **);
-
-/* Subtract umask from mode */
-mode_t umasked(mode_t expected_mode);
-
-/* Path to working directory for current test */
-extern const char *testworkdir;
-
-/*
- * Special interfaces for program test harness.
- */
-
-/* Pathname of exe to be tested. */
-extern const char *testprogfile;
-/* Name of exe to use in printf-formatted command strings. */
-/* On Windows, this includes leading/trailing quotes. */
-extern const char *testprog;
-
-#ifdef USE_DMALLOC
-#include <dmalloc.h>
-#endif
+#define KNOWNREF       "test_expand.Z.uu"
+#define ENVBASE "BSDCAT"  /* Prefix for environment variables. */
+#define        PROGRAM "bsdcat"  /* Name of program being tested. */
+#define PROGRAM_ALIAS "cat" /* Generic alias for program */
+#undef LIBRARY           /* Not testing a library. */
+#undef EXTRA_DUMP        /* How to dump extra data */
+#undef EXTRA_ERRNO       /* How to dump errno */
+/* How to generate extra version info. */
+#define        EXTRA_VERSION    (systemf("%s --version", testprog) ? "" : "")
+
+#include "test_common.h"
index e587b34..51a4fd4 100644 (file)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2003-2017 Tim Kientzle
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 
 DEFINE_TEST(test_version)
 {
-       int r;
-       char *p, *q;
-       size_t s;
-
-
-       r = systemf("%s --version >version.stdout 2>version.stderr", testprog);
-       failure("Unable to run %s --version", testprog);
-       if (!assert(r == 0))
-               return;
-
-       /* --version should generate nothing to stdout. */
-       assertEmptyFile("version.stderr");
-       /* Verify format of version message. */
-       q = p = slurpfile(&s, "version.stdout");
-       /* Version message should start with name of program, then space. */
-       assert(s > 6);
-       failure("Version must start with 'bsdcat': ``%s''", p);
-       if (!assertEqualMem(q, "bsdcat ", 7))
-               return;
-       q += 7; s -= 7;
-       /* Version number is a series of digits and periods. */
-       while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
-               ++q;
-               --s;
-       }
-       /* Version number terminated by space. */
-       failure("No space after bsdcat version: ``%s''", p);
-       assert(s > 1);
-       /* Skip a single trailing a,b,c, or d. */
-       if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
-               ++q;
-       failure("No space after bsdcat version: ``%s''", p);
-       assert(*q == ' ');
-       ++q; --s;
-       /* Separator. */
-       failure("No `-' between bsdcat and libarchive versions: ``%s''", p);
-       assertEqualMem(q, "- ", 2);
-       q += 2; s -= 2;
-       /* libarchive name and version number */
-       failure("Not long enough for libarchive version: ``%s''", p);
-       assert(s > 11);
-       failure("Libarchive version must start with `libarchive': ``%s''", p);
-       assertEqualMem(q, "libarchive ", 11);
-       q += 11; s -= 11;
-       /* Version number is a series of digits and periods. */
-       while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
-               ++q;
-               --s;
-       }
-       /* Skip a single trailing a,b,c, or d. */
-       if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
-               ++q;
-       /* Skip arbitrary third-party version numbers. */
-       while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) {
-               ++q;
-               --s;
-       }
-       /* All terminated by end-of-line. */
-       assert(s >= 1);
-       /* Skip an optional CR character (e.g., Windows) */
-       failure("Version output must end with \\n or \\r\\n");
-       if (*q == '\r') { ++q; --s; }
-       assertEqualMem(q, "\n", 1);
-       free(p);
+       assertVersion(testprog, "bsdcat");
 }
index 6471e9d..2b1438a 100644 (file)
 /* Define to 1 if you have a working EXT2_IOC_GETFLAGS */
 #undef HAVE_WORKING_EXT2_IOC_GETFLAGS
 
+/* Define to 1 if you have a working FS_IOC_GETFLAGS */
+#undef HAVE_WORKING_FS_IOC_GETFLAGS
+
 /* Define to 1 if you have the <zlib.h> header file. */
 #undef HAVE_ZLIB_H
 
index 8227024..ff3e961 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libarchive 3.3.0.
+# Generated by GNU Autoconf 2.69 for libarchive 3.3.1.
 #
 # Report bugs to <libarchive-discuss@googlegroups.com>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='libarchive'
 PACKAGE_TARNAME='libarchive'
-PACKAGE_VERSION='3.3.0'
-PACKAGE_STRING='libarchive 3.3.0'
+PACKAGE_VERSION='3.3.1'
+PACKAGE_STRING='libarchive 3.3.1'
 PACKAGE_BUGREPORT='libarchive-discuss@googlegroups.com'
 PACKAGE_URL=''
 
@@ -1383,7 +1383,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libarchive 3.3.0 to adapt to many kinds of systems.
+\`configure' configures libarchive 3.3.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1454,7 +1454,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libarchive 3.3.0:";;
+     short | recursive ) echo "Configuration of libarchive 3.3.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1617,7 +1617,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libarchive configure 3.3.0
+libarchive configure 3.3.1
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2456,7 +2456,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libarchive $as_me 3.3.0, which was
+It was created by libarchive $as_me 3.3.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3325,7 +3325,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='libarchive'
- VERSION='3.3.0'
+ VERSION='3.3.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3485,7 +3485,7 @@ AM_BACKSLASH='\'
 
 # Libtool interface version bumps on any API change, so increments
 # whenever libarchive minor version does.
-ARCHIVE_MINOR=$(( (3003000 / 1000) % 1000 ))
+ARCHIVE_MINOR=$(( (3003001 / 1000) % 1000 ))
 # Libarchive 2.7 == libtool interface 9 = 2 + 7
 # Libarchive 2.8 == libtool interface 10 = 2 + 8
 # Libarchive 2.9 == libtool interface 11 = 2 + 8
@@ -3493,37 +3493,37 @@ ARCHIVE_MINOR=$(( (3003000 / 1000) % 1000 ))
 # Libarchive 3.1 == libtool interface 13
 ARCHIVE_INTERFACE=`echo $((13 + ${ARCHIVE_MINOR}))`
 # Libarchive revision is bumped on any source change === libtool revision
-ARCHIVE_REVISION=$(( 3003000 % 1000 ))
+ARCHIVE_REVISION=$(( 3003001 % 1000 ))
 # Libarchive minor is bumped on any interface addition === libtool age
 ARCHIVE_LIBTOOL_VERSION=$ARCHIVE_INTERFACE:$ARCHIVE_REVISION:$ARCHIVE_MINOR
 
 # Stick the version numbers into config.h
 
-$as_echo "#define LIBARCHIVE_VERSION_STRING \"3.3.0\"" >>confdefs.h
+$as_echo "#define LIBARCHIVE_VERSION_STRING \"3.3.1\"" >>confdefs.h
 
 
 cat >>confdefs.h <<_ACEOF
-#define LIBARCHIVE_VERSION_NUMBER "3003000"
+#define LIBARCHIVE_VERSION_NUMBER "3003001"
 _ACEOF
 
 
-$as_echo "#define BSDCPIO_VERSION_STRING \"3.3.0\"" >>confdefs.h
+$as_echo "#define BSDCPIO_VERSION_STRING \"3.3.1\"" >>confdefs.h
 
 
-$as_echo "#define BSDTAR_VERSION_STRING \"3.3.0\"" >>confdefs.h
+$as_echo "#define BSDTAR_VERSION_STRING \"3.3.1\"" >>confdefs.h
 
 
-$as_echo "#define BSDCAT_VERSION_STRING \"3.3.0\"" >>confdefs.h
+$as_echo "#define BSDCAT_VERSION_STRING \"3.3.1\"" >>confdefs.h
 
 
 # The shell variables here must be the same as the AC_SUBST() variables
 # below, but the shell variable names apparently cannot be the same as
 # the m4 macro names above.  Why?  Ask autoconf.
-BSDCPIO_VERSION_STRING=3.3.0
-BSDTAR_VERSION_STRING=3.3.0
-BSDCAT_VERSION_STRING=3.3.0
-LIBARCHIVE_VERSION_STRING=3.3.0
-LIBARCHIVE_VERSION_NUMBER=3003000
+BSDCPIO_VERSION_STRING=3.3.1
+BSDTAR_VERSION_STRING=3.3.1
+BSDCAT_VERSION_STRING=3.3.1
+LIBARCHIVE_VERSION_STRING=3.3.1
+LIBARCHIVE_VERSION_NUMBER=3003001
 
 # Substitute the above version numbers into the various files below.
 # Yes, I believe this is the fourth time we define what are essentially
 
 done
 
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether FS_IOC_GETFLAGS is usable" >&5
+$as_echo_n "checking whether FS_IOC_GETFLAGS is usable... " >&6; }
+if ${ac_cv_have_decl_FS_IOC_GETFLAGS+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/ioctl.h>
+#include <linux/fs.h>
+int
+main ()
+{
+int x = FS_IOC_GETFLAGS
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_have_decl_FS_IOC_GETFLAGS=yes
+else
+  ac_cv_have_decl_FS_IOC_GETFLAGS=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl_FS_IOC_GETFLAGS" >&5
+$as_echo "$ac_cv_have_decl_FS_IOC_GETFLAGS" >&6; }
+
+if test "x$ac_cv_have_decl_FS_IOC_GETFLAGS" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_WORKING_FS_IOC_GETFLAGS 1
+_ACEOF
+
+fi
+
 for ac_header in locale.h paths.h poll.h pthread.h pwd.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -15237,7 +15273,7 @@ if test "${with_lzo2+set}" = set; then :
 fi
 
 
-if test "x$with_lzo2" == "xyes"; then
+if test "x$with_lzo2" = "xyes"; then
   for ac_header in lzo/lzoconf.h lzo/lzo1x.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -21205,7 +21241,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libarchive $as_me 3.3.0, which was
+This file was extended by libarchive $as_me 3.3.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21271,7 +21307,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libarchive config.status 3.3.0
+libarchive config.status 3.3.1
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
index b8904de..3a8ac6a 100644 (file)
@@ -4,8 +4,8 @@ dnl First, define all of the version numbers up front.
 dnl In particular, this allows the version macro to be used in AC_INIT
 
 dnl These first two version numbers are updated automatically on each release.
-m4_define([LIBARCHIVE_VERSION_S],[3.3.0])
-m4_define([LIBARCHIVE_VERSION_N],[3003000])
+m4_define([LIBARCHIVE_VERSION_S],[3.3.1])
+m4_define([LIBARCHIVE_VERSION_N],[3003001])
 
 dnl bsdtar and bsdcpio versioning tracks libarchive
 m4_define([BSDTAR_VERSION_S],LIBARCHIVE_VERSION_S())
@@ -270,6 +270,19 @@ AS_VAR_IF([ac_cv_have_decl_EXT2_IOC_GETFLAGS], [yes],
 
 AC_CHECK_HEADERS([inttypes.h io.h langinfo.h limits.h])
 AC_CHECK_HEADERS([linux/fiemap.h linux/fs.h linux/magic.h linux/types.h])
+
+AC_CACHE_CHECK([whether FS_IOC_GETFLAGS is usable],
+    [ac_cv_have_decl_FS_IOC_GETFLAGS],
+    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include <sys/ioctl.h>
+@%:@include <linux/fs.h>],
+                                   [int x = FS_IOC_GETFLAGS])],
+                  [AS_VAR_SET([ac_cv_have_decl_FS_IOC_GETFLAGS], [yes])],
+                  [AS_VAR_SET([ac_cv_have_decl_FS_IOC_GETFLAGS], [no])])])
+
+AS_VAR_IF([ac_cv_have_decl_FS_IOC_GETFLAGS], [yes],
+    [AC_DEFINE_UNQUOTED([HAVE_WORKING_FS_IOC_GETFLAGS], [1],
+                    [Define to 1 if you have a working FS_IOC_GETFLAGS])])
+
 AC_CHECK_HEADERS([locale.h paths.h poll.h pthread.h pwd.h])
 AC_CHECK_HEADERS([readpassphrase.h signal.h spawn.h])
 AC_CHECK_HEADERS([stdarg.h stdint.h stdlib.h string.h])
@@ -381,7 +394,7 @@ fi
 AC_ARG_WITH([lzo2],
   AS_HELP_STRING([--with-lzo2], [Build with LZO support from liblzo2]))
 
-if test "x$with_lzo2" == "xyes"; then
+if test "x$with_lzo2" = "xyes"; then
   AC_CHECK_HEADERS([lzo/lzoconf.h lzo/lzo1x.h])
   AC_CHECK_LIB(lzo2,lzo1x_decompress_safe)
 fi
index 8ffb542..ec9509b 100644 (file)
@@ -8,7 +8,7 @@ IF(ENABLE_CPIO AND ENABLE_TEST)
     ../cmdline.c
     ../../libarchive_fe/err.c
     ../../test_utils/test_utils.c
-    main.c
+    ../../test_utils/test_main.c
     test.h
     test_0.c
     test_basic.c
@@ -87,6 +87,7 @@ IF(ENABLE_CPIO AND ENABLE_TEST)
   INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
   INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/test_utils)
+  INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/cpio/test)
 
   # Experimental new test handling
   ADD_CUSTOM_TARGET(run_bsdcpio_test
diff --git a/cpio/test/main.c b/cpio/test/main.c
deleted file mode 100644 (file)
index 34282f3..0000000
+++ /dev/null
@@ -1,3073 +0,0 @@
-/*
- * Copyright (c) 2003-2009 Tim Kientzle
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "test.h"
-#include "test_utils.h"
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <errno.h>
-#ifdef HAVE_ICONV_H
-#include <iconv.h>
-#endif
-/*
- * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.
- * As the include guards don't agree, the order of include is important.
- */
-#ifdef HAVE_LINUX_EXT2_FS_H
-#include <linux/ext2_fs.h>      /* for Linux file flags */
-#endif
-#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__)
-#include <ext2fs/ext2_fs.h>     /* Linux file flags, broken on Cygwin */
-#endif
-#include <limits.h>
-#include <locale.h>
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#include <stdarg.h>
-#include <time.h>
-
-/*
- * This same file is used pretty much verbatim for all test harnesses.
- *
- * The next few lines are the only differences.
- * TODO: Move this into a separate configuration header, have all test
- * suites share one copy of this file.
- */
-__FBSDID("$FreeBSD: src/usr.bin/cpio/test/main.c,v 1.3 2008/08/24 04:58:22 kientzle Exp $");
-#define KNOWNREF       "test_option_f.cpio.uu"
-#define ENVBASE "BSDCPIO" /* Prefix for environment variables. */
-#define        PROGRAM "bsdcpio" /* Name of program being tested. */
-#define PROGRAM_ALIAS "cpio" /* Generic alias for program */
-#undef LIBRARY           /* Not testing a library. */
-#undef EXTRA_DUMP        /* How to dump extra data */
-#undef EXTRA_ERRNO       /* How to dump errno */
-/* How to generate extra version info. */
-#define        EXTRA_VERSION    (systemf("%s --version", testprog) ? "" : "")
-
-/*
- *
- * Windows support routines
- *
- * Note: Configuration is a tricky issue.  Using HAVE_* feature macros
- * in the test harness is dangerous because they cover up
- * configuration errors.  The classic example of this is omitting a
- * configure check.  If libarchive and libarchive_test both look for
- * the same feature macro, such errors are hard to detect.  Platform
- * macros (e.g., _WIN32 or __GNUC__) are a little better, but can
- * easily lead to very messy code.  It's best to limit yourself
- * to only the most generic programming techniques in the test harness
- * and thus avoid conditionals altogether.  Where that's not possible,
- * try to minimize conditionals by grouping platform-specific tests in
- * one place (e.g., test_acl_freebsd) or by adding new assert()
- * functions (e.g., assertMakeHardlink()) to cover up platform
- * differences.  Platform-specific coding in libarchive_test is often
- * a symptom that some capability is missing from libarchive itself.
- */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#include <io.h>
-#include <direct.h>
-#include <windows.h>
-#ifndef F_OK
-#define F_OK (0)
-#endif
-#ifndef S_ISDIR
-#define S_ISDIR(m)  ((m) & _S_IFDIR)
-#endif
-#ifndef S_ISREG
-#define S_ISREG(m)  ((m) & _S_IFREG)
-#endif
-#if !defined(__BORLANDC__)
-#define access _access
-#undef chdir
-#define chdir _chdir
-#endif
-#ifndef fileno
-#define fileno _fileno
-#endif
-/*#define fstat _fstat64*/
-#if !defined(__BORLANDC__)
-#define getcwd _getcwd
-#endif
-#define lstat stat
-/*#define lstat _stat64*/
-/*#define stat _stat64*/
-#define rmdir _rmdir
-#if !defined(__BORLANDC__)
-#define strdup _strdup
-#define umask _umask
-#endif
-#define int64_t __int64
-#endif
-
-#if defined(HAVE__CrtSetReportMode)
-# include <crtdbg.h>
-#endif
-
-mode_t umasked(mode_t expected_mode)
-{
-       mode_t mode = umask(0);
-       umask(mode);
-       return expected_mode & ~mode;
-}
-
-/* Path to working directory for current test */
-const char *testworkdir;
-#ifdef PROGRAM
-/* Pathname of exe to be tested. */
-const char *testprogfile;
-/* Name of exe to use in printf-formatted command strings. */
-/* On Windows, this includes leading/trailing quotes. */
-const char *testprog;
-#endif
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-static void    *GetFunctionKernel32(const char *);
-static int      my_CreateSymbolicLinkA(const char *, const char *, int);
-static int      my_CreateHardLinkA(const char *, const char *);
-static int      my_GetFileInformationByName(const char *,
-                    BY_HANDLE_FILE_INFORMATION *);
-
-static void *
-GetFunctionKernel32(const char *name)
-{
-       static HINSTANCE lib;
-       static int set;
-       if (!set) {
-               set = 1;
-               lib = LoadLibrary("kernel32.dll");
-       }
-       if (lib == NULL) {
-               fprintf(stderr, "Can't load kernel32.dll?!\n");
-               exit(1);
-       }
-       return (void *)GetProcAddress(lib, name);
-}
-
-static int
-my_CreateSymbolicLinkA(const char *linkname, const char *target, int flags)
-{
-       static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, DWORD);
-       static int set;
-       if (!set) {
-               set = 1;
-               f = GetFunctionKernel32("CreateSymbolicLinkA");
-       }
-       return f == NULL ? 0 : (*f)(linkname, target, flags);
-}
-
-static int
-my_CreateHardLinkA(const char *linkname, const char *target)
-{
-       static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES);
-       static int set;
-       if (!set) {
-               set = 1;
-               f = GetFunctionKernel32("CreateHardLinkA");
-       }
-       return f == NULL ? 0 : (*f)(linkname, target, NULL);
-}
-
-static int
-my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi)
-{
-       HANDLE h;
-       int r;
-
-       memset(bhfi, 0, sizeof(*bhfi));
-       h = CreateFile(path, FILE_READ_ATTRIBUTES, 0, NULL,
-               OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
-       if (h == INVALID_HANDLE_VALUE)
-               return (0);
-       r = GetFileInformationByHandle(h, bhfi);
-       CloseHandle(h);
-       return (r);
-}
-#endif
-
-#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__)
-static void
-invalid_parameter_handler(const wchar_t * expression,
-    const wchar_t * function, const wchar_t * file,
-    unsigned int line, uintptr_t pReserved)
-{
-       /* nop */
-}
-#endif
-
-/*
- *
- * OPTIONS FLAGS
- *
- */
-
-/* Enable core dump on failure. */
-static int dump_on_failure = 0;
-/* Default is to remove temp dirs and log data for successful tests. */
-static int keep_temp_files = 0;
-/* Default is to run the specified tests once and report errors. */
-static int until_failure = 0;
-/* Default is to just report pass/fail for each test. */
-static int verbosity = 0;
-#define        VERBOSITY_SUMMARY_ONLY -1 /* -q */
-#define VERBOSITY_PASSFAIL 0   /* Default */
-#define VERBOSITY_LIGHT_REPORT 1 /* -v */
-#define VERBOSITY_FULL 2 /* -vv */
-/* A few places generate even more output for verbosity > VERBOSITY_FULL,
- * mostly for debugging the test harness itself. */
-/* Cumulative count of assertion failures. */
-static int failures = 0;
-/* Cumulative count of reported skips. */
-static int skips = 0;
-/* Cumulative count of assertions checked. */
-static int assertions = 0;
-
-/* Directory where uuencoded reference files can be found. */
-static const char *refdir;
-
-/*
- * Report log information selectively to console and/or disk log.
- */
-static int log_console = 0;
-static FILE *logfile;
-static void
-vlogprintf(const char *fmt, va_list ap)
-{
-#ifdef va_copy
-       va_list lfap;
-       va_copy(lfap, ap);
-#endif
-       if (log_console)
-               vfprintf(stdout, fmt, ap);
-       if (logfile != NULL)
-#ifdef va_copy
-               vfprintf(logfile, fmt, lfap);
-       va_end(lfap);
-#else
-               vfprintf(logfile, fmt, ap);
-#endif
-}
-
-static void
-logprintf(const char *fmt, ...)
-{
-       va_list ap;
-       va_start(ap, fmt);
-       vlogprintf(fmt, ap);
-       va_end(ap);
-}
-
-/* Set up a message to display only if next assertion fails. */
-static char msgbuff[4096];
-static const char *msg, *nextmsg;
-void
-failure(const char *fmt, ...)
-{
-       va_list ap;
-       if (fmt == NULL) {
-               nextmsg = NULL;
-       } else {
-               va_start(ap, fmt);
-               vsprintf(msgbuff, fmt, ap);
-               va_end(ap);
-               nextmsg = msgbuff;
-       }
-}
-
-/*
- * Copy arguments into file-local variables.
- * This was added to permit vararg assert() functions without needing
- * variadic wrapper macros.  Turns out that the vararg capability is almost
- * never used, so almost all of the vararg assertions can be simplified
- * by removing the vararg capability and reworking the wrapper macro to
- * pass __FILE__, __LINE__ directly into the function instead of using
- * this hook.  I suspect this machinery is used so rarely that we
- * would be better off just removing it entirely.  That would simplify
- * the code here noticeably.
- */
-static const char *skipping_filename;
-static int skipping_line;
-void skipping_setup(const char *filename, int line)
-{
-       skipping_filename = filename;
-       skipping_line = line;
-}
-
-/* Called at the beginning of each assert() function. */
-static void
-assertion_count(const char *file, int line)
-{
-       (void)file; /* UNUSED */
-       (void)line; /* UNUSED */
-       ++assertions;
-       /* Proper handling of "failure()" message. */
-       msg = nextmsg;
-       nextmsg = NULL;
-       /* Uncomment to print file:line after every assertion.
-        * Verbose, but occasionally useful in tracking down crashes. */
-       /* printf("Checked %s:%d\n", file, line); */
-}
-
-/*
- * For each test source file, we remember how many times each
- * assertion was reported.  Cleared before each new test,
- * used by test_summarize().
- */
-static struct line {
-       int count;
-       int skip;
-}  failed_lines[10000];
-const char *failed_filename;
-
-/* Count this failure, setup up log destination and handle initial report. */
-static void
-failure_start(const char *filename, int line, const char *fmt, ...)
-{
-       va_list ap;
-
-       /* Record another failure for this line. */
-       ++failures;
-       failed_filename = filename;
-       failed_lines[line].count++;
-
-       /* Determine whether to log header to console. */
-       switch (verbosity) {
-       case VERBOSITY_LIGHT_REPORT:
-               log_console = (failed_lines[line].count < 2);
-               break;
-       default:
-               log_console = (verbosity >= VERBOSITY_FULL);
-       }
-
-       /* Log file:line header for this failure */
-       va_start(ap, fmt);
-#if _MSC_VER
-       logprintf("%s(%d): ", filename, line);
-#else
-       logprintf("%s:%d: ", filename, line);
-#endif
-       vlogprintf(fmt, ap);
-       va_end(ap);
-       logprintf("\n");
-
-       if (msg != NULL && msg[0] != '\0') {
-               logprintf("   Description: %s\n", msg);
-               msg = NULL;
-       }
-
-       /* Determine whether to log details to console. */
-       if (verbosity == VERBOSITY_LIGHT_REPORT)
-               log_console = 0;
-}
-
-/* Complete reporting of failed tests. */
-/*
- * The 'extra' hook here is used by libarchive to include libarchive
- * error messages with assertion failures.  It could also be used
- * to add strerror() output, for example.  Just define the EXTRA_DUMP()
- * macro appropriately.
- */
-static void
-failure_finish(void *extra)
-{
-       (void)extra; /* UNUSED (maybe) */
-#ifdef EXTRA_DUMP
-       if (extra != NULL) {
-               logprintf("    errno: %d\n", EXTRA_ERRNO(extra));
-               logprintf("   detail: %s\n", EXTRA_DUMP(extra));
-       }
-#endif
-
-       if (dump_on_failure) {
-               fprintf(stderr,
-                   " *** forcing core dump so failure can be debugged ***\n");
-               abort();
-       }
-}
-
-/* Inform user that we're skipping some checks. */
-void
-test_skipping(const char *fmt, ...)
-{
-       char buff[1024];
-       va_list ap;
-
-       va_start(ap, fmt);
-       vsprintf(buff, fmt, ap);
-       va_end(ap);
-       /* Use failure() message if set. */
-       msg = nextmsg;
-       nextmsg = NULL;
-       /* failure_start() isn't quite right, but is awfully convenient. */
-       failure_start(skipping_filename, skipping_line, "SKIPPING: %s", buff);
-       --failures; /* Undo failures++ in failure_start() */
-       /* Don't failure_finish() here. */
-       /* Mark as skip, so doesn't count as failed test. */
-       failed_lines[skipping_line].skip = 1;
-       ++skips;
-}
-
-/*
- *
- * ASSERTIONS
- *
- */
-
-/* Generic assert() just displays the failed condition. */
-int
-assertion_assert(const char *file, int line, int value,
-    const char *condition, void *extra)
-{
-       assertion_count(file, line);
-       if (!value) {
-               failure_start(file, line, "Assertion failed: %s", condition);
-               failure_finish(extra);
-       }
-       return (value);
-}
-
-/* chdir() and report any errors */
-int
-assertion_chdir(const char *file, int line, const char *pathname)
-{
-       assertion_count(file, line);
-       if (chdir(pathname) == 0)
-               return (1);
-       failure_start(file, line, "chdir(\"%s\")", pathname);
-       failure_finish(NULL);
-       return (0);
-
-}
-
-/* Verify two integers are equal. */
-int
-assertion_equal_int(const char *file, int line,
-    long long v1, const char *e1, long long v2, const char *e2, void *extra)
-{
-       assertion_count(file, line);
-       if (v1 == v2)
-               return (1);
-       failure_start(file, line, "%s != %s", e1, e2);
-       logprintf("      %s=%lld (0x%llx, 0%llo)\n", e1, v1, v1, v1);
-       logprintf("      %s=%lld (0x%llx, 0%llo)\n", e2, v2, v2, v2);
-       failure_finish(extra);
-       return (0);
-}
-
-/*
- * Utility to convert a single UTF-8 sequence.
- */
-static int
-_utf8_to_unicode(uint32_t *pwc, const char *s, size_t n)
-{
-       static const char utf8_count[256] = {
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 00 - 0F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 10 - 1F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 20 - 2F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 30 - 3F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 40 - 4F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 50 - 5F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 60 - 6F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 70 - 7F */
-                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 80 - 8F */
-                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 90 - 9F */
-                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* A0 - AF */
-                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* B0 - BF */
-                0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* C0 - CF */
-                2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* D0 - DF */
-                3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,/* E0 - EF */
-                4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */
-       };
-       int ch;
-       int cnt;
-       uint32_t wc;
-
-       *pwc = 0;
-
-       /* Sanity check. */
-       if (n == 0)
-               return (0);
-       /*
-        * Decode 1-4 bytes depending on the value of the first byte.
-        */
-       ch = (unsigned char)*s;
-       if (ch == 0)
-               return (0); /* Standard:  return 0 for end-of-string. */
-       cnt = utf8_count[ch];
-
-       /* Invalid sequence or there are not plenty bytes. */
-       if (n < (size_t)cnt)
-               return (-1);
-
-       /* Make a Unicode code point from a single UTF-8 sequence. */
-       switch (cnt) {
-       case 1: /* 1 byte sequence. */
-               *pwc = ch & 0x7f;
-               return (cnt);
-       case 2: /* 2 bytes sequence. */
-               if ((s[1] & 0xc0) != 0x80) return (-1);
-               *pwc = ((ch & 0x1f) << 6) | (s[1] & 0x3f);
-               return (cnt);
-       case 3: /* 3 bytes sequence. */
-               if ((s[1] & 0xc0) != 0x80) return (-1);
-               if ((s[2] & 0xc0) != 0x80) return (-1);
-               wc = ((ch & 0x0f) << 12)
-                   | ((s[1] & 0x3f) << 6)
-                   | (s[2] & 0x3f);
-               if (wc < 0x800)
-                       return (-1);/* Overlong sequence. */
-               break;
-       case 4: /* 4 bytes sequence. */
-               if (n < 4)
-                       return (-1);
-               if ((s[1] & 0xc0) != 0x80) return (-1);
-               if ((s[2] & 0xc0) != 0x80) return (-1);
-               if ((s[3] & 0xc0) != 0x80) return (-1);
-               wc = ((ch & 0x07) << 18)
-                   | ((s[1] & 0x3f) << 12)
-                   | ((s[2] & 0x3f) << 6)
-                   | (s[3] & 0x3f);
-               if (wc < 0x10000)
-                       return (-1);/* Overlong sequence. */
-               break;
-       default:
-               return (-1);
-       }
-
-       /* The code point larger than 0x10FFFF is not legal
-        * Unicode values. */
-       if (wc > 0x10FFFF)
-               return (-1);
-       /* Correctly gets a Unicode, returns used bytes. */
-       *pwc = wc;
-       return (cnt);
-}
-
-static void strdump(const char *e, const char *p, int ewidth, int utf8)
-{
-       const char *q = p;
-
-       logprintf("      %*s = ", ewidth, e);
-       if (p == NULL) {
-               logprintf("NULL\n");
-               return;
-       }
-       logprintf("\"");
-       while (*p != '\0') {
-               unsigned int c = 0xff & *p++;
-               switch (c) {
-               case '\a': logprintf("\\a"); break;
-               case '\b': logprintf("\\b"); break;
-               case '\n': logprintf("\\n"); break;
-               case '\r': logprintf("\\r"); break;
-               default:
-                       if (c >= 32 && c < 127)
-                               logprintf("%c", c);
-                       else
-                               logprintf("\\x%02X", c);
-               }
-       }
-       logprintf("\"");
-       logprintf(" (length %d)", q == NULL ? -1 : (int)strlen(q));
-
-       /*
-        * If the current string is UTF-8, dump its code points.
-        */
-       if (utf8) {
-               size_t len;
-               uint32_t uc;
-               int n;
-               int cnt = 0;
-
-               p = q;
-               len = strlen(p);
-               logprintf(" [");
-               while ((n = _utf8_to_unicode(&uc, p, len)) > 0) {
-                       if (p != q)
-                               logprintf(" ");
-                       logprintf("%04X", uc);
-                       p += n;
-                       len -= n;
-                       cnt++;
-               }
-               logprintf("]");
-               logprintf(" (count %d", cnt);
-               if (n < 0) {
-                       logprintf(",unknown %d bytes", len);
-               }
-               logprintf(")");
-
-       }
-       logprintf("\n");
-}
-
-/* Verify two strings are equal, dump them if not. */
-int
-assertion_equal_string(const char *file, int line,
-    const char *v1, const char *e1,
-    const char *v2, const char *e2,
-    void *extra, int utf8)
-{
-       int l1, l2;
-
-       assertion_count(file, line);
-       if (v1 == v2 || (v1 != NULL && v2 != NULL && strcmp(v1, v2) == 0))
-               return (1);
-       failure_start(file, line, "%s != %s", e1, e2);
-       l1 = (int)strlen(e1);
-       l2 = (int)strlen(e2);
-       if (l1 < l2)
-               l1 = l2;
-       strdump(e1, v1, l1, utf8);
-       strdump(e2, v2, l1, utf8);
-       failure_finish(extra);
-       return (0);
-}
-
-static void
-wcsdump(const char *e, const wchar_t *w)
-{
-       logprintf("      %s = ", e);
-       if (w == NULL) {
-               logprintf("(null)");
-               return;
-       }
-       logprintf("\"");
-       while (*w != L'\0') {
-               unsigned int c = *w++;
-               if (c >= 32 && c < 127)
-                       logprintf("%c", c);
-               else if (c < 256)
-                       logprintf("\\x%02X", c);
-               else if (c < 0x10000)
-                       logprintf("\\u%04X", c);
-               else
-                       logprintf("\\U%08X", c);
-       }
-       logprintf("\"\n");
-}
-
-#ifndef HAVE_WCSCMP
-static int
-wcscmp(const wchar_t *s1, const wchar_t *s2)
-{
-
-       while (*s1 == *s2++) {
-               if (*s1++ == L'\0')
-                       return 0;
-       }
-       if (*s1 > *--s2)
-               return 1;
-       else
-               return -1;
-}
-#endif
-
-/* Verify that two wide strings are equal, dump them if not. */
-int
-assertion_equal_wstring(const char *file, int line,
-    const wchar_t *v1, const char *e1,
-    const wchar_t *v2, const char *e2,
-    void *extra)
-{
-       assertion_count(file, line);
-       if (v1 == v2)
-               return (1);
-       if (v1 != NULL && v2 != NULL && wcscmp(v1, v2) == 0)
-               return (1);
-       failure_start(file, line, "%s != %s", e1, e2);
-       wcsdump(e1, v1);
-       wcsdump(e2, v2);
-       failure_finish(extra);
-       return (0);
-}
-
-/*
- * Pretty standard hexdump routine.  As a bonus, if ref != NULL, then
- * any bytes in p that differ from ref will be highlighted with '_'
- * before and after the hex value.
- */
-static void
-hexdump(const char *p, const char *ref, size_t l, size_t offset)
-{
-       size_t i, j;
-       char sep;
-
-       if (p == NULL) {
-               logprintf("(null)\n");
-               return;
-       }
-       for(i=0; i < l; i+=16) {
-               logprintf("%04x", (unsigned)(i + offset));
-               sep = ' ';
-               for (j = 0; j < 16 && i + j < l; j++) {
-                       if (ref != NULL && p[i + j] != ref[i + j])
-                               sep = '_';
-                       logprintf("%c%02x", sep, 0xff & (int)p[i+j]);
-                       if (ref != NULL && p[i + j] == ref[i + j])
-                               sep = ' ';
-               }
-               for (; j < 16; j++) {
-                       logprintf("%c  ", sep);
-                       sep = ' ';
-               }
-               logprintf("%c", sep);
-               for (j=0; j < 16 && i + j < l; j++) {
-                       int c = p[i + j];
-                       if (c >= ' ' && c <= 126)
-                               logprintf("%c", c);
-                       else
-                               logprintf(".");
-               }
-               logprintf("\n");
-       }
-}
-
-/* Verify that two blocks of memory are the same, display the first
- * block of differences if they're not. */
-int
-assertion_equal_mem(const char *file, int line,
-    const void *_v1, const char *e1,
-    const void *_v2, const char *e2,
-    size_t l, const char *ld, void *extra)
-{
-       const char *v1 = (const char *)_v1;
-       const char *v2 = (const char *)_v2;
-       size_t offset;
-
-       assertion_count(file, line);
-       if (v1 == v2 || (v1 != NULL && v2 != NULL && memcmp(v1, v2, l) == 0))
-               return (1);
-       if (v1 == NULL || v2 == NULL)
-               return (0);
-
-       failure_start(file, line, "%s != %s", e1, e2);
-       logprintf("      size %s = %d\n", ld, (int)l);
-       /* Dump 48 bytes (3 lines) so that the first difference is
-        * in the second line. */
-       offset = 0;
-       while (l > 64 && memcmp(v1, v2, 32) == 0) {
-               /* Two lines agree, so step forward one line. */
-               v1 += 16;
-               v2 += 16;
-               l -= 16;
-               offset += 16;
-       }
-       logprintf("      Dump of %s\n", e1);
-       hexdump(v1, v2, l < 128 ? l : 128, offset);
-       logprintf("      Dump of %s\n", e2);
-       hexdump(v2, v1, l < 128 ? l : 128, offset);
-       logprintf("\n");
-       failure_finish(extra);
-       return (0);
-}
-
-/* Verify that a block of memory is filled with the specified byte. */
-int
-assertion_memory_filled_with(const char *file, int line,
-    const void *_v1, const char *vd,
-    size_t l, const char *ld,
-    char b, const char *bd, void *extra)
-{
-       const char *v1 = (const char *)_v1;
-       size_t c = 0;
-       size_t i;
-       (void)ld; /* UNUSED */
-
-       assertion_count(file, line);
-
-       for (i = 0; i < l; ++i) {
-               if (v1[i] == b) {
-                       ++c;
-               }
-       }
-       if (c == l)
-               return (1);
-
-       failure_start(file, line, "%s (size %d) not filled with %s", vd, (int)l, bd);
-       logprintf("   Only %d bytes were correct\n", (int)c);
-       failure_finish(extra);
-       return (0);
-}
-
-/* Verify that the named file exists and is empty. */
-int
-assertion_empty_file(const char *filename, int line, const char *f1)
-{
-       char buff[1024];
-       struct stat st;
-       ssize_t s;
-       FILE *f;
-
-       assertion_count(filename, line);
-
-       if (stat(f1, &st) != 0) {
-               failure_start(filename, line, "Stat failed: %s", f1);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (st.st_size == 0)
-               return (1);
-
-       failure_start(filename, line, "File should be empty: %s", f1);
-       logprintf("    File size: %d\n", (int)st.st_size);
-       logprintf("    Contents:\n");
-       f = fopen(f1, "rb");
-       if (f == NULL) {
-               logprintf("    Unable to open %s\n", f1);
-       } else {
-               s = ((off_t)sizeof(buff) < st.st_size) ?
-                   (ssize_t)sizeof(buff) : (ssize_t)st.st_size;
-               s = fread(buff, 1, s, f);
-               hexdump(buff, NULL, s, 0);
-               fclose(f);
-       }
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Verify that the named file exists and is not empty. */
-int
-assertion_non_empty_file(const char *filename, int line, const char *f1)
-{
-       struct stat st;
-
-       assertion_count(filename, line);
-
-       if (stat(f1, &st) != 0) {
-               failure_start(filename, line, "Stat failed: %s", f1);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (st.st_size == 0) {
-               failure_start(filename, line, "File empty: %s", f1);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (1);
-}
-
-/* Verify that two files have the same contents. */
-/* TODO: hexdump the first bytes that actually differ. */
-int
-assertion_equal_file(const char *filename, int line, const char *fn1, const char *fn2)
-{
-       char buff1[1024];
-       char buff2[1024];
-       FILE *f1, *f2;
-       int n1, n2;
-
-       assertion_count(filename, line);
-
-       f1 = fopen(fn1, "rb");
-       f2 = fopen(fn2, "rb");
-       if (f1 == NULL || f2 == NULL) {
-               if (f1) fclose(f1);
-               if (f2) fclose(f2);
-               return (0);
-       }
-       for (;;) {
-               n1 = (int)fread(buff1, 1, sizeof(buff1), f1);
-               n2 = (int)fread(buff2, 1, sizeof(buff2), f2);
-               if (n1 != n2)
-                       break;
-               if (n1 == 0 && n2 == 0) {
-                       fclose(f1);
-                       fclose(f2);
-                       return (1);
-               }
-               if (memcmp(buff1, buff2, n1) != 0)
-                       break;
-       }
-       fclose(f1);
-       fclose(f2);
-       failure_start(filename, line, "Files not identical");
-       logprintf("  file1=\"%s\"\n", fn1);
-       logprintf("  file2=\"%s\"\n", fn2);
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Verify that the named file does exist. */
-int
-assertion_file_exists(const char *filename, int line, const char *f)
-{
-       assertion_count(filename, line);
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       if (!_access(f, 0))
-               return (1);
-#else
-       if (!access(f, F_OK))
-               return (1);
-#endif
-       failure_start(filename, line, "File should exist: %s", f);
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Verify that the named file doesn't exist. */
-int
-assertion_file_not_exists(const char *filename, int line, const char *f)
-{
-       assertion_count(filename, line);
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       if (_access(f, 0))
-               return (1);
-#else
-       if (access(f, F_OK))
-               return (1);
-#endif
-       failure_start(filename, line, "File should not exist: %s", f);
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Compare the contents of a file to a block of memory. */
-int
-assertion_file_contents(const char *filename, int line, const void *buff, int s, const char *fn)
-{
-       char *contents;
-       FILE *f;
-       int n;
-
-       assertion_count(filename, line);
-
-       f = fopen(fn, "rb");
-       if (f == NULL) {
-               failure_start(filename, line,
-                   "File should exist: %s", fn);
-               failure_finish(NULL);
-               return (0);
-       }
-       contents = malloc(s * 2);
-       n = (int)fread(contents, 1, s * 2, f);
-       fclose(f);
-       if (n == s && memcmp(buff, contents, s) == 0) {
-               free(contents);
-               return (1);
-       }
-       failure_start(filename, line, "File contents don't match");
-       logprintf("  file=\"%s\"\n", fn);
-       if (n > 0)
-               hexdump(contents, buff, n > 512 ? 512 : n, 0);
-       else {
-               logprintf("  File empty, contents should be:\n");
-               hexdump(buff, NULL, s > 512 ? 512 : s, 0);
-       }
-       failure_finish(NULL);
-       free(contents);
-       return (0);
-}
-
-/* Check the contents of a text file, being tolerant of line endings. */
-int
-assertion_text_file_contents(const char *filename, int line, const char *buff, const char *fn)
-{
-       char *contents;
-       const char *btxt, *ftxt;
-       FILE *f;
-       int n, s;
-
-       assertion_count(filename, line);
-       f = fopen(fn, "r");
-       if (f == NULL) {
-               failure_start(filename, line,
-                   "File doesn't exist: %s", fn);
-               failure_finish(NULL);
-               return (0);
-       }
-       s = (int)strlen(buff);
-       contents = malloc(s * 2 + 128);
-       n = (int)fread(contents, 1, s * 2 + 128 - 1, f);
-       if (n >= 0)
-               contents[n] = '\0';
-       fclose(f);
-       /* Compare texts. */
-       btxt = buff;
-       ftxt = (const char *)contents;
-       while (*btxt != '\0' && *ftxt != '\0') {
-               if (*btxt == *ftxt) {
-                       ++btxt;
-                       ++ftxt;
-                       continue;
-               }
-               if (btxt[0] == '\n' && ftxt[0] == '\r' && ftxt[1] == '\n') {
-                       /* Pass over different new line characters. */
-                       ++btxt;
-                       ftxt += 2;
-                       continue;
-               }
-               break;
-       }
-       if (*btxt == '\0' && *ftxt == '\0') {
-               free(contents);
-               return (1);
-       }
-       failure_start(filename, line, "Contents don't match");
-       logprintf("  file=\"%s\"\n", fn);
-       if (n > 0) {
-               hexdump(contents, buff, n, 0);
-               logprintf("  expected\n", fn);
-               hexdump(buff, contents, s, 0);
-       } else {
-               logprintf("  File empty, contents should be:\n");
-               hexdump(buff, NULL, s, 0);
-       }
-       failure_finish(NULL);
-       free(contents);
-       return (0);
-}
-
-/* Verify that a text file contains the specified lines, regardless of order */
-/* This could be more efficient if we sorted both sets of lines, etc, but
- * since this is used only for testing and only ever deals with a dozen or so
- * lines at a time, this relatively crude approach is just fine. */
-int
-assertion_file_contains_lines_any_order(const char *file, int line,
-    const char *pathname, const char *lines[])
-{
-       char *buff;
-       size_t buff_size;
-       size_t expected_count, actual_count, i, j;
-       char **expected = NULL;
-       char *p, **actual = NULL;
-       char c;
-       int expected_failure = 0, actual_failure = 0;
-
-       assertion_count(file, line);
-
-       buff = slurpfile(&buff_size, "%s", pathname);
-       if (buff == NULL) {
-               failure_start(pathname, line, "Can't read file: %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-
-       /* Make a copy of the provided lines and count up the expected
-        * file size. */
-       for (i = 0; lines[i] != NULL; ++i) {
-       }
-       expected_count = i;
-       if (expected_count) {
-               expected = malloc(sizeof(char *) * expected_count);
-               if (expected == NULL) {
-                       failure_start(pathname, line, "Can't allocate memory");
-                       failure_finish(NULL);
-                       free(expected);
-                       return (0);
-               }
-               for (i = 0; lines[i] != NULL; ++i) {
-                       expected[i] = strdup(lines[i]);
-               }
-       }
-
-       /* Break the file into lines */
-       actual_count = 0;
-       for (c = '\0', p = buff; p < buff + buff_size; ++p) {
-               if (*p == '\x0d' || *p == '\x0a')
-                       *p = '\0';
-               if (c == '\0' && *p != '\0')
-                       ++actual_count;
-               c = *p;
-       }
-       if (actual_count) {
-               actual = calloc(sizeof(char *), actual_count);
-               if (actual == NULL) {
-                       failure_start(pathname, line, "Can't allocate memory");
-                       failure_finish(NULL);
-                       free(expected);
-                       return (0);
-               }
-               for (j = 0, p = buff; p < buff + buff_size;
-                   p += 1 + strlen(p)) {
-                       if (*p != '\0') {
-                               actual[j] = p;
-                               ++j;
-                       }
-               }
-       }
-
-       /* Erase matching lines from both lists */
-       for (i = 0; i < expected_count; ++i) {
-               if (expected[i] == NULL)
-                       continue;
-               for (j = 0; j < actual_count; ++j) {
-                       if (actual[j] == NULL)
-                               continue;
-                       if (strcmp(expected[i], actual[j]) == 0) {
-                               free(expected[i]);
-                               expected[i] = NULL;
-                               actual[j] = NULL;
-                               break;
-                       }
-               }
-       }
-
-       /* If there's anything left, it's a failure */
-       for (i = 0; i < expected_count; ++i) {
-               if (expected[i] != NULL)
-                       ++expected_failure;
-       }
-       for (j = 0; j < actual_count; ++j) {
-               if (actual[j] != NULL)
-                       ++actual_failure;
-       }
-       if (expected_failure == 0 && actual_failure == 0) {
-               free(buff);
-               free(expected);
-               free(actual);
-               return (1);
-       }
-       failure_start(file, line, "File doesn't match: %s", pathname);
-       for (i = 0; i < expected_count; ++i) {
-               if (expected[i] != NULL) {
-                       logprintf("  Expected but not present: %s\n", expected[i]);
-                       free(expected[i]);
-               }
-       }
-       for (j = 0; j < actual_count; ++j) {
-               if (actual[j] != NULL)
-                       logprintf("  Present but not expected: %s\n", actual[j]);
-       }
-       failure_finish(NULL);
-       free(buff);
-       free(expected);
-       free(actual);
-       return (0);
-}
-
-/* Verify that a text file does not contains the specified strings */
-int
-assertion_file_contains_no_invalid_strings(const char *file, int line,
-    const char *pathname, const char *strings[])
-{
-       char *buff;
-       int i;
-
-       buff = slurpfile(NULL, "%s", pathname);
-       if (buff == NULL) {
-               failure_start(file, line, "Can't read file: %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-
-       for (i = 0; strings[i] != NULL; ++i) {
-               if (strstr(buff, strings[i]) != NULL) {
-                       failure_start(file, line, "Invalid string in %s: %s", pathname,
-                           strings[i]);
-                       failure_finish(NULL);
-                       free(buff);
-                       return(0);
-               }
-       }
-
-       free(buff);
-       return (0);
-}
-
-/* Test that two paths point to the same file. */
-/* As a side-effect, asserts that both files exist. */
-static int
-is_hardlink(const char *file, int line,
-    const char *path1, const char *path2)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       BY_HANDLE_FILE_INFORMATION bhfi1, bhfi2;
-       int r;
-
-       assertion_count(file, line);
-       r = my_GetFileInformationByName(path1, &bhfi1);
-       if (r == 0) {
-               failure_start(file, line, "File %s can't be inspected?", path1);
-               failure_finish(NULL);
-               return (0);
-       }
-       r = my_GetFileInformationByName(path2, &bhfi2);
-       if (r == 0) {
-               failure_start(file, line, "File %s can't be inspected?", path2);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (bhfi1.dwVolumeSerialNumber == bhfi2.dwVolumeSerialNumber
-               && bhfi1.nFileIndexHigh == bhfi2.nFileIndexHigh
-               && bhfi1.nFileIndexLow == bhfi2.nFileIndexLow);
-#else
-       struct stat st1, st2;
-       int r;
-
-       assertion_count(file, line);
-       r = lstat(path1, &st1);
-       if (r != 0) {
-               failure_start(file, line, "File should exist: %s", path1);
-               failure_finish(NULL);
-               return (0);
-       }
-       r = lstat(path2, &st2);
-       if (r != 0) {
-               failure_start(file, line, "File should exist: %s", path2);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (st1.st_ino == st2.st_ino && st1.st_dev == st2.st_dev);
-#endif
-}
-
-int
-assertion_is_hardlink(const char *file, int line,
-    const char *path1, const char *path2)
-{
-       if (is_hardlink(file, line, path1, path2))
-               return (1);
-       failure_start(file, line,
-           "Files %s and %s are not hardlinked", path1, path2);
-       failure_finish(NULL);
-       return (0);
-}
-
-int
-assertion_is_not_hardlink(const char *file, int line,
-    const char *path1, const char *path2)
-{
-       if (!is_hardlink(file, line, path1, path2))
-               return (1);
-       failure_start(file, line,
-           "Files %s and %s should not be hardlinked", path1, path2);
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Verify a/b/mtime of 'pathname'. */
-/* If 'recent', verify that it's within last 10 seconds. */
-static int
-assertion_file_time(const char *file, int line,
-    const char *pathname, long t, long nsec, char type, int recent)
-{
-       long long filet, filet_nsec;
-       int r;
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#define EPOC_TIME      (116444736000000000ULL)
-       FILETIME fxtime, fbirthtime, fatime, fmtime;
-       ULARGE_INTEGER wintm;
-       HANDLE h;
-       fxtime.dwLowDateTime = 0;
-       fxtime.dwHighDateTime = 0;
-
-       assertion_count(file, line);
-       /* Note: FILE_FLAG_BACKUP_SEMANTICS applies to open
-        * a directory file. If not, CreateFile() will fail when
-        * the pathname is a directory. */
-       h = CreateFile(pathname, FILE_READ_ATTRIBUTES, 0, NULL,
-           OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
-       if (h == INVALID_HANDLE_VALUE) {
-               failure_start(file, line, "Can't access %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       r = GetFileTime(h, &fbirthtime, &fatime, &fmtime);
-       switch (type) {
-       case 'a': fxtime = fatime; break;
-       case 'b': fxtime = fbirthtime; break;
-       case 'm': fxtime = fmtime; break;
-       }
-       CloseHandle(h);
-       if (r == 0) {
-               failure_start(file, line, "Can't GetFileTime %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       wintm.LowPart = fxtime.dwLowDateTime;
-       wintm.HighPart = fxtime.dwHighDateTime;
-       filet = (wintm.QuadPart - EPOC_TIME) / 10000000;
-       filet_nsec = ((wintm.QuadPart - EPOC_TIME) % 10000000) * 100;
-       nsec = (nsec / 100) * 100; /* Round the request */
-#else
-       struct stat st;
-
-       assertion_count(file, line);
-       r = lstat(pathname, &st);
-       if (r != 0) {
-               failure_start(file, line, "Can't stat %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       switch (type) {
-       case 'a': filet = st.st_atime; break;
-       case 'm': filet = st.st_mtime; break;
-       case 'b': filet = 0; break;
-       default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
-               exit(1);
-       }
-#if defined(__FreeBSD__)
-       switch (type) {
-       case 'a': filet_nsec = st.st_atimespec.tv_nsec; break;
-       case 'b': filet = st.st_birthtime;
-               /* FreeBSD filesystems that don't support birthtime
-                * (e.g., UFS1) always return -1 here. */
-               if (filet == -1) {
-                       return (1);
-               }
-               filet_nsec = st.st_birthtimespec.tv_nsec; break;
-       case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break;
-       default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
-               exit(1);
-       }
-       /* FreeBSD generally only stores to microsecond res, so round. */
-       filet_nsec = (filet_nsec / 1000) * 1000;
-       nsec = (nsec / 1000) * 1000;
-#else
-       filet_nsec = nsec = 0;  /* Generic POSIX only has whole seconds. */
-       if (type == 'b') return (1); /* Generic POSIX doesn't have birthtime */
-#if defined(__HAIKU__)
-       if (type == 'a') return (1); /* Haiku doesn't have atime. */
-#endif
-#endif
-#endif
-       if (recent) {
-               /* Check that requested time is up-to-date. */
-               time_t now = time(NULL);
-               if (filet < now - 10 || filet > now + 1) {
-                       failure_start(file, line,
-                           "File %s has %ctime %lld, %lld seconds ago\n",
-                           pathname, type, filet, now - filet);
-                       failure_finish(NULL);
-                       return (0);
-               }
-       } else if (filet != t || filet_nsec != nsec) {
-               failure_start(file, line,
-                   "File %s has %ctime %lld.%09lld, expected %lld.%09lld",
-                   pathname, type, filet, filet_nsec, t, nsec);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (1);
-}
-
-/* Verify atime of 'pathname'. */
-int
-assertion_file_atime(const char *file, int line,
-    const char *pathname, long t, long nsec)
-{
-       return assertion_file_time(file, line, pathname, t, nsec, 'a', 0);
-}
-
-/* Verify atime of 'pathname' is up-to-date. */
-int
-assertion_file_atime_recent(const char *file, int line, const char *pathname)
-{
-       return assertion_file_time(file, line, pathname, 0, 0, 'a', 1);
-}
-
-/* Verify birthtime of 'pathname'. */
-int
-assertion_file_birthtime(const char *file, int line,
-    const char *pathname, long t, long nsec)
-{
-       return assertion_file_time(file, line, pathname, t, nsec, 'b', 0);
-}
-
-/* Verify birthtime of 'pathname' is up-to-date. */
-int
-assertion_file_birthtime_recent(const char *file, int line,
-    const char *pathname)
-{
-       return assertion_file_time(file, line, pathname, 0, 0, 'b', 1);
-}
-
-/* Verify mode of 'pathname'. */
-int
-assertion_file_mode(const char *file, int line, const char *pathname, int expected_mode)
-{
-       int mode;
-       int r;
-
-       assertion_count(file, line);
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       failure_start(file, line, "assertFileMode not yet implemented for Windows");
-       (void)mode; /* UNUSED */
-       (void)r; /* UNUSED */
-#else
-       {
-               struct stat st;
-               r = lstat(pathname, &st);
-               mode = (int)(st.st_mode & 0777);
-       }
-       if (r == 0 && mode == expected_mode)
-                       return (1);
-       failure_start(file, line, "File %s has mode %o, expected %o",
-           pathname, mode, expected_mode);
-#endif
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Verify mtime of 'pathname'. */
-int
-assertion_file_mtime(const char *file, int line,
-    const char *pathname, long t, long nsec)
-{
-       return assertion_file_time(file, line, pathname, t, nsec, 'm', 0);
-}
-
-/* Verify mtime of 'pathname' is up-to-date. */
-int
-assertion_file_mtime_recent(const char *file, int line, const char *pathname)
-{
-       return assertion_file_time(file, line, pathname, 0, 0, 'm', 1);
-}
-
-/* Verify number of links to 'pathname'. */
-int
-assertion_file_nlinks(const char *file, int line,
-    const char *pathname, int nlinks)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       BY_HANDLE_FILE_INFORMATION bhfi;
-       int r;
-
-       assertion_count(file, line);
-       r = my_GetFileInformationByName(pathname, &bhfi);
-       if (r != 0 && bhfi.nNumberOfLinks == (DWORD)nlinks)
-               return (1);
-       failure_start(file, line, "File %s has %d links, expected %d",
-           pathname, bhfi.nNumberOfLinks, nlinks);
-       failure_finish(NULL);
-       return (0);
-#else
-       struct stat st;
-       int r;
-
-       assertion_count(file, line);
-       r = lstat(pathname, &st);
-       if (r == 0 && (int)st.st_nlink == nlinks)
-               return (1);
-       failure_start(file, line, "File %s has %d links, expected %d",
-           pathname, st.st_nlink, nlinks);
-       failure_finish(NULL);
-       return (0);
-#endif
-}
-
-/* Verify size of 'pathname'. */
-int
-assertion_file_size(const char *file, int line, const char *pathname, long size)
-{
-       int64_t filesize;
-       int r;
-
-       assertion_count(file, line);
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       {
-               BY_HANDLE_FILE_INFORMATION bhfi;
-               r = !my_GetFileInformationByName(pathname, &bhfi);
-               filesize = ((int64_t)bhfi.nFileSizeHigh << 32) + bhfi.nFileSizeLow;
-       }
-#else
-       {
-               struct stat st;
-               r = lstat(pathname, &st);
-               filesize = st.st_size;
-       }
-#endif
-       if (r == 0 && filesize == size)
-                       return (1);
-       failure_start(file, line, "File %s has size %ld, expected %ld",
-           pathname, (long)filesize, (long)size);
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Assert that 'pathname' is a dir.  If mode >= 0, verify that too. */
-int
-assertion_is_dir(const char *file, int line, const char *pathname, int mode)
-{
-       struct stat st;
-       int r;
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       (void)mode; /* UNUSED */
-#endif
-       assertion_count(file, line);
-       r = lstat(pathname, &st);
-       if (r != 0) {
-               failure_start(file, line, "Dir should exist: %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (!S_ISDIR(st.st_mode)) {
-               failure_start(file, line, "%s is not a dir", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-#if !defined(_WIN32) || defined(__CYGWIN__)
-       /* Windows doesn't handle permissions the same way as POSIX,
-        * so just ignore the mode tests. */
-       /* TODO: Can we do better here? */
-       if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) {
-               failure_start(file, line, "Dir %s has wrong mode", pathname);
-               logprintf("  Expected: 0%3o\n", mode);
-               logprintf("  Found: 0%3o\n", st.st_mode & 07777);
-               failure_finish(NULL);
-               return (0);
-       }
-#endif
-       return (1);
-}
-
-/* Verify that 'pathname' is a regular file.  If 'mode' is >= 0,
- * verify that too. */
-int
-assertion_is_reg(const char *file, int line, const char *pathname, int mode)
-{
-       struct stat st;
-       int r;
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       (void)mode; /* UNUSED */
-#endif
-       assertion_count(file, line);
-       r = lstat(pathname, &st);
-       if (r != 0 || !S_ISREG(st.st_mode)) {
-               failure_start(file, line, "File should exist: %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-#if !defined(_WIN32) || defined(__CYGWIN__)
-       /* Windows doesn't handle permissions the same way as POSIX,
-        * so just ignore the mode tests. */
-       /* TODO: Can we do better here? */
-       if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) {
-               failure_start(file, line, "File %s has wrong mode", pathname);
-               logprintf("  Expected: 0%3o\n", mode);
-               logprintf("  Found: 0%3o\n", st.st_mode & 07777);
-               failure_finish(NULL);
-               return (0);
-       }
-#endif
-       return (1);
-}
-
-/* Check whether 'pathname' is a symbolic link.  If 'contents' is
- * non-NULL, verify that the symlink has those contents. */
-static int
-is_symlink(const char *file, int line,
-    const char *pathname, const char *contents)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       (void)pathname; /* UNUSED */
-       (void)contents; /* UNUSED */
-       assertion_count(file, line);
-       /* Windows sort-of has real symlinks, but they're only usable
-        * by privileged users and are crippled even then, so there's
-        * really not much point in bothering with this. */
-       return (0);
-#else
-       char buff[300];
-       struct stat st;
-       ssize_t linklen;
-       int r;
-
-       assertion_count(file, line);
-       r = lstat(pathname, &st);
-       if (r != 0) {
-               failure_start(file, line,
-                   "Symlink should exist: %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (!S_ISLNK(st.st_mode))
-               return (0);
-       if (contents == NULL)
-               return (1);
-       linklen = readlink(pathname, buff, sizeof(buff));
-       if (linklen < 0) {
-               failure_start(file, line, "Can't read symlink %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       buff[linklen] = '\0';
-       if (strcmp(buff, contents) != 0)
-               return (0);
-       return (1);
-#endif
-}
-
-/* Assert that path is a symlink that (optionally) contains contents. */
-int
-assertion_is_symlink(const char *file, int line,
-    const char *path, const char *contents)
-{
-       if (is_symlink(file, line, path, contents))
-               return (1);
-       if (contents)
-               failure_start(file, line, "File %s is not a symlink to %s",
-                   path, contents);
-       else
-               failure_start(file, line, "File %s is not a symlink", path);
-       failure_finish(NULL);
-       return (0);
-}
-
-
-/* Create a directory and report any errors. */
-int
-assertion_make_dir(const char *file, int line, const char *dirname, int mode)
-{
-       assertion_count(file, line);
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       (void)mode; /* UNUSED */
-       if (0 == _mkdir(dirname))
-               return (1);
-#else
-       if (0 == mkdir(dirname, mode)) {
-               if (0 == chmod(dirname, mode)) {
-                       assertion_file_mode(file, line, dirname, mode);
-                       return (1);
-               }
-       }
-#endif
-       failure_start(file, line, "Could not create directory %s", dirname);
-       failure_finish(NULL);
-       return(0);
-}
-
-/* Create a file with the specified contents and report any failures. */
-int
-assertion_make_file(const char *file, int line,
-    const char *path, int mode, int csize, const void *contents)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       /* TODO: Rework this to set file mode as well. */
-       FILE *f;
-       (void)mode; /* UNUSED */
-       assertion_count(file, line);
-       f = fopen(path, "wb");
-       if (f == NULL) {
-               failure_start(file, line, "Could not create file %s", path);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (contents != NULL) {
-               size_t wsize;
-
-               if (csize < 0)
-                       wsize = strlen(contents);
-               else
-                       wsize = (size_t)csize;
-               if (wsize != fwrite(contents, 1, wsize, f)) {
-                       fclose(f);
-                       failure_start(file, line,
-                           "Could not write file %s", path);
-                       failure_finish(NULL);
-                       return (0);
-               }
-       }
-       fclose(f);
-       return (1);
-#else
-       int fd;
-       assertion_count(file, line);
-       fd = open(path, O_CREAT | O_WRONLY, mode >= 0 ? mode : 0644);
-       if (fd < 0) {
-               failure_start(file, line, "Could not create %s", path);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (0 != chmod(path, mode)) {
-               failure_start(file, line, "Could not chmod %s", path);
-               failure_finish(NULL);
-               close(fd);
-               return (0);
-       }
-       if (contents != NULL) {
-               ssize_t wsize;
-
-               if (csize < 0)
-                       wsize = (ssize_t)strlen(contents);
-               else
-                       wsize = (ssize_t)csize;
-               if (wsize != write(fd, contents, wsize)) {
-                       close(fd);
-                       failure_start(file, line,
-                           "Could not write to %s", path);
-                       failure_finish(NULL);
-                       close(fd);
-                       return (0);
-               }
-       }
-       close(fd);
-       assertion_file_mode(file, line, path, mode);
-       return (1);
-#endif
-}
-
-/* Create a hardlink and report any failures. */
-int
-assertion_make_hardlink(const char *file, int line,
-    const char *newpath, const char *linkto)
-{
-       int succeeded;
-
-       assertion_count(file, line);
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       succeeded = my_CreateHardLinkA(newpath, linkto);
-#elif HAVE_LINK
-       succeeded = !link(linkto, newpath);
-#else
-       succeeded = 0;
-#endif
-       if (succeeded)
-               return (1);
-       failure_start(file, line, "Could not create hardlink");
-       logprintf("   New link: %s\n", newpath);
-       logprintf("   Old name: %s\n", linkto);
-       failure_finish(NULL);
-       return(0);
-}
-
-/* Create a symlink and report any failures. */
-int
-assertion_make_symlink(const char *file, int line,
-    const char *newpath, const char *linkto)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       int targetIsDir = 0;  /* TODO: Fix this */
-       assertion_count(file, line);
-       if (my_CreateSymbolicLinkA(newpath, linkto, targetIsDir))
-               return (1);
-#elif HAVE_SYMLINK
-       assertion_count(file, line);
-       if (0 == symlink(linkto, newpath))
-               return (1);
-#endif
-       failure_start(file, line, "Could not create symlink");
-       logprintf("   New link: %s\n", newpath);
-       logprintf("   Old name: %s\n", linkto);
-       failure_finish(NULL);
-       return(0);
-}
-
-/* Set umask, report failures. */
-int
-assertion_umask(const char *file, int line, int mask)
-{
-       assertion_count(file, line);
-       (void)file; /* UNUSED */
-       (void)line; /* UNUSED */
-       umask(mask);
-       return (1);
-}
-
-/* Set times, report failures. */
-int
-assertion_utimes(const char *file, int line,
-    const char *pathname, long at, long at_nsec, long mt, long mt_nsec)
-{
-       int r;
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#define WINTIME(sec, nsec) ((Int32x32To64(sec, 10000000) + EPOC_TIME)\
-        + (((nsec)/1000)*10))
-       HANDLE h;
-       ULARGE_INTEGER wintm;
-       FILETIME fatime, fmtime;
-       FILETIME *pat, *pmt;
-
-       assertion_count(file, line);
-       h = CreateFileA(pathname,GENERIC_READ | GENERIC_WRITE,
-                   FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
-                   FILE_FLAG_BACKUP_SEMANTICS, NULL);
-       if (h == INVALID_HANDLE_VALUE) {
-               failure_start(file, line, "Can't access %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-
-       if (at > 0 || at_nsec > 0) {
-               wintm.QuadPart = WINTIME(at, at_nsec);
-               fatime.dwLowDateTime = wintm.LowPart;
-               fatime.dwHighDateTime = wintm.HighPart;
-               pat = &fatime;
-       } else
-               pat = NULL;
-       if (mt > 0 || mt_nsec > 0) {
-               wintm.QuadPart = WINTIME(mt, mt_nsec);
-               fmtime.dwLowDateTime = wintm.LowPart;
-               fmtime.dwHighDateTime = wintm.HighPart;
-               pmt = &fmtime;
-       } else
-               pmt = NULL;
-       if (pat != NULL || pmt != NULL)
-               r = SetFileTime(h, NULL, pat, pmt);
-       else
-               r = 1;
-       CloseHandle(h);
-       if (r == 0) {
-               failure_start(file, line, "Can't SetFileTime %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (1);
-#else /* defined(_WIN32) && !defined(__CYGWIN__) */
-       struct stat st;
-       struct timeval times[2];
-
-#if !defined(__FreeBSD__)
-       mt_nsec = at_nsec = 0;  /* Generic POSIX only has whole seconds. */
-#endif
-       if (mt == 0 && mt_nsec == 0 && at == 0 && at_nsec == 0)
-               return (1);
-
-       r = lstat(pathname, &st);
-       if (r < 0) {
-               failure_start(file, line, "Can't stat %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-
-       if (mt == 0 && mt_nsec == 0) {
-               mt = st.st_mtime;
-#if defined(__FreeBSD__)
-               mt_nsec = st.st_mtimespec.tv_nsec;
-               /* FreeBSD generally only stores to microsecond res, so round. */
-               mt_nsec = (mt_nsec / 1000) * 1000;
-#endif
-       }
-       if (at == 0 && at_nsec == 0) {
-               at = st.st_atime;
-#if defined(__FreeBSD__)
-               at_nsec = st.st_atimespec.tv_nsec;
-               /* FreeBSD generally only stores to microsecond res, so round. */
-               at_nsec = (at_nsec / 1000) * 1000;
-#endif
-       }
-
-       times[1].tv_sec = mt;
-       times[1].tv_usec = mt_nsec / 1000;
-
-       times[0].tv_sec = at;
-       times[0].tv_usec = at_nsec / 1000;
-
-#ifdef HAVE_LUTIMES
-       r = lutimes(pathname, times);
-#else
-       r = utimes(pathname, times);
-#endif
-       if (r < 0) {
-               failure_start(file, line, "Can't utimes %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (1);
-#endif /* defined(_WIN32) && !defined(__CYGWIN__) */
-}
-
-/* Set nodump, report failures. */
-int
-assertion_nodump(const char *file, int line, const char *pathname)
-{
-#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP)
-       int r;
-
-       assertion_count(file, line);
-       r = chflags(pathname, UF_NODUMP);
-       if (r < 0) {
-               failure_start(file, line, "Can't set nodump %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-#elif defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS)\
-        && defined(EXT2_NODUMP_FL)
-       int fd, r, flags;
-
-       assertion_count(file, line);
-       fd = open(pathname, O_RDONLY | O_NONBLOCK);
-       if (fd < 0) {
-               failure_start(file, line, "Can't open %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       r = ioctl(fd, EXT2_IOC_GETFLAGS, &flags);
-       if (r < 0) {
-               failure_start(file, line, "Can't get flags %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       flags |= EXT2_NODUMP_FL;
-       r = ioctl(fd, EXT2_IOC_SETFLAGS, &flags);
-       if (r < 0) {
-               failure_start(file, line, "Can't set nodump %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       close(fd);
-#else
-       (void)pathname; /* UNUSED */
-       assertion_count(file, line);
-#endif
-       return (1);
-}
-
-/*
- *
- *  UTILITIES for use by tests.
- *
- */
-
-/*
- * Check whether platform supports symlinks.  This is intended
- * for tests to use in deciding whether to bother testing symlink
- * support; if the platform doesn't support symlinks, there's no point
- * in checking whether the program being tested can create them.
- *
- * Note that the first time this test is called, we actually go out to
- * disk to create and verify a symlink.  This is necessary because
- * symlink support is actually a property of a particular filesystem
- * and can thus vary between directories on a single system.  After
- * the first call, this returns the cached result from memory, so it's
- * safe to call it as often as you wish.
- */
-int
-canSymlink(void)
-{
-       /* Remember the test result */
-       static int value = 0, tested = 0;
-       if (tested)
-               return (value);
-
-       ++tested;
-       assertion_make_file(__FILE__, __LINE__, "canSymlink.0", 0644, 1, "a");
-       /* Note: Cygwin has its own symlink() emulation that does not
-        * use the Win32 CreateSymbolicLink() function. */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       value = my_CreateSymbolicLinkA("canSymlink.1", "canSymlink.0", 0)
-           && is_symlink(__FILE__, __LINE__, "canSymlink.1", "canSymlink.0");
-#elif HAVE_SYMLINK
-       value = (0 == symlink("canSymlink.0", "canSymlink.1"))
-           && is_symlink(__FILE__, __LINE__, "canSymlink.1","canSymlink.0");
-#endif
-       return (value);
-}
-
-/* Platform-dependent options for hiding the output of a subcommand. */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-static const char *redirectArgs = ">NUL 2>NUL"; /* Win32 cmd.exe */
-#else
-static const char *redirectArgs = ">/dev/null 2>/dev/null"; /* POSIX 'sh' */
-#endif
-/*
- * Can this platform run the bzip2 program?
- */
-int
-canBzip2(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("bzip2 -d -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the grzip program?
- */
-int
-canGrzip(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("grzip -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the gzip program?
- */
-int
-canGzip(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("gzip -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the lrzip program?
- */
-int
-canRunCommand(const char *cmd)
-{
-  static int tested = 0, value = 0;
-  if (!tested) {
-    tested = 1;
-    if (systemf("%s %s", cmd, redirectArgs) == 0)
-      value = 1;
-  }
-  return (value);
-}
-
-int
-canLrzip(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("lrzip -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the lz4 program?
- */
-int
-canLz4(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("lz4 -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the lzip program?
- */
-int
-canLzip(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("lzip -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the lzma program?
- */
-int
-canLzma(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("lzma -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the lzop program?
- */
-int
-canLzop(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("lzop -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the xz program?
- */
-int
-canXz(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("xz -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this filesystem handle nodump flags.
- */
-#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP)
-
-int
-canNodump(void)
-{
-       const char *path = "cannodumptest";
-       struct stat sb;
-
-       assertion_make_file(__FILE__, __LINE__, path, 0644, 0, NULL);
-       if (chflags(path, UF_NODUMP) < 0)
-               return (0);
-       if (stat(path, &sb) < 0)
-               return (0);
-       if (sb.st_flags & UF_NODUMP)
-               return (1);
-       return (0);
-}
-
-#elif defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS)\
-        && defined(EXT2_NODUMP_FL)
-
-int
-canNodump(void)
-{
-       const char *path = "cannodumptest";
-       int fd, r, flags;
-
-       assertion_make_file(__FILE__, __LINE__, path, 0644, 0, NULL);
-       fd = open(path, O_RDONLY | O_NONBLOCK);
-       if (fd < 0)
-               return (0);
-       r = ioctl(fd, EXT2_IOC_GETFLAGS, &flags);
-       if (r < 0)
-               return (0);
-       flags |= EXT2_NODUMP_FL;
-       r = ioctl(fd, EXT2_IOC_SETFLAGS, &flags);
-       if (r < 0)
-               return (0);
-       close(fd);
-       fd = open(path, O_RDONLY | O_NONBLOCK);
-       if (fd < 0)
-               return (0);
-       r = ioctl(fd, EXT2_IOC_GETFLAGS, &flags);
-       if (r < 0)
-               return (0);
-       close(fd);
-       if (flags & EXT2_NODUMP_FL)
-               return (1);
-       return (0);
-}
-
-#else
-
-int
-canNodump()
-{
-       return (0);
-}
-
-#endif
-
-/*
- * Sleep as needed; useful for verifying disk timestamp changes by
- * ensuring that the wall-clock time has actually changed before we
- * go back to re-read something from disk.
- */
-void
-sleepUntilAfter(time_t t)
-{
-       while (t >= time(NULL))
-#if defined(_WIN32) && !defined(__CYGWIN__)
-               Sleep(500);
-#else
-               sleep(1);
-#endif
-}
-
-/*
- * Call standard system() call, but build up the command line using
- * sprintf() conventions.
- */
-int
-systemf(const char *fmt, ...)
-{
-       char buff[8192];
-       va_list ap;
-       int r;
-
-       va_start(ap, fmt);
-       vsprintf(buff, fmt, ap);
-       if (verbosity > VERBOSITY_FULL)
-               logprintf("Cmd: %s\n", buff);
-       r = system(buff);
-       va_end(ap);
-       return (r);
-}
-
-/*
- * Slurp a file into memory for ease of comparison and testing.
- * Returns size of file in 'sizep' if non-NULL, null-terminates
- * data in memory for ease of use.
- */
-char *
-slurpfile(size_t * sizep, const char *fmt, ...)
-{
-       char filename[8192];
-       struct stat st;
-       va_list ap;
-       char *p;
-       ssize_t bytes_read;
-       FILE *f;
-       int r;
-
-       va_start(ap, fmt);
-       vsprintf(filename, fmt, ap);
-       va_end(ap);
-
-       f = fopen(filename, "rb");
-       if (f == NULL) {
-               /* Note: No error; non-existent file is okay here. */
-               return (NULL);
-       }
-       r = fstat(fileno(f), &st);
-       if (r != 0) {
-               logprintf("Can't stat file %s\n", filename);
-               fclose(f);
-               return (NULL);
-       }
-       p = malloc((size_t)st.st_size + 1);
-       if (p == NULL) {
-               logprintf("Can't allocate %ld bytes of memory to read file %s\n",
-                   (long int)st.st_size, filename);
-               fclose(f);
-               return (NULL);
-       }
-       bytes_read = fread(p, 1, (size_t)st.st_size, f);
-       if (bytes_read < st.st_size) {
-               logprintf("Can't read file %s\n", filename);
-               fclose(f);
-               free(p);
-               return (NULL);
-       }
-       p[st.st_size] = '\0';
-       if (sizep != NULL)
-               *sizep = (size_t)st.st_size;
-       fclose(f);
-       return (p);
-}
-
-/*
- * Slurp a file into memory for ease of comparison and testing.
- * Returns size of file in 'sizep' if non-NULL, null-terminates
- * data in memory for ease of use.
- */
-void
-dumpfile(const char *filename, void *data, size_t len)
-{
-       ssize_t bytes_written;
-       FILE *f;
-
-       f = fopen(filename, "wb");
-       if (f == NULL) {
-               logprintf("Can't open file %s for writing\n", filename);
-               return;
-       }
-       bytes_written = fwrite(data, 1, len, f);
-       if (bytes_written < (ssize_t)len)
-               logprintf("Can't write file %s\n", filename);
-       fclose(f);
-}
-
-/* Read a uuencoded file from the reference directory, decode, and
- * write the result into the current directory. */
-#define VALID_UUDECODE(c) (c >= 32 && c <= 96)
-#define        UUDECODE(c) (((c) - 0x20) & 0x3f)
-void
-extract_reference_file(const char *name)
-{
-       char buff[1024];
-       FILE *in, *out;
-
-       sprintf(buff, "%s/%s.uu", refdir, name);
-       in = fopen(buff, "r");
-       failure("Couldn't open reference file %s", buff);
-       assert(in != NULL);
-       if (in == NULL)
-               return;
-       /* Read up to and including the 'begin' line. */
-       for (;;) {
-               if (fgets(buff, sizeof(buff), in) == NULL) {
-                       /* TODO: This is a failure. */
-                       return;
-               }
-               if (memcmp(buff, "begin ", 6) == 0)
-                       break;
-       }
-       /* Now, decode the rest and write it. */
-       out = fopen(name, "wb");
-       while (fgets(buff, sizeof(buff), in) != NULL) {
-               char *p = buff;
-               int bytes;
-
-               if (memcmp(buff, "end", 3) == 0)
-                       break;
-
-               bytes = UUDECODE(*p++);
-               while (bytes > 0) {
-                       int n = 0;
-                       /* Write out 1-3 bytes from that. */
-                       if (bytes > 0) {
-                               assert(VALID_UUDECODE(p[0]));
-                               assert(VALID_UUDECODE(p[1]));
-                               n = UUDECODE(*p++) << 18;
-                               n |= UUDECODE(*p++) << 12;
-                               fputc(n >> 16, out);
-                               --bytes;
-                       }
-                       if (bytes > 0) {
-                               assert(VALID_UUDECODE(p[0]));
-                               n |= UUDECODE(*p++) << 6;
-                               fputc((n >> 8) & 0xFF, out);
-                               --bytes;
-                       }
-                       if (bytes > 0) {
-                               assert(VALID_UUDECODE(p[0]));
-                               n |= UUDECODE(*p++);
-                               fputc(n & 0xFF, out);
-                               --bytes;
-                       }
-               }
-       }
-       fclose(out);
-       fclose(in);
-}
-
-void
-copy_reference_file(const char *name)
-{
-       char buff[1024];
-       FILE *in, *out;
-       size_t rbytes;
-
-       sprintf(buff, "%s/%s", refdir, name);
-       in = fopen(buff, "rb");
-       failure("Couldn't open reference file %s", buff);
-       assert(in != NULL);
-       if (in == NULL)
-               return;
-       /* Now, decode the rest and write it. */
-       /* Not a lot of error checking here; the input better be right. */
-       out = fopen(name, "wb");
-       while ((rbytes = fread(buff, 1, sizeof(buff), in)) > 0) {
-               if (fwrite(buff, 1, rbytes, out) != rbytes) {
-                       logprintf("Error: fwrite\n");
-                       break;
-               }
-       }
-       fclose(out);
-       fclose(in);
-}
-
-int
-is_LargeInode(const char *file)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       BY_HANDLE_FILE_INFORMATION bhfi;
-       int r;
-
-       r = my_GetFileInformationByName(file, &bhfi);
-       if (r != 0)
-               return (0);
-       return (bhfi.nFileIndexHigh & 0x0000FFFFUL);
-#else
-       struct stat st;
-       int64_t ino;
-
-       if (stat(file, &st) < 0)
-               return (0);
-       ino = (int64_t)st.st_ino;
-       return (ino > 0xffffffff);
-#endif
-}
-
-void
-extract_reference_files(const char **names)
-{
-       while (names && *names)
-               extract_reference_file(*names++);
-}
-
-/*
- *
- * TEST management
- *
- */
-
-/*
- * "list.h" is simply created by "grep DEFINE_TEST test_*.c"; it has
- * a line like
- *      DEFINE_TEST(test_function)
- * for each test.
- */
-
-/* Use "list.h" to declare all of the test functions. */
-#undef DEFINE_TEST
-#define        DEFINE_TEST(name) void name(void);
-#include "list.h"
-
-/* Use "list.h" to create a list of all tests (functions and names). */
-#undef DEFINE_TEST
-#define        DEFINE_TEST(n) { n, #n, 0 },
-struct test_list_t tests[] = {
-       #include "list.h"
-};
-
-/*
- * Summarize repeated failures in the just-completed test.
- */
-static void
-test_summarize(int failed, int skips_num)
-{
-       unsigned int i;
-
-       switch (verbosity) {
-       case VERBOSITY_SUMMARY_ONLY:
-               printf(failed ? "E" : ".");
-               fflush(stdout);
-               break;
-       case VERBOSITY_PASSFAIL:
-               printf(failed ? "FAIL\n" : skips_num ? "ok (S)\n" : "ok\n");
-               break;
-       }
-
-       log_console = (verbosity == VERBOSITY_LIGHT_REPORT);
-
-       for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) {
-               if (failed_lines[i].count > 1 && !failed_lines[i].skip)
-                       logprintf("%s:%d: Summary: Failed %d times\n",
-                           failed_filename, i, failed_lines[i].count);
-       }
-       /* Clear the failure history for the next file. */
-       failed_filename = NULL;
-       memset(failed_lines, 0, sizeof(failed_lines));
-}
-
-/*
- * Actually run a single test, with appropriate setup and cleanup.
- */
-static int
-test_run(int i, const char *tmpdir)
-{
-       char workdir[1024];
-       char logfilename[64];
-       int failures_before = failures;
-       int skips_before = skips;
-       int oldumask;
-
-       switch (verbosity) {
-       case VERBOSITY_SUMMARY_ONLY: /* No per-test reports at all */
-               break;
-       case VERBOSITY_PASSFAIL: /* rest of line will include ok/FAIL marker */
-               printf("%3d: %-64s", i, tests[i].name);
-               fflush(stdout);
-               break;
-       default: /* Title of test, details will follow */
-               printf("%3d: %s\n", i, tests[i].name);
-       }
-
-       /* Chdir to the top-level work directory. */
-       if (!assertChdir(tmpdir)) {
-               fprintf(stderr,
-                   "ERROR: Can't chdir to top work dir %s\n", tmpdir);
-               exit(1);
-       }
-       /* Create a log file for this test. */
-       sprintf(logfilename, "%s.log", tests[i].name);
-       logfile = fopen(logfilename, "w");
-       fprintf(logfile, "%s\n\n", tests[i].name);
-       /* Chdir() to a work dir for this specific test. */
-       snprintf(workdir, sizeof(workdir), "%s/%s", tmpdir, tests[i].name);
-       testworkdir = workdir;
-       if (!assertMakeDir(testworkdir, 0755)
-           || !assertChdir(testworkdir)) {
-               fprintf(stderr,
-                   "ERROR: Can't chdir to work dir %s\n", testworkdir);
-               exit(1);
-       }
-       /* Explicitly reset the locale before each test. */
-       setlocale(LC_ALL, "C");
-       /* Record the umask before we run the test. */
-       umask(oldumask = umask(0));
-       /*
-        * Run the actual test.
-        */
-       (*tests[i].func)();
-       /*
-        * Clean up and report afterwards.
-        */
-       testworkdir = NULL;
-       /* Restore umask */
-       umask(oldumask);
-       /* Reset locale. */
-       setlocale(LC_ALL, "C");
-       /* Reset directory. */
-       if (!assertChdir(tmpdir)) {
-               fprintf(stderr, "ERROR: Couldn't chdir to temp dir %s\n",
-                   tmpdir);
-               exit(1);
-       }
-       /* Report per-test summaries. */
-       tests[i].failures = failures - failures_before;
-       test_summarize(tests[i].failures, skips - skips_before);
-       /* Close the per-test log file. */
-       fclose(logfile);
-       logfile = NULL;
-       /* If there were no failures, we can remove the work dir and logfile. */
-       if (tests[i].failures == 0) {
-               if (!keep_temp_files && assertChdir(tmpdir)) {
-#if defined(_WIN32) && !defined(__CYGWIN__)
-                       /* Make sure not to leave empty directories.
-                        * Sometimes a processing of closing files used by tests
-                        * is not done, then rmdir will be failed and it will
-                        * leave a empty test directory. So we should wait a few
-                        * seconds and retry rmdir. */
-                       int r, t;
-                       for (t = 0; t < 10; t++) {
-                               if (t > 0)
-                                       Sleep(1000);
-                               r = systemf("rmdir /S /Q %s", tests[i].name);
-                               if (r == 0)
-                                       break;
-                       }
-                       systemf("del %s", logfilename);
-#else
-                       systemf("rm -rf %s", tests[i].name);
-                       systemf("rm %s", logfilename);
-#endif
-               }
-       }
-       /* Return appropriate status. */
-       return (tests[i].failures);
-}
-
-/*
- *
- *
- * MAIN and support routines.
- *
- *
- */
-
-static void
-usage(const char *program)
-{
-       static const int limit = sizeof(tests) / sizeof(tests[0]);
-       int i;
-
-       printf("Usage: %s [options] <test> <test> ...\n", program);
-       printf("Default is to run all tests.\n");
-       printf("Otherwise, specify the numbers of the tests you wish to run.\n");
-       printf("Options:\n");
-       printf("  -d  Dump core after any failure, for debugging.\n");
-       printf("  -k  Keep all temp files.\n");
-       printf("      Default: temp files for successful tests deleted.\n");
-#ifdef PROGRAM
-       printf("  -p <path>  Path to executable to be tested.\n");
-       printf("      Default: path taken from " ENVBASE " environment variable.\n");
-#endif
-       printf("  -q  Quiet.\n");
-       printf("  -r <dir>   Path to dir containing reference files.\n");
-       printf("      Default: Current directory.\n");
-       printf("  -u  Keep running specifies tests until one fails.\n");
-       printf("  -v  Verbose.\n");
-       printf("Available tests:\n");
-       for (i = 0; i < limit; i++)
-               printf("  %d: %s\n", i, tests[i].name);
-       exit(1);
-}
-
-static char *
-get_refdir(const char *d)
-{
-       size_t tried_size, buff_size;
-       char *buff, *tried, *pwd = NULL, *p = NULL;
-
-#ifdef PATH_MAX
-       buff_size = PATH_MAX;
-#else
-       buff_size = 8192;
-#endif
-       buff = calloc(buff_size, 1);
-       if (buff == NULL) {
-               fprintf(stderr, "Unable to allocate memory\n");
-               exit(1);
-       }
-
-       /* Allocate a buffer to hold the various directories we checked. */
-       tried_size = buff_size * 2;
-       tried = calloc(tried_size, 1);
-       if (tried == NULL) {
-               fprintf(stderr, "Unable to allocate memory\n");
-               exit(1);
-       }
-
-       /* If a dir was specified, try that */
-       if (d != NULL) {
-               pwd = NULL;
-               snprintf(buff, buff_size, "%s", d);
-               p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-               if (p != NULL) goto success;
-               strncat(tried, buff, tried_size - strlen(tried) - 1);
-               strncat(tried, "\n", tried_size - strlen(tried) - 1);
-               goto failure;
-       }
-
-       /* Get the current dir. */
-#ifdef PATH_MAX
-       pwd = getcwd(NULL, PATH_MAX);/* Solaris getcwd needs the size. */
-#else
-       pwd = getcwd(NULL, 0);
-#endif
-       while (pwd[strlen(pwd) - 1] == '\n')
-               pwd[strlen(pwd) - 1] = '\0';
-
-       /* Look for a known file. */
-       snprintf(buff, buff_size, "%s", pwd);
-       p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-       if (p != NULL) goto success;
-       strncat(tried, buff, tried_size - strlen(tried) - 1);
-       strncat(tried, "\n", tried_size - strlen(tried) - 1);
-
-       snprintf(buff, buff_size, "%s/test", pwd);
-       p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-       if (p != NULL) goto success;
-       strncat(tried, buff, tried_size - strlen(tried) - 1);
-       strncat(tried, "\n", tried_size - strlen(tried) - 1);
-
-#if defined(LIBRARY)
-       snprintf(buff, buff_size, "%s/%s/test", pwd, LIBRARY);
-#else
-       snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM);
-#endif
-       p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-       if (p != NULL) goto success;
-       strncat(tried, buff, tried_size - strlen(tried) - 1);
-       strncat(tried, "\n", tried_size - strlen(tried) - 1);
-
-#if defined(PROGRAM_ALIAS)
-       snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM_ALIAS);
-       p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-       if (p != NULL) goto success;
-       strncat(tried, buff, tried_size - strlen(tried) - 1);
-       strncat(tried, "\n", tried_size - strlen(tried) - 1);
-#endif
-
-       if (memcmp(pwd, "/usr/obj", 8) == 0) {
-               snprintf(buff, buff_size, "%s", pwd + 8);
-               p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-               if (p != NULL) goto success;
-               strncat(tried, buff, tried_size - strlen(tried) - 1);
-               strncat(tried, "\n", tried_size - strlen(tried) - 1);
-
-               snprintf(buff, buff_size, "%s/test", pwd + 8);
-               p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-               if (p != NULL) goto success;
-               strncat(tried, buff, tried_size - strlen(tried) - 1);
-               strncat(tried, "\n", tried_size - strlen(tried) - 1);
-       }
-
-failure:
-       printf("Unable to locate known reference file %s\n", KNOWNREF);
-       printf("  Checked following directories:\n%s\n", tried);
-       printf("Use -r option to specify full path to reference directory\n");
-#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
-       DebugBreak();
-#endif
-       exit(1);
-
-success:
-       free(p);
-       free(pwd);
-       free(tried);
-
-       /* Copy result into a fresh buffer to reduce memory usage. */
-       p = strdup(buff);
-       free(buff);
-       return p;
-}
-
-int
-main(int argc, char **argv)
-{
-       static const int limit = sizeof(tests) / sizeof(tests[0]);
-       int test_set[sizeof(tests) / sizeof(tests[0])];
-       int i = 0, j = 0, tests_run = 0, tests_failed = 0, option;
-       time_t now;
-       char *refdir_alloc = NULL;
-       const char *progname;
-       char **saved_argv;
-       const char *tmp, *option_arg, *p;
-       char tmpdir[256], *pwd, *testprogdir, *tmp2 = NULL, *vlevel = NULL;
-       char tmpdir_timestamp[256];
-
-       (void)argc; /* UNUSED */
-
-       /* Get the current dir. */
-#ifdef PATH_MAX
-       pwd = getcwd(NULL, PATH_MAX);/* Solaris getcwd needs the size. */
-#else
-       pwd = getcwd(NULL, 0);
-#endif
-       while (pwd[strlen(pwd) - 1] == '\n')
-               pwd[strlen(pwd) - 1] = '\0';
-
-#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__)
-       /* To stop to run the default invalid parameter handler. */
-       _set_invalid_parameter_handler(invalid_parameter_handler);
-       /* Disable annoying assertion message box. */
-       _CrtSetReportMode(_CRT_ASSERT, 0);
-#endif
-
-       /*
-        * Name of this program, used to build root of our temp directory
-        * tree.
-        */
-       progname = p = argv[0];
-       if ((testprogdir = (char *)malloc(strlen(progname) + 1)) == NULL)
-       {
-               fprintf(stderr, "ERROR: Out of memory.");
-               exit(1);
-       }
-       strcpy(testprogdir, progname);
-       while (*p != '\0') {
-               /* Support \ or / dir separators for Windows compat. */
-               if (*p == '/' || *p == '\\')
-               {
-                       progname = p + 1;
-                       i = j;
-               }
-               ++p;
-               j++;
-       }
-       testprogdir[i] = '\0';
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       if (testprogdir[0] != '/' && testprogdir[0] != '\\' &&
-           !(((testprogdir[0] >= 'a' && testprogdir[0] <= 'z') ||
-              (testprogdir[0] >= 'A' && testprogdir[0] <= 'Z')) &&
-               testprogdir[1] == ':' &&
-               (testprogdir[2] == '/' || testprogdir[2] == '\\')))
-#else
-       if (testprogdir[0] != '/')
-#endif
-       {
-               /* Fixup path for relative directories. */
-               if ((testprogdir = (char *)realloc(testprogdir,
-                       strlen(pwd) + 1 + strlen(testprogdir) + 1)) == NULL)
-               {
-                       fprintf(stderr, "ERROR: Out of memory.");
-                       exit(1);
-               }
-               memmove(testprogdir + strlen(pwd) + 1, testprogdir,
-                   strlen(testprogdir) + 1);
-               memcpy(testprogdir, pwd, strlen(pwd));
-               testprogdir[strlen(pwd)] = '/';
-       }
-
-#ifdef PROGRAM
-       /* Get the target program from environment, if available. */
-       testprogfile = getenv(ENVBASE);
-#endif
-
-       if (getenv("TMPDIR") != NULL)
-               tmp = getenv("TMPDIR");
-       else if (getenv("TMP") != NULL)
-               tmp = getenv("TMP");
-       else if (getenv("TEMP") != NULL)
-               tmp = getenv("TEMP");
-       else if (getenv("TEMPDIR") != NULL)
-               tmp = getenv("TEMPDIR");
-       else
-               tmp = "/tmp";
-
-       /* Allow -d to be controlled through the environment. */
-       if (getenv(ENVBASE "_DEBUG") != NULL)
-               dump_on_failure = 1;
-
-       /* Allow -v to be controlled through the environment. */
-       if (getenv("_VERBOSITY_LEVEL") != NULL)
-       {
-               vlevel = getenv("_VERBOSITY_LEVEL");
-               verbosity = atoi(vlevel);
-               if (verbosity < VERBOSITY_SUMMARY_ONLY || verbosity > VERBOSITY_FULL)
-               {
-                       /* Unsupported verbosity levels are silently ignored */
-                       vlevel = NULL;
-                       verbosity = VERBOSITY_PASSFAIL;
-               }
-       }
-
-       /* Get the directory holding test files from environment. */
-       refdir = getenv(ENVBASE "_TEST_FILES");
-
-       /*
-        * Parse options, without using getopt(), which isn't available
-        * on all platforms.
-        */
-       ++argv; /* Skip program name */
-       while (*argv != NULL) {
-               if (**argv != '-')
-                       break;
-               p = *argv++;
-               ++p; /* Skip '-' */
-               while (*p != '\0') {
-                       option = *p++;
-                       option_arg = NULL;
-                       /* If 'opt' takes an argument, parse that. */
-                       if (option == 'p' || option == 'r') {
-                               if (*p != '\0')
-                                       option_arg = p;
-                               else if (*argv == NULL) {
-                                       fprintf(stderr,
-                                           "Option -%c requires argument.\n",
-                                           option);
-                                       usage(progname);
-                               } else
-                                       option_arg = *argv++;
-                               p = ""; /* End of this option word. */
-                       }
-
-                       /* Now, handle the option. */
-                       switch (option) {
-                       case 'd':
-                               dump_on_failure = 1;
-                               break;
-                       case 'k':
-                               keep_temp_files = 1;
-                               break;
-                       case 'p':
-#ifdef PROGRAM
-                               testprogfile = option_arg;
-#else
-                               fprintf(stderr, "-p option not permitted\n");
-                               usage(progname);
-#endif
-                               break;
-                       case 'q':
-                               if (!vlevel)
-                                       verbosity--;
-                               break;
-                       case 'r':
-                               refdir = option_arg;
-                               break;
-                       case 'u':
-                               until_failure++;
-                               break;
-                       case 'v':
-                               if (!vlevel)
-                                       verbosity++;
-                               break;
-                       default:
-                               fprintf(stderr, "Unrecognized option '%c'\n",
-                                   option);
-                               usage(progname);
-                       }
-               }
-       }
-
-       /*
-        * Sanity-check that our options make sense.
-        */
-#ifdef PROGRAM
-       if (testprogfile == NULL)
-       {
-               if ((tmp2 = (char *)malloc(strlen(testprogdir) + 1 +
-                       strlen(PROGRAM) + 1)) == NULL)
-               {
-                       fprintf(stderr, "ERROR: Out of memory.");
-                       exit(1);
-               }
-               strcpy(tmp2, testprogdir);
-               strcat(tmp2, "/");
-               strcat(tmp2, PROGRAM);
-               testprogfile = tmp2;
-       }
-
-       {
-               char *testprg;
-#if defined(_WIN32) && !defined(__CYGWIN__)
-               /* Command.com sometimes rejects '/' separators. */
-               testprg = strdup(testprogfile);
-               for (i = 0; testprg[i] != '\0'; i++) {
-                       if (testprg[i] == '/')
-                               testprg[i] = '\\';
-               }
-               testprogfile = testprg;
-#endif
-               /* Quote the name that gets put into shell command lines. */
-               testprg = malloc(strlen(testprogfile) + 3);
-               strcpy(testprg, "\"");
-               strcat(testprg, testprogfile);
-               strcat(testprg, "\"");
-               testprog = testprg;
-       }
-#endif
-
-#if !defined(_WIN32) && defined(SIGPIPE)
-       {   /* Ignore SIGPIPE signals */
-               struct sigaction sa;
-               sa.sa_handler = SIG_IGN;
-               sigemptyset(&sa.sa_mask);
-               sa.sa_flags = 0;
-               sigaction(SIGPIPE, &sa, NULL);
-       }
-#endif
-
-       /*
-        * Create a temp directory for the following tests.
-        * Include the time the tests started as part of the name,
-        * to make it easier to track the results of multiple tests.
-        */
-       now = time(NULL);
-       for (i = 0; ; i++) {
-               strftime(tmpdir_timestamp, sizeof(tmpdir_timestamp),
-                   "%Y-%m-%dT%H.%M.%S",
-                   localtime(&now));
-               sprintf(tmpdir, "%s/%s.%s-%03d", tmp, progname,
-                   tmpdir_timestamp, i);
-               if (assertMakeDir(tmpdir,0755))
-                       break;
-               if (i >= 999) {
-                       fprintf(stderr,
-                           "ERROR: Unable to create temp directory %s\n",
-                           tmpdir);
-                       exit(1);
-               }
-       }
-
-       /*
-        * If the user didn't specify a directory for locating
-        * reference files, try to find the reference files in
-        * the "usual places."
-        */
-       refdir = refdir_alloc = get_refdir(refdir);
-
-       /*
-        * Banner with basic information.
-        */
-       printf("\n");
-       printf("If tests fail or crash, details will be in:\n");
-       printf("   %s\n", tmpdir);
-       printf("\n");
-       if (verbosity > VERBOSITY_SUMMARY_ONLY) {
-               printf("Reference files will be read from: %s\n", refdir);
-#ifdef PROGRAM
-               printf("Running tests on: %s\n", testprog);
-#endif
-               printf("Exercising: ");
-               fflush(stdout);
-               printf("%s\n", EXTRA_VERSION);
-       } else {
-               printf("Running ");
-               fflush(stdout);
-       }
-
-       /*
-        * Run some or all of the individual tests.
-        */
-       saved_argv = argv;
-       do {
-               argv = saved_argv;
-               do {
-                       int test_num;
-
-                       test_num = get_test_set(test_set, limit, *argv, tests);
-                       if (test_num < 0) {
-                               printf("*** INVALID Test %s\n", *argv);
-                               free(refdir_alloc);
-                               free(testprogdir);
-                               usage(progname);
-                               return (1);
-                       }
-                       for (i = 0; i < test_num; i++) {
-                               tests_run++;
-                               if (test_run(test_set[i], tmpdir)) {
-                                       tests_failed++;
-                                       if (until_failure)
-                                               goto finish;
-                               }
-                       }
-                       if (*argv != NULL)
-                               argv++;
-               } while (*argv != NULL);
-       } while (until_failure);
-
-finish:
-       /* Must be freed after all tests run */
-       free(tmp2);
-       free(testprogdir);
-       free(pwd);
-
-       /*
-        * Report summary statistics.
-        */
-       if (verbosity > VERBOSITY_SUMMARY_ONLY) {
-               printf("\n");
-               printf("Totals:\n");
-               printf("  Tests run:         %8d\n", tests_run);
-               printf("  Tests failed:      %8d\n", tests_failed);
-               printf("  Assertions checked:%8d\n", assertions);
-               printf("  Assertions failed: %8d\n", failures);
-               printf("  Skips reported:    %8d\n", skips);
-       }
-       if (failures) {
-               printf("\n");
-               printf("Failing tests:\n");
-               for (i = 0; i < limit; ++i) {
-                       if (tests[i].failures)
-                               printf("  %d: %s (%d failures)\n", i,
-                                   tests[i].name, tests[i].failures);
-               }
-               printf("\n");
-               printf("Details for failing tests: %s\n", tmpdir);
-               printf("\n");
-       } else {
-               if (verbosity == VERBOSITY_SUMMARY_ONLY)
-                       printf("\n");
-               printf("%d tests passed, no failures\n", tests_run);
-       }
-
-       free(refdir_alloc);
-
-       /* If the final tmpdir is empty, we can remove it. */
-       /* This should be the usual case when all tests succeed. */
-       assertChdir("..");
-       rmdir(tmpdir);
-
-       return (tests_failed ? 1 : 0);
-}
index 49fa32c..1dadf68 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003-2006 Tim Kientzle
+ * Copyright (c) 2003-2017 Tim Kientzle
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/usr.bin/cpio/test/test.h,v 1.2 2008/06/21 02:17:18 kientzle Exp $
+ * $FreeBSD$
  */
 
 /* Every test program should #include "test.h" as the first thing. */
 
-/*
- * The goal of this file (and the matching test.c) is to
- * simplify the very repetitive test-*.c test programs.
- */
-#if defined(HAVE_CONFIG_H)
-/* Most POSIX platforms use the 'configure' script to build config.h */
-#include "config.h"
-#elif defined(__FreeBSD__)
-/* Building as part of FreeBSD system requires a pre-built config.h. */
-#include "config_freebsd.h"
-#elif defined(_WIN32) && !defined(__CYGWIN__)
-/* Win32 can't run the 'configure' script. */
-#include "config_windows.h"
-#else
-/* Warn if the library hasn't been (automatically or manually) configured. */
-#error Oops: No config.h and no pre-built configuration in test.h.
-#endif
-
-#include <sys/types.h>  /* Windows requires this before sys/stat.h */
-#include <sys/stat.h>
-
-#if HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-#ifdef HAVE_DIRECT_H
-#include <direct.h>
-#define dirent direct
-#endif
-#include <errno.h>
-#include <fcntl.h>
-#ifdef HAVE_IO_H
-#include <io.h>
-#endif
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <wchar.h>
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
-/*
- * System-specific tweaks.  We really want to minimize these
- * as much as possible, since they make it harder to understand
- * the mainline code.
- */
-
-/* Windows (including Visual Studio and MinGW but not Cygwin) */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#if !defined(__BORLANDC__)
-#undef chdir
-#define chdir _chdir
-#define strdup _strdup
-#endif
-#endif
-
-/* Visual Studio */
-#if defined(_MSC_VER) && _MSC_VER < 1900
-#define snprintf       sprintf_s
-#endif
-
-#if defined(__BORLANDC__)
-#pragma warn -8068     /* Constant out of range in comparison. */
-#endif
-
-/* Haiku OS and QNX */
-#if defined(__HAIKU__) || defined(__QNXNTO__)
-/* Haiku and QNX have typedefs in stdint.h (needed for int64_t) */
-#include <stdint.h>
-#endif
-
-/* Get a real definition for __FBSDID if we can */
-#if HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-
-/* If not, define it so as to avoid dangling semicolons. */
-#ifndef __FBSDID
-#define        __FBSDID(a)     struct _undefined_hack
-#endif
-
-#ifndef O_BINARY
-#define        O_BINARY 0
-#endif
-
-/*
- * Redefine DEFINE_TEST for use in defining the test functions.
- */
-#undef DEFINE_TEST
-#define DEFINE_TEST(name) void name(void); void name(void)
-
-/* An implementation of the standard assert() macro */
-#define assert(e)   assertion_assert(__FILE__, __LINE__, (e), #e, NULL)
-/* chdir() and error if it fails */
-#define assertChdir(path)  \
-  assertion_chdir(__FILE__, __LINE__, path)
-/* Assert two integers are the same.  Reports value of each one if not. */
-#define assertEqualInt(v1,v2) \
-  assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-/* Assert two strings are the same.  Reports value of each one if not. */
-#define assertEqualString(v1,v2)   \
-  assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 0)
-#define assertEqualUTF8String(v1,v2)   \
-  assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 1)
-/* As above, but v1 and v2 are wchar_t * */
-#define assertEqualWString(v1,v2)   \
-  assertion_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-/* As above, but raw blocks of bytes. */
-#define assertEqualMem(v1, v2, l)      \
-  assertion_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
-/* Assert that memory is full of a specified byte */
-#define assertMemoryFilledWith(v1, l, b)                                       \
-  assertion_memory_filled_with(__FILE__, __LINE__, (v1), #v1, (l), #l, (b), #b, NULL)
-/* Assert two files are the same. */
-#define assertEqualFile(f1, f2)        \
-  assertion_equal_file(__FILE__, __LINE__, (f1), (f2))
-/* Assert that a file is empty. */
-#define assertEmptyFile(pathname)      \
-  assertion_empty_file(__FILE__, __LINE__, (pathname))
-/* Assert that a file is not empty. */
-#define assertNonEmptyFile(pathname)           \
-  assertion_non_empty_file(__FILE__, __LINE__, (pathname))
-#define assertFileAtime(pathname, sec, nsec)   \
-  assertion_file_atime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileAtimeRecent(pathname)        \
-  assertion_file_atime_recent(__FILE__, __LINE__, pathname)
-#define assertFileBirthtime(pathname, sec, nsec)       \
-  assertion_file_birthtime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileBirthtimeRecent(pathname) \
-  assertion_file_birthtime_recent(__FILE__, __LINE__, pathname)
-/* Assert that a file exists; supports printf-style arguments. */
-#define assertFileExists(pathname) \
-  assertion_file_exists(__FILE__, __LINE__, pathname)
-/* Assert that a file exists. */
-#define assertFileNotExists(pathname) \
-  assertion_file_not_exists(__FILE__, __LINE__, pathname)
-/* Assert that file contents match a string. */
-#define assertFileContents(data, data_size, pathname) \
-  assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname)
-/* Verify that a file does not contain invalid strings */
-#define assertFileContainsNoInvalidStrings(pathname, strings) \
-  assertion_file_contains_no_invalid_strings(__FILE__, __LINE__, pathname, strings)
-#define assertFileMtime(pathname, sec, nsec)   \
-  assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileMtimeRecent(pathname) \
-  assertion_file_mtime_recent(__FILE__, __LINE__, pathname)
-#define assertFileNLinks(pathname, nlinks)  \
-  assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
-#define assertFileSize(pathname, size)  \
-  assertion_file_size(__FILE__, __LINE__, pathname, size)
-#define assertFileMode(pathname, mode)  \
-  assertion_file_mode(__FILE__, __LINE__, pathname, mode)
-#define assertTextFileContents(text, pathname) \
-  assertion_text_file_contents(__FILE__, __LINE__, text, pathname)
-#define assertFileContainsLinesAnyOrder(pathname, lines)       \
-  assertion_file_contains_lines_any_order(__FILE__, __LINE__, pathname, lines)
-#define assertIsDir(pathname, mode)            \
-  assertion_is_dir(__FILE__, __LINE__, pathname, mode)
-#define assertIsHardlink(path1, path2) \
-  assertion_is_hardlink(__FILE__, __LINE__, path1, path2)
-#define assertIsNotHardlink(path1, path2)      \
-  assertion_is_not_hardlink(__FILE__, __LINE__, path1, path2)
-#define assertIsReg(pathname, mode)            \
-  assertion_is_reg(__FILE__, __LINE__, pathname, mode)
-#define assertIsSymlink(pathname, contents)    \
-  assertion_is_symlink(__FILE__, __LINE__, pathname, contents)
-/* Create a directory, report error if it fails. */
-#define assertMakeDir(dirname, mode)   \
-  assertion_make_dir(__FILE__, __LINE__, dirname, mode)
-#define assertMakeFile(path, mode, contents) \
-  assertion_make_file(__FILE__, __LINE__, path, mode, -1, contents)
-#define assertMakeBinFile(path, mode, csize, contents) \
-  assertion_make_file(__FILE__, __LINE__, path, mode, csize, contents)
-#define assertMakeHardlink(newfile, oldfile)   \
-  assertion_make_hardlink(__FILE__, __LINE__, newfile, oldfile)
-#define assertMakeSymlink(newfile, linkto)     \
-  assertion_make_symlink(__FILE__, __LINE__, newfile, linkto)
-#define assertNodump(path)      \
-  assertion_nodump(__FILE__, __LINE__, path)
-#define assertUmask(mask)      \
-  assertion_umask(__FILE__, __LINE__, mask)
-#define assertUtimes(pathname, atime, atime_nsec, mtime, mtime_nsec)   \
-  assertion_utimes(__FILE__, __LINE__, pathname, atime, atime_nsec, mtime, mtime_nsec)
-
-/*
- * This would be simple with C99 variadic macros, but I don't want to
- * require that.  Instead, I insert a function call before each
- * skipping() call to pass the file and line information down.  Crude,
- * but effective.
- */
-#define skipping       \
-  skipping_setup(__FILE__, __LINE__);test_skipping
-
-/* Function declarations.  These are defined in test_utility.c. */
-void failure(const char *fmt, ...);
-int assertion_assert(const char *, int, int, const char *, void *);
-int assertion_chdir(const char *, int, const char *);
-int assertion_empty_file(const char *, int, const char *);
-int assertion_equal_file(const char *, int, const char *, const char *);
-int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *);
-int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *);
-int assertion_memory_filled_with(const char *, int, const void *, const char *, size_t, const char *, char, const char *, void *);
-int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *, int);
-int assertion_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
-int assertion_file_atime(const char *, int, const char *, long, long);
-int assertion_file_atime_recent(const char *, int, const char *);
-int assertion_file_birthtime(const char *, int, const char *, long, long);
-int assertion_file_birthtime_recent(const char *, int, const char *);
-int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
-int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **);
-int assertion_file_contents(const char *, int, const void *, int, const char *);
-int assertion_file_exists(const char *, int, const char *);
-int assertion_file_mode(const char *, int, const char *, int);
-int assertion_file_mtime(const char *, int, const char *, long, long);
-int assertion_file_mtime_recent(const char *, int, const char *);
-int assertion_file_nlinks(const char *, int, const char *, int);
-int assertion_file_not_exists(const char *, int, const char *);
-int assertion_file_size(const char *, int, const char *, long);
-int assertion_is_dir(const char *, int, const char *, int);
-int assertion_is_hardlink(const char *, int, const char *, const char *);
-int assertion_is_not_hardlink(const char *, int, const char *, const char *);
-int assertion_is_reg(const char *, int, const char *, int);
-int assertion_is_symlink(const char *, int, const char *, const char *);
-int assertion_make_dir(const char *, int, const char *, int);
-int assertion_make_file(const char *, int, const char *, int, int, const void *);
-int assertion_make_hardlink(const char *, int, const char *newpath, const char *);
-int assertion_make_symlink(const char *, int, const char *newpath, const char *);
-int assertion_nodump(const char *, int, const char *);
-int assertion_non_empty_file(const char *, int, const char *);
-int assertion_text_file_contents(const char *, int, const char *buff, const char *f);
-int assertion_umask(const char *, int, int);
-int assertion_utimes(const char *, int, const char *, long, long, long, long );
-
-void skipping_setup(const char *, int);
-void test_skipping(const char *fmt, ...);
-
-/* Like sprintf, then system() */
-int systemf(const char * fmt, ...);
-
-/* Delay until time() returns a value after this. */
-void sleepUntilAfter(time_t);
-
-/* Return true if this platform can create symlinks. */
-int canSymlink(void);
-
-/* Return true if this platform can run the "bzip2" program. */
-int canBzip2(void);
-
-/* Return true if this platform can run the "grzip" program. */
-int canGrzip(void);
-
-/* Return true if this platform can run the "gzip" program. */
-int canGzip(void);
-
-/* Return true if this platform can run the specified command. */
-int canRunCommand(const char *);
-
-/* Return true if this platform can run the "lrzip" program. */
-int canLrzip(void);
-
-/* Return true if this platform can run the "lz4" program. */
-int canLz4(void);
-
-/* Return true if this platform can run the "lzip" program. */
-int canLzip(void);
-
-/* Return true if this platform can run the "lzma" program. */
-int canLzma(void);
-
-/* Return true if this platform can run the "lzop" program. */
-int canLzop(void);
-
-/* Return true if this platform can run the "xz" program. */
-int canXz(void);
-
-/* Return true if this filesystem can handle nodump flags. */
-int canNodump(void);
-
-/* Return true if the file has large i-node number(>0xffffffff). */
-int is_LargeInode(const char *);
-
-/* Suck file into string allocated via malloc(). Call free() when done. */
-/* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
-char *slurpfile(size_t *, const char *fmt, ...);
-
-/* Dump block of bytes to a file. */
-void dumpfile(const char *filename, void *, size_t);
-
-/* Extracts named reference file to the current directory. */
-void extract_reference_file(const char *);
-/* Copies named reference file to the current directory. */
-void copy_reference_file(const char *);
-
-/* Extracts a list of files to the current directory.
- * List must be NULL terminated.
- */
-void extract_reference_files(const char **);
-
-/* Subtract umask from mode */
-mode_t umasked(mode_t expected_mode);
-
-/* Path to working directory for current test */
-extern const char *testworkdir;
-
-/*
- * Special interfaces for program test harness.
- */
-
-/* Pathname of exe to be tested. */
-extern const char *testprogfile;
-/* Name of exe to use in printf-formatted command strings. */
-/* On Windows, this includes leading/trailing quotes. */
-extern const char *testprog;
-
-#ifdef USE_DMALLOC
-#include <dmalloc.h>
-#endif
+#define KNOWNREF       "test_option_f.cpio.uu"
+#define ENVBASE "BSDCPIO" /* Prefix for environment variables. */
+#define        PROGRAM "bsdcpio" /* Name of program being tested. */
+#define PROGRAM_ALIAS "cpio" /* Generic alias for program */
+#undef LIBRARY           /* Not testing a library. */
+#undef EXTRA_DUMP        /* How to dump extra data */
+#undef EXTRA_ERRNO       /* How to dump errno */
+/* How to generate extra version info. */
+#define        EXTRA_VERSION    (systemf("%s --version", testprog) ? "" : "")
+
+#include "test_common.h"
index ac58cef..505db27 100644 (file)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2003-2017 Tim Kientzle
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "test.h"
-__FBSDID("$FreeBSD$");
-
-/*
- * Test that --version option works and generates reasonable output.
- */
-
-static void
-verify(const char *p, size_t s)
-{
-       const char *q = p;
-
-       /* Version message should start with name of program, then space. */
-       failure("version message too short:", p);
-       if (!assert(s > 6))
-               return;
-       failure("Version message should begin with 'bsdcpio': %s", p);
-       if (!assertEqualMem(q, "bsdcpio ", 8))
-               /* If we're not testing bsdcpio, don't keep going. */
-               return;
-       q += 8; s -= 8;
-       /* Version number is a series of digits and periods. */
-       while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
-               ++q;
-               --s;
-       }
-       /* Version number terminated by space. */
-       failure("Version: %s", p);
-       assert(s > 1);
-       /* Skip a single trailing a,b,c, or d. */
-       if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
-               ++q;
-       failure("Version: %s", p);
-       assert(*q == ' ');
-       ++q; --s;
-       /* Separator. */
-       failure("Version: %s", p);
-       assertEqualMem(q, "- ", 2);
-       q += 2; s -= 2;
-       /* libarchive name and version number */
-       assert(s > 11);
-       failure("Version: %s", p);
-       assertEqualMem(q, "libarchive ", 11);
-       q += 11; s -= 11;
-       /* Version number is a series of digits and periods. */
-       while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
-               ++q;
-               --s;
-       }
-       /* Skip a single trailing a,b,c, or d. */
-       if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
-               ++q;
-       /* Skip arbitrary third-party version numbers. */
-       while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) {
-               ++q;
-               --s;
-       }
-       /* All terminated by end-of-line: \r, \r\n, or \n */
-       assert(s >= 1);
-       failure("Version: %s", p);
-       if (*q == '\x0d') {
-               if (q[1] != '\0')
-                       assertEqualMem(q, "\x0d\x0a", 2);
-       } else
-               assertEqualMem(q, "\x0a", 1);
-}
-
 
 DEFINE_TEST(test_option_version)
 {
-       int r;
-       char *p;
-       size_t s;
-
-       r = systemf("%s --version >version.stdout 2>version.stderr", testprog);
-       if (r != 0)
-               r = systemf("%s -W version >version.stdout 2>version.stderr",
-                   testprog);
-       failure("Unable to run either %s --version or %s -W version",
-           testprog, testprog);
-       if (!assert(r == 0))
-               return;
-
-       /* --version should generate nothing to stderr. */
-       assertEmptyFile("version.stderr");
-       /* Verify format of version message. */
-       p = slurpfile(&s, "version.stdout");
-       verify(p, s);
-       free(p);
+       assertVersion(testprog, "bsdcpio");
 }
index e045e7c..c3da36a 100644 (file)
@@ -104,15 +104,15 @@ archive_write_set_passphrase.3.html: ../../libarchive/archive_write_set_passphra
 cpio.5.html: ../../libarchive/cpio.5
        groff -mdoc -T html ../../libarchive/cpio.5 > cpio.5.html
 
+libarchive-formats.5.html: ../../libarchive/libarchive-formats.5
+       groff -mdoc -T html ../../libarchive/libarchive-formats.5 > libarchive-formats.5.html
+
 libarchive.3.html: ../../libarchive/libarchive.3
        groff -mdoc -T html ../../libarchive/libarchive.3 > libarchive.3.html
 
 libarchive_changes.3.html: ../../libarchive/libarchive_changes.3
        groff -mdoc -T html ../../libarchive/libarchive_changes.3 > libarchive_changes.3.html
 
-libarchive-formats.5.html: ../../libarchive/libarchive-formats.5
-       groff -mdoc -T html ../../libarchive/libarchive-formats.5 > libarchive-formats.5.html
-
 libarchive_internals.3.html: ../../libarchive/libarchive_internals.3
        groff -mdoc -T html ../../libarchive/libarchive_internals.3 > libarchive_internals.3.html
 
@@ -127,4 +127,4 @@ bsdtar.1.html: ../../tar/bsdtar.1
 
 bsdcpio.1.html: ../../cpio/bsdcpio.1
        groff -mdoc -T html ../../cpio/bsdcpio.1 > bsdcpio.1.html
-all: archive_entry.3.html archive_entry_acl.3.html archive_entry_linkify.3.html archive_entry_paths.3.html archive_entry_perms.3.html archive_entry_stat.3.html archive_entry_time.3.html archive_read.3.html archive_read_add_passphrase.3.html archive_read_data.3.html archive_read_disk.3.html archive_read_extract.3.html archive_read_filter.3.html archive_read_format.3.html archive_read_free.3.html archive_read_header.3.html archive_read_new.3.html archive_read_open.3.html archive_read_set_options.3.html archive_util.3.html archive_write.3.html archive_write_blocksize.3.html archive_write_data.3.html archive_write_disk.3.html archive_write_filter.3.html archive_write_finish_entry.3.html archive_write_format.3.html archive_write_free.3.html archive_write_header.3.html archive_write_new.3.html archive_write_open.3.html archive_write_set_options.3.html archive_write_set_passphrase.3.html cpio.5.html libarchive.3.html libarchive_changes.3.html libarchive-formats.5.html libarchive_internals.3.html mtree.5.html tar.5.html bsdtar.1.html bsdcpio.1.html
+all: archive_entry.3.html archive_entry_acl.3.html archive_entry_linkify.3.html archive_entry_paths.3.html archive_entry_perms.3.html archive_entry_stat.3.html archive_entry_time.3.html archive_read.3.html archive_read_add_passphrase.3.html archive_read_data.3.html archive_read_disk.3.html archive_read_extract.3.html archive_read_filter.3.html archive_read_format.3.html archive_read_free.3.html archive_read_header.3.html archive_read_new.3.html archive_read_open.3.html archive_read_set_options.3.html archive_util.3.html archive_write.3.html archive_write_blocksize.3.html archive_write_data.3.html archive_write_disk.3.html archive_write_filter.3.html archive_write_finish_entry.3.html archive_write_format.3.html archive_write_free.3.html archive_write_header.3.html archive_write_new.3.html archive_write_open.3.html archive_write_set_options.3.html archive_write_set_passphrase.3.html cpio.5.html libarchive-formats.5.html libarchive.3.html libarchive_changes.3.html libarchive_internals.3.html mtree.5.html tar.5.html bsdtar.1.html bsdcpio.1.html
index 3d41221..fc75a82 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:15 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:01 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index a688cc8..7e76efb 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:15 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:01 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -136,7 +136,7 @@ descriptions</p>
 
 <p style="margin-top: 1em"><b>DESCRIPTION</b></p>
 
-<p style="margin-left:6%;">The &rsquo;&rsquo;Access Control
+<p style="margin-left:6%;">The &lsquo;&lsquo;Access Control
 Lists (ACLs)&rsquo;&rsquo; extend the standard Unix perssion
 model. The ACL interface of <b>libarchive</b> supports both
 POSIX.1e and NFSv4 style ACLs. Use of ACLs is restricted by
@@ -439,11 +439,11 @@ formats that can be created with
 <b>archive_entry_acl_to_text_w</b>(). Existing ACL entries
 are preserved. To get a clean new ACL from text
 <b>archive_entry_acl_clear</b>() must be called first.
-Entries prefixed with &rsquo;&rsquo;default:&rsquo;&rsquo;
+Entries prefixed with &lsquo;&lsquo;default:&rsquo;&rsquo;
 are treated as ARCHIVE_ENTRY_ACL_TYPE_DEFAULT unless
 <i>type</i> is ARCHIVE_ENTRY_ACL_TYPE_NFS4. Invalid entries,
 non-parseable ACL entries and entries beginning with the
-&rsquo;#&rsquo; character (comments) are skipped.</p>
+&lsquo;#&rsquo; character (comments) are skipped.</p>
 
 
 <p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_next</b>()
@@ -488,7 +488,7 @@ ACLs.</p>
 <p>ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT</p>
 
 <p style="margin-left:24%;">Prefix each default ACL entry
-with the word &rsquo;&rsquo;default:&rsquo;&rsquo;.</p>
+with the word &lsquo;&lsquo;default:&rsquo;&rsquo;.</p>
 
 <p>ARCHIVE_ENTRY_ACL_STYLE_SOLARIS</p>
 
@@ -523,7 +523,7 @@ returned. It the entry contains POSIX.1e ACLs and none of
 the flags ARCHIVE_ENTRY_ACL_TYPE_ACCESS or
 ARCHIVE_ENTRY_ACL_TYPE_DEFAULT are specified, both access
 and default entries are returned and default entries are
-prefixed with &rsquo;&rsquo;default:&rsquo;&rsquo;.</p>
+prefixed with &lsquo;&lsquo;default:&rsquo;&rsquo;.</p>
 
 
 <p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_types</b>()
index f4a2933..d0a9955 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:16 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:01 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index bbfb1dd..a431c70 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:16 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:02 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index 76094dd..ba8ed77 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:16 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:02 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index 6e3af5d..9716c12 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:16 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:02 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index 3d45e58..bac2cb8 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:16 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:02 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index ddb76c2..a9b3759 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:16 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:02 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -224,7 +224,7 @@ example, many implementations of tar(1) allow you to append
 entries to an empty file. Of course, it is impossible to
 determine the format of an empty file by inspecting the
 contents, so this library treats empty files as having a
-special &rsquo;&rsquo;empty&rsquo;&rsquo; format.</p>
+special &lsquo;&lsquo;empty&rsquo;&rsquo; format.</p>
 
 <p style="margin-left:6%; margin-top: 1em">BSD
 February&nbsp;2, 2012 BSD</p>
index 3413ebb..34d7e00 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:16 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:02 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index be90caf..e6b5285 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:16 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:02 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index 662b660..db78662 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:16 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:03 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -148,11 +148,11 @@ information from disk.</p>
 
 <p style="margin-left:17%;">This sets the mode used for
 handling symbolic links. The
-&rsquo;&rsquo;logical&rsquo;&rsquo; mode follows all
-symbolic links. The &rsquo;&rsquo;physical&rsquo;&rsquo;
+&lsquo;&lsquo;logical&rsquo;&rsquo; mode follows all
+symbolic links. The &lsquo;&lsquo;physical&rsquo;&rsquo;
 mode does not follow any symbolic links. The
-&rsquo;&rsquo;hybrid&rsquo;&rsquo; mode currently behaves
-identically to the &rsquo;&rsquo;logical&rsquo;&rsquo;
+&lsquo;&lsquo;hybrid&rsquo;&rsquo; mode currently behaves
+identically to the &lsquo;&lsquo;logical&rsquo;&rsquo;
 mode.</p>
 
 
@@ -325,7 +325,7 @@ was written by Tim Kientzle
 <p style="margin-top: 1em"><b>BUGS</b></p>
 
 <p style="margin-left:6%;">The
-&rsquo;&rsquo;standard&rsquo;&rsquo; user name and group
+&lsquo;&lsquo;standard&rsquo;&rsquo; user name and group
 name lookup functions are not the defaults because
 getgrgid(3) and getpwuid(3) are sometimes too large for
 particular applications. The current design allows the
@@ -348,7 +348,7 @@ such information.</p>
 provide a set of methods for walking a directory tree. That
 would make it a direct parallel of the archive_read(3) API.
 When such methods are implemented, the
-&rsquo;&rsquo;hybrid&rsquo;&rsquo; symbolic link mode will
+&lsquo;&lsquo;hybrid&rsquo;&rsquo; symbolic link mode will
 make sense.</p>
 
 <p style="margin-left:6%; margin-top: 1em">BSD
index 70e61fc..5c61898 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:16 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:03 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index ac5a0da..837b208 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:16 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:03 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -149,7 +149,7 @@ functions may fall back on external programs if an
 appropriate library was not available at build time.
 Decompression using an external program is usually slower
 than decompression through built-in libraries. Note that
-&rsquo;&rsquo;none&rsquo;&rsquo; is always enabled by
+&lsquo;&lsquo;none&rsquo;&rsquo; is always enabled by
 default.</p>
 
 <p><b>archive_read_support_filter_all</b>()</p>
index e24e6be..31ac3e2 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:16 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:03 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -153,7 +153,7 @@ variants.</p>
 <p><b>archive_read_support_format_all</b>()</p>
 
 <p style="margin-left:17%;">Enables support for all
-available formats except the &rsquo;&rsquo;raw&rsquo;&rsquo;
+available formats except the &lsquo;&lsquo;raw&rsquo;&rsquo;
 format (see below).</p>
 
 <p><b>archive_read_support_format_by_code</b>()</p>
@@ -180,10 +180,10 @@ distinct format.</p>
 <p><b>archive_read_support_format_raw</b>()</p>
 
 <p style="margin-left:17%;">The
-&rsquo;&rsquo;raw&rsquo;&rsquo; format handler allows
+&lsquo;&lsquo;raw&rsquo;&rsquo; format handler allows
 libarchive to be used to read arbitrary data. It treats any
 data stream as an archive with a single entry. The pathname
-of this entry is &rsquo;&rsquo;data&rsquo;&rsquo;; all other
+of this entry is &lsquo;&lsquo;data&rsquo;&rsquo;; all other
 entry fields are unset. This is not enabled by
 <b>archive_read_support_format_all</b>() in order to avoid
 erroneous handling of damaged archives.</p>
@@ -213,10 +213,10 @@ example, many implementations of tar(1) allow you to append
 entries to an empty file. Of course, it is impossible to
 determine the format of an empty file by inspecting the
 contents, so this library treats empty files as having a
-special &rsquo;&rsquo;empty&rsquo;&rsquo; format.</p>
+special &lsquo;&lsquo;empty&rsquo;&rsquo; format.</p>
 
 <p style="margin-left:6%; margin-top: 1em">Using the
-&rsquo;&rsquo;raw&rsquo;&rsquo; handler together with any
+&lsquo;&lsquo;raw&rsquo;&rsquo; handler together with any
 other handler will often work but can produce surprising
 results.</p>
 
index 42aecff..a7336df 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:17 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:03 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index e662686..01aae30 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:17 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:03 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index a1b9b9e..5c35255 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:17 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:03 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index 7e75243..4e1c7b8 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:17 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:04 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index 8558843..99049a1 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:17 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:04 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -142,7 +142,7 @@ option with this name will ignore it.</p>
 
 <p style="margin-left:27%; margin-top: 1em">The option will
 be provided to every module with a value of
-&rsquo;&rsquo;1&rsquo;&rsquo;.</p>
+&lsquo;&lsquo;1&rsquo;&rsquo;.</p>
 
 <p><i>!option</i></p>
 
index 842cd97..30c0919 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:17 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:04 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -253,21 +253,21 @@ This function should be used within I/O callbacks to set
 system-specific error codes and error descriptions. This
 function accepts a printf-like format string and arguments.
 However, you should be careful to use only the following
-printf format specifiers: &rsquo;&rsquo;%c&rsquo;&rsquo;,
-&rsquo;&rsquo;%d&rsquo;&rsquo;,
-&rsquo;&rsquo;%jd&rsquo;&rsquo;,
-&rsquo;&rsquo;%jo&rsquo;&rsquo;,
-&rsquo;&rsquo;%ju&rsquo;&rsquo;,
-&rsquo;&rsquo;%jx&rsquo;&rsquo;,
-&rsquo;&rsquo;%ld&rsquo;&rsquo;,
-&rsquo;&rsquo;%lo&rsquo;&rsquo;,
-&rsquo;&rsquo;%lu&rsquo;&rsquo;,
-&rsquo;&rsquo;%lx&rsquo;&rsquo;,
-&rsquo;&rsquo;%o&rsquo;&rsquo;,
-&rsquo;&rsquo;%u&rsquo;&rsquo;,
-&rsquo;&rsquo;%s&rsquo;&rsquo;,
-&rsquo;&rsquo;%x&rsquo;&rsquo;,
-&rsquo;&rsquo;%%&rsquo;&rsquo;. Field-width specifiers and
+printf format specifiers: &lsquo;&lsquo;%c&rsquo;&rsquo;,
+&lsquo;&lsquo;%d&rsquo;&rsquo;,
+&lsquo;&lsquo;%jd&rsquo;&rsquo;,
+&lsquo;&lsquo;%jo&rsquo;&rsquo;,
+&lsquo;&lsquo;%ju&rsquo;&rsquo;,
+&lsquo;&lsquo;%jx&rsquo;&rsquo;,
+&lsquo;&lsquo;%ld&rsquo;&rsquo;,
+&lsquo;&lsquo;%lo&rsquo;&rsquo;,
+&lsquo;&lsquo;%lu&rsquo;&rsquo;,
+&lsquo;&lsquo;%lx&rsquo;&rsquo;,
+&lsquo;&lsquo;%o&rsquo;&rsquo;,
+&lsquo;&lsquo;%u&rsquo;&rsquo;,
+&lsquo;&lsquo;%s&rsquo;&rsquo;,
+&lsquo;&lsquo;%x&rsquo;&rsquo;,
+&lsquo;&lsquo;%%&rsquo;&rsquo;. Field-width specifiers and
 other printf features are not uniformly supported and should
 not be used.</p>
 
index 1081903..7c89e15 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:17 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:04 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -273,8 +273,8 @@ limitations and provides a generic key/value attribute
 facility for vendor-defined extensions. One oversight in
 POSIX is the failure to provide a standard attribute for
 large device numbers. This library uses
-&rsquo;&rsquo;SCHILY.devminor&rsquo;&rsquo; and
-&rsquo;&rsquo;SCHILY.devmajor&rsquo;&rsquo; for device
+&lsquo;&lsquo;SCHILY.devminor&rsquo;&rsquo; and
+&lsquo;&lsquo;SCHILY.devmajor&rsquo;&rsquo; for device
 numbers that exceed the range supported by the
 backwards-compatible ustar header. These keys are compatible
 with Joerg Schilling&rsquo;s <b>star</b> archiver. Other
index 972e490..7358c49 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:17 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:04 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -97,7 +97,7 @@ compression. The uncompressed data is always unpadded. The
 default is to pad the last block to the full block size
 (note that <b>archive_write_open_filename</b>() will set
 this based on the file type). Unlike the other
-&rsquo;&rsquo;set&rsquo;&rsquo; functions, this function can
+&lsquo;&lsquo;set&rsquo;&rsquo; functions, this function can
 be called after the archive is opened.</p>
 
 
index 7ffe058..deceae0 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:17 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:04 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index b6e96eb..2b909b0 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:18 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:05 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -450,7 +450,7 @@ of the final object happen to match those specified in the
 entry.</p>
 
 <p style="margin-left:6%; margin-top: 1em">The
-&rsquo;&rsquo;standard&rsquo;&rsquo; user-id and group-id
+&lsquo;&lsquo;standard&rsquo;&rsquo; user-id and group-id
 lookup functions are not the defaults because getgrnam(3)
 and getpwnam(3) are sometimes too large for particular
 applications. The current design allows the application
index 44565e9..107fb36 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:18 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:05 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index 3c0093b..5980913 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:18 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:05 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index e0075ab..901a4e4 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:18 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:05 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index 1749c22..eabdd7c 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:18 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:05 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index f6fcb58..12b3963 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:18 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:05 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index f1a1127..8c459fa 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:18 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:05 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index a22b598..3bd43f1 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:18 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:06 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -116,7 +116,7 @@ require correct blocking.</p>
 <b>archive_write_open</b>() that accepts a filename. A NULL
 argument indicates that the output should be written to
 standard output; an argument of
-&rsquo;&rsquo;-&rsquo;&rsquo; will open a file with that
+&lsquo;&lsquo;-&rsquo;&rsquo; will open a file with that
 name. If you have not invoked
 <b>archive_write_set_bytes_in_last_block</b>(), then
 <b>archive_write_open_filename</b>() will adjust the
index 3c36524..8ea1189 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:18 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:06 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -138,7 +138,7 @@ option with this name will ignore it.</p>
 
 <p style="margin-left:27%; margin-top: 1em">The option will
 be provided to every module with a value of
-&rsquo;&rsquo;1&rsquo;&rsquo;.</p>
+&lsquo;&lsquo;1&rsquo;&rsquo;.</p>
 
 <p><i>!option</i></p>
 
@@ -175,7 +175,7 @@ cksum</b>, <b>device</b>, <b>flags</b>, <b>gid</b>,
 <p style="margin-left:27%;">Enable a particular keyword in
 the mtree output. Prefix with an exclamation mark to disable
 the corresponding keyword. The default is equivalent to
-&rsquo;&rsquo;device, flags, gid, gname, link, mode, nlink,
+&lsquo;&lsquo;device, flags, gid, gname, link, mode, nlink,
 size, time, type, uid, uname&rsquo;&rsquo;.</p>
 
 <p><b>all</b></p>
@@ -483,8 +483,8 @@ compression on many files.</p>
 compression</b></p>
 
 <p style="margin-left:27%;">The value is either
-&rsquo;&rsquo;store&rsquo;&rsquo; or
-&rsquo;&rsquo;deflate&rsquo;&rsquo; to indicate how the
+&lsquo;&lsquo;store&rsquo;&rsquo; or
+&lsquo;&lsquo;deflate&rsquo;&rsquo; to indicate how the
 following entries should be compressed. Note that this
 setting is ignored for directories, symbolic links, and
 other special entries.</p>
index b93b7fb..9d490d5 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:18 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:06 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index 5801296..8c30ec9 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:20 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:08 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -29,11 +29,12 @@ to and from archives</p>
 
 <p style="margin-top: 1em"><b>SYNOPSIS</b></p>
 
-<p style="margin-left:13%;"><b>cpio -i</b> [<i>options</i>]
-[<i>pattern&nbsp;...</i>] [<i>&lt;&nbsp;archive</i>] <b><br>
-cpio -o</b> [<i>options</i>] <i>&lt; name-list</i>
+<p style="margin-left:13%;"><b>cpio &minus;i</b>
+[<i>options</i>] [<i>pattern&nbsp;...</i>]
+[<i>&lt;&nbsp;archive</i>] <b><br>
+cpio &minus;o</b> [<i>options</i>] <i>&lt; name-list</i>
 [<i>&gt;&nbsp;archive</i>] <b><br>
-cpio -p</b> [<i>options</i>] <i>dest-dir &lt;
+cpio &minus;p</b> [<i>options</i>] <i>dest-dir &lt;
 name-list</i></p>
 
 <p style="margin-top: 1em"><b>DESCRIPTION</b></p>
@@ -47,23 +48,23 @@ and can create tar, pax, cpio, ar, and shar archives.</p>
 to <b>cpio</b> is a mode indicator from the following
 list:</p>
 
-<p><b>-i</b></p>
+<p><b>&minus;i</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">Input. Read an
 archive from standard input (unless overridden) and extract
-the contents to disk or (if the <b>-t</b> option is
+the contents to disk or (if the <b>&minus;t</b> option is
 specified) list the contents to standard output. If one or
 more file patterns are specified, only files matching one of
 the patterns will be extracted.</p>
 
-<p><b>-o</b></p>
+<p><b>&minus;o</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">Output. Read a
 list of filenames from standard input and produce a new
 archive on standard output (unless overridden) containing
 the specified items.</p>
 
-<p><b>-p</b></p>
+<p><b>&minus;p</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">Pass-through.
 Read a list of filenames from standard input and copy the
@@ -75,62 +76,64 @@ files to the specified directory.</p>
 otherwise, options are applicable in all operating
 modes.</p>
 
-<p style="margin-top: 1em"><b>-0</b>, <b>--null</b></p>
+<p style="margin-top: 1em"><b>&minus;0</b>,
+<b>&minus;&minus;null</b></p>
 
 <p style="margin-left:17%;">Read filenames separated by NUL
 characters instead of newlines. This is necessary if any of
 the filenames being read might contain newlines.</p>
 
-<p style="margin-top: 1em"><b>-A</b></p>
+<p style="margin-top: 1em"><b>&minus;A</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(o mode only)
 Append to the specified archive. (Not yet implemented.)</p>
 
-<p style="margin-top: 1em"><b>-a</b></p>
+<p style="margin-top: 1em"><b>&minus;a</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(o and p modes)
 Reset access times on files after they are read.</p>
 
-<p style="margin-top: 1em"><b>-B</b></p>
+<p style="margin-top: 1em"><b>&minus;B</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(o mode only)
 Block output to records of 5120 bytes.</p>
 
-<p style="margin-top: 1em"><b>-C</b> <i>size</i></p>
+<p style="margin-top: 1em"><b>&minus;C</b> <i>size</i></p>
 
 <p style="margin-left:17%;">(o mode only) Block output to
 records of <i>size</i> bytes.</p>
 
-<p style="margin-top: 1em"><b>-c</b></p>
+<p style="margin-top: 1em"><b>&minus;c</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(o mode only)
 Use the old POSIX portable character format. Equivalent to
-<b>--format</b> <i>odc</i>.</p>
+<b>&minus;&minus;format</b> <i>odc</i>.</p>
 
-<p style="margin-top: 1em"><b>-d</b>,
-<b>--make-directories</b></p>
+<p style="margin-top: 1em"><b>&minus;d</b>,
+<b>&minus;&minus;make-directories</b></p>
 
 <p style="margin-left:17%;">(i and p modes) Create
 directories as necessary.</p>
 
-<p style="margin-top: 1em"><b>-E</b> <i>file</i></p>
+<p style="margin-top: 1em"><b>&minus;E</b> <i>file</i></p>
 
 <p style="margin-left:17%;">(i mode only) Read list of file
 name patterns from <i>file</i> to list and extract.</p>
 
-<p style="margin-top: 1em"><b>-F</b> <i>file</i>,
-<b>--file</b> <i>file</i></p>
+<p style="margin-top: 1em"><b>&minus;F</b> <i>file</i>,
+<b>&minus;&minus;file</b> <i>file</i></p>
 
 <p style="margin-left:17%;">Read archive from or write
 archive to <i>file</i>.</p>
 
-<p style="margin-top: 1em"><b>-f</b> <i>pattern</i></p>
+<p style="margin-top: 1em"><b>&minus;f</b>
+<i>pattern</i></p>
 
 <p style="margin-left:17%;">(i mode only) Ignore files that
 match <i>pattern</i>.</p>
 
-<p style="margin-top: 1em"><b>-H</b> <i>format</i>,
-<b>--format</b> <i>format</i></p>
+<p style="margin-top: 1em"><b>&minus;H</b> <i>format</i>,
+<b>&minus;&minus;format</b> <i>format</i></p>
 
 <p style="margin-left:17%;">(o mode only) Produce the
 output archive in the specified format. Supported formats
@@ -166,40 +169,44 @@ format is <i>odc</i>. See libarchive-formats(5) for more
 complete information about the formats currently supported
 by the underlying libarchive(3) library.</p>
 
-<p style="margin-top: 1em"><b>-h</b>, <b>--help</b></p>
+<p style="margin-top: 1em"><b>&minus;h</b>,
+<b>&minus;&minus;help</b></p>
 
 <p style="margin-left:17%;">Print usage information.</p>
 
-<p style="margin-top: 1em"><b>-I</b> <i>file</i></p>
+<p style="margin-top: 1em"><b>&minus;I</b> <i>file</i></p>
 
 <p style="margin-left:17%;">Read archive from
 <i>file</i>.</p>
 
-<p style="margin-top: 1em"><b>-i</b>, <b>--extract</b></p>
+<p style="margin-top: 1em"><b>&minus;i</b>,
+<b>&minus;&minus;extract</b></p>
 
 <p style="margin-left:17%;">Input mode. See above for
 description.</p>
 
-<p style="margin-top: 1em"><b>--insecure</b></p>
+
+<p style="margin-top: 1em"><b>&minus;&minus;insecure</b></p>
 
 <p style="margin-left:17%;">(i and p mode only) Disable
 security checks during extraction or copying. This allows
 extraction via symbolic links, absolute paths, and path
-names containing &rsquo;..&rsquo; in the name.</p>
+names containing &lsquo;..&rsquo; in the name.</p>
 
-<p style="margin-top: 1em"><b>-J</b>, <b>--xz</b></p>
+<p style="margin-top: 1em"><b>&minus;J</b>,
+<b>&minus;&minus;xz</b></p>
 
 <p style="margin-left:17%;">(o mode only) Compress the file
 with xz-compatible compression before writing it. In input
 mode, this option is ignored; xz compression is recognized
 automatically on input.</p>
 
-<p style="margin-top: 1em"><b>-j</b></p>
+<p style="margin-top: 1em"><b>&minus;j</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">Synonym for
-<b>-y</b>.</p>
+<b>&minus;y</b>.</p>
 
-<p style="margin-top: 1em"><b>-L</b></p>
+<p style="margin-top: 1em"><b>&minus;L</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(o and p modes)
 All symbolic links will be followed. Normally, symbolic
@@ -207,39 +214,40 @@ links are archived and copied as symbolic links. With this
 option, the target of the link will be archived or copied
 instead.</p>
 
-<p style="margin-top: 1em"><b>-l</b>, <b>--link</b></p>
+<p style="margin-top: 1em"><b>&minus;l</b>,
+<b>&minus;&minus;link</b></p>
 
 <p style="margin-left:17%;">(p mode only) Create links from
 the target directory to the original files, instead of
 copying.</p>
 
-<p style="margin-top: 1em"><b>--lrzip</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;lrzip</b></p>
 
 <p style="margin-left:17%;">(o mode only) Compress the
 resulting archive with lrzip(1). In input mode, this option
 is ignored.</p>
 
-<p style="margin-top: 1em"><b>--lz4</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;lz4</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(o mode only)
 Compress the archive with lz4-compatible compression before
 writing it. In input mode, this option is ignored; lz4
 compression is recognized automatically on input.</p>
 
-<p style="margin-top: 1em"><b>--lzma</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;lzma</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(o mode only)
 Compress the file with lzma-compatible compression before
 writing it. In input mode, this option is ignored; lzma
 compression is recognized automatically on input.</p>
 
-<p style="margin-top: 1em"><b>--lzop</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;lzop</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(o mode only)
 Compress the resulting archive with lzop(1). In input mode,
 this option is ignored.</p>
 
-<p style="margin-top: 1em"><b>--passphrase</b>
+<p style="margin-top: 1em"><b>&minus;&minus;passphrase</b>
 <i>passphrase</i></p>
 
 <p style="margin-left:17%;">The <i>passphrase</i> is used
@@ -248,76 +256,79 @@ only a format that <b>cpio</b> can handle encrypted
 archives. You shouldn&rsquo;t use this option unless you
 realize how insecure use of this option is.</p>
 
-<p style="margin-top: 1em"><b>-m</b>,
-<b>--preserve-modification-time</b></p>
+<p style="margin-top: 1em"><b>&minus;m</b>,
+<b>&minus;&minus;preserve-modification-time</b></p>
 
 <p style="margin-left:17%;">(i and p modes) Set file
 modification time on created files to match those in the
 source.</p>
 
-<p style="margin-top: 1em"><b>-n</b>,
-<b>--numeric-uid-gid</b></p>
+<p style="margin-top: 1em"><b>&minus;n</b>,
+<b>&minus;&minus;numeric-uid-gid</b></p>
+
+<p style="margin-left:17%;">(i mode, only with
+<b>&minus;t</b>) Display numeric uid and gid. By default,
+<b>cpio</b> displays the user and group names when they are
+provided in the archive, or looks up the user and group
+names in the system password database.</p>
 
-<p style="margin-left:17%;">(i mode, only with <b>-t</b>)
-Display numeric uid and gid. By default, <b>cpio</b>
-displays the user and group names when they are provided in
-the archive, or looks up the user and group names in the
-system password database.</p>
 
-<p style="margin-top: 1em"><b>--no-preserve-owner</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;no-preserve-owner</b></p>
 
 <p style="margin-left:17%;">(i mode only) Do not attempt to
 restore file ownership. This is the default when run by
 non-root users.</p>
 
-<p style="margin-top: 1em"><b>-O</b> <i>file</i></p>
+<p style="margin-top: 1em"><b>&minus;O</b> <i>file</i></p>
 
 <p style="margin-left:17%;">Write archive to
 <i>file</i>.</p>
 
-<p style="margin-top: 1em"><b>-o</b>, <b>--create</b></p>
+<p style="margin-top: 1em"><b>&minus;o</b>,
+<b>&minus;&minus;create</b></p>
 
 <p style="margin-left:17%;">Output mode. See above for
 description.</p>
 
-<p style="margin-top: 1em"><b>-p</b>,
-<b>--pass-through</b></p>
+<p style="margin-top: 1em"><b>&minus;p</b>,
+<b>&minus;&minus;pass-through</b></p>
 
 <p style="margin-left:17%;">Pass-through mode. See above
 for description.</p>
 
-<p style="margin-top: 1em"><b>--preserve-owner</b></p>
+
+<p style="margin-top: 1em"><b>&minus;&minus;preserve-owner</b></p>
 
 <p style="margin-left:17%;">(i mode only) Restore file
 ownership. This is the default when run by the root
 user.</p>
 
-<p style="margin-top: 1em"><b>--quiet</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;quiet</b></p>
 
 <p style="margin-left:17%;">Suppress unnecessary
 messages.</p>
 
-<p style="margin-top: 1em"><b>-R</b> [ <br>
+<p style="margin-top: 1em"><b>&minus;R</b> [ <br>
 user][ <br>
 :][ <br>
-group], <b>--owner</b> [ <br>
+group], <b>&minus;&minus;owner</b> [ <br>
 user][ <br>
 :][ <br>
 group]</p>
 
 <p style="margin-left:17%;">Set the owner and/or group on
 files in the output. If group is specified with no user (for
-example, <b>-R</b> <i>:wheel</i>) then the group will be set
-but not the user. If the user is specified with a trailing
-colon and no group (for example, <b>-R</b> <i>root:</i>)
-then the group will be set to the user&rsquo;s default
-group. If the user is specified with no trailing colon, then
-the user will be set but not the group. In <b>-i</b> and
-<b>-p</b> modes, this option can only be used by the
-super-user. (For compatibility, a period can be used in
-place of the colon.)</p>
-
-<p style="margin-top: 1em"><b>-r</b></p>
+example, <b>&minus;R</b> <i>:wheel</i>) then the group will
+be set but not the user. If the user is specified with a
+trailing colon and no group (for example, <b>&minus;R</b>
+<i>root:</i>) then the group will be set to the user&rsquo;s
+default group. If the user is specified with no trailing
+colon, then the user will be set but not the group. In
+<b>&minus;i</b> and <b>&minus;p</b> modes, this option can
+only be used by the super-user. (For compatibility, a period
+can be used in place of the colon.)</p>
+
+<p style="margin-top: 1em"><b>&minus;r</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(All modes.)
 Rename files interactively. For each file, a prompt is
@@ -327,50 +338,54 @@ blank, the file is skipped. If the line contains a single
 period, the file is processed normally. Otherwise, the line
 is taken to be the new name of the file.</p>
 
-<p style="margin-top: 1em"><b>-t</b>, <b>--list</b></p>
+<p style="margin-top: 1em"><b>&minus;t</b>,
+<b>&minus;&minus;list</b></p>
 
 <p style="margin-left:17%;">(i mode only) List the contents
 of the archive to stdout; do not restore the contents to
 disk.</p>
 
-<p style="margin-top: 1em"><b>-u</b>,
-<b>--unconditional</b></p>
+<p style="margin-top: 1em"><b>&minus;u</b>,
+<b>&minus;&minus;unconditional</b></p>
 
 <p style="margin-left:17%;">(i and p modes) Unconditionally
 overwrite existing files. Ordinarily, an older file will not
 overwrite a newer file on disk.</p>
 
-<p style="margin-top: 1em"><b>-V</b>, <b>--dot</b></p>
+<p style="margin-top: 1em"><b>&minus;V</b>,
+<b>&minus;&minus;dot</b></p>
 
 <p style="margin-left:17%;">Print a dot to stderr for each
-file as it is processed. Superseded by <b>-v</b>.</p>
+file as it is processed. Superseded by <b>&minus;v</b>.</p>
 
-<p style="margin-top: 1em"><b>-v</b>, <b>--verbose</b></p>
+<p style="margin-top: 1em"><b>&minus;v</b>,
+<b>&minus;&minus;verbose</b></p>
 
 <p style="margin-left:17%;">Print the name of each file to
-stderr as it is processed. With <b>-t</b>, provide a
+stderr as it is processed. With <b>&minus;t</b>, provide a
 detailed listing of each file.</p>
 
-<p style="margin-top: 1em"><b>--version</b></p>
+
+<p style="margin-top: 1em"><b>&minus;&minus;version</b></p>
 
 <p style="margin-left:17%;">Print the program version
 information and exit.</p>
 
-<p style="margin-top: 1em"><b>-y</b></p>
+<p style="margin-top: 1em"><b>&minus;y</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(o mode only)
 Compress the archive with bzip2-compatible compression
 before writing it. In input mode, this option is ignored;
 bzip2 compression is recognized automatically on input.</p>
 
-<p style="margin-top: 1em"><b>-Z</b></p>
+<p style="margin-top: 1em"><b>&minus;Z</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(o mode only)
 Compress the archive with compress-compatible compression
 before writing it. In input mode, this option is ignored;
 compression is recognized automatically on input.</p>
 
-<p style="margin-top: 1em"><b>-z</b></p>
+<p style="margin-top: 1em"><b>&minus;z</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(o mode only)
 Compress the archive with gzip-compatible compression before
@@ -407,7 +422,7 @@ with the find(1) command. The first example here simply
 copies all files from <i>src</i> to <i>dest</i>:</p>
 
 <p style="margin-left:14%;"><b>find</b> <i>src</i> |
-<b>cpio -pmud</b> <i>dest</i></p>
+<b>cpio &minus;pmud</b> <i>dest</i></p>
 
 <p style="margin-left:6%; margin-top: 1em">By carefully
 selecting options to the find(1) command and combining it
@@ -418,19 +433,19 @@ more than 2 days old and whose names match a particular
 pattern:</p>
 
 <p style="margin-left:14%;"><b>find</b> <i>src</i>
-<b>-mtime</b> <i>+2</i> | <b>grep foo[bar]</b> | <b>cpio
--pdmu</b> <i>dest</i></p>
+<b>&minus;mtime</b> <i>+2</i> | <b>grep foo[bar]</b> |
+<b>cpio &minus;pdmu</b> <i>dest</i></p>
 
 <p style="margin-left:6%; margin-top: 1em">This example
 copies files from <i>src</i> to <i>dest</i> that are more
 than 2 days old and which contain the word
-&rsquo;&rsquo;</p>
+&lsquo;&lsquo;</p>
 
 <p>foobar &rsquo;&rsquo;:</p>
 
 <p style="margin-left:14%;"><b>find</b> <i>src</i>
-<b>-mtime</b> <i>+2</i> | <b>xargs grep -l foobar</b> |
-<b>cpio -pdmu</b> <i>dest</i></p>
+<b>&minus;mtime</b> <i>+2</i> | <b>xargs grep -l foobar</b>
+| <b>cpio &minus;pdmu</b> <i>dest</i></p>
 
 <p style="margin-top: 1em"><b>COMPATIBILITY</b></p>
 
@@ -439,16 +454,18 @@ the options a, B, c, d, f, l, m, r, t, u, and v comply with
 SUSv2.</p>
 
 <p style="margin-left:6%; margin-top: 1em">The old POSIX.1
-standard specified that only <b>-i</b>, <b>-o</b>, and
-<b>-p</b> were interpreted as command-line options. Each
-took a single argument of a list of modifier characters. For
-example, the standard syntax allows <b>-imu</b> but does not
-support <b>-miu</b> or <b>-i -m -u</b>, since <i>m</i> and
-<i>u</i> are only modifiers to <b>-i</b>, they are not
-command-line options in their own right. The syntax
-supported by this implementation is backwards-compatible
-with the standard. For best compatibility, scripts should
-limit themselves to the standard syntax.</p>
+standard specified that only <b>&minus;i</b>,
+<b>&minus;o</b>, and <b>&minus;p</b> were interpreted as
+command-line options. Each took a single argument of a list
+of modifier characters. For example, the standard syntax
+allows <b>&minus;imu</b> but does not support
+<b>&minus;miu</b> or <b>&minus;i &minus;m &minus;u</b>,
+since <i>m</i> and <i>u</i> are only modifiers to
+<b>&minus;i</b>, they are not command-line options in their
+own right. The syntax supported by this implementation is
+backwards-compatible with the standard. For best
+compatibility, scripts should limit themselves to the
+standard syntax.</p>
 
 <p style="margin-top: 1em"><b>SEE ALSO</b></p>
 
@@ -460,13 +477,13 @@ libarchive-formats(5), tar(5)</p>
 
 <p style="margin-left:6%;">There is no current POSIX
 standard for the cpio command; it appeared in ISO/IEC
-9945-1:1996 (&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;) but was
+9945-1:1996 (&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;) but was
 dropped from IEEE Std 1003.1-2001
-(&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;).</p>
+(&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;).</p>
 
 <p style="margin-left:6%; margin-top: 1em">The cpio, ustar,
 and pax interchange file formats are defined by IEEE Std
-1003.1-2001 (&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;) for the
+1003.1-2001 (&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;) for the
 pax command.</p>
 
 <p style="margin-top: 1em"><b>HISTORY</b></p>
@@ -475,7 +492,7 @@ pax command.</p>
 <b>find</b> utilities were written by Dick Haight while
 working in AT&amp;T&rsquo;s Unix Support Group. They first
 appeared in 1977 in PWB/UNIX 1.0, the
-&rsquo;&rsquo;Programmer&rsquo;s Work Bench&rsquo;&rsquo;
+&lsquo;&lsquo;Programmer&rsquo;s Work Bench&rsquo;&rsquo;
 system developed for use within AT&amp;T. They were first
 released outside of AT&amp;T as part of System III Unix in
 1981. As a result, <b>cpio</b> actually predates <b>tar</b>,
@@ -495,7 +512,7 @@ to transfer files between systems with dissimilar user and
 group numbering. Older cpio formats limit the user and group
 numbers to 16 or 18 bits, which is insufficient for modern
 systems. The cpio archive formats cannot support files over
-4 gigabytes, except for the &rsquo;&rsquo;odc&rsquo;&rsquo;
+4 gigabytes, except for the &lsquo;&lsquo;odc&rsquo;&rsquo;
 variant, which can support files up to 8 gigabytes.</p>
 
 <p style="margin-left:6%; margin-top: 1em">BSD
index c81a210..8e9edc8 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:20 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:08 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -36,14 +36,14 @@ tape archives</p>
 file</i> &rang; &nbsp;|&nbsp;&lang; <i><br>
 pattern</i> &rang; &nbsp;...]</p>
 
-<p style="margin-left:12%;"><b>tar</b> {<b>-c</b>}
+<p style="margin-left:12%;"><b>tar</b> {<b>&minus;c</b>}
 [<i>options</i>]
 [<i>files&nbsp;</i>|&nbsp;<i>directories</i>] <b><br>
-tar</b> {<b>-r&nbsp;</b>|&nbsp;<b>-u</b>} <b>-f</b>
-<i>archive-file</i> [<i>options</i>]
+tar</b> {<b>&minus;r&nbsp;</b>|&nbsp;<b>&minus;u</b>}
+<b>&minus;f</b> <i>archive-file</i> [<i>options</i>]
 [<i>files&nbsp;</i>|&nbsp;<i>directories</i>] <b><br>
-tar</b> {<b>-t&nbsp;</b>|&nbsp;<b>-x</b>} [<i>options</i>]
-[<i>patterns</i>]</p>
+tar</b> {<b>&minus;t&nbsp;</b>|&nbsp;<b>&minus;x</b>}
+[<i>options</i>] [<i>patterns</i>]</p>
 
 <p style="margin-top: 1em"><b>DESCRIPTION</b></p>
 
@@ -54,7 +54,7 @@ and ISO 9660 cdrom images and can create tar, pax, cpio, ar,
 zip, 7-zip, and shar archives.</p>
 
 <p style="margin-left:6%; margin-top: 1em">The first
-synopsis form shows a &rsquo;&rsquo;bundled&rsquo;&rsquo;
+synopsis form shows a &lsquo;&lsquo;bundled&rsquo;&rsquo;
 option word. This usage is provided for compatibility with
 historical implementations. See COMPATIBILITY below for
 details.</p>
@@ -63,48 +63,50 @@ details.</p>
 synopsis forms show the preferred usage. The first option to
 <b>tar</b> is a mode indicator from the following list:</p>
 
-<p><b>-c</b></p>
+<p><b>&minus;c</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">Create a new
 archive containing the specified items. The long option form
-is <b>--create</b>.</p>
+is <b>&minus;&minus;create</b>.</p>
 
-<p><b>-r</b></p>
+<p><b>&minus;r</b></p>
 
-<p style="margin-left:17%; margin-top: 1em">Like <b>-c</b>,
-but new entries are appended to the archive. Note that this
-only works on uncompressed archives stored in regular files.
-The <b>-f</b> option is required. The long option form is
-<b>--append</b>.</p>
+<p style="margin-left:17%; margin-top: 1em">Like
+<b>&minus;c</b>, but new entries are appended to the
+archive. Note that this only works on uncompressed archives
+stored in regular files. The <b>&minus;f</b> option is
+required. The long option form is
+<b>&minus;&minus;append</b>.</p>
 
-<p><b>-t</b></p>
+<p><b>&minus;t</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">List archive
 contents to stdout. The long option form is
-<b>--list</b>.</p>
+<b>&minus;&minus;list</b>.</p>
 
-<p><b>-u</b></p>
+<p><b>&minus;u</b></p>
 
-<p style="margin-left:17%; margin-top: 1em">Like <b>-r</b>,
-but new entries are added only if they have a modification
-date newer than the corresponding entry in the archive. Note
-that this only works on uncompressed archives stored in
-regular files. The <b>-f</b> option is required. The long
-form is <b>--update</b>.</p>
+<p style="margin-left:17%; margin-top: 1em">Like
+<b>&minus;r</b>, but new entries are added only if they have
+a modification date newer than the corresponding entry in
+the archive. Note that this only works on uncompressed
+archives stored in regular files. The <b>&minus;f</b> option
+is required. The long form is
+<b>&minus;&minus;update</b>.</p>
 
-<p><b>-x</b></p>
+<p><b>&minus;x</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">Extract to disk
 from the archive. If a file with the same name appears more
 than once in the archive, each copy will be extracted, with
 later copies overwriting (replacing) earlier copies. The
-long option form is <b>--extract</b>.</p>
+long option form is <b>&minus;&minus;extract</b>.</p>
 
-<p style="margin-left:6%; margin-top: 1em">In <b>-c</b>,
-<b>-r</b>, or <b>-u</b> mode, each specified file or
-directory is added to the archive in the order specified on
-the command line. By default, the contents of each directory
-are also archived.</p>
+<p style="margin-left:6%; margin-top: 1em">In
+<b>&minus;c</b>, <b>&minus;r</b>, or <b>&minus;u</b> mode,
+each specified file or directory is added to the archive in
+the order specified on the command line. By default, the
+contents of each directory are also archived.</p>
 
 <p style="margin-left:6%; margin-top: 1em">In extract or
 list mode, the entire command line is read and parsed before
@@ -121,25 +123,25 @@ modes.</p>
 
 <p style="margin-top: 1em"><b>@</b><i>archive</i></p>
 
-<p style="margin-left:17%;">(c and r mode only) The
+<p style="margin-left:17%;">(c and r modes only) The
 specified archive is opened and the entries in it will be
 appended to the current archive. As a simple example,</p>
 
-<p style="margin-left:24%;"><b>tar -c -f</b> <i>-
-newfile</i> <b>@</b><i>original.tar</i></p>
+<p style="margin-left:24%;"><b>tar &minus;c &minus;f</b>
+<i>- newfile</i> <b>@</b><i>original.tar</i></p>
 
 <p style="margin-left:17%;">writes a new archive to
 standard output containing a file <i>newfile</i> and all of
 the entries from <i>original.tar</i>. In contrast,</p>
 
-<p style="margin-left:24%;"><b>tar -c -f</b> <i>- newfile
-original.tar</i></p>
+<p style="margin-left:24%;"><b>tar &minus;c &minus;f</b>
+<i>- newfile original.tar</i></p>
 
 <p style="margin-left:17%;">creates a new archive with only
 two entries. Similarly,</p>
 
-<p style="margin-left:24%;"><b>tar -czf</b> <i>-</i>
-<b>--format pax @</b><i>-</i></p>
+<p style="margin-left:24%;"><b>tar &minus;czf</b> <i>-</i>
+<b>&minus;&minus;format pax @</b><i>-</i></p>
 
 <p style="margin-left:17%;">reads an archive from standard
 input (whose format will be determined automatically) and
@@ -147,54 +149,66 @@ converts it into a gzip-compressed pax-format archive on
 stdout. In this way, <b>tar</b> can be used to convert
 archives from one format to another.</p>
 
-<p style="margin-top: 1em"><b>-a</b>,
-<b>--auto-compress</b></p>
+<p style="margin-top: 1em"><b>&minus;a</b>,
+<b>&minus;&minus;auto-compress</b></p>
 
 <p style="margin-left:17%;">(c mode only) Use the archive
 suffix to decide a set of the format and the compressions.
 As a simple example,</p>
 
-<p style="margin-left:24%;"><b>tar -a -cf</b>
+<p style="margin-left:24%;"><b>tar &minus;a &minus;cf</b>
 <i>archive.tgz source.c source.h</i></p>
 
 <p style="margin-left:17%;">creates a new archive with
 restricted pax format and gzip compression,</p>
 
-<p style="margin-left:24%;"><b>tar -a -cf</b>
+<p style="margin-left:24%;"><b>tar &minus;a &minus;cf</b>
 <i>archive.tar.bz2.uu source.c source.h</i></p>
 
 <p style="margin-left:17%;">creates a new archive with
 restricted pax format and bzip2 compression and uuencode
 compression,</p>
 
-<p style="margin-left:24%;"><b>tar -a -cf</b>
+<p style="margin-left:24%;"><b>tar &minus;a &minus;cf</b>
 <i>archive.zip source.c source.h</i></p>
 
 <p style="margin-left:17%;">creates a new archive with zip
 format,</p>
 
-<p style="margin-left:24%;"><b>tar -a -jcf</b>
+<p style="margin-left:24%;"><b>tar &minus;a &minus;jcf</b>
 <i>archive.tgz source.c source.h</i></p>
 
 <p style="margin-left:17%;">ignores the
-&rsquo;&rsquo;-j&rsquo;&rsquo; option, and creates a new
+&lsquo;&lsquo;-j&rsquo;&rsquo; option, and creates a new
 archive with restricted pax format and gzip compression,</p>
 
-<p style="margin-left:24%;"><b>tar -a -jcf</b>
+<p style="margin-left:24%;"><b>tar &minus;a &minus;jcf</b>
 <i>archive.xxx source.c source.h</i></p>
 
 <p style="margin-left:17%;">if it is unknown suffix or no
 suffix, creates a new archive with restricted pax format and
 bzip2 compression.</p>
 
-<p style="margin-top: 1em"><b>-B</b>,
-<b>--read-full-blocks</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;acls</b></p>
+
+<p style="margin-left:17%; margin-top: 1em">(c, r, u, x
+modes only) Archive or extract POSIX.1e or NFSv4 ACLs. This
+is the reverse of <b>&minus;&minus;no-acls</b> and the
+default behavior in c, r, and u modes (except Mac OS X) or
+if <b>tar</b> is run in x mode as root. On Mac OS X this
+option translates extended ACLs to NFSv4 ACLs. To store
+extended ACLs the <b>&minus;&minus;mac-metadata</b> option
+is preferred.</p>
+
+<p style="margin-top: 1em"><b>&minus;B</b>,
+<b>&minus;&minus;read-full-blocks</b></p>
 
 <p style="margin-left:17%;">Ignored for compatibility with
 other tar(1) implementations.</p>
 
-<p style="margin-top: 1em"><b>-b</b> <i>blocksize</i>,
-<b>--block-size</b> <i>blocksize</i></p>
+<p style="margin-top: 1em"><b>&minus;b</b>
+<i>blocksize</i>, <b>&minus;&minus;block-size</b>
+<i>blocksize</i></p>
 
 <p style="margin-left:17%;">Specify the block size, in
 512-byte records, for tape drive I/O. As a rule, this
@@ -202,34 +216,29 @@ argument is only needed when reading from or writing to tape
 drives, and usually not even then as the default block size
 of 20 records (10240 bytes) is very common.</p>
 
-<p style="margin-top: 1em"><b>-C</b> <i>directory</i>,
-<b>--cd</b> <i>directory</i>, <b>--directory</b>
-<i>directory</i></p>
+<p style="margin-top: 1em"><b>&minus;C</b>
+<i>directory</i>, <b>&minus;&minus;cd</b> <i>directory</i>,
+<b>&minus;&minus;directory</b> <i>directory</i></p>
 
 <p style="margin-left:17%;">In c and r mode, this changes
 the directory before adding the following files. In x mode,
 change directories after opening the archive but before
 extracting entries from the archive.</p>
 
-<p style="margin-top: 1em"><b>--chroot</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;chroot</b></p>
 
 <p style="margin-left:17%;">(x mode only) <b>chroot</b>()
-to the current directory after processing any <b>-C</b>
-options and before extracting any files.</p>
+to the current directory after processing any
+<b>&minus;C</b> options and before extracting any files.</p>
 
 
-<p style="margin-top: 1em"><b>--clear-nochange-fflags</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;clear-nochange-fflags</b></p>
 
 <p style="margin-left:17%;">(x mode only) Before removing
 file system objects to replace them, clear platform-specific
 file flags that might prevent removal.</p>
 
-<p style="margin-top: 1em"><b>--disable-copyfile</b></p>
-
-<p style="margin-left:17%;">Mac OS X specific. Disable the
-use of copyfile(3).</p>
-
-<p style="margin-top: 1em"><b>--exclude</b>
+<p style="margin-top: 1em"><b>&minus;&minus;exclude</b>
 <i>pattern</i></p>
 
 <p style="margin-left:17%;">Do not process files or
@@ -237,23 +246,31 @@ directories that match the specified pattern. Note that
 exclusions take precedence over patterns or filenames
 specified on the command line.</p>
 
-<p style="margin-top: 1em"><b>--format</b>
+<p style="margin-top: 1em"><b>&minus;&minus;fflags</b></p>
+
+<p style="margin-left:17%;">(c, r, u, x modes only) Archive
+or extract file flags. This is the reverse of
+<b>&minus;&minus;no-fflags</b> and the default behavior in
+c, r, and u modes or if <b>tar</b> is run in x mode as
+root.</p>
+
+<p style="margin-top: 1em"><b>&minus;&minus;format</b>
 <i>format</i></p>
 
 <p style="margin-left:17%;">(c, r, u mode only) Use the
 specified format for the created archive. Supported formats
-include &rsquo;&rsquo;cpio&rsquo;&rsquo;,
-&rsquo;&rsquo;pax&rsquo;&rsquo;,
-&rsquo;&rsquo;shar&rsquo;&rsquo;, and
-&rsquo;&rsquo;ustar&rsquo;&rsquo;. Other formats may also be
+include &lsquo;&lsquo;cpio&rsquo;&rsquo;,
+&lsquo;&lsquo;pax&rsquo;&rsquo;,
+&lsquo;&lsquo;shar&rsquo;&rsquo;, and
+&lsquo;&lsquo;ustar&rsquo;&rsquo;. Other formats may also be
 supported; see libarchive-formats(5) for more information
 about currently-supported formats. In r and u modes, when
 extending an existing archive, the format specified here
 must be compatible with the format of the existing archive
 on disk.</p>
 
-<p style="margin-top: 1em"><b>-f</b> <i>file</i>,
-<b>--file</b> <i>file</i></p>
+<p style="margin-top: 1em"><b>&minus;f</b> <i>file</i>,
+<b>&minus;&minus;file</b> <i>file</i></p>
 
 <p style="margin-left:17%;">Read the archive from or write
 the archive to the specified file. The filename can be
@@ -262,77 +279,84 @@ varies by system; on FreeBSD, the default is
 <i>/dev/sa0</i>; on Linux, the default is
 <i>/dev/st0</i>.</p>
 
-<p style="margin-top: 1em"><b>--gid</b> <i>id</i></p>
+<p style="margin-top: 1em"><b>&minus;&minus;gid</b>
+<i>id</i></p>
 
 <p style="margin-left:17%;">Use the provided group id
 number. On extract, this overrides the group id in the
 archive; the group name in the archive will be ignored. On
 create, this overrides the group id read from disk; if
-<b>--gname</b> is not also specified, the group name will be
-set to match the group id.</p>
+<b>&minus;&minus;gname</b> is not also specified, the group
+name will be set to match the group id.</p>
 
-<p style="margin-top: 1em"><b>--gname</b> <i>name</i></p>
+<p style="margin-top: 1em"><b>&minus;&minus;gname</b>
+<i>name</i></p>
 
 <p style="margin-left:17%;">Use the provided group name. On
 extract, this overrides the group name in the archive; if
 the provided group name does not exist on the system, the
-group id (from the archive or from the <b>--gid</b> option)
-will be used instead. On create, this sets the group name
-that will be stored in the archive; the name will not be
-verified against the system group database.</p>
+group id (from the archive or from the
+<b>&minus;&minus;gid</b> option) will be used instead. On
+create, this sets the group name that will be stored in the
+archive; the name will not be verified against the system
+group database.</p>
 
-<p style="margin-top: 1em"><b>-H</b></p>
+<p style="margin-top: 1em"><b>&minus;H</b></p>
 
-<p style="margin-left:17%; margin-top: 1em">(c and r mode
+<p style="margin-left:17%; margin-top: 1em">(c and r modes
 only) Symbolic links named on the command line will be
 followed; the target of the link will be archived, not the
 link itself.</p>
 
-<p style="margin-top: 1em"><b>-h</b></p>
+<p style="margin-top: 1em"><b>&minus;h</b></p>
 
-<p style="margin-left:17%; margin-top: 1em">(c and r mode
-only) Synonym for <b>-L</b>.</p>
+<p style="margin-left:17%; margin-top: 1em">(c and r modes
+only) Synonym for <b>&minus;L</b>.</p>
 
-<p style="margin-top: 1em"><b>-I</b></p>
+<p style="margin-top: 1em"><b>&minus;I</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">Synonym for
-<b>-T</b>.</p>
+<b>&minus;T</b>.</p>
 
-<p style="margin-top: 1em"><b>--help</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;help</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">Show usage.</p>
 
-<p style="margin-top: 1em"><b>--hfsCompression</b></p>
 
-<p style="margin-left:17%;">(x mode only) Mac OS X
-specific(v10.6 or later). Compress extracted regular files
-with HFS+ compression.</p>
+<p style="margin-top: 1em"><b>&minus;&minus;hfsCompression</b></p>
 
-<p style="margin-top: 1em"><b>--ignore-zeros</b></p>
+<p style="margin-left:17%;">(x mode only) Mac OS X specific
+(v10.6 or later). Compress extracted regular files with HFS+
+compression.</p>
 
-<p style="margin-left:17%;">An alias of <b>--options
-read_concatenated_archives</b> for compatibility with GNU
-tar.</p>
 
-<p style="margin-top: 1em"><b>--include</b>
+<p style="margin-top: 1em"><b>&minus;&minus;ignore-zeros</b></p>
+
+<p style="margin-left:17%;">An alias of
+<b>&minus;&minus;options read_concatenated_archives</b> for
+compatibility with GNU tar.</p>
+
+<p style="margin-top: 1em"><b>&minus;&minus;include</b>
 <i>pattern</i></p>
 
 <p style="margin-left:17%;">Process only files or
 directories that match the specified pattern. Note that
-exclusions specified with <b>--exclude</b> take precedence
-over inclusions. If no inclusions are explicitly specified,
-all entries are processed by default. The <b>--include</b>
-option is especially useful when filtering archives. For
-example, the command</p>
+exclusions specified with <b>&minus;&minus;exclude</b> take
+precedence over inclusions. If no inclusions are explicitly
+specified, all entries are processed by default. The
+<b>&minus;&minus;include</b> option is especially useful
+when filtering archives. For example, the command</p>
 
-<p style="margin-left:24%;"><b>tar -c -f</b> <i>new.tar</i>
-<b>--include=&rsquo;*foo*&rsquo; @</b><i>old.tgz</i></p>
+<p style="margin-left:24%;"><b>tar &minus;c &minus;f</b>
+<i>new.tar</i> <b>&minus;&minus;include=&rsquo;*foo*&rsquo;
+@</b><i>old.tgz</i></p>
 
 <p style="margin-left:17%;">creates a new archive
 <i>new.tar</i> containing only the entries from
-<i>old.tgz</i> containing the string &rsquo;foo&rsquo;.</p>
+<i>old.tgz</i> containing the string &lsquo;foo&rsquo;.</p>
 
-<p style="margin-top: 1em"><b>-J</b>, <b>--xz</b></p>
+<p style="margin-top: 1em"><b>&minus;J</b>,
+<b>&minus;&minus;xz</b></p>
 
 <p style="margin-left:17%;">(c mode only) Compress the
 resulting archive with xz(1). In extract or list modes, this
@@ -340,8 +364,9 @@ option is ignored. Note that, unlike other <b>tar</b>
 implementations, this implementation recognizes XZ
 compression automatically when reading archives.</p>
 
-<p style="margin-top: 1em"><b>-j</b>, <b>--bzip</b>,
-<b>--bzip2</b>, <b>--bunzip2</b></p>
+<p style="margin-top: 1em"><b>&minus;j</b>,
+<b>&minus;&minus;bzip</b>, <b>&minus;&minus;bzip2</b>,
+<b>&minus;&minus;bunzip2</b></p>
 
 <p style="margin-left:17%;">(c mode only) Compress the
 resulting archive with bzip2(1). In extract or list modes,
@@ -349,111 +374,126 @@ this option is ignored. Note that, unlike other <b>tar</b>
 implementations, this implementation recognizes bzip2
 compression automatically when reading archives.</p>
 
-<p style="margin-top: 1em"><b>-k</b>,
-<b>--keep-old-files</b></p>
+<p style="margin-top: 1em"><b>&minus;k</b>,
+<b>&minus;&minus;keep-old-files</b></p>
 
 <p style="margin-left:17%;">(x mode only) Do not overwrite
 existing files. In particular, if a file appears more than
 once in an archive, later copies will not overwrite earlier
 copies.</p>
 
-<p style="margin-top: 1em"><b>--keep-newer-files</b></p>
+
+<p style="margin-top: 1em"><b>&minus;&minus;keep-newer-files</b></p>
 
 <p style="margin-left:17%;">(x mode only) Do not overwrite
 existing files that are newer than the versions appearing in
 the archive being extracted.</p>
 
-<p style="margin-top: 1em"><b>-L</b>,
-<b>--dereference</b></p>
+<p style="margin-top: 1em"><b>&minus;L</b>,
+<b>&minus;&minus;dereference</b></p>
 
-<p style="margin-left:17%;">(c and r mode only) All
+<p style="margin-left:17%;">(c and r modes only) All
 symbolic links will be followed. Normally, symbolic links
 are archived as such. With this option, the target of the
 link will be archived instead.</p>
 
-<p style="margin-top: 1em"><b>-l</b>,
-<b>--check-links</b></p>
+<p style="margin-top: 1em"><b>&minus;l</b>,
+<b>&minus;&minus;check-links</b></p>
 
 <p style="margin-left:17%;">(c and r modes only) Issue a
 warning message unless all links to each file are
 archived.</p>
 
-<p style="margin-top: 1em"><b>--lrzip</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;lrzip</b></p>
 
 <p style="margin-left:17%;">(c mode only) Compress the
 resulting archive with lrzip(1). In extract or list modes,
 this option is ignored.</p>
 
-<p style="margin-top: 1em"><b>--lz4</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;lz4</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(c mode only)
 Compress the archive with lz4-compatible compression before
 writing it. In input mode, this option is ignored; lz4
 compression is recognized automatically on input.</p>
 
-<p style="margin-top: 1em"><b>--lzma</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;lzma</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(c mode only)
 Compress the resulting archive with the original LZMA
 algorithm. Use of this option is discouraged and new
-archives should be created with <b>--xz</b> instead. Note
-that, unlike other <b>tar</b> implementations, this
-implementation recognizes LZMA compression automatically
-when reading archives.</p>
+archives should be created with <b>&minus;&minus;xz</b>
+instead. Note that, unlike other <b>tar</b> implementations,
+this implementation recognizes LZMA compression
+automatically when reading archives.</p>
 
-<p style="margin-top: 1em"><b>--lzop</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;lzop</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(c mode only)
 Compress the resulting archive with lzop(1). In extract or
 list modes, this option is ignored.</p>
 
-<p style="margin-top: 1em"><b>-m</b>,
-<b>--modification-time</b></p>
+<p style="margin-top: 1em"><b>&minus;m</b>,
+<b>&minus;&minus;modification-time</b></p>
 
 <p style="margin-left:17%;">(x mode only) Do not extract
 modification time. By default, the modification time is set
 to the time stored in the archive.</p>
 
-<p style="margin-top: 1em"><b>-n</b>, <b>--norecurse</b>,
-<b>--no-recursion</b></p>
+
+<p style="margin-top: 1em"><b>&minus;&minus;mac-metadata</b></p>
+
+<p style="margin-left:17%;">(c, r, u and x mode only) Mac
+OS X specific. Archive or extract extended ACLs and extended
+attributes using copyfile(3) in AppleDouble format. This is
+the reverse of <b>&minus;&minus;no-mac-metadata</b>. and the
+default behavior in c, r, and u modes or if <b>tar</b> is
+run in x mode as root.</p>
+
+<p style="margin-top: 1em"><b>&minus;n</b>,
+<b>&minus;&minus;norecurse</b>,
+<b>&minus;&minus;no-recursion</b></p>
 
 <p style="margin-left:17%;">(c, r, u modes only) Do not
 recursively archive the contents of directories.</p>
 
-<p style="margin-top: 1em"><b>--newer</b> <i>date</i></p>
+<p style="margin-top: 1em"><b>&minus;&minus;newer</b>
+<i>date</i></p>
 
 <p style="margin-left:17%;">(c, r, u modes only) Only
 include files and directories newer than the specified date.
 This compares ctime entries.</p>
 
-<p style="margin-top: 1em"><b>--newer-mtime</b>
+
+<p style="margin-top: 1em"><b>&minus;&minus;newer-mtime</b>
 <i>date</i></p>
 
 <p style="margin-left:17%;">(c, r, u modes only) Like
-<b>--newer</b>, except it compares mtime entries instead of
-ctime entries.</p>
+<b>&minus;&minus;newer</b>, except it compares mtime entries
+instead of ctime entries.</p>
 
-<p style="margin-top: 1em"><b>--newer-than</b>
+<p style="margin-top: 1em"><b>&minus;&minus;newer-than</b>
 <i>file</i></p>
 
 <p style="margin-left:17%;">(c, r, u modes only) Only
 include files and directories newer than the specified file.
 This compares ctime entries.</p>
 
-<p style="margin-top: 1em"><b>--newer-mtime-than</b>
+
+<p style="margin-top: 1em"><b>&minus;&minus;newer-mtime-than</b>
 <i>file</i></p>
 
 <p style="margin-left:17%;">(c, r, u modes only) Like
-<b>--newer-than</b>, except it compares mtime entries
-instead of ctime entries.</p>
+<b>&minus;&minus;newer-than</b>, except it compares mtime
+entries instead of ctime entries.</p>
 
-<p style="margin-top: 1em"><b>--nodump</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;nodump</b></p>
 
 <p style="margin-left:17%;">(c and r modes only) Honor the
 nodump file flag by skipping this file.</p>
 
 
-<p style="margin-top: 1em"><b>--nopreserveHFSCompression</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;nopreserveHFSCompression</b></p>
 
 <p style="margin-left:17%;">(x mode only) Mac OS X
 specific(v10.6 or later). Do not compress extracted regular
@@ -461,95 +501,146 @@ files which were compressed with HFS+ compression before
 archived. By default, compress the regular files again with
 HFS+ compression.</p>
 
-<p style="margin-top: 1em"><b>--null</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;null</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(use with
-<b>-I</b> or <b>-T</b>) Filenames or patterns are separated
-by null characters, not by newlines. This is often used to
-read filenames output by the <b>-print0</b> option to
-find(1).</p>
+<b>&minus;I</b> or <b>&minus;T</b>) Filenames or patterns
+are separated by null characters, not by newlines. This is
+often used to read filenames output by the
+<b>&minus;print0</b> option to find(1).</p>
+
+
+<p style="margin-top: 1em"><b>&minus;&minus;no-acls</b></p>
+
+<p style="margin-left:17%;">(c, r, u, x modes only) Do not
+archive or extract POSIX.1e or NFSv4 ACLs. This is the
+reverse of <b>&minus;&minus;acls</b> and the default
+behavior if <b>tar</b> is run as non-root in x mode (on Mac
+OS X also in c, r and u modes).</p>
+
+
+<p style="margin-top: 1em"><b>&minus;&minus;no-fflags</b></p>
+
+<p style="margin-left:17%;">(c, r, u, x modes only) Do not
+archive or extract file flags. This is the reverse of
+<b>&minus;&minus;fflags</b> and the default behavior if
+<b>tar</b> is run as non-root in x mode.</p>
+
 
-<p style="margin-top: 1em"><b>--no-same-owner</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;no-mac-metadata</b></p>
+
+<p style="margin-left:17%;">(x mode only) Mac OS X
+specific. Do not archive or extract ACLs and extended
+attributes using copyfile(3) in AppleDouble format. This is
+the reverse of <b>&minus;&minus;mac-metadata</b>. and the
+default behavior if <b>tar</b> is run as non-root in x
+mode.</p>
+
+<p style="margin-top: 1em"><b>&minus;n</b>,
+<b>&minus;&minus;norecurse</b>,
+<b>&minus;&minus;no-recursion</b></p>
+
+
+<p style="margin-top: 1em"><b>&minus;&minus;no-same-owner</b></p>
 
 <p style="margin-left:17%;">(x mode only) Do not extract
 owner and group IDs. This is the reverse of
-<b>--same-owner</b> and the default behavior if <b>tar</b>
-is run as non-root.</p>
+<b>&minus;&minus;same-owner</b> and the default behavior if
+<b>tar</b> is run as non-root.</p>
 
 
-<p style="margin-top: 1em"><b>--no-same-permissions</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;no-same-permissions</b></p>
 
 <p style="margin-left:17%;">(x mode only) Do not extract
 full permissions (SGID, SUID, sticky bit, ACLs, extended
 attributes or extended file flags). This is the reverse of
-<b>-p</b> and the default behavior if <b>tar</b> is run as
-non-root.</p>
+<b>&minus;p</b> and the default behavior if <b>tar</b> is
+run as non-root and can be overridden by also specifying
+<b>&minus;&minus;acls</b>, <b>&minus;&minus;fflags</b>,
+<b>&minus;&minus;mac-metadata, &minus;&minus;same-owner</b>,
+<b>&minus;&minus;same-permissions</b> and
+<b>&minus;&minus;xattrs</b>.</p>
+
+
+<p style="margin-top: 1em"><b>&minus;&minus;no-xattrs</b></p>
 
-<p style="margin-top: 1em"><b>--numeric-owner</b></p>
+<p style="margin-left:17%;">(c, r, u, x modes only) Do not
+archive or extract extended attributes. This is the reverse
+of <b>&minus;&minus;xattrs</b> and the default behavior if
+<b>tar</b> is run as non-root in x mode.</p>
+
+
+<p style="margin-top: 1em"><b>&minus;&minus;numeric-owner</b></p>
 
 <p style="margin-left:17%;">This is equivalent to
-<b>--uname</b> &quot;&quot; <b>--gname</b> &quot;&quot;. On
-extract, it causes user and group names in the archive to be
-ignored in favor of the numeric user and group ids. On
-create, it causes user and group names to not be stored in
-the archive.</p>
+<b>&minus;&minus;uname</b> &quot;&quot;
+<b>&minus;&minus;gname</b> &quot;&quot;. On extract, it
+causes user and group names in the archive to be ignored in
+favor of the numeric user and group ids. On create, it
+causes user and group names to not be stored in the
+archive.</p>
 
-<p style="margin-top: 1em"><b>-O</b>,
-<b>--to-stdout</b></p>
+<p style="margin-top: 1em"><b>&minus;O</b>,
+<b>&minus;&minus;to-stdout</b></p>
 
 <p style="margin-left:17%;">(x, t modes only) In extract
 (-x) mode, files will be written to standard out rather than
 being extracted to disk. In list (-t) mode, the file listing
 will be written to stderr rather than the usual stdout.</p>
 
-<p style="margin-top: 1em"><b>-o</b></p>
+<p style="margin-top: 1em"><b>&minus;o</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(x mode) Use
 the user and group of the user running the program rather
 than those specified in the archive. Note that this has no
-significance unless <b>-p</b> is specified, and the program
-is being run by the root user. In this case, the file modes
-and flags from the archive will be restored, but ACLs or
-owner information in the archive will be discarded.</p>
+significance unless <b>&minus;p</b> is specified, and the
+program is being run by the root user. In this case, the
+file modes and flags from the archive will be restored, but
+ACLs or owner information in the archive will be
+discarded.</p>
 
-<p style="margin-top: 1em"><b>-o</b></p>
+<p style="margin-top: 1em"><b>&minus;o</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(c, r, u mode)
-A synonym for <b>--format</b> <i>ustar</i></p>
+A synonym for <b>&minus;&minus;format</b> <i>ustar</i></p>
 
-<p style="margin-top: 1em"><b>--older</b> <i>date</i></p>
+<p style="margin-top: 1em"><b>&minus;&minus;older</b>
+<i>date</i></p>
 
 <p style="margin-left:17%;">(c, r, u modes only) Only
 include files and directories older than the specified date.
 This compares ctime entries.</p>
 
-<p style="margin-top: 1em"><b>--older-mtime</b>
+
+<p style="margin-top: 1em"><b>&minus;&minus;older-mtime</b>
 <i>date</i></p>
 
 <p style="margin-left:17%;">(c, r, u modes only) Like
-<b>--older</b>, except it compares mtime entries instead of
-ctime entries.</p>
+<b>&minus;&minus;older</b>, except it compares mtime entries
+instead of ctime entries.</p>
 
-<p style="margin-top: 1em"><b>--older-than</b>
+<p style="margin-top: 1em"><b>&minus;&minus;older-than</b>
 <i>file</i></p>
 
 <p style="margin-left:17%;">(c, r, u modes only) Only
 include files and directories older than the specified file.
 This compares ctime entries.</p>
 
-<p style="margin-top: 1em"><b>--older-mtime-than</b>
+
+<p style="margin-top: 1em"><b>&minus;&minus;older-mtime-than</b>
 <i>file</i></p>
 
 <p style="margin-left:17%;">(c, r, u modes only) Like
-<b>--older-than</b>, except it compares mtime entries
-instead of ctime entries.</p>
+<b>&minus;&minus;older-than</b>, except it compares mtime
+entries instead of ctime entries.</p>
+
 
-<p style="margin-top: 1em"><b>--one-file-system</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;one-file-system</b></p>
 
 <p style="margin-left:17%;">(c, r, and u modes) Do not
 cross mount points.</p>
 
-<p style="margin-top: 1em"><b>--options</b>
+<p style="margin-top: 1em"><b>&minus;&minus;options</b>
 <i>options</i></p>
 
 <p style="margin-left:17%;">Select optional behaviors for
@@ -667,7 +758,7 @@ output. Supported keywords include: <b>cksum</b>,
 <b>nlink</b>, <b>rmd160</b>, <b>sha1</b>, <b>sha256</b>,
 <b>sha384</b>, <b>sha512</b>, <b>size</b>, <b>time</b>,
 <b>uid</b>, <b>uname</b>. The default is equivalent to:
-&rsquo;&rsquo;device, flags, gid, gname, link, mode, nlink,
+&lsquo;&lsquo;device, flags, gid, gname, link, mode, nlink,
 size, time, type, uid, uname&rsquo;&rsquo;.</p>
 
 <p><b>mtree:all</b></p>
@@ -711,14 +802,14 @@ encryption), aes128 (WinZip AES-128 encryption) and aes256
 archive, which occurs when multiple tar archives have been
 concatenated together. Without this option, only the
 contents of the first concatenated archive would be read.
-This option is comparable to the <b>-i</b>,
-<b>--ignore-zeros</b> option of GNU tar.</p>
+This option is comparable to the <b>&minus;i</b>,
+<b>&minus;&minus;ignore-zeros</b> option of GNU tar.</p>
 
 <p style="margin-left:17%;">If a provided option is not
 supported by any module, that is a fatal error.</p>
 
-<p style="margin-top: 1em"><b>-P</b>,
-<b>--absolute-paths</b></p>
+<p style="margin-top: 1em"><b>&minus;P</b>,
+<b>&minus;&minus;absolute-paths</b></p>
 
 <p style="margin-left:17%;">Preserve pathnames. By default,
 absolute pathnames (those that begin with a / character)
@@ -728,18 +819,24 @@ extract archive entries whose pathnames contain <i>..</i> or
 whose target directory would be altered by a symlink. This
 option suppresses these behaviors.</p>
 
-<p style="margin-top: 1em"><b>-p</b>, <b>--insecure</b>,
-<b>--preserve-permissions</b></p>
+<p style="margin-top: 1em"><b>&minus;p</b>,
+<b>&minus;&minus;insecure</b>,
+<b>&minus;&minus;preserve-permissions</b></p>
 
 <p style="margin-left:17%;">(x mode only) Preserve file
 permissions. Attempt to restore the full permissions,
-including owner, file modes, file flags and ACLs, if
-available, for each item extracted from the archive. This is
-the default, if <b>tar</b> is being run by root and can be
-overridden by also specifying <b>--no-same-owner</b> and
-<b>--no-same-permissions</b>.</p>
-
-<p style="margin-top: 1em"><b>--passphrase</b>
+including owner, file modes, ACLs, extended atributes and
+extended file flags, if available, for each item extracted
+from the archive. This is the default, if <b>tar</b> is
+being run by root and can be overridden by also specifying
+<b>&minus;&minus;no-acls</b>,
+<b>&minus;&minus;no-fflags</b>,
+<b>&minus;&minus;no-mac-metadata,
+&minus;&minus;no-same-owner</b>,
+<b>&minus;&minus;no-same-permissions</b> and
+<b>&minus;&minus;no-xattrs</b>.</p>
+
+<p style="margin-top: 1em"><b>&minus;&minus;passphrase</b>
 <i>passphrase</i></p>
 
 <p style="margin-left:17%;">The <i>passphrase</i> is used
@@ -748,13 +845,13 @@ the only supported format that supports encryption. You
 shouldn&rsquo;t use this option unless you realize how
 insecure use of this option is.</p>
 
-<p style="margin-top: 1em"><b>--posix</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;posix</b></p>
 
 <p style="margin-left:17%;">(c, r, u mode only) Synonym for
-<b>--format</b> <i>pax</i></p>
+<b>&minus;&minus;format</b> <i>pax</i></p>
 
-<p style="margin-top: 1em"><b>-q</b>,
-<b>--fast-read</b></p>
+<p style="margin-top: 1em"><b>&minus;q</b>,
+<b>&minus;&minus;fast-read</b></p>
 
 <p style="margin-left:17%;">(x and t mode only) Extract or
 list only the first archive entry that matches each pattern
@@ -765,7 +862,7 @@ entries with the same name and, by convention, later entries
 overwrite earlier entries. This option is provided as a
 performance optimization.</p>
 
-<p style="margin-top: 1em"><b>-S</b></p>
+<p style="margin-top: 1em"><b>&minus;S</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(x mode only)
 Extract files as sparse files. For every block on disk,
@@ -773,7 +870,8 @@ check first if it contains only NULL bytes and seek over it
 otherwise. This works similar to the conv=sparse option of
 dd.</p>
 
-<p style="margin-top: 1em"><b>-s</b> <i>pattern</i></p>
+<p style="margin-top: 1em"><b>&minus;s</b>
+<i>pattern</i></p>
 
 <p style="margin-left:17%;">Modify file or archive member
 names according to <i>pattern</i>. The pattern has the
@@ -799,13 +897,16 @@ default is <i>hrs</i> which applies substitutions to all
 names. In particular, it is never necessary to specify h, r,
 or s.</p>
 
-<p style="margin-top: 1em"><b>--same-owner</b></p>
+
+<p style="margin-top: 1em"><b>&minus;&minus;same-owner</b></p>
 
 <p style="margin-left:17%;">(x mode only) Extract owner and
-group IDs. This is the reverse of <b>--no-same-owner</b> and
-the default behavior if <b>tar</b> is run as root.</p>
+group IDs. This is the reverse of
+<b>&minus;&minus;no-same-owner</b> and the default behavior
+if <b>tar</b> is run as root.</p>
+
 
-<p style="margin-top: 1em"><b>--strip-components</b>
+<p style="margin-top: 1em"><b>&minus;&minus;strip-components</b>
 <i>count</i></p>
 
 <p style="margin-left:17%;">Remove the specified number of
@@ -814,29 +915,30 @@ silently skipped. Note that the pathname is edited after
 checking inclusion/exclusion patterns but before security
 checks.</p>
 
-<p style="margin-top: 1em"><b>-T</b> <i>filename</i>,
-<b>--files-from</b> <i>filename</i></p>
+<p style="margin-top: 1em"><b>&minus;T</b> <i>filename</i>,
+<b>&minus;&minus;files-from</b> <i>filename</i></p>
 
 <p style="margin-left:17%;">In x or t mode, <b>tar</b> will
 read the list of names to be extracted from <i>filename</i>.
 In c mode, <b>tar</b> will read names to be archived from
 <i>filename</i>. The special name
-&rsquo;&rsquo;-C&rsquo;&rsquo; on a line by itself will
+&lsquo;&lsquo;-C&rsquo;&rsquo; on a line by itself will
 cause the current directory to be changed to the directory
 specified on the following line. Names are terminated by
-newlines unless <b>--null</b> is specified. Note that
-<b>--null</b> also disables the special handling of lines
-containing &rsquo;&rsquo;-C&rsquo;&rsquo;. Note: If you are
-generating lists of files using find(1), you probably want
-to use <b>-n</b> as well.</p>
+newlines unless <b>&minus;&minus;null</b> is specified. Note
+that <b>&minus;&minus;null</b> also disables the special
+handling of lines containing &lsquo;&lsquo;-C&rsquo;&rsquo;.
+Note: If you are generating lists of files using find(1),
+you probably want to use <b>&minus;n</b> as well.</p>
 
-<p style="margin-top: 1em"><b>--totals</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;totals</b></p>
 
-<p style="margin-left:17%;">(c, r, u mode only) After
+<p style="margin-left:17%;">(c, r, u modes only) After
 archiving all files, print a summary to stderr.</p>
 
-<p style="margin-top: 1em"><b>-U</b>, <b>--unlink</b>,
-<b>--unlink-first</b></p>
+<p style="margin-top: 1em"><b>&minus;U</b>,
+<b>&minus;&minus;unlink</b>,
+<b>&minus;&minus;unlink-first</b></p>
 
 <p style="margin-left:17%;">(x mode only) Unlink files
 before creating them. This can be a minor performance
@@ -846,58 +948,74 @@ also causes <b>tar</b> to remove intervening directory
 symlinks instead of reporting an error. See the SECURITY
 section below for more details.</p>
 
-<p style="margin-top: 1em"><b>--uid</b> <i>id</i></p>
+<p style="margin-top: 1em"><b>&minus;&minus;uid</b>
+<i>id</i></p>
 
 <p style="margin-left:17%;">Use the provided user id number
 and ignore the user name from the archive. On create, if
-<b>--uname</b> is not also specified, the user name will be
-set to match the user id.</p>
+<b>&minus;&minus;uname</b> is not also specified, the user
+name will be set to match the user id.</p>
 
-<p style="margin-top: 1em"><b>--uname</b> <i>name</i></p>
+<p style="margin-top: 1em"><b>&minus;&minus;uname</b>
+<i>name</i></p>
 
 <p style="margin-left:17%;">Use the provided user name. On
 extract, this overrides the user name in the archive; if the
 provided user name does not exist on the system, it will be
 ignored and the user id (from the archive or from the
-<b>--uid</b> option) will be used instead. On create, this
-sets the user name that will be stored in the archive; the
-name is not verified against the system user database.</p>
+<b>&minus;&minus;uid</b> option) will be used instead. On
+create, this sets the user name that will be stored in the
+archive; the name is not verified against the system user
+database.</p>
 
-<p style="margin-top: 1em"><b>--use-compress-program</b>
+
+<p style="margin-top: 1em"><b>&minus;&minus;use-compress-program</b>
 <i>program</i></p>
 
 <p style="margin-left:17%;">Pipe the input (in x or t mode)
 or the output (in c mode) through <i>program</i> instead of
 using the builtin compression support.</p>
 
-<p style="margin-top: 1em"><b>-v</b>, <b>--verbose</b></p>
+<p style="margin-top: 1em"><b>&minus;v</b>,
+<b>&minus;&minus;verbose</b></p>
 
 <p style="margin-left:17%;">Produce verbose output. In
 create and extract modes, <b>tar</b> will list each file
 name as it is read from or written to the archive. In list
 mode, <b>tar</b> will produce output similar to that of
-ls(1). An additional <b>-v</b> option will also provide
-ls-like details in create and extract mode.</p>
+ls(1). An additional <b>&minus;v</b> option will also
+provide ls-like details in create and extract mode.</p>
+
 
-<p style="margin-top: 1em"><b>--version</b></p>
+<p style="margin-top: 1em"><b>&minus;&minus;version</b></p>
 
 <p style="margin-left:17%;">Print version of <b>tar</b> and
 <b>libarchive</b>, and exit.</p>
 
-<p style="margin-top: 1em"><b>-w</b>,
-<b>--confirmation</b>, <b>--interactive</b></p>
+<p style="margin-top: 1em"><b>&minus;w</b>,
+<b>&minus;&minus;confirmation</b>,
+<b>&minus;&minus;interactive</b></p>
 
 <p style="margin-left:17%;">Ask for confirmation for every
 action.</p>
 
-<p style="margin-top: 1em"><b>-X</b> <i>filename</i>,
-<b>--exclude-from</b> <i>filename</i></p>
+<p style="margin-top: 1em"><b>&minus;X</b> <i>filename</i>,
+<b>&minus;&minus;exclude-from</b> <i>filename</i></p>
 
 <p style="margin-left:17%;">Read a list of exclusion
-patterns from the specified file. See <b>--exclude</b> for
-more information about the handling of exclusions.</p>
+patterns from the specified file. See
+<b>&minus;&minus;exclude</b> for more information about the
+handling of exclusions.</p>
+
+<p style="margin-top: 1em"><b>&minus;&minus;xattrs</b></p>
 
-<p style="margin-top: 1em"><b>-y</b></p>
+<p style="margin-left:17%;">(c, r, u, x modes only) Archive
+or extract extended attributes. This is the reverse of
+<b>&minus;&minus;no-xattrs</b> and the default behavior in
+c, r, and u modes or if <b>tar</b> is run in x mode as
+root.</p>
+
+<p style="margin-top: 1em"><b>&minus;y</b></p>
 
 <p style="margin-left:17%; margin-top: 1em">(c mode only)
 Compress the resulting archive with bzip2(1). In extract or
@@ -905,8 +1023,9 @@ list modes, this option is ignored. Note that, unlike other
 <b>tar</b> implementations, this implementation recognizes
 bzip2 compression automatically when reading archives.</p>
 
-<p style="margin-top: 1em"><b>-Z</b>, <b>--compress</b>,
-<b>--uncompress</b></p>
+<p style="margin-top: 1em"><b>&minus;Z</b>,
+<b>&minus;&minus;compress</b>,
+<b>&minus;&minus;uncompress</b></p>
 
 <p style="margin-left:17%;">(c mode only) Compress the
 resulting archive with compress(1). In extract or list
@@ -915,8 +1034,8 @@ modes, this option is ignored. Note that, unlike other
 compress compression automatically when reading
 archives.</p>
 
-<p style="margin-top: 1em"><b>-z</b>, <b>--gunzip</b>,
-<b>--gzip</b></p>
+<p style="margin-top: 1em"><b>&minus;z</b>,
+<b>&minus;&minus;gunzip</b>, <b>&minus;&minus;gzip</b></p>
 
 <p style="margin-left:17%;">(c mode only) Compress the
 resulting archive with gzip(1). In extract or list modes,
@@ -932,14 +1051,14 @@ variables affect the execution of <b>tar</b>:</p>
 <p style="margin-top: 1em">TAR_READER_OPTIONS</p>
 
 <p style="margin-left:21%;">The default options for format
-readers and compression readers. The <b>--options</b> option
-overrides this.</p>
+readers and compression readers. The
+<b>&minus;&minus;options</b> option overrides this.</p>
 
 <p style="margin-top: 1em">TAR_WRITER_OPTIONS</p>
 
 <p style="margin-left:21%;">The default options for format
-writers and compression writers. The <b>--options</b> option
-overrides this.</p>
+writers and compression writers. The
+<b>&minus;&minus;options</b> option overrides this.</p>
 
 <p style="margin-top: 1em">LANG</p>
 
@@ -949,9 +1068,9 @@ use. See environ(7) for more information.</p>
 <p style="margin-top: 1em">TAPE</p>
 
 <p style="margin-left:21%; margin-top: 1em">The default
-device. The <b>-f</b> option overrides this. Please see the
-description of the <b>-f</b> option above for more
-details.</p>
+device. The <b>&minus;f</b> option overrides this. Please
+see the description of the <b>&minus;f</b> option above for
+more details.</p>
 
 <p style="margin-top: 1em">TZ</p>
 
@@ -971,38 +1090,38 @@ occurs.</p>
 archive called <i>file.tar.gz</i> that contains two files
 <i>source.c</i> and <i>source.h</i>:</p>
 
-<p style="margin-left:14%;"><b>tar -czf</b> <i>file.tar.gz
-source.c source.h</i></p>
+<p style="margin-left:14%;"><b>tar &minus;czf</b>
+<i>file.tar.gz source.c source.h</i></p>
 
 <p style="margin-left:6%; margin-top: 1em">To view a
 detailed table of contents for this archive:</p>
 
-<p style="margin-left:14%;"><b>tar -tvf</b>
+<p style="margin-left:14%;"><b>tar &minus;tvf</b>
 <i>file.tar.gz</i></p>
 
 <p style="margin-left:6%; margin-top: 1em">To extract all
 entries from the archive on the default tape drive:</p>
 
-<p style="margin-left:14%;"><b>tar -x</b></p>
+<p style="margin-left:14%;"><b>tar &minus;x</b></p>
 
 <p style="margin-left:6%; margin-top: 1em">To examine the
 contents of an ISO 9660 cdrom image:</p>
 
-<p style="margin-left:14%;"><b>tar -tf</b>
+<p style="margin-left:14%;"><b>tar &minus;tf</b>
 <i>image.iso</i></p>
 
 <p style="margin-left:6%; margin-top: 1em">To move file
 hierarchies, invoke <b>tar</b> as</p>
 
-<p style="margin-left:14%;"><b>tar -cf</b> <i>-</i>
-<b>-C</b> <i>srcdir&nbsp;.</i> | <b>tar -xpf</b> <i>-</i>
-<b>-C</b> <i>destdir</i></p>
+<p style="margin-left:14%;"><b>tar &minus;cf</b> <i>-</i>
+<b>&minus;C</b> <i>srcdir&nbsp;.</i> | <b>tar &minus;xpf</b>
+<i>-</i> <b>&minus;C</b> <i>destdir</i></p>
 
 <p style="margin-left:6%;">or more traditionally</p>
 
-<p style="margin-left:14%;">cd srcdir ; <b>tar -cf</b>
-<i>-&nbsp;.</i> | (<i>cd destdir ;</i> <b>tar -xpf</b>
-<i>-</i>)</p>
+<p style="margin-left:14%;">cd srcdir ; <b>tar
+&minus;cf</b> <i>-&nbsp;.</i> | (<i>cd destdir ;</i> <b>tar
+&minus;xpf</b> <i>-</i>)</p>
 
 <p style="margin-left:6%; margin-top: 1em">In create mode,
 the list of files and directories to be archived can also
@@ -1011,8 +1130,8 @@ include directory change instructions of the form
 <b>@</b><i>archive-file</i>. For example, the command
 line</p>
 
-<p style="margin-left:14%;"><b>tar -c -f</b> <i>new.tar
-foo1</i> <b>@</b><i>old.tgz</i> <b>-C</b><i>/tmp
+<p style="margin-left:14%;"><b>tar &minus;c &minus;f</b>
+<i>new.tar foo1</i> <b>@</b><i>old.tgz</i> <b>-C</b><i>/tmp
 foo2</i></p>
 
 <p style="margin-left:6%;">will create a new archive
@@ -1036,29 +1155,31 @@ usr/bin/ls uid=0 gid=0 mode=0755 type=file content=myls <br>
 $ tar -cvf output.tar @input.mtree</p>
 
 <p style="margin-left:6%; margin-top: 1em">The
-<b>--newer</b> and <b>--newer-mtime</b> switches accept a
-variety of common date and time specifications, including
-&rsquo;&rsquo;12 Mar 2005 7:14:29pm&rsquo;&rsquo;,
-&rsquo;&rsquo;2005-03-12 19:14&rsquo;&rsquo;,
-&rsquo;&rsquo;5 minutes ago&rsquo;&rsquo;, and
-&rsquo;&rsquo;19:14 PST May 1&rsquo;&rsquo;.</p>
+<b>&minus;&minus;newer</b> and
+<b>&minus;&minus;newer-mtime</b> switches accept a variety
+of common date and time specifications, including
+&lsquo;&lsquo;12 Mar 2005 7:14:29pm&rsquo;&rsquo;,
+&lsquo;&lsquo;2005-03-12 19:14&rsquo;&rsquo;,
+&lsquo;&lsquo;5 minutes ago&rsquo;&rsquo;, and
+&lsquo;&lsquo;19:14 PST May 1&rsquo;&rsquo;.</p>
 
 <p style="margin-left:6%; margin-top: 1em">The
-<b>--options</b> argument can be used to control various
-details of archive generation or reading. For example, you
-can generate mtree output which only contains <b>type</b>,
-<b>time</b>, and <b>uid</b> keywords:</p>
-
-<p style="margin-left:14%;"><b>tar -cf</b> <i>file.tar</i>
-<b>--format=mtree
---options=&rsquo;!all,type,time,uid&rsquo;</b>
+<b>&minus;&minus;options</b> argument can be used to control
+various details of archive generation or reading. For
+example, you can generate mtree output which only contains
+<b>type</b>, <b>time</b>, and <b>uid</b> keywords:</p>
+
+<p style="margin-left:14%;"><b>tar &minus;cf</b>
+<i>file.tar</i> <b>&minus;&minus;format=mtree
+&minus;&minus;options=&rsquo;!all,type,time,uid&rsquo;</b>
 <i>dir</i></p>
 
 <p style="margin-left:6%;">or you can set the compression
 level used by gzip or xz compression:</p>
 
-<p style="margin-left:14%;"><b>tar -czf</b> <i>file.tar</i>
-<b>--options=&rsquo;compression-level=9&rsquo;</b>.</p>
+<p style="margin-left:14%;"><b>tar &minus;czf</b>
+<i>file.tar</i>
+<b>&minus;&minus;options=&rsquo;compression-level=9&rsquo;</b>.</p>
 
 <p style="margin-left:6%;">For more details, see the
 explanation of the <b>archive_read_set_options</b>() and
@@ -1137,27 +1258,28 @@ then use that link to restore a file into that directory. To
 guard against this, <b>tar</b> checks each extracted path
 for symlinks. If the final path element is a symlink, it
 will be removed and replaced with the archive entry. If
-<b>-U</b> is specified, any intermediate symlink will also
-be unconditionally removed. If neither <b>-U</b> nor
-<b>-P</b> is specified, <b>tar</b> will refuse to extract
-the entry.</p>
+<b>&minus;U</b> is specified, any intermediate symlink will
+also be unconditionally removed. If neither <b>&minus;U</b>
+nor <b>&minus;P</b> is specified, <b>tar</b> will refuse to
+extract the entry.</p>
 
 <p style="margin-left:6%;">To protect yourself, you should
 be wary of any archives that come from untrusted sources.
 You should examine the contents of an archive with</p>
 
-<p style="margin-left:14%;"><b>tar -tf</b>
+<p style="margin-left:14%;"><b>tar &minus;tf</b>
 <i>filename</i></p>
 
 <p style="margin-left:6%;">before extraction. You should
-use the <b>-k</b> option to ensure that <b>tar</b> will not
-overwrite any existing files or the <b>-U</b> option to
-remove any pre-existing files. You should generally not
-extract archives while running with super-user privileges.
-Note that the <b>-P</b> option to <b>tar</b> disables the
-security checks above and allows you to extract an archive
-while preserving any absolute pathnames, <i>..</i>
-components, or symlinks to other directories.</p>
+use the <b>&minus;k</b> option to ensure that <b>tar</b>
+will not overwrite any existing files or the <b>&minus;U</b>
+option to remove any pre-existing files. You should
+generally not extract archives while running with super-user
+privileges. Note that the <b>&minus;P</b> option to
+<b>tar</b> disables the security checks above and allows you
+to extract an archive while preserving any absolute
+pathnames, <i>..</i> components, or symlinks to other
+directories.</p>
 
 <p style="margin-top: 1em"><b>SEE ALSO</b></p>
 
@@ -1169,9 +1291,9 @@ libarchive-formats(5), tar(5)</p>
 
 <p style="margin-left:6%;">There is no current POSIX
 standard for the tar command; it appeared in ISO/IEC
-9945-1:1996 (&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;) but was
+9945-1:1996 (&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;) but was
 dropped from IEEE Std 1003.1-2001
-(&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;). The options supported
+(&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;). The options supported
 by this implementation were developed by surveying a number
 of existing tar implementations as well as the old POSIX
 specification for tar and the current POSIX specification
@@ -1179,7 +1301,7 @@ for pax.</p>
 
 <p style="margin-left:6%; margin-top: 1em">The ustar and
 pax interchange file formats are defined by IEEE Std
-1003.1-2001 (&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;) for the
+1003.1-2001 (&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;) for the
 pax command.</p>
 
 <p style="margin-top: 1em"><b>HISTORY</b></p>
@@ -1201,13 +1323,13 @@ library. It was first released with FreeBSD&nbsp;5.4 in May,
 <p style="margin-top: 1em"><b>BUGS</b></p>
 
 <p style="margin-left:6%;">This program follows ISO/IEC
-9945-1:1996 (&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;) for the
-definition of the <b>-l</b> option. Note that GNU tar prior
-to version 1.15 treated <b>-l</b> as a synonym for the
-<b>--one-file-system</b> option.</p>
+9945-1:1996 (&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;) for the
+definition of the <b>&minus;l</b> option. Note that GNU tar
+prior to version 1.15 treated <b>&minus;l</b> as a synonym
+for the <b>&minus;&minus;one-file-system</b> option.</p>
 
-<p style="margin-left:6%; margin-top: 1em">The <b>-C</b>
-<i>dir</i> option may differ from historic
+<p style="margin-left:6%; margin-top: 1em">The
+<b>&minus;C</b> <i>dir</i> option may differ from historic
 implementations.</p>
 
 <p style="margin-left:6%; margin-top: 1em">All archive
@@ -1229,13 +1351,13 @@ and decompression is implemented internally, so there may be
 insignificant differences between the compressed output
 generated by</p>
 
-<p style="margin-left:14%;"><b>tar -czf</b> <i>-
+<p style="margin-left:14%;"><b>tar &minus;czf</b> <i>-
 file</i></p>
 
 <p style="margin-left:6%;">and that generated by</p>
 
-<p style="margin-left:14%;"><b>tar -cf</b> <i>- file</i> |
-<b>gzip</b></p>
+<p style="margin-left:14%;"><b>tar &minus;cf</b> <i>-
+file</i> | <b>gzip</b></p>
 
 <p style="margin-left:6%; margin-top: 1em">The default
 should be to read and write archives to the standard I/O
@@ -1253,7 +1375,7 @@ as <i>./@foo</i> or <i>./-foo</i>, respectively.</p>
 
 <p style="margin-left:6%; margin-top: 1em">In create mode,
 a leading <i>./</i> is always removed. A leading <i>/</i> is
-stripped unless the <b>-P</b> option is specified.</p>
+stripped unless the <b>&minus;P</b> option is specified.</p>
 
 <p style="margin-left:6%; margin-top: 1em">There needs to
 be better support for file selection on both create and
@@ -1270,7 +1392,7 @@ incompatible ways that different archive formats store
 hardlink information.)</p>
 
 <p style="margin-left:6%; margin-top: 1em">BSD
-September&nbsp;16, 2014 BSD</p>
+February&nbsp;24, 2017 BSD</p>
 <hr>
 </body>
 </html>
index aa3e57c..af75de4 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:19 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:06 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -46,7 +46,7 @@ those integers (binary, octal, or hexadecimal). The header
 is followed by the pathname of the entry (the length of the
 pathname is stored in the header) and any file data. The end
 of the archive is indicated by a special record with the
-pathname &rsquo;&rsquo;TRAILER!!!&rsquo;&rsquo;.</p>
+pathname &lsquo;&lsquo;TRAILER!!!&rsquo;&rsquo;.</p>
 
 <p style="margin-left:6%; margin-top: 1em"><b>PWB
 format</b> <br>
@@ -239,11 +239,11 @@ included with each copy of the file.</p>
 <p style="margin-left:6%; margin-top: 1em"><b>Portable
 ASCII Format</b> <br>
 Version&nbsp;2 of the Single UNIX Specification
-(&rsquo;&rsquo;SUSv2&rsquo;&rsquo;) standardized an ASCII
+(&lsquo;&lsquo;SUSv2&rsquo;&rsquo;) standardized an ASCII
 variant that is portable across all platforms. It is
-commonly known as the &rsquo;&rsquo;old
+commonly known as the &lsquo;&lsquo;old
 character&rsquo;&rsquo; format or as the
-&rsquo;&rsquo;odc&rsquo;&rsquo; format. It stores the same
+&lsquo;&lsquo;odc&rsquo;&rsquo; format. It stores the same
 numeric fields as the old binary format, but represents them
 as 6-character or 11-character octal values.</p>
 
@@ -302,7 +302,7 @@ the old binary format above.</p>
 <p style="margin-top: 1em"><i>magic</i></p>
 
 <p style="margin-left:17%; margin-top: 1em">The string
-&rsquo;&rsquo;070701&rsquo;&rsquo;.</p>
+&lsquo;&lsquo;070701&rsquo;&rsquo;.</p>
 
 <p style="margin-top: 1em"><i>check</i></p>
 
@@ -326,7 +326,7 @@ archive.</p>
 Format</b> <br>
 The CRC format is identical to the new ASCII format
 described in the previous section except that the magic
-field is set to &rsquo;&rsquo;070702&rsquo;&rsquo; and the
+field is set to &lsquo;&lsquo;070702&rsquo;&rsquo; and the
 <i>check</i> field is set to the sum of all bytes in the
 file data. This sum is computed treating all bytes as
 unsigned values and using unsigned arithmetic. Only the
@@ -355,7 +355,7 @@ XXX</p>
 <p style="margin-left:6%;">The <b>cpio</b> utility is no
 longer a part of POSIX or the Single Unix Standard. It last
 appeared in Version&nbsp;2 of the Single UNIX Specification
-(&rsquo;&rsquo;SUSv2&rsquo;&rsquo;). It has been supplanted
+(&lsquo;&lsquo;SUSv2&rsquo;&rsquo;). It has been supplanted
 in subsequent standards by pax(1). The portable ASCII format
 is currently part of the specification for the pax(1)
 utility.</p>
@@ -365,14 +365,14 @@ utility.</p>
 <p style="margin-left:6%;">The original cpio utility was
 written by Dick Haight while working in AT&amp;T&rsquo;s
 Unix Support Group. It appeared in 1977 as part of PWB/UNIX
-1.0, the &rsquo;&rsquo;Programmer&rsquo;s Work
+1.0, the &lsquo;&lsquo;Programmer&rsquo;s Work
 Bench&rsquo;&rsquo; derived from Version&nbsp;6 AT&amp;T
 UNIX that was used internally at AT&amp;T. Both the old
 binary and old character formats were in use by 1980,
 according to the System III source released by SCO under
-their &rsquo;&rsquo;Ancient Unix&rsquo;&rsquo; license. The
+their &lsquo;&lsquo;Ancient Unix&rsquo;&rsquo; license. The
 character format was adopted as part of IEEE Std 1003.1-1988
-(&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;). XXX when did
+(&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;). XXX when did
 &quot;newc&quot; appear? Who invented it? When did HP come
 out with their variant? When did Sun introduce ACLs and
 extended attributes? XXX</p>
@@ -380,7 +380,7 @@ extended attributes? XXX</p>
 <p style="margin-top: 1em"><b>BUGS</b></p>
 
 <p style="margin-left:6%;">The
-&rsquo;&rsquo;CRC&rsquo;&rsquo; format is mis-named, as it
+&lsquo;&lsquo;CRC&rsquo;&rsquo; format is mis-named, as it
 uses a simple checksum and not a cyclic redundancy
 check.</p>
 
index 6423b4f..3c6df7f 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:19 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:06 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -34,7 +34,7 @@ library</p>
 <p style="margin-left:6%;">The libarchive(3) library reads
 and writes a variety of streaming archive formats. Generally
 speaking, all of these archive formats consist of a series
-of &rsquo;&rsquo;entries&rsquo;&rsquo;. Each entry stores a
+of &lsquo;&lsquo;entries&rsquo;&rsquo;. Each entry stores a
 single file system object, such as a file, directory, or
 symbolic link.</p>
 
@@ -52,8 +52,8 @@ all supported formats.</p>
 <p style="margin-left:6%; margin-top: 1em"><b>Tar
 Formats</b> <br>
 The libarchive(3) library can read most tar archives. It can
-write POSIX-standard &rsquo;&rsquo;ustar&rsquo;&rsquo; and
-&rsquo;&rsquo;pax interchange&rsquo;&rsquo; formats as well
+write POSIX-standard &lsquo;&lsquo;ustar&rsquo;&rsquo; and
+&lsquo;&lsquo;pax interchange&rsquo;&rsquo; formats as well
 as v7 tar format and a subset of the legacy GNU tar
 format.</p>
 
@@ -99,7 +99,7 @@ standard are in all lowercase; vendors are allowed to define
 custom keys by preceding them with the vendor name in all
 uppercase. When writing pax archives, libarchive uses many
 of the SCHILY keys defined by Joerg Schilling&rsquo;s
-&rsquo;&rsquo;star&rsquo;&rsquo; archiver and a few
+&lsquo;&lsquo;star&rsquo;&rsquo; archiver and a few
 LIBARCHIVE keys. The libarchive library can read most of the
 SCHILY keys and most of the GNU keys introduced by GNU tar.
 It silently ignores any keywords that it does not
@@ -241,16 +241,16 @@ extended attribute records written by Solaris tar.</p>
 <p style="margin-left:6%; margin-top: 1em">The first tar
 program appeared in Seventh Edition Unix in 1979. The first
 official standard for the tar file format was the
-&rsquo;&rsquo;ustar&rsquo;&rsquo; (Unix Standard Tar) format
+&lsquo;&lsquo;ustar&rsquo;&rsquo; (Unix Standard Tar) format
 defined by POSIX in 1988. POSIX.1-2001 extended the ustar
-format to create the &rsquo;&rsquo;pax
+format to create the &lsquo;&lsquo;pax
 interchange&rsquo;&rsquo; format.</p>
 
 <p style="margin-left:6%; margin-top: 1em"><b>Cpio
 Formats</b> <br>
 The libarchive library can read a number of common cpio
-variants and can write &rsquo;&rsquo;odc&rsquo;&rsquo; and
-&rsquo;&rsquo;newc&rsquo;&rsquo; format archives. A cpio
+variants and can write &lsquo;&lsquo;odc&rsquo;&rsquo; and
+&lsquo;&lsquo;newc&rsquo;&rsquo; format archives. A cpio
 archive stores each entry as a fixed-size header followed by
 a variable-length filename and variable-length data. Unlike
 the tar format, the cpio format does only minimal padding of
@@ -272,11 +272,11 @@ mtime, and 16-bit binary values for the other fields.</p>
 
 <p style="margin-left:17%; margin-top: 1em">The libarchive
 library can both read and write this POSIX-standard format,
-which is officially known as the &rsquo;&rsquo;cpio
+which is officially known as the &lsquo;&lsquo;cpio
 interchange format&rsquo;&rsquo; or the
-&rsquo;&rsquo;octet-oriented cpio archive
+&lsquo;&lsquo;octet-oriented cpio archive
 format&rsquo;&rsquo; and sometimes unofficially referred to
-as the &rsquo;&rsquo;old character format&rsquo;&rsquo;.
+as the &lsquo;&lsquo;old character format&rsquo;&rsquo;.
 This format stores the header contents as octal values in
 ASCII. It is standard, portable, and immune from byte-order
 confusion. File sizes and mtime are limited to 33 bits (8GB
@@ -312,7 +312,7 @@ systems with dissimilar user numbering.</p>
 
 <p style="margin-left:6%; margin-top: 1em"><b>Shar
 Formats</b> <br>
-A &rsquo;&rsquo;shell archive&rsquo;&rsquo; is a shell
+A &lsquo;&lsquo;shell archive&rsquo;&rsquo; is a shell
 script that, when executed on a POSIX-compliant system, will
 recreate a collection of file system objects. The libarchive
 library can write two different kinds of shar archives:</p>
@@ -379,7 +379,7 @@ variables.</p>
 format</b> <br>
 Libarchive can read and write zip format archives that have
 uncompressed entries and entries compressed with the
-&rsquo;&rsquo;deflate&rsquo;&rsquo; algorithm. Other zip
+&lsquo;&lsquo;deflate&rsquo;&rsquo; algorithm. Other zip
 compression algorithms are not supported. It can extract jar
 archives, archives that use Zip64 extensions and
 self-extracting zip archives. Libarchive can use either of
@@ -469,7 +469,7 @@ Need more information</p>
 
 <p style="margin-left:6%; margin-top: 1em"><b>CAB</b> <br>
 Libarchive can read Microsoft Cabinet (
-&rsquo;&rsquo;CAB&rsquo;&rsquo;) format archives. TODO: Need
+&lsquo;&lsquo;CAB&rsquo;&rsquo;) format archives. TODO: Need
 more information.</p>
 
 <p style="margin-left:6%; margin-top: 1em"><b>LHA</b> <br>
@@ -484,7 +484,7 @@ the RARv3 format. Libarchive can also read self-extracting
 RAR archives.</p>
 
 <p style="margin-left:6%; margin-top: 1em"><b>Warc</b> <br>
-Libarchive can read and write &rsquo;&rsquo;web
+Libarchive can read and write &lsquo;&lsquo;web
 archives&rsquo;&rsquo;. TODO: Need more information</p>
 
 <p style="margin-left:6%; margin-top: 1em"><b>XAR</b> <br>
index 0b9e57f..bddaee8 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:19 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:07 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -53,11 +53,11 @@ for:</p>
 <p><b>&bull;</b></p>
 
 <p style="margin-left:12%;">most variants of the POSIX
-&rsquo;&rsquo;ustar&rsquo;&rsquo; format,</p>
+&lsquo;&lsquo;ustar&rsquo;&rsquo; format,</p>
 
 <p><b>&bull;</b></p>
 
-<p style="margin-left:12%;">the POSIX &rsquo;&rsquo;pax
+<p style="margin-left:12%;">the POSIX &lsquo;&lsquo;pax
 interchange&rsquo;&rsquo; format,</p>
 
 <p><b>&bull;</b></p>
@@ -117,11 +117,11 @@ format to use. The library can write</p>
 <p><b>&bull;</b></p>
 
 <p style="margin-left:12%;">POSIX-standard
-&rsquo;&rsquo;ustar&rsquo;&rsquo; archives,</p>
+&lsquo;&lsquo;ustar&rsquo;&rsquo; archives,</p>
 
 <p><b>&bull;</b></p>
 
-<p style="margin-left:12%;">POSIX &rsquo;&rsquo;pax
+<p style="margin-left:12%;">POSIX &lsquo;&lsquo;pax
 interchange format&rsquo;&rsquo; archives,</p>
 
 <p><b>&bull;</b></p>
index 7863b7d..7bf820d 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:19 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:07 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -57,7 +57,7 @@ can be easily converted to UTF-8.</p>
 
 <p style="margin-left:6%; margin-top: 1em">Libarchive3 uses
 the standard iconv library to convert between character sets
-and is introducing the notion of a &rsquo;&rsquo;default
+and is introducing the notion of a &lsquo;&lsquo;default
 character set for the archive&rsquo;&rsquo;. To support
 this, archive_entry objects can now be bound to a particular
 archive when they are created. The automatic character set
index 34cc937..8be18c9 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:19 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:07 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
index b0af74d..f7d3fba 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:19 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:07 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -175,7 +175,7 @@ pathname of a file that holds the contents of this file.</p>
 <p style="margin-left:22%; margin-top: 1em">The file flags
 as a symbolic name. See chflags(1) for information on these
 names. If no flags are to be set the string
-&rsquo;&rsquo;none&rsquo;&rsquo; may be used to override the
+&lsquo;&lsquo;none&rsquo;&rsquo; may be used to override the
 current default.</p>
 
 <p style="margin-top: 1em"><b>gid</b></p>
@@ -239,7 +239,7 @@ file hierarchy.</p>
 <p style="margin-top: 1em"><b>resdevice</b></p>
 
 <p style="margin-left:22%; margin-top: 1em">The
-&rsquo;&rsquo;resident&rsquo;&rsquo; device number of the
+&lsquo;&lsquo;resident&rsquo;&rsquo; device number of the
 file, e.g. the ID of the device that contains the file. Its
 format is the same as the one for <b>device</b>.</p>
 
@@ -261,7 +261,7 @@ the file.</p>
 <p style="margin-top: 1em"><b>sha1</b></p>
 
 <p style="margin-left:22%; margin-top: 1em">The FIPS 160-1
-(&rsquo;&rsquo;SHA-1&rsquo;&rsquo;) message digest of the
+(&lsquo;&lsquo;SHA-1&rsquo;&rsquo;) message digest of the
 file.</p>
 
 <p style="margin-top: 1em"><b>sha1digest</b></p>
@@ -272,7 +272,7 @@ file.</p>
 <p style="margin-top: 1em"><b>sha256</b></p>
 
 <p style="margin-left:22%; margin-top: 1em">The FIPS 180-2
-(&rsquo;&rsquo;SHA-256&rsquo;&rsquo;) message digest of the
+(&lsquo;&lsquo;SHA-256&rsquo;&rsquo;) message digest of the
 file.</p>
 
 <p style="margin-top: 1em"><b>sha256digest</b></p>
@@ -283,7 +283,7 @@ file.</p>
 <p style="margin-top: 1em"><b>sha384</b></p>
 
 <p style="margin-left:22%; margin-top: 1em">The FIPS 180-2
-(&rsquo;&rsquo;SHA-384&rsquo;&rsquo;) message digest of the
+(&lsquo;&lsquo;SHA-384&rsquo;&rsquo;) message digest of the
 file.</p>
 
 <p style="margin-top: 1em"><b>sha384digest</b></p>
@@ -294,7 +294,7 @@ file.</p>
 <p style="margin-top: 1em"><b>sha512</b></p>
 
 <p style="margin-left:22%; margin-top: 1em">The FIPS 180-2
-(&rsquo;&rsquo;SHA-512&rsquo;&rsquo;) message digest of the
+(&lsquo;&lsquo;SHA-512&rsquo;&rsquo;) message digest of the
 file.</p>
 
 <p style="margin-top: 1em"><b>sha512digest</b></p>
@@ -367,15 +367,15 @@ as a symbolic name.</p>
 HISTORY</b></p>
 
 <p style="margin-left:6%;">The <b>mtree</b> utility
-appeared in 4.3BSD-Reno. The MD5 digest capability was added
-in FreeBSD&nbsp;2.1, in response to the widespread use of
-programs which can spoof cksum(1). The SHA-1 and RIPEMD160
-digests were added in FreeBSD&nbsp;4.0, as new attacks have
-demonstrated weaknesses in MD5. The SHA-256 digest was added
-in FreeBSD&nbsp;6.0. Support for file flags was added in
-FreeBSD&nbsp;4.0, and mostly comes from NetBSD. The
-&rsquo;&rsquo;full&rsquo;&rsquo; entry format was added by
-NetBSD.</p>
+appeared in 4.3BSD&minus;Reno. The MD5 digest capability was
+added in FreeBSD&nbsp;2.1, in response to the widespread use
+of programs which can spoof cksum(1). The SHA-1 and
+RIPEMD160 digests were added in FreeBSD&nbsp;4.0, as new
+attacks have demonstrated weaknesses in MD5. The SHA-256
+digest was added in FreeBSD&nbsp;6.0. Support for file flags
+was added in FreeBSD&nbsp;4.0, and mostly comes from NetBSD.
+The &lsquo;&lsquo;full&rsquo;&rsquo; entry format was added
+by NetBSD.</p>
 
 <p style="margin-left:6%; margin-top: 1em">BSD
 September&nbsp;4, 2013 BSD</p>
index 917bbd5..692a799 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.22.3 -->
-<!-- CreationDate: Sun Feb 19 09:11:19 2017 -->
+<!-- CreationDate: Sat Feb 25 11:22:08 2017 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -50,14 +50,14 @@ entirely of zero bytes.</p>
 compatibility with tape drives that use fixed block sizes,
 programs that read or write tar files always read or write a
 fixed number of records with each I/O operation. These
-&rsquo;&rsquo;blocks&rsquo;&rsquo; are always a multiple of
+&lsquo;&lsquo;blocks&rsquo;&rsquo; are always a multiple of
 the record size. The maximum block size supported by early
 implementations was 10240 bytes or 20 records. This is still
 the default for most implementations although block sizes of
 1MiB (2048 records) or larger are commonly used with modern
 high-speed tape drives. (Note: the terms
-&rsquo;&rsquo;block&rsquo;&rsquo; and
-&rsquo;&rsquo;record&rsquo;&rsquo; here are not entirely
+&lsquo;&lsquo;block&rsquo;&rsquo; and
+&lsquo;&lsquo;record&rsquo;&rsquo; here are not entirely
 standard; this document follows the convention established
 by John Gilmore in documenting <b>pdtar</b>.)</p>
 
@@ -224,7 +224,7 @@ matches.</p>
 and conserve tape, a file with multiple links is only
 written to the archive the first time it is encountered. The
 next time it is encountered, the <i>linkflag</i> is set to
-an ASCII &rsquo;1&rsquo; and the <i>linkname</i> field holds
+an ASCII &lsquo;1&rsquo; and the <i>linkname</i> field holds
 the first name under which this file appears. (Note that
 regular files have a null value in the <i>linkflag</i>
 field.)</p>
@@ -239,14 +239,14 @@ size and mtime fields must end in a space; the checksum is
 terminated by a null and a space. Early implementations
 filled the numeric fields with leading spaces. This seems to
 have been common practice until the IEEE Std 1003.1-1988
-(&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;) standard was released.
+(&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;) standard was released.
 For best portability, modern implementations should fill the
 numeric fields with leading zeros.</p>
 
 <p style="margin-left:6%; margin-top: 1em"><b>Pre-POSIX
 Archives</b> <br>
 An early draft of IEEE Std 1003.1-1988
-(&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;) served as the basis
+(&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;) served as the basis
 for John Gilmore&rsquo;s <b>pdtar</b> program and many
 system implementations from the late 1980s and early 1990s.
 These archives generally follow the POSIX ustar format
@@ -255,7 +255,7 @@ described below with the following variations:</p>
 <p><b>&bull;</b></p>
 
 <p style="margin-left:17%;">The magic value consists of the
-five characters &rsquo;&rsquo;ustar&rsquo;&rsquo; followed
+five characters &lsquo;&lsquo;ustar&rsquo;&rsquo; followed
 by a space. The version field contains a space character
 followed by a null.</p>
 
@@ -273,12 +273,12 @@ archives.</p>
 
 <p style="margin-left:6%; margin-top: 1em"><b>POSIX ustar
 Archives</b> <br>
-IEEE Std 1003.1-1988 (&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;)
+IEEE Std 1003.1-1988 (&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;)
 defined a standard tar file format to be read and written by
 compliant implementations of tar(1). This format is often
-called the &rsquo;&rsquo;ustar&rsquo;&rsquo; format, after
+called the &lsquo;&lsquo;ustar&rsquo;&rsquo; format, after
 the magic value used in the header. (The name is an acronym
-for &rsquo;&rsquo;Unix Standard TAR&rsquo;&rsquo;.) It
+for &lsquo;&lsquo;Unix Standard TAR&rsquo;&rsquo;.) It
 extends the historic format with new fields:</p>
 
 <p style="margin-left:14%; margin-top: 1em">struct
@@ -432,40 +432,40 @@ header_posix_ustar {</p>
 the earlier <i>linkflag</i> field with several new type
 values:</p>
 
-<p>&rsquo;&rsquo;0&rsquo;&rsquo;</p>
+<p>&lsquo;&lsquo;0&rsquo;&rsquo;</p>
 
 <p style="margin-left:27%; margin-top: 1em">Regular file.
 NUL should be treated as a synonym, for compatibility
 purposes.</p>
 
-<p>&rsquo;&rsquo;1&rsquo;&rsquo;</p>
+<p>&lsquo;&lsquo;1&rsquo;&rsquo;</p>
 
 <p style="margin-left:27%; margin-top: 1em">Hard link.</p>
 
-<p>&rsquo;&rsquo;2&rsquo;&rsquo;</p>
+<p>&lsquo;&lsquo;2&rsquo;&rsquo;</p>
 
 <p style="margin-left:27%; margin-top: 1em">Symbolic
 link.</p>
 
-<p>&rsquo;&rsquo;3&rsquo;&rsquo;</p>
+<p>&lsquo;&lsquo;3&rsquo;&rsquo;</p>
 
 <p style="margin-left:27%; margin-top: 1em">Character
 device node.</p>
 
-<p>&rsquo;&rsquo;4&rsquo;&rsquo;</p>
+<p>&lsquo;&lsquo;4&rsquo;&rsquo;</p>
 
 <p style="margin-left:27%; margin-top: 1em">Block device
 node.</p>
 
-<p>&rsquo;&rsquo;5&rsquo;&rsquo;</p>
+<p>&lsquo;&lsquo;5&rsquo;&rsquo;</p>
 
 <p style="margin-left:27%; margin-top: 1em">Directory.</p>
 
-<p>&rsquo;&rsquo;6&rsquo;&rsquo;</p>
+<p>&lsquo;&lsquo;6&rsquo;&rsquo;</p>
 
 <p style="margin-left:27%; margin-top: 1em">FIFO node.</p>
 
-<p>&rsquo;&rsquo;7&rsquo;&rsquo;</p>
+<p>&lsquo;&lsquo;7&rsquo;&rsquo;</p>
 
 <p style="margin-left:27%; margin-top: 1em">Reserved.</p>
 
@@ -493,7 +493,7 @@ should be set to zero by writers and ignored by readers.</p>
 <p style="margin-top: 1em"><i>magic</i></p>
 
 <p style="margin-left:17%; margin-top: 1em">Contains the
-magic value &rsquo;&rsquo;ustar&rsquo;&rsquo; followed by a
+magic value &lsquo;&lsquo;ustar&rsquo;&rsquo; followed by a
 NUL byte to indicate that this is a POSIX standard archive.
 Full compliance requires the uname and gname fields be
 properly set.</p>
@@ -501,7 +501,7 @@ properly set.</p>
 <p style="margin-top: 1em"><i>version</i></p>
 
 <p style="margin-left:17%;">Version. This should be
-&rsquo;&rsquo;00&rsquo;&rsquo; (two copies of the ASCII
+&lsquo;&lsquo;00&rsquo;&rsquo; (two copies of the ASCII
 digit zero) for POSIX standard archives.</p>
 
 <p style="margin-top: 1em"><i>uname</i>, <i>gname</i></p>
@@ -589,14 +589,14 @@ implementation.</p>
 Interchange Format</b> <br>
 There are many attributes that cannot be portably stored in
 a POSIX ustar archive. IEEE Std 1003.1-2001
-(&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;) defined a
-&rsquo;&rsquo;pax interchange format&rsquo;&rsquo; that uses
+(&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;) defined a
+&lsquo;&lsquo;pax interchange format&rsquo;&rsquo; that uses
 two new types of entries to hold text-formatted metadata
 that applies to following entries. Note that a pax
 interchange format archive is a ustar archive in every
 respect. The new data is stored in ustar-compatible archive
-entries that use the &rsquo;&rsquo;x&rsquo;&rsquo; or
-&rsquo;&rsquo;g&rsquo;&rsquo; typeflag. In particular, older
+entries that use the &lsquo;&lsquo;x&rsquo;&rsquo; or
+&lsquo;&lsquo;g&rsquo;&rsquo; typeflag. In particular, older
 implementations that do not fully support these extensions
 will extract the metadata into regular files, where the
 metadata can be examined as necessary.</p>
@@ -641,11 +641,11 @@ including pathnames, user names, and group names. In some
 cases, it is not possible to translate local conventions
 into UTF-8. If this key is present and the value is the
 six-character ASCII string
-&rsquo;&rsquo;BINARY&rsquo;&rsquo;, then all textual values
+&lsquo;&lsquo;BINARY&rsquo;&rsquo;, then all textual values
 are assumed to be in a platform-dependent multi-byte
 encoding. Note that there are only two valid values for this
-key: &rsquo;&rsquo;BINARY&rsquo;&rsquo; or
-&rsquo;&rsquo;ISO-IR&nbsp;10646&nbsp;2000&nbsp;UTF-8&rsquo;&rsquo;.
+key: &lsquo;&lsquo;BINARY&rsquo;&rsquo; or
+&lsquo;&lsquo;ISO-IR&nbsp;10646&nbsp;2000&nbsp;UTF-8&rsquo;&rsquo;.
 No other values are permitted by the standard, and the
 latter value should generally not be used as it is the
 default when this key is not specified. In particular, this
@@ -739,7 +739,7 @@ it.</p>
 
 <p style="margin-left:17%;">The time when the file was
 created. (This should not be confused with the POSIX
-&rsquo;&rsquo;ctime&rsquo;&rsquo; attribute, which refers to
+&lsquo;&lsquo;ctime&rsquo;&rsquo; attribute, which refers to
 the time when the file metadata was last changed.)</p>
 
 
@@ -749,9 +749,9 @@ the time when the file metadata was last changed.)</p>
 POSIX.1e-style extended attributes using keys of this form.
 The <i>key</i> value is URL-encoded: All non-ASCII
 characters and the two special characters
-&rsquo;&rsquo;=&rsquo;&rsquo; and
-&rsquo;&rsquo;%&rsquo;&rsquo; are encoded as
-&rsquo;&rsquo;%&rsquo;&rsquo; followed by two uppercase
+&lsquo;&lsquo;=&rsquo;&rsquo; and
+&lsquo;&lsquo;%&rsquo;&rsquo; are encoded as
+&lsquo;&lsquo;%&rsquo;&rsquo; followed by two uppercase
 hexadecimal digits. The value of this key is the extended
 attribute value encoded in base 64. XXX Detail the base-64
 format here XXX</p>
@@ -1137,8 +1137,8 @@ equal to realsize.</p>
 They contained a list of files to be renamed or symlinked
 after extraction; this was originally used to support long
 names. The contents of this record are a text description of
-the operations to be done, in the form &rsquo;&rsquo;Rename
-%s to %s\n&rsquo;&rsquo; or &rsquo;&rsquo;Symlink %s to
+the operations to be done, in the form &lsquo;&lsquo;Rename
+%s to %s\n&rsquo;&rsquo; or &lsquo;&lsquo;Symlink %s to
 %s\n&rsquo;&rsquo;; in either case, both filenames are
 escaped using K&amp;R C syntax. Due to security concerns,
 &quot;N&quot; records are now generally ignored when reading
@@ -1147,13 +1147,13 @@ archives.</p>
 <p style="margin-top: 1em">S</p>
 
 <p style="margin-left:27%; margin-top: 1em">This is a
-&rsquo;&rsquo;sparse&rsquo;&rsquo; regular file. Sparse
+&lsquo;&lsquo;sparse&rsquo;&rsquo; regular file. Sparse
 files are stored as a series of fragments. The header
 contains a list of fragment offset/length pairs. If more
 than four such entries are required, the header is extended
-as necessary with &rsquo;&rsquo;extra&rsquo;&rsquo; header
+as necessary with &lsquo;&lsquo;extra&rsquo;&rsquo; header
 extensions (an older format that is no longer used), or
-&rsquo;&rsquo;sparse&rsquo;&rsquo; extensions.</p>
+&lsquo;&lsquo;sparse&rsquo;&rsquo; extensions.</p>
 
 <p style="margin-top: 1em">V</p>
 
@@ -1164,7 +1164,7 @@ This entry should generally be ignored on extraction.</p>
 <p style="margin-top: 1em"><i>magic</i></p>
 
 <p style="margin-left:17%; margin-top: 1em">The magic field
-holds the five characters &rsquo;&rsquo;ustar&rsquo;&rsquo;
+holds the five characters &lsquo;&lsquo;ustar&rsquo;&rsquo;
 followed by a space. Note that POSIX ustar archives have a
 trailing null.</p>
 
@@ -1173,7 +1173,7 @@ trailing null.</p>
 <p style="margin-left:17%;">The version field holds a space
 character followed by a null. Note that POSIX ustar archives
 use two copies of the ASCII digit
-&rsquo;&rsquo;0&rsquo;&rsquo;.</p>
+&lsquo;&lsquo;0&rsquo;&rsquo;.</p>
 
 <p style="margin-top: 1em"><i>atime</i>, <i>ctime</i></p>
 
@@ -1200,7 +1200,7 @@ written to the file at appropriate offsets.</p>
 <p style="margin-top: 1em"><i>isextended</i></p>
 
 <p style="margin-left:17%;">If this is set to non-zero, the
-header will be followed by additional &rsquo;&rsquo;sparse
+header will be followed by additional &lsquo;&lsquo;sparse
 header&rsquo;&rsquo; records. Each such record contains
 information about as many as 21 additional sparse blocks as
 shown here:</p>
@@ -1284,20 +1284,21 @@ total size of the file.</p>
 archives</b> <br>
 GNU tar 1.14 (XXX check this XXX) and later will write pax
 interchange format archives when you specify the
-<b>--posix</b> flag. This format follows the pax interchange
-format closely, using some <b>SCHILY</b> tags and
-introducing new keywords to store sparse file information.
-There have been three iterations of the sparse file support,
-referred to as &rsquo;&rsquo;0.0&rsquo;&rsquo;,
-&rsquo;&rsquo;0.1&rsquo;&rsquo;, and
-&rsquo;&rsquo;1.0&rsquo;&rsquo;.</p>
+<b>&minus;-posix</b> flag. This format follows the pax
+interchange format closely, using some <b>SCHILY</b> tags
+and introducing new keywords to store sparse file
+information. There have been three iterations of the sparse
+file support, referred to as
+&lsquo;&lsquo;0.0&rsquo;&rsquo;,
+&lsquo;&lsquo;0.1&rsquo;&rsquo;, and
+&lsquo;&lsquo;1.0&rsquo;&rsquo;.</p>
 
 <p style="margin-top: 1em"><b>GNU.sparse.numblocks</b>,
 <b>GNU.sparse.offset</b>, <b>GNU.sparse.numbytes</b>,
 <b>GNU.sparse.size</b></p>
 
 <p style="margin-left:17%;">The
-&rsquo;&rsquo;0.0&rsquo;&rsquo; format used an initial
+&lsquo;&lsquo;0.0&rsquo;&rsquo; format used an initial
 <b>GNU.sparse.numblocks</b> attribute to indicate the number
 of blocks in the file, a pair of <b>GNU.sparse.offset</b>
 and <b>GNU.sparse.numbytes</b> to indicate the offset and
@@ -1312,7 +1313,7 @@ which is not officially permitted by the standards.</p>
 <p style="margin-top: 1em"><b>GNU.sparse.map</b></p>
 
 <p style="margin-left:17%;">The
-&rsquo;&rsquo;0.1&rsquo;&rsquo; format used a single
+&lsquo;&lsquo;0.1&rsquo;&rsquo; format used a single
 attribute that stored a comma-separated list of decimal
 numbers. Each pair of numbers indicated the offset and size,
 respectively, of a block of data. This does not work well if
@@ -1325,7 +1326,7 @@ simply discard unrecognized attributes.</p>
 <b>GNU.sparse.realsize</b></p>
 
 <p style="margin-left:17%;">The
-&rsquo;&rsquo;1.0&rsquo;&rsquo; format stores the sparse
+&lsquo;&lsquo;1.0&rsquo;&rsquo; format stores the sparse
 block map in one or more 512-byte blocks prepended to the
 file data in the entry body. The pax attributes indicate the
 existence of this map (via the <b>GNU.sparse.major</b> and
@@ -1341,7 +1342,7 @@ XXX More Details Needed XXX</p>
 
 <p style="margin-left:6%; margin-top: 1em">Solaris tar
 (beginning with SunOS XXX 5.7 ?? XXX) supports an
-&rsquo;&rsquo;extended&rsquo;&rsquo; format that is
+&lsquo;&lsquo;extended&rsquo;&rsquo; format that is
 fundamentally similar to pax interchange format, with the
 following differences:</p>
 
@@ -1380,7 +1381,7 @@ Tar</b> <br>
 The tar distributed with Apple&rsquo;s Mac OS X stores most
 regular files as two separate files in the tar archive. The
 two files have the same name except that the first one has
-&rsquo;&rsquo;._&rsquo;&rsquo; prepended to the last path
+&lsquo;&lsquo;._&rsquo;&rsquo; prepended to the last path
 element. This special file stores an AppleDouble-encoded
 binary blob with additional metadata about the second file,
 including ACL, extended attributes, and resources. To
@@ -1388,7 +1389,7 @@ recreate the original file on disk, each separate file can
 be extracted and the Mac OS X <b>copyfile</b>() function can
 be used to unpack the separate metadata file and apply it to
 th regular file. Conversely, the same function provides a
-&rsquo;&rsquo;pack&rsquo;&rsquo; option to encode the
+&lsquo;&lsquo;pack&rsquo;&rsquo; option to encode the
 extended metadata from a file into a separate file whose
 contents can then be put into a tar archive.</p>
 
@@ -1526,11 +1527,11 @@ interchange format per-file extensions.</p>
 <p style="margin-left:6%;">The <b>tar</b> utility is no
 longer a part of POSIX or the Single Unix Standard. It last
 appeared in Version&nbsp;2 of the Single UNIX Specification
-(&rsquo;&rsquo;SUSv2&rsquo;&rsquo;). It has been supplanted
+(&lsquo;&lsquo;SUSv2&rsquo;&rsquo;). It has been supplanted
 in subsequent standards by pax(1). The ustar format is
 currently part of the specification for the pax(1) utility.
 The pax interchange file format is new with IEEE Std
-1003.1-2001 (&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;).</p>
+1003.1-2001 (&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;).</p>
 
 <p style="margin-top: 1em"><b>HISTORY</b></p>
 
index 0c43b1d..5f05971 100644 (file)
@@ -104,15 +104,15 @@ archive_write_set_passphrase.3: ../mdoc2man.awk ../../libarchive/archive_write_s
 cpio.5: ../mdoc2man.awk ../../libarchive/cpio.5
        awk -f ../mdoc2man.awk < ../../libarchive/cpio.5 > cpio.5
 
+libarchive-formats.5: ../mdoc2man.awk ../../libarchive/libarchive-formats.5
+       awk -f ../mdoc2man.awk < ../../libarchive/libarchive-formats.5 > libarchive-formats.5
+
 libarchive.3: ../mdoc2man.awk ../../libarchive/libarchive.3
        awk -f ../mdoc2man.awk < ../../libarchive/libarchive.3 > libarchive.3
 
 libarchive_changes.3: ../mdoc2man.awk ../../libarchive/libarchive_changes.3
        awk -f ../mdoc2man.awk < ../../libarchive/libarchive_changes.3 > libarchive_changes.3
 
-libarchive-formats.5: ../mdoc2man.awk ../../libarchive/libarchive-formats.5
-       awk -f ../mdoc2man.awk < ../../libarchive/libarchive-formats.5 > libarchive-formats.5
-
 libarchive_internals.3: ../mdoc2man.awk ../../libarchive/libarchive_internals.3
        awk -f ../mdoc2man.awk < ../../libarchive/libarchive_internals.3 > libarchive_internals.3
 
@@ -127,4 +127,4 @@ bsdtar.1: ../mdoc2man.awk ../../tar/bsdtar.1
 
 bsdcpio.1: ../mdoc2man.awk ../../cpio/bsdcpio.1
        awk -f ../mdoc2man.awk < ../../cpio/bsdcpio.1 > bsdcpio.1
-all: archive_entry.3 archive_entry_acl.3 archive_entry_linkify.3 archive_entry_paths.3 archive_entry_perms.3 archive_entry_stat.3 archive_entry_time.3 archive_read.3 archive_read_add_passphrase.3 archive_read_data.3 archive_read_disk.3 archive_read_extract.3 archive_read_filter.3 archive_read_format.3 archive_read_free.3 archive_read_header.3 archive_read_new.3 archive_read_open.3 archive_read_set_options.3 archive_util.3 archive_write.3 archive_write_blocksize.3 archive_write_data.3 archive_write_disk.3 archive_write_filter.3 archive_write_finish_entry.3 archive_write_format.3 archive_write_free.3 archive_write_header.3 archive_write_new.3 archive_write_open.3 archive_write_set_options.3 archive_write_set_passphrase.3 cpio.5 libarchive.3 libarchive_changes.3 libarchive-formats.5 libarchive_internals.3 mtree.5 tar.5 bsdtar.1 bsdcpio.1
+all: archive_entry.3 archive_entry_acl.3 archive_entry_linkify.3 archive_entry_paths.3 archive_entry_perms.3 archive_entry_stat.3 archive_entry_time.3 archive_read.3 archive_read_add_passphrase.3 archive_read_data.3 archive_read_disk.3 archive_read_extract.3 archive_read_filter.3 archive_read_format.3 archive_read_free.3 archive_read_header.3 archive_read_new.3 archive_read_open.3 archive_read_set_options.3 archive_util.3 archive_write.3 archive_write_blocksize.3 archive_write_data.3 archive_write_disk.3 archive_write_filter.3 archive_write_finish_entry.3 archive_write_format.3 archive_write_free.3 archive_write_header.3 archive_write_new.3 archive_write_open.3 archive_write_set_options.3 archive_write_set_passphrase.3 cpio.5 libarchive-formats.5 libarchive.3 libarchive_changes.3 libarchive_internals.3 mtree.5 tar.5 bsdtar.1 bsdcpio.1
index 22c06c3..3b49475 100644 (file)
@@ -1,4 +1,4 @@
-.TH TAR 1 "September 16, 2014" ""
+.TH TAR 1 "February 24, 2017" ""
 .SH NAME
 .ad l
 \fB\%tar\fP
@@ -110,7 +110,7 @@ all operating modes.
 .RS 5
 .TP
 \fB@\fP \fIarchive\fP
-(c and r mode only)
+(c and r modes only)
 The specified archive is opened and the entries
 in it will be appended to the current archive.
 As a simple example,
@@ -168,6 +168,17 @@ and gzip compression,
 if it is unknown suffix or no suffix, creates a new archive with
 restricted pax format and bzip2 compression.
 .TP
+\fB\-Fl\fP acls
+(c, r, u, x modes only)
+Archive or extract POSIX.1e or NFSv4 ACLs. This is the reverse of
+\fB\-Fl\fP no-acls
+and the default behavior in c, r, and u modes (except Mac OS X) or if
+\fB\%tar\fP
+is run in x mode as root. On Mac OS X this option translates extended ACLs
+to NFSv4 ACLs. To store extended ACLs the
+\fB\-Fl\fP mac-metadata
+option is preferred.
+.TP
 \fB\-B\fP, \fB\-Fl\fP read-full-blocks
 Ignored for compatibility with other
 \fBtar\fP(1)
@@ -197,17 +208,20 @@ options and before extracting any files.
 Before removing file system objects to replace them, clear platform-specific
 file flags that might prevent removal.
 .TP
-\fB\-Fl\fP disable-copyfile
-Mac OS X specific.
-Disable the use of
-\fBcopyfile\fP(3).
-.TP
 \fB\-Fl\fP exclude \fIpattern\fP
 Do not process files or directories that match the
 specified pattern.
 Note that exclusions take precedence over patterns or filenames
 specified on the command line.
 .TP
+\fB\-Fl\fP fflags
+(c, r, u, x modes only)
+Archive or extract file flags. This is the reverse of
+\fB\-Fl\fP no-fflags
+and the default behavior in c, r, and u modes or if
+\fB\%tar\fP
+is run in x mode as root.
+.TP
 \fB\-Fl\fP format \fIformat\fP
 (c, r, u mode only)
 Use the specified format for the created archive.
@@ -260,12 +274,12 @@ in the archive;
 the name will not be verified against the system group database.
 .TP
 \fB\-H\fP
-(c and r mode only)
+(c and r modes only)
 Symbolic links named on the command line will be followed; the
 target of the link will be archived, not the link itself.
 .TP
 \fB\-h\fP
-(c and r mode only)
+(c and r modes only)
 Synonym for
 \fB\-L\fP.
 .TP
@@ -278,7 +292,8 @@ Show usage.
 .TP
 \fB\-Fl\fP hfsCompression
 (x mode only)
-Mac OS X specific(v10.6 or later). Compress extracted regular files with HFS+ compression.
+Mac OS X specific (v10.6 or later). Compress extracted regular files with HFS+
+compression.
 .TP
 \fB\-Fl\fP ignore-zeros
 An alias of
@@ -338,7 +353,7 @@ Do not overwrite existing files that are newer than the
 versions appearing in the archive being extracted.
 .TP
 \fB\-L\fP, \fB\-Fl\fP dereference
-(c and r mode only)
+(c and r modes only)
 All symbolic links will be followed.
 Normally, symbolic links are archived as such.
 With this option, the target of the link will be archived instead.
@@ -380,6 +395,17 @@ In extract or list modes, this option is ignored.
 Do not extract modification time.
 By default, the modification time is set to the time stored in the archive.
 .TP
+\fB\-Fl\fP mac-metadata
+(c, r, u and x mode only)
+Mac OS X specific. Archive or extract extended ACLs and extended attributes
+using
+\fBcopyfile\fP(3)
+in AppleDouble format. This is the reverse of
+\fB\-Fl\fP no-mac-metadata.
+and the default behavior in c, r, and u modes or if
+\fB\%tar\fP
+is run in x mode as root.
+.TP
 \fB\-n\fP, \fB\-Fl\fP norecurse, \fB\-Fl\fP no-recursion
 (c, r, u modes only)
 Do not recursively archive the contents of directories.
@@ -428,6 +454,34 @@ This is often used to read filenames output by the
 option to
 \fBfind\fP(1).
 .TP
+\fB\-Fl\fP no-acls
+(c, r, u, x modes only)
+Do not archive or extract POSIX.1e or NFSv4 ACLs. This is the reverse of
+\fB\-Fl\fP acls
+and the default behavior if
+\fB\%tar\fP
+is run as non-root in x mode (on Mac OS X also in c, r and u modes).
+.TP
+\fB\-Fl\fP no-fflags
+(c, r, u, x modes only)
+Do not archive or extract file flags. This is the reverse of
+\fB\-Fl\fP fflags
+and the default behavior if
+\fB\%tar\fP
+is run as non-root in x mode.
+.TP
+\fB\-Fl\fP no-mac-metadata
+(x mode only)
+Mac OS X specific. Do not archive or extract ACLs and extended attributes using
+\fBcopyfile\fP(3)
+in AppleDouble format. This is the reverse of
+\fB\-Fl\fP mac-metadata.
+and the default behavior if
+\fB\%tar\fP
+is run as non-root in x mode.
+.TP
+\fB\-n\fP, \fB\-Fl\fP norecurse, \fB\-Fl\fP no-recursion
+.TP
 \fB\-Fl\fP no-same-owner
 (x mode only)
 Do not extract owner and group IDs.
@@ -445,7 +499,22 @@ This is the reverse of
 \fB\-p\fP
 and the default behavior if
 \fB\%tar\fP
-is run as non-root.
+is run as non-root and can be overridden by also specifying
+\fB\-Fl\fP acls,
+\fB\-Fl\fP fflags,
+\fB\-Fl\fP mac-metadata,
+\fB\-Fl\fP same-owner,
+\fB\-Fl\fP same-permissions
+and
+\fB\-Fl\fP xattrs.
+.TP
+\fB\-Fl\fP no-xattrs
+(c, r, u, x modes only)
+Do not archive or extract extended attributes. This is the reverse of
+\fB\-Fl\fP xattrs
+and the default behavior if
+\fB\%tar\fP
+is run as non-root in x mode.
 .TP
 \fB\-Fl\fP numeric-owner
 This is equivalent to
@@ -664,14 +733,18 @@ This option suppresses these behaviors.
 \fB\-p\fP, \fB\-Fl\fP insecure, \fB\-Fl\fP preserve-permissions
 (x mode only)
 Preserve file permissions.
-Attempt to restore the full permissions, including owner, file modes, file
-flags and ACLs, if available, for each item extracted from the archive.
-This is the default, if
+Attempt to restore the full permissions, including owner, file modes, ACLs,
+extended atributes and extended file flags, if available, for each item
+extracted from the archive. This is the default, if
 \fB\%tar\fP
 is being run by root and can be overridden by also specifying
-\fB\-Fl\fP no-same-owner
+\fB\-Fl\fP no-acls,
+\fB\-Fl\fP no-fflags,
+\fB\-Fl\fP no-mac-metadata,
+\fB\-Fl\fP no-same-owner,
+\fB\-Fl\fP no-same-permissions
 and
-\fB\-Fl\fP no-same-permissions.
+\fB\-Fl\fP no-xattrs.
 .TP
 \fB\-Fl\fP passphrase \fIpassphrase\fP
 The
@@ -782,7 +855,7 @@ you probably want to use
 as well.
 .TP
 \fB\-Fl\fP totals
-(c, r, u mode only)
+(c, r, u modes only)
 After archiving all files, print a summary to stderr.
 .TP
 \fB\-U\fP, \fB\-Fl\fP unlink, \fB\-Fl\fP unlink-first
@@ -853,6 +926,14 @@ See
 \fB\-Fl\fP exclude
 for more information about the handling of exclusions.
 .TP
+\fB\-Fl\fP xattrs
+(c, r, u, x modes only)
+Archive or extract extended attributes. This is the reverse of
+\fB\-Fl\fP no-xattrs
+and the default behavior in c, r, and u modes or if
+\fB\%tar\fP
+is run in x mode as root.
+.TP
 \fB\-y\fP
 (c mode only)
 Compress the resulting archive with
index 5e63178..c71cb84 100644 (file)
@@ -104,15 +104,15 @@ archive_write_set_passphrase.3.pdf: ../../libarchive/archive_write_set_passphras
 cpio.5.pdf: ../../libarchive/cpio.5
        groff -mdoc -T ps ../../libarchive/cpio.5 | ps2pdf - - > cpio.5.pdf
 
+libarchive-formats.5.pdf: ../../libarchive/libarchive-formats.5
+       groff -mdoc -T ps ../../libarchive/libarchive-formats.5 | ps2pdf - - > libarchive-formats.5.pdf
+
 libarchive.3.pdf: ../../libarchive/libarchive.3
        groff -mdoc -T ps ../../libarchive/libarchive.3 | ps2pdf - - > libarchive.3.pdf
 
 libarchive_changes.3.pdf: ../../libarchive/libarchive_changes.3
        groff -mdoc -T ps ../../libarchive/libarchive_changes.3 | ps2pdf - - > libarchive_changes.3.pdf
 
-libarchive-formats.5.pdf: ../../libarchive/libarchive-formats.5
-       groff -mdoc -T ps ../../libarchive/libarchive-formats.5 | ps2pdf - - > libarchive-formats.5.pdf
-
 libarchive_internals.3.pdf: ../../libarchive/libarchive_internals.3
        groff -mdoc -T ps ../../libarchive/libarchive_internals.3 | ps2pdf - - > libarchive_internals.3.pdf
 
@@ -127,4 +127,4 @@ bsdtar.1.pdf: ../../tar/bsdtar.1
 
 bsdcpio.1.pdf: ../../cpio/bsdcpio.1
        groff -mdoc -T ps ../../cpio/bsdcpio.1 | ps2pdf - - > bsdcpio.1.pdf
-all: archive_entry.3.pdf archive_entry_acl.3.pdf archive_entry_linkify.3.pdf archive_entry_paths.3.pdf archive_entry_perms.3.pdf archive_entry_stat.3.pdf archive_entry_time.3.pdf archive_read.3.pdf archive_read_add_passphrase.3.pdf archive_read_data.3.pdf archive_read_disk.3.pdf archive_read_extract.3.pdf archive_read_filter.3.pdf archive_read_format.3.pdf archive_read_free.3.pdf archive_read_header.3.pdf archive_read_new.3.pdf archive_read_open.3.pdf archive_read_set_options.3.pdf archive_util.3.pdf archive_write.3.pdf archive_write_blocksize.3.pdf archive_write_data.3.pdf archive_write_disk.3.pdf archive_write_filter.3.pdf archive_write_finish_entry.3.pdf archive_write_format.3.pdf archive_write_free.3.pdf archive_write_header.3.pdf archive_write_new.3.pdf archive_write_open.3.pdf archive_write_set_options.3.pdf archive_write_set_passphrase.3.pdf cpio.5.pdf libarchive.3.pdf libarchive_changes.3.pdf libarchive-formats.5.pdf libarchive_internals.3.pdf mtree.5.pdf tar.5.pdf bsdtar.1.pdf bsdcpio.1.pdf
+all: archive_entry.3.pdf archive_entry_acl.3.pdf archive_entry_linkify.3.pdf archive_entry_paths.3.pdf archive_entry_perms.3.pdf archive_entry_stat.3.pdf archive_entry_time.3.pdf archive_read.3.pdf archive_read_add_passphrase.3.pdf archive_read_data.3.pdf archive_read_disk.3.pdf archive_read_extract.3.pdf archive_read_filter.3.pdf archive_read_format.3.pdf archive_read_free.3.pdf archive_read_header.3.pdf archive_read_new.3.pdf archive_read_open.3.pdf archive_read_set_options.3.pdf archive_util.3.pdf archive_write.3.pdf archive_write_blocksize.3.pdf archive_write_data.3.pdf archive_write_disk.3.pdf archive_write_filter.3.pdf archive_write_finish_entry.3.pdf archive_write_format.3.pdf archive_write_free.3.pdf archive_write_header.3.pdf archive_write_new.3.pdf archive_write_open.3.pdf archive_write_set_options.3.pdf archive_write_set_passphrase.3.pdf cpio.5.pdf libarchive-formats.5.pdf libarchive.3.pdf libarchive_changes.3.pdf libarchive_internals.3.pdf mtree.5.pdf tar.5.pdf bsdtar.1.pdf bsdcpio.1.pdf
index d5b40d5..128a764 100644 (file)
Binary files a/doc/pdf/archive_entry.3.pdf and b/doc/pdf/archive_entry.3.pdf differ
index 41c3df7..93103fd 100644 (file)
Binary files a/doc/pdf/archive_entry_acl.3.pdf and b/doc/pdf/archive_entry_acl.3.pdf differ
index 0072ebc..25b1d23 100644 (file)
Binary files a/doc/pdf/archive_entry_linkify.3.pdf and b/doc/pdf/archive_entry_linkify.3.pdf differ
index 5760b6e..ae8b20f 100644 (file)
Binary files a/doc/pdf/archive_entry_paths.3.pdf and b/doc/pdf/archive_entry_paths.3.pdf differ
index 43c8ca2..4d1acdd 100644 (file)
Binary files a/doc/pdf/archive_entry_perms.3.pdf and b/doc/pdf/archive_entry_perms.3.pdf differ
index 66a773d..724b995 100644 (file)
Binary files a/doc/pdf/archive_entry_stat.3.pdf and b/doc/pdf/archive_entry_stat.3.pdf differ
index 6329b6d..731989e 100644 (file)
Binary files a/doc/pdf/archive_entry_time.3.pdf and b/doc/pdf/archive_entry_time.3.pdf differ
index c46aba2..631327e 100644 (file)
Binary files a/doc/pdf/archive_read.3.pdf and b/doc/pdf/archive_read.3.pdf differ
index f077ad5..3aa0c7d 100644 (file)
Binary files a/doc/pdf/archive_read_add_passphrase.3.pdf and b/doc/pdf/archive_read_add_passphrase.3.pdf differ
index 6dde6a8..5be56a1 100644 (file)
Binary files a/doc/pdf/archive_read_data.3.pdf and b/doc/pdf/archive_read_data.3.pdf differ
index 992e19e..2e76797 100644 (file)
Binary files a/doc/pdf/archive_read_disk.3.pdf and b/doc/pdf/archive_read_disk.3.pdf differ
index c55b0bb..7aaa41c 100644 (file)
Binary files a/doc/pdf/archive_read_extract.3.pdf and b/doc/pdf/archive_read_extract.3.pdf differ
index ebbe8f5..5c0ff37 100644 (file)
Binary files a/doc/pdf/archive_read_filter.3.pdf and b/doc/pdf/archive_read_filter.3.pdf differ
index ea9952d..b82d50d 100644 (file)
Binary files a/doc/pdf/archive_read_format.3.pdf and b/doc/pdf/archive_read_format.3.pdf differ
index 4c9205b..943ba61 100644 (file)
Binary files a/doc/pdf/archive_read_free.3.pdf and b/doc/pdf/archive_read_free.3.pdf differ
index 5ef0815..eafb141 100644 (file)
Binary files a/doc/pdf/archive_read_header.3.pdf and b/doc/pdf/archive_read_header.3.pdf differ
index 60a4cde..24d5f1f 100644 (file)
Binary files a/doc/pdf/archive_read_new.3.pdf and b/doc/pdf/archive_read_new.3.pdf differ
index ebd3b7a..9604457 100644 (file)
Binary files a/doc/pdf/archive_read_open.3.pdf and b/doc/pdf/archive_read_open.3.pdf differ
index 841909b..c148071 100644 (file)
Binary files a/doc/pdf/archive_read_set_options.3.pdf and b/doc/pdf/archive_read_set_options.3.pdf differ
index 93596f6..3ea0860 100644 (file)
Binary files a/doc/pdf/archive_util.3.pdf and b/doc/pdf/archive_util.3.pdf differ
index 7edc2c2..ddedac0 100644 (file)
Binary files a/doc/pdf/archive_write.3.pdf and b/doc/pdf/archive_write.3.pdf differ
index 4aa49cb..dd4d697 100644 (file)
Binary files a/doc/pdf/archive_write_blocksize.3.pdf and b/doc/pdf/archive_write_blocksize.3.pdf differ
index 65840a8..c27d764 100644 (file)
Binary files a/doc/pdf/archive_write_data.3.pdf and b/doc/pdf/archive_write_data.3.pdf differ
index 3fe964f..a614317 100644 (file)
Binary files a/doc/pdf/archive_write_disk.3.pdf and b/doc/pdf/archive_write_disk.3.pdf differ
index 16b0e89..eaad665 100644 (file)
Binary files a/doc/pdf/archive_write_filter.3.pdf and b/doc/pdf/archive_write_filter.3.pdf differ
index 4cda3d6..8140ea0 100644 (file)
Binary files a/doc/pdf/archive_write_finish_entry.3.pdf and b/doc/pdf/archive_write_finish_entry.3.pdf differ
index b7e2b7c..ba5073a 100644 (file)
Binary files a/doc/pdf/archive_write_format.3.pdf and b/doc/pdf/archive_write_format.3.pdf differ
index 840755b..5b4e039 100644 (file)
Binary files a/doc/pdf/archive_write_free.3.pdf and b/doc/pdf/archive_write_free.3.pdf differ
index e88367a..2bec714 100644 (file)
Binary files a/doc/pdf/archive_write_header.3.pdf and b/doc/pdf/archive_write_header.3.pdf differ
index 201c817..996feb5 100644 (file)
Binary files a/doc/pdf/archive_write_new.3.pdf and b/doc/pdf/archive_write_new.3.pdf differ
index f549b08..9723e6b 100644 (file)
Binary files a/doc/pdf/archive_write_open.3.pdf and b/doc/pdf/archive_write_open.3.pdf differ
index 8fe58d6..1d8bfb3 100644 (file)
Binary files a/doc/pdf/archive_write_set_options.3.pdf and b/doc/pdf/archive_write_set_options.3.pdf differ
index 852077a..9775e30 100644 (file)
Binary files a/doc/pdf/archive_write_set_passphrase.3.pdf and b/doc/pdf/archive_write_set_passphrase.3.pdf differ
index 2656691..17e73ff 100644 (file)
Binary files a/doc/pdf/bsdcpio.1.pdf and b/doc/pdf/bsdcpio.1.pdf differ
index 114eef1..c48ccc4 100644 (file)
Binary files a/doc/pdf/bsdtar.1.pdf and b/doc/pdf/bsdtar.1.pdf differ
index ad504e2..974420e 100644 (file)
Binary files a/doc/pdf/cpio.5.pdf and b/doc/pdf/cpio.5.pdf differ
index 7581781..397de7d 100644 (file)
Binary files a/doc/pdf/libarchive-formats.5.pdf and b/doc/pdf/libarchive-formats.5.pdf differ
index cd30fee..db0ba75 100644 (file)
Binary files a/doc/pdf/libarchive.3.pdf and b/doc/pdf/libarchive.3.pdf differ
index 1209173..a588be4 100644 (file)
Binary files a/doc/pdf/libarchive_changes.3.pdf and b/doc/pdf/libarchive_changes.3.pdf differ
index 0b7de98..ce74db9 100644 (file)
Binary files a/doc/pdf/libarchive_internals.3.pdf and b/doc/pdf/libarchive_internals.3.pdf differ
index 3206684..c9e55cf 100644 (file)
Binary files a/doc/pdf/mtree.5.pdf and b/doc/pdf/mtree.5.pdf differ
index 8dc3b15..5414efc 100644 (file)
Binary files a/doc/pdf/tar.5.pdf and b/doc/pdf/tar.5.pdf differ
index d58f7d9..d5f91ef 100644 (file)
@@ -104,15 +104,15 @@ archive_write_set_passphrase.3.txt: ../../libarchive/archive_write_set_passphras
 cpio.5.txt: ../../libarchive/cpio.5
        nroff -mdoc ../../libarchive/cpio.5 | col -b > cpio.5.txt
 
+libarchive-formats.5.txt: ../../libarchive/libarchive-formats.5
+       nroff -mdoc ../../libarchive/libarchive-formats.5 | col -b > libarchive-formats.5.txt
+
 libarchive.3.txt: ../../libarchive/libarchive.3
        nroff -mdoc ../../libarchive/libarchive.3 | col -b > libarchive.3.txt
 
 libarchive_changes.3.txt: ../../libarchive/libarchive_changes.3
        nroff -mdoc ../../libarchive/libarchive_changes.3 | col -b > libarchive_changes.3.txt
 
-libarchive-formats.5.txt: ../../libarchive/libarchive-formats.5
-       nroff -mdoc ../../libarchive/libarchive-formats.5 | col -b > libarchive-formats.5.txt
-
 libarchive_internals.3.txt: ../../libarchive/libarchive_internals.3
        nroff -mdoc ../../libarchive/libarchive_internals.3 | col -b > libarchive_internals.3.txt
 
@@ -127,4 +127,4 @@ bsdtar.1.txt: ../../tar/bsdtar.1
 
 bsdcpio.1.txt: ../../cpio/bsdcpio.1
        nroff -mdoc ../../cpio/bsdcpio.1 | col -b > bsdcpio.1.txt
-all: archive_entry.3.txt archive_entry_acl.3.txt archive_entry_linkify.3.txt archive_entry_paths.3.txt archive_entry_perms.3.txt archive_entry_stat.3.txt archive_entry_time.3.txt archive_read.3.txt archive_read_add_passphrase.3.txt archive_read_data.3.txt archive_read_disk.3.txt archive_read_extract.3.txt archive_read_filter.3.txt archive_read_format.3.txt archive_read_free.3.txt archive_read_header.3.txt archive_read_new.3.txt archive_read_open.3.txt archive_read_set_options.3.txt archive_util.3.txt archive_write.3.txt archive_write_blocksize.3.txt archive_write_data.3.txt archive_write_disk.3.txt archive_write_filter.3.txt archive_write_finish_entry.3.txt archive_write_format.3.txt archive_write_free.3.txt archive_write_header.3.txt archive_write_new.3.txt archive_write_open.3.txt archive_write_set_options.3.txt archive_write_set_passphrase.3.txt cpio.5.txt libarchive.3.txt libarchive_changes.3.txt libarchive-formats.5.txt libarchive_internals.3.txt mtree.5.txt tar.5.txt bsdtar.1.txt bsdcpio.1.txt
+all: archive_entry.3.txt archive_entry_acl.3.txt archive_entry_linkify.3.txt archive_entry_paths.3.txt archive_entry_perms.3.txt archive_entry_stat.3.txt archive_entry_time.3.txt archive_read.3.txt archive_read_add_passphrase.3.txt archive_read_data.3.txt archive_read_disk.3.txt archive_read_extract.3.txt archive_read_filter.3.txt archive_read_format.3.txt archive_read_free.3.txt archive_read_header.3.txt archive_read_new.3.txt archive_read_open.3.txt archive_read_set_options.3.txt archive_util.3.txt archive_write.3.txt archive_write_blocksize.3.txt archive_write_data.3.txt archive_write_disk.3.txt archive_write_filter.3.txt archive_write_finish_entry.3.txt archive_write_format.3.txt archive_write_free.3.txt archive_write_header.3.txt archive_write_new.3.txt archive_write_open.3.txt archive_write_set_options.3.txt archive_write_set_passphrase.3.txt cpio.5.txt libarchive-formats.5.txt libarchive.3.txt libarchive_changes.3.txt libarchive_internals.3.txt mtree.5.txt tar.5.txt bsdtar.1.txt bsdcpio.1.txt
index 3147f3f..e2ef919 100644 (file)
@@ -1,28 +1,28 @@
 ARCHIVE_ENTRY(3)        BSD Library Functions Manual         ARCHIVE_ENTRY(3)
 
-NAME
-     archive_entry_clear, archive_entry_clone, archive_entry_free,
-     archive_entry_new, — functions for managing archive entry descriptions
+1mNAME0m
+     1marchive_entry_clear22m, 1marchive_entry_clone22m, 1marchive_entry_free22m,
+     1marchive_entry_new22m, — functions for managing archive entry descriptions
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive_entry.h>
+1mSYNOPSIS0m
+     1m#include <archive_entry.h>0m
 
-     struct archive_entry *
-     archive_entry_clear(struct archive_entry *);
+     4mstruct24m 4marchive_entry24m 4m*0m
+     1marchive_entry_clear22m(4mstruct24m 4marchive_entry24m 4m*24m);
 
-     struct archive_entry *
-     archive_entry_clone(struct archive_entry *);
+     4mstruct24m 4marchive_entry24m 4m*0m
+     1marchive_entry_clone22m(4mstruct24m 4marchive_entry24m 4m*24m);
 
-     void
-     archive_entry_free(struct archive_entry *);
+     4mvoid0m
+     1marchive_entry_free22m(4mstruct24m 4marchive_entry24m 4m*24m);
 
-     struct archive_entry *
-     archive_entry_new(void);
+     4mstruct24m 4marchive_entry24m 4m*0m
+     1marchive_entry_new22m(4mvoid24m);
 
-DESCRIPTION
+1mDESCRIPTION0m
      These functions create and manipulate data objects that represent entries
      within an archive.  You can think of a struct archive_entry as a heavy-
      duty version of struct stat: it includes everything from struct stat plus
@@ -30,21 +30,21 @@ DESCRIPTION
      are used by libarchive(3) to represent the metadata associated with a
      particular entry in an archive.
 
-   Create and Destroy
-     There are functions to allocate, destroy, clear, and copy archive_entry
+   1mCreate and Destroy0m
+     There are functions to allocate, destroy, clear, and copy 4marchive_entry0m
      objects:
-     archive_entry_clear()
+     1marchive_entry_clear22m()
             Erases the object, resetting all internal fields to the same
             state as a newly-created object.  This is provided to allow you
             to quickly recycle objects without thrashing the heap.
-     archive_entry_clone()
+     1marchive_entry_clone22m()
             A deep copy operation; all text fields are duplicated.
-     archive_entry_free()
+     1marchive_entry_free22m()
             Releases the struct archive_entry object.
-     archive_entry_new()
+     1marchive_entry_new22m()
             Allocate and return a blank struct archive_entry object.
 
-   Function groups
+   1mFunction groups0m
      Due to high number of functions, the accessor functions can be found in
      man pages grouped by the purpose.
 
@@ -55,38 +55,38 @@ DESCRIPTION
      archive_entry_perms(3)  User, group and mode manipulation
 
      archive_entry_stat(3)   Functions not in the other groups and copying
-                            to/from struct stat.
+                            to/from 4mstruct24m 4mstat24m.
 
      archive_entry_time(3)   Time field manipulation
 
      Most of the functions set or read entries in an object.  Such functions
      have one of the following forms:
-     archive_entry_set_XXXX()
+     1marchive_entry_set_XXXX22m()
             Stores the provided data in the object.  In particular, for
             strings, the pointer is stored, not the referenced string.
-     archive_entry_copy_XXXX()
+     1marchive_entry_copy_XXXX22m()
             As above, except that the referenced data is copied into the
             object.
-     archive_entry_XXXX()
+     1marchive_entry_XXXX22m()
             Returns the specified data.  In the case of strings, a const-
             qualified pointer to the string is returned.
      String data can be set or accessed as wide character strings or normal
-     char strings.  The functions that use wide character strings are suffixed
-     with _w.  Note that these are different representations of the same data:
+     4mchar24m strings.  The functions that use wide character strings are suffixed
+     with 1m_w22m.  Note that these are different representations of the same data:
      For example, if you store a narrow string and read the corresponding wide
      string, the object will transparently convert formats using the current
      locale.  Similarly, if you store a wide string and then store a narrow
      string for the same data, the previously-set wide string will be dis‐
      carded in favor of the new data.
 
-SEE ALSO
+1mSEE ALSO0m
      archive_entry_acl(3), archive_entry_paths(3), archive_entry_perms(3),
      archive_entry_time(3) libarchive(3),
 
-HISTORY
-     The libarchive library first appeared in FreeBSD 5.3.
+1mHISTORY0m
+     The 1mlibarchive 22mlibrary first appeared in FreeBSD 5.3.
 
-AUTHORS
-     The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
+1mAUTHORS0m
+     The 1mlibarchive 22mlibrary was written by Tim Kientzle <kientzle@acm.org>.
 
 BSD                           Feburary 2, 2012                            BSD
index d93f25b..53d1c1b 100644 (file)
@@ -1,82 +1,82 @@
 ARCHIVE_ENTRY_ACL(3)    BSD Library Functions Manual     ARCHIVE_ENTRY_ACL(3)
 
-NAME
-     archive_entry_acl_add_entry, archive_entry_acl_add_entry_w,
-     archive_entry_acl_clear, archive_entry_acl_count,
-     archive_entry_acl_from_text, archive_entry_acl_from_text_w,
-     archive_entry_acl_next, archive_entry_acl_next_w,
-     archive_entry_acl_reset, archive_entry_acl_to_text,
-     archive_entry_acl_to_text_w, archive_entry_acl_types — functions for
+1mNAME0m
+     1marchive_entry_acl_add_entry22m, 1marchive_entry_acl_add_entry_w22m,
+     1marchive_entry_acl_clear22m, 1marchive_entry_acl_count22m,
+     1marchive_entry_acl_from_text22m, 1marchive_entry_acl_from_text_w,0m
+     1marchive_entry_acl_next22m, 1marchive_entry_acl_next_w22m,
+     1marchive_entry_acl_reset22m, 1marchive_entry_acl_to_text22m,
+     1marchive_entry_acl_to_text_w22m, 1marchive_entry_acl_types 22m— functions for
      manipulating Access Control Lists in archive entry descriptions
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive_entry.h>
+1mSYNOPSIS0m
+     1m#include <archive_entry.h>0m
 
-     void
-     archive_entry_acl_add_entry(struct archive_entry *a, int type,
-        int permset, int tag, int qualifier, const char *name);
+     4mvoid0m
+     1marchive_entry_acl_add_entry22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mint24m 4mtype24m,
+        4mint24m 4mpermset24m, 4mint24m 4mtag24m, 4mint24m 4mqualifier24m, 4mconst24m 4mchar24m 4m*name24m);
 
-     void
-     archive_entry_acl_add_entry_w(struct archive_entry *a, int type,
-        int permset, int tag, int qualifier, const wchar_t *name);
+     4mvoid0m
+     1marchive_entry_acl_add_entry_w22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mint24m 4mtype24m,
+        4mint24m 4mpermset24m, 4mint24m 4mtag24m, 4mint24m 4mqualifier24m, 4mconst24m 4mwchar_t24m 4m*name24m);
 
-     void
-     archive_entry_acl_clear(struct archive_entry *a);
+     4mvoid0m
+     1marchive_entry_acl_clear22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     int
-     archive_entry_acl_count(struct archive_entry *a, int type);
+     4mint0m
+     1marchive_entry_acl_count22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mint24m 4mtype24m);
 
-     int
-     archive_entry_acl_from_text(struct archive_entry *a, const char *text,
-        int type);
+     4mint0m
+     1marchive_entry_acl_from_text22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mchar24m 4m*text24m,
+        4mint24m 4mtype24m);
 
-     int
-     archive_entry_acl_from_text_w(struct archive_entry *a,
-        const wchar_t *text, int type);
+     4mint0m
+     1marchive_entry_acl_from_text_w22m(4mstruct24m 4marchive_entry24m 4m*a24m,
+        4mconst24m 4mwchar_t24m 4m*text24m, 4mint24m 4mtype24m);
 
-     int
-     archive_entry_acl_next(struct archive_entry *a, int type, int *ret_type,
-        int *ret_permset, int *ret_tag, int *ret_qual,
-        const char **ret_name);
+     4mint0m
+     1marchive_entry_acl_next22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mint24m 4mtype24m, 4mint24m 4m*ret_type24m,
+        4mint24m 4m*ret_permset24m, 4mint24m 4m*ret_tag24m, 4mint24m 4m*ret_qual24m,
+        4mconst24m 4mchar24m 4m**ret_name24m);
 
-     int
-     archive_entry_acl_next_w(struct archive_entry *a, int type,
-        int *ret_type, int *ret_permset, int *ret_tag, int *ret_qual,
-        const wchar_t **ret_name);
+     4mint0m
+     1marchive_entry_acl_next_w22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mint24m 4mtype24m,
+        4mint24m 4m*ret_type24m, 4mint24m 4m*ret_permset24m, 4mint24m 4m*ret_tag24m, 4mint24m 4m*ret_qual24m,
+        4mconst24m 4mwchar_t24m 4m**ret_name24m);
 
-     int
-     archive_entry_acl_reset(struct archive_entry *a, int type);
+     4mint0m
+     1marchive_entry_acl_reset22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mint24m 4mtype24m);
 
-     char *
-     archive_entry_acl_to_text(struct archive_entry *a, ssize_t *len_p,
-        int flags);
+     4mchar24m 4m*0m
+     1marchive_entry_acl_to_text22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mssize_t24m 4m*len_p24m,
+        4mint24m 4mflags24m);
 
-     wchar_t *
-     archive_entry_acl_to_text_w(struct archive_entry *a, ssize_t *len_p,
-        int flags);
+     4mwchar_t24m 4m*0m
+     1marchive_entry_acl_to_text_w22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mssize_t24m 4m*len_p24m,
+        4mint24m 4mflags24m);
 
-     int
-     archive_entry_acl_types(struct archive_entry *a);
+     4mint0m
+     1marchive_entry_acl_types22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-DESCRIPTION
+1mDESCRIPTION0m
      The “Access Control Lists (ACLs)” extend the standard Unix perssion
-     model.  The ACL interface of libarchive supports both POSIX.1e and NFSv4
+     model.  The ACL interface of 1mlibarchive 22msupports both POSIX.1e and NFSv4
      style ACLs. Use of ACLs is restricted by various levels of ACL support in
      operating systems, file systems and archive formats.
 
-   POSIX.1e Access Control Lists
+   1mPOSIX.1e Access Control Lists0m
      A POSIX.1e ACL consists of a number of independent entries.  Each entry
      specifies the permission set as bitmask of basic permissions.  Valid per‐
-     missions in the permset are:
-          ARCHIVE_ENTRY_ACL_READ (r)
-          ARCHIVE_ENTRY_ACL_WRITE (w)
-          ARCHIVE_ENTRY_ACL_EXECUTE (x)
+     missions in the 4mpermset24m are:
+          ARCHIVE_ENTRY_ACL_READ (1mr22m)
+          ARCHIVE_ENTRY_ACL_WRITE (1mw22m)
+          ARCHIVE_ENTRY_ACL_EXECUTE (1mx22m)
      The permissions correspond to the normal Unix permissions.
 
-     The tag specifies the principal to which the permission applies.  Valid
+     The 4mtag24m specifies the principal to which the permission applies.  Valid
      values are:
           ARCHIVE_ENTRY_ACL_USER       The user specified by the name field.
           ARCHIVE_ENTRY_ACL_USER_OBJ   The owner of the file.
@@ -96,7 +96,7 @@ DESCRIPTION
      tories have an additional ACL (ARCHIVE_ENTRY_ACL_TYPE_DEFAULT), which
      controls the initial access ACL for newly created directory entries.
 
-   NFSv4 Access Control Lists
+   1mNFSv4 Access Control Lists0m
      A NFSv4 ACL consists of multiple individual entries called Access Control
      Entries (ACEs).
 
@@ -111,7 +111,7 @@ DESCRIPTION
                                        attempts by principal which require
                                        given permissions.
 
-     The tag specifies the principal to which the permission applies.  Valid
+     The 4mtag24m specifies the principal to which the permission applies.  Valid
      values are:
           ARCHIVE_ENTRY_ACL_USER       The user specified by the name field.
           ARCHIVE_ENTRY_ACL_USER_OBJ   The owner of the file.
@@ -121,77 +121,77 @@ DESCRIPTION
                                        a member of the owning group.
 
      Entries with the ARCHIVE_ENTRY_ACL_USER or ARCHIVE_ENTRY_ACL_GROUP tag
-     store the user and group name in the name string and optionally the user
-     or group ID in the qualifier integer.
+     store the user and group name in the 4mname24m string and optionally the user
+     or group ID in the 4mqualifier24m integer.
 
-     NFSv4 ACE permissions and flags are stored in the same permset bitfield.
+     NFSv4 ACE permissions and flags are stored in the same 4mpermset24m bitfield.
      Some permissions share the same constant and permission character but
      have different effect on directories than on files. The following ACE
      permissions are supported:
-          ARCHIVE_ENTRY_ACL_READ_DATA (r)
+          ARCHIVE_ENTRY_ACL_READ_DATA (1mr22m)
                   Read data (file).
-          ARCHIVE_ENTRY_ACL_LIST_DIRECTORY (r)
+          ARCHIVE_ENTRY_ACL_LIST_DIRECTORY (1mr22m)
                   List entries (directory).
-          ARCHIVE_ENTRY_ACL_WRITE_DATA (w)
+          ARCHIVE_ENTRY_ACL_WRITE_DATA (1mw22m)
                   Write data (file).
-          ARCHIVE_ENTRY_ACL_ADD_FILE (w)
+          ARCHIVE_ENTRY_ACL_ADD_FILE (1mw22m)
                   Create files (directory).
-          ARCHIVE_ENTRY_ACL_EXECUTE (x)
+          ARCHIVE_ENTRY_ACL_EXECUTE (1mx22m)
                   Execute file or change into a directory.
-          ARCHIVE_ENTRY_ACL_APPEND_DATA (p)
+          ARCHIVE_ENTRY_ACL_APPEND_DATA (1mp22m)
                   Append data (file).
-          ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY (p)
+          ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY (1mp22m)
                   Create subdirectories (directory).
-          ARCHIVE_ENTRY_ACL_DELETE_CHILD (D)
+          ARCHIVE_ENTRY_ACL_DELETE_CHILD (1mD22m)
                   Remove files and subdirectories inside a directory.
-          ARCHIVE_ENTRY_ACL_DELETE (d)
+          ARCHIVE_ENTRY_ACL_DELETE (1md22m)
                   Remove file or directory.
-          ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES (a)
+          ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES (1ma22m)
                   Read file or directory attributes.
-          ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES (A)
+          ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES (1mA22m)
                   Write file or directory attributes.
-          ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS (R)
+          ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS (1mR22m)
                   Read named file or directory attributes.
-          ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS (W)
+          ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS (1mW22m)
                   Write named file or directory attributes.
-          ARCHIVE_ENTRY_ACL_READ_ACL (c)
+          ARCHIVE_ENTRY_ACL_READ_ACL (1mc22m)
                   Read file or directory ACL.
-          ARCHIVE_ENTRY_ACL_WRITE_ACL (C)
+          ARCHIVE_ENTRY_ACL_WRITE_ACL (1mC22m)
                   Write file or directory ACL.
-          ARCHIVE_ENTRY_ACL_WRITE_OWNER (o)
+          ARCHIVE_ENTRY_ACL_WRITE_OWNER (1mo22m)
                   Change owner of a file or directory.
-          ARCHIVE_ENTRY_ACL_SYNCHRONIZE (s)
+          ARCHIVE_ENTRY_ACL_SYNCHRONIZE (1ms22m)
                   Use synchronous I/O.
 
      The following NFSv4 ACL inheritance flags are supported:
-          ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT (f)
+          ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT (1mf22m)
                   Inherit parent directory ACE to files.
-          ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT (d)
+          ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT (1md22m)
                   Inherit parent directory ACE to subdirectories.
-          ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY (i)
+          ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY (1mi22m)
                   Only inherit, do not apply the permission on the directory
                   itself.
-          ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT (n)
+          ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT (1mn22m)
                   Do not propagate inherit flags. Only first-level entries
                   inherit ACLs.
-          ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS (S)
+          ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS (1mS22m)
                   Trigger alarm or audit on succesful access.
-          ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS (F)
+          ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS (1mF22m)
                   Trigger alarm or audit on failed access.
-          ARCHIVE_ENTRY_ACL_ENTRY_INHERITED (I)
+          ARCHIVE_ENTRY_ACL_ENTRY_INHERITED (1mI22m)
                   Mark that ACE was inherited.
 
-   Functions
-     archive_entry_acl_add_entry() and archive_entry_acl_add_entry_w() add a
+   1mFunctions0m
+     1marchive_entry_acl_add_entry22m() and 1marchive_entry_acl_add_entry_w22m() add a
      single ACL entry. For the access ACL and non-extended principals, the
      classic Unix permissions are updated. An archive enry cannot contain both
      POSIX.1e and NFSv4 ACL entries.
 
-     archive_entry_acl_clear() removes all ACL entries and resets the enumera‐
+     1marchive_entry_acl_clear22m() removes all ACL entries and resets the enumera‐
      tion pointer.
 
-     archive_entry_acl_count() counts the ACL entries that have the given type
-     mask.  type can be the bitwise-or of
+     1marchive_entry_acl_count22m() counts the ACL entries that have the given type
+     mask.  4mtype24m can be the bitwise-or of
           ARCHIVE_ENTRY_ACL_TYPE_ACCESS
           ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
      for POSIX.1e ACLs and
@@ -203,37 +203,37 @@ DESCRIPTION
      included and at least one extended ACL entry is found, the three non-
      extened ACLs are added.
 
-     archive_entry_acl_from_text() and archive_entry_acl_from_text_w() add new
-     (or merge with existing) ACL entries from (wide) text. The argument type
+     1marchive_entry_acl_from_text22m() and 1marchive_entry_acl_from_text_w22m() add new
+     (or merge with existing) ACL entries from (wide) text. The argument 4mtype0m
      may take one of the following values:
           ARCHIVE_ENTRY_ACL_TYPE_ACCESS
           ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
           ARCHIVE_ENTRY_ACL_TYPE_NFS4
-     Supports all formats that can be created with archive_entry_acl_to_text()
-     or respective archive_entry_acl_to_text_w().  Existing ACL entries are
-     preserved. To get a clean new ACL from text archive_entry_acl_clear()
+     Supports all formats that can be created with 1marchive_entry_acl_to_text22m()
+     or respective 1marchive_entry_acl_to_text_w22m(). Existing ACL entries are
+     preserved. To get a clean new ACL from text 1marchive_entry_acl_clear22m()
      must be called first. Entries prefixed with “default:” are treated as
-     ARCHIVE_ENTRY_ACL_TYPE_DEFAULT unless type is
+     ARCHIVE_ENTRY_ACL_TYPE_DEFAULT unless 4mtype24m is
      ARCHIVE_ENTRY_ACL_TYPE_NFS4.  Invalid entries, non-parseable ACL entries
      and entries beginning with the ‘#’ character (comments) are skipped.
 
-     archive_entry_acl_next() and archive_entry_acl_next_w() return the next
+     1marchive_entry_acl_next22m() and 1marchive_entry_acl_next_w22m() return the next
      entry of the ACL list.  This functions may only be called after
-     archive_entry_acl_reset() has indicated the presence of extended ACL
+     1marchive_entry_acl_reset22m() has indicated the presence of extended ACL
      entries.
 
-     archive_entry_acl_reset() prepare reading the list of ACL entries with
-     archive_entry_acl_next() or archive_entry_acl_next_w().  The function
+     1marchive_entry_acl_reset22m() prepare reading the list of ACL entries with
+     1marchive_entry_acl_next22m() or 1marchive_entry_acl_next_w22m(). The function
      returns either 0, if no non-extended ACLs are found.  In this case, the
      access permissions should be obtained by archive_entry_mode(3) or set
      using chmod(2).  Otherwise, the function returns the same value as
-     archive_entry_acl_count().
+     1marchive_entry_acl_count22m().
 
-     archive_entry_acl_to_text() and archive_entry_acl_to_text_w() convert the
+     1marchive_entry_acl_to_text22m() and 1marchive_entry_acl_to_text_w22m() convert the
      ACL entries for the given type into a (wide) string of ACL entries sepa‐
-     rated by newline. If the the pointer len_p is not NULL, then the function
+     rated by newline. If the the pointer 4mlen_p24m is not NULL, then the function
      shall return the length of the string (not including the NULL terminator)
-     in the location pointed to by len_p.  The flag argument is a bitwise-or.
+     in the location pointed to by 4mlen_p24m. The 4mflag24m argument is a bitwise-or.
 
      The following flags are effective only on POSIX.1e ACL:
           ARCHIVE_ENTRY_ACL_TYPE_ACCESS
@@ -263,36 +263,36 @@ DESCRIPTION
      ified, both access and default entries are returned and default entries
      are prefixed with “default:”.
 
-     archive_entry_acl_types() get ACL entry types contained in an archive
+     1marchive_entry_acl_types22m() get ACL entry types contained in an archive
      entry's ACL. As POSIX.1e and NFSv4 ACL entries cannot be mixed, this
      function is a very efficient way to detect if an ACL already contains
      POSIX.1e or NFSv4 ACL entries.
 
-RETURN VALUES
-     archive_entry_acl_count() and archive_entry_acl_reset() returns the num‐
+1mRETURN VALUES0m
+     1marchive_entry_acl_count22m() and 1marchive_entry_acl_reset22m() returns the num‐
      ber of ACL entries that match the given type mask.  For POSIX.1e ACLS if
      the type mask includes ARCHIVE_ENTRY_ACL_TYPE_ACCESS and at least one
      extended ACL entry exists, the three classic Unix permissions are
      counted.
 
-     archive_entry_acl_from_text() and archive_entry_acl_from_text_w() return
+     1marchive_entry_acl_from_text22m() and 1marchive_entry_acl_from_text_w22m() return
      ARCHIVE_OK if all entries were successfully parsed and ARCHIVE_WARN if
      one or more entries were invalid or non-parseable.
 
-     archive_entry_acl_next() and archive_entry_acl_next_w() return ARCHIVE_OK
+     1marchive_entry_acl_next22m() and 1marchive_entry_acl_next_w22m() return ARCHIVE_OK
      on success, ARCHIVE_EOF if no more ACL entries exist and ARCHIVE_WARN if
-     archive_entry_acl_reset() has not been called first.
+     1marchive_entry_acl_reset22m() has not been called first.
 
-     archive_entry_acl_to_text() returns a string representing the ACL entries
+     1marchive_entry_acl_to_text22m() returns a string representing the ACL entries
      matching the given type and flags on success or NULL on error.
 
-     archive_entry_acl_to_text_w() returns a wide string representing the ACL
+     1marchive_entry_acl_to_text_w22m() returns a wide string representing the ACL
      entries matching the given type and flags on success or NULL on error.
 
-     archive_entry_acl_types() returns a bitmask of ACL entry types or 0 if
+     1marchive_entry_acl_types22m() returns a bitmask of ACL entry types or 0 if
      archive entry has no ACL entries.
 
-SEE ALSO
+1mSEE ALSO0m
      archive_entry(3), libarchive(3)
 
 BSD                           February 15, 2017                           BSD
index 62eb522..14ed564 100644 (file)
@@ -1,31 +1,31 @@
 ARCHIVE_ENTRY_LINKIFY(3) BSD Library Functions Manual ARCHIVE_ENTRY_LINKIFY(3)
 
-NAME
-     archive_entry_linkresolver, archive_entry_linkresolver_new,
-     archive_entry_linkresolver_set_strategy, archive_entry_linkresolver_free,
-     archive_entry_linkify — hardlink resolver functions
+1mNAME0m
+     1marchive_entry_linkresolver22m, 1marchive_entry_linkresolver_new22m,
+     1marchive_entry_linkresolver_set_strategy22m, 1marchive_entry_linkresolver_free22m,
+     1marchive_entry_linkify 22m— hardlink resolver functions
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive_entry.h>
+1mSYNOPSIS0m
+     1m#include <archive_entry.h>0m
 
-     struct archive_entry_linkresolver *
-     archive_entry_linkresolver_new(void);
+     4mstruct24m 4marchive_entry_linkresolver24m 4m*0m
+     1marchive_entry_linkresolver_new22m(4mvoid24m);
 
-     void
-     archive_entry_linkresolver_set_strategy(struct archive_entry_linkresolver *resolver,
-        int format);
+     4mvoid0m
+     1marchive_entry_linkresolver_set_strategy22m(4mstruct24m 4marchive_entry_linkresolver24m 4m*resolver24m,
+        4mint24m 4mformat24m);
 
-     void
-     archive_entry_linkresolver_free(struct archive_entry_linkresolver *resolver);
+     4mvoid0m
+     1marchive_entry_linkresolver_free22m(4mstruct24m 4marchive_entry_linkresolver24m 4m*resolver24m);
 
-     void
-     archive_entry_linkify(struct archive_entry_linkresolver *resolver,
-        struct archive_entry **entry, struct archive_entry **sparse);
+     4mvoid0m
+     1marchive_entry_linkify22m(4mstruct24m 4marchive_entry_linkresolver24m 4m*resolver24m,
+        4mstruct24m 4marchive_entry24m 4m**entry24m, 4mstruct24m 4marchive_entry24m 4m**sparse24m);
 
-DESCRIPTION
+1mDESCRIPTION0m
      Programs that want to create archives have to deal with hardlinks.
      Hardlinks are handled in different ways by the archive formats.  The
      basic strategies are:
@@ -37,77 +37,77 @@ DESCRIPTION
 
      3.   Store the body the last time an inode is seen (new cpio).
 
-     The archive_entry_linkresolver functions help by providing a unified
+     The 1marchive_entry_linkresolver 22mfunctions help by providing a unified
      interface and handling the complexity behind the scene.
 
-     The archive_entry_linkresolver functions assume that archive_entry
+     The 1marchive_entry_linkresolver 22mfunctions assume that 4marchive_entry0m
      instances have valid nlinks, inode and device values.  The inode and
      device value is used to match entries.  The nlinks value is used to
      determined if all references have been found and if the internal refer‐
      ences can be recycled.
 
-     The archive_entry_linkresolver_new() function allocates a new link
+     The 1marchive_entry_linkresolver_new22m() function allocates a new link
      resolver. The instance can be freed using
-     archive_entry_linkresolver_free().  All deferred entries are flushed and
+     1marchive_entry_linkresolver_free22m().  All deferred entries are flushed and
      the internal storage is freed.
 
-     The archive_entry_linkresolver_set_strategy() function selects the opti‐
+     The 1marchive_entry_linkresolver_set_strategy22m() function selects the opti‐
      mal hardlink strategy for the given format.  The format code can be
      obtained from archive_format(3).  The function can be called more than
      once, but it is recommended to flush all deferred entries first.
 
-     The archive_entry_linkify() function is the core of
-     archive_entry_linkresolver.  The entry() argument points to the
-     archive_entry that should be written.  Depending on the strategy one of
+     The 1marchive_entry_linkify22m() function is the core of
+     1marchive_entry_linkresolver22m.  The 1mentry22m() argument points to the
+     4marchive_entry24m that should be written.  Depending on the strategy one of
      the following actions is taken:
 
-     1.   For the simple archive formats *entry is left unmodified and *sparse
+     1.   For the simple archive formats 4m*entry24m is left unmodified and 4m*sparse0m
          is set to NULL.
 
-     2.   For tar like archive formats, *sparse is set to NULL.  If *entry is
-         NULL, no action is taken.  If the hardlink count of *entry is larger
+     2.   For tar like archive formats, 4m*sparse24m is set to NULL.  If 4m*entry24m is
+         NULL, no action is taken.  If the hardlink count of 4m*entry24m is larger
          than 1 and the file type is a regular file or symbolic link, the
          internal list is searched for a matching inode.  If such an inode is
-         found, the link count is decremented and the file size of *entry is
+         found, the link count is decremented and the file size of 4m*entry24m is
          set to 0 to notify that no body should be written.  If no such inode
          is found, a copy of the entry is added to the internal cache with a
          link count reduced by one.
 
-     3.   For new cpio like archive formats a value for *entry of NULL is used
-         to flush deferred entries.  In that case *entry is set to an arbi‐
+     3.   For new cpio like archive formats a value for 4m*entry24m of NULL is used
+         to flush deferred entries.  In that case 4m*entry24m is set to an arbi‐
          trary deferred entry and the entry itself is removed from the inter‐
-         nal list.  If the internal list is empty, *entry is set to NULL.  In
-         either case, *sparse is set to NULL and the function returns.  If
-         the hardlink count of *entry is one or the file type is a directory
-         or device, *sparse is set to NULL and no further action is taken.
+         nal list.  If the internal list is empty, 4m*entry24m is set to NULL.  In
+         either case, 4m*sparse24m is set to NULL and the function returns.  If
+         the hardlink count of 4m*entry24m is one or the file type is a directory
+         or device, 4m*sparse24m is set to NULL and no further action is taken.
          Otherwise, the internal list is searched for a matching inode.  If
          such an inode is not found, the entry is added to the internal list,
-         both *entry and *sparse are set to NULL and the function returns.
+         both 4m*entry24m and 4m*sparse24m are set to NULL and the function returns.
          If such an inode is found, the link count is decremented.  If it
          remains larger than one, the existing entry on the internal list is
-         swapped with *entry after retaining the link count.  The existing
-         entry is returned in *entry.  If the link count reached one, the new
+         swapped with 4m*entry24m after retaining the link count.  The existing
+         entry is returned in 4m*entry24m.  If the link count reached one, the new
          entry is also removed from the internal list and returned in
-         *sparse.  Otherwise *sparse is set to NULL.
+         4m*sparse24m.  Otherwise 4m*sparse24m is set to NULL.
 
      The general usage is therefore:
 
-     1.   For each new archive entry, call archive_entry_linkify().
+     1.   For each new archive entry, call 1marchive_entry_linkify22m().
 
      2.   Keep in mind that the entries returned may have a size of 0 now.
 
-     3.   If *entry is not NULL, archive it.
+     3.   If 4m*entry24m is not NULL, archive it.
 
-     4.   If *sparse is not NULL, archive it.
+     4.   If 4m*sparse24m is not NULL, archive it.
 
      5.   After all entries have been written to disk, call
-         archive_entry_linkify() with *entry set to NULL and archive the
+         1marchive_entry_linkify22m() with 4m*entry24m set to NULL and archive the
          returned entry as long as it is not NULL.
 
-RETURN VALUES
-     archive_entry_linkresolver_new() returns NULL on malloc(3) failures.
+1mRETURN VALUES0m
+     1marchive_entry_linkresolver_new22m() returns NULL on malloc(3) failures.
 
-SEE ALSO
+1mSEE ALSO0m
      archive_entry(3)
 
 BSD                           February 2, 2012                            BSD
index 9dfd8d1..5fab948 100644 (file)
 ARCHIVE_ENTRY_PATHS(3)  BSD Library Functions Manual   ARCHIVE_ENTRY_PATHS(3)
 
-NAME
-     archive_entry_hardlink, archive_entry_hardlink_w,
-     archive_entry_set_hardlink, archive_entry_copy_hardlink,
-     archive_entry_copy_hardlink_w, archve_entry_update_hardlink_utf8,
-     archive_entry_set_link, archive_entry_copy_link,
-     archive_entry_copy_link_w, archve_entry_update_link_utf8,
-     archive_entry_pathname, archive_entry_pathname_w,
-     archive_entry_set_pathname, archive_entry_copy_pathname,
-     archive_entry_copy_pathname_w, archve_entry_update_pathname_utf8,
-     archive_entry_sourcepath, archive_entry_copy_sourcepath,
-     archive_entry_symlink, archive_entry_symlink_w,
-     archive_entry_set_symlink, archive_entry_copy_symlink,
-     archive_entry_copy_symlink_w, archve_entry_update_symlink_utf8 — func‐
+1mNAME0m
+     1marchive_entry_hardlink22m, 1marchive_entry_hardlink_w22m,
+     1marchive_entry_set_hardlink22m, 1marchive_entry_copy_hardlink22m,
+     1marchive_entry_copy_hardlink_w22m, 1marchve_entry_update_hardlink_utf822m,
+     1marchive_entry_set_link22m, 1marchive_entry_copy_link22m,
+     1marchive_entry_copy_link_w22m, 1marchve_entry_update_link_utf822m,
+     1marchive_entry_pathname22m, 1marchive_entry_pathname_w22m,
+     1marchive_entry_set_pathname22m, 1marchive_entry_copy_pathname22m,
+     1marchive_entry_copy_pathname_w22m, 1marchve_entry_update_pathname_utf822m,
+     1marchive_entry_sourcepath22m, 1marchive_entry_copy_sourcepath22m,
+     1marchive_entry_symlink, archive_entry_symlink_w,0m
+     1marchive_entry_set_symlink22m, 1marchive_entry_copy_symlink22m,
+     1marchive_entry_copy_symlink_w22m, 1marchve_entry_update_symlink_utf8 22m— func‐
      tions for manipulating path names in archive entry descriptions
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive_entry.h>
+1mSYNOPSIS0m
+     1m#include <archive_entry.h>0m
 
-     const char *
-     archive_entry_hardlink(struct archive_entry *a);
+     4mconst24m 4mchar24m 4m*0m
+     1marchive_entry_hardlink22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     const wchar_t *
-     archive_entry_hardlink_w(struct archive_entry *a);
+     4mconst24m 4mwchar_t24m 4m*0m
+     1marchive_entry_hardlink_w22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_hardlink(struct archive_entry *a, const char *path);
+     4mvoid0m
+     1marchive_entry_set_hardlink22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mchar24m 4m*path24m);
 
-     void
-     archive_entry_copy_hardlink(struct archive_entry *a, const char *path);
+     4mvoid0m
+     1marchive_entry_copy_hardlink22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mchar24m 4m*path24m);
 
-     void
-     archive_entry_copy_hardlink_w(struct archive_entry *a, const, wchar_t,
-        *path");
+     4mvoid0m
+     1marchive_entry_copy_hardlink_w22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m, 4mwchar_t24m,
+        4m*path"24m);
 
-     int
-     archive_entry_update_hardlink_utf8(struct archive_entry *a,
-        const char *path);
+     4mint0m
+     1marchive_entry_update_hardlink_utf822m(4mstruct24m 4marchive_entry24m 4m*a24m,
+        4mconst24m 4mchar24m 4m*path24m);
 
-     void
-     archive_entry_set_link(struct archive_entry *a, const char *path);
+     4mvoid0m
+     1marchive_entry_set_link22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mchar24m 4m*path24m);
 
-     void
-     archive_entry_copy_link(struct archive_entry *a, const char *path);
+     4mvoid0m
+     1marchive_entry_copy_link22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mchar24m 4m*path24m);
 
-     void
-     archive_entry_copy_link_w(struct archive_entry *a, const wchar_t *path);
+     4mvoid0m
+     1marchive_entry_copy_link_w22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mwchar_t24m 4m*path24m);
 
-     int
-     archive_entry_update_link_utf8(struct archive_entry *a,
-        const char *path);
+     4mint0m
+     1marchive_entry_update_link_utf822m(4mstruct24m 4marchive_entry24m 4m*a24m,
+        4mconst24m 4mchar24m 4m*path24m);
 
-     const char *
-     archive_entry_pathname(struct archive_entry *a);
+     4mconst24m 4mchar24m 4m*0m
+     1marchive_entry_pathname22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     const wchar_t *
-     archive_entry_pathname_w(struct archive_entry *a);
+     4mconst24m 4mwchar_t24m 4m*0m
+     1marchive_entry_pathname_w22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_pathname(struct archive_entry *a, const char *path);
+     4mvoid0m
+     1marchive_entry_set_pathname22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mchar24m 4m*path24m);
 
-     void
-     archive_entry_copy_pathname(struct archive_entry *a, const char *path);
+     4mvoid0m
+     1marchive_entry_copy_pathname22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mchar24m 4m*path24m);
 
-     void
-     archive_entry_copy_pathname_w(struct archive_entry *a,
-        const wchar_t *path);
+     4mvoid0m
+     1marchive_entry_copy_pathname_w22m(4mstruct24m 4marchive_entry24m 4m*a24m,
+        4mconst24m 4mwchar_t24m 4m*path24m);
 
-     int
-     archive_entry_update_pathname_utf8(struct archive_entry *a,
-        const char *path);
+     4mint0m
+     1marchive_entry_update_pathname_utf822m(4mstruct24m 4marchive_entry24m 4m*a24m,
+        4mconst24m 4mchar24m 4m*path24m);
 
-     const char *
-     archive_entry_sourcepath(struct archive_entry *a);
+     4mconst24m 4mchar24m 4m*0m
+     1marchive_entry_sourcepath22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_copy_sourcepath(struct archive_entry *a, const char *path);
+     4mvoid0m
+     1marchive_entry_copy_sourcepath22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mchar24m 4m*path24m);
 
-     const char *
-     archive_entry_symlink(struct archive_entry *a);
+     4mconst24m 4mchar24m 4m*0m
+     1marchive_entry_symlink22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     const wchar_t *
-     archive_entry_symlink_w(struct archive_entry *a);
+     4mconst24m 4mwchar_t24m 4m*0m
+     1marchive_entry_symlink_w22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_symlink(struct archive_entry *a, const char *path);
+     4mvoid0m
+     1marchive_entry_set_symlink22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mchar24m 4m*path24m);
 
-     void
-     archive_entry_copy_symlink(struct archive_entry *a, const char *path);
+     4mvoid0m
+     1marchive_entry_copy_symlink22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mchar24m 4m*path24m);
 
-     void
-     archive_entry_copy_symlink_w(struct archive_entry *a,
-        const wchar_t *path);
+     4mvoid0m
+     1marchive_entry_copy_symlink_w22m(4mstruct24m 4marchive_entry24m 4m*a24m,
+        4mconst24m 4mwchar_t24m 4m*path24m);
 
-     int
-     archive_entry_update_symlink_utf8(struct archive_entry *a,
-        const char *path);
+     4mint0m
+     1marchive_entry_update_symlink_utf822m(4mstruct24m 4marchive_entry24m 4m*a24m,
+        4mconst24m 4mchar24m 4m*path24m);
 
-DESCRIPTION
+1mDESCRIPTION0m
      Path names supported by archive_entry(3):
      hardlink   Destination of the hardlink.
      link       Update only.  For a symlink, update the destination.  Other‐
@@ -115,7 +115,7 @@ DESCRIPTION
      char *    Multibyte strings in the current locale.
 
      wchar_t * Wide character strings in the current locale.  The accessor
-               functions are named XXX_w().
+               functions are named 1mXXX_w22m().
 
      UTF-8     Unicode strings encoded as UTF-8.  This are convience func‐
                tions to update both the multibyte and wide character strings
@@ -128,9 +128,9 @@ DESCRIPTION
      is a convience function for conditionally setting hardlink or symlink
      destination.  It doesn't have a corresponding get accessor function.
 
-     archive_entry_set_XXX() is an alias for archive_entry_copy_XXX().
+     1marchive_entry_set_XXX22m() is an alias for 1marchive_entry_copy_XXX22m().
 
-SEE ALSO
+1mSEE ALSO0m
      archive_entry(3) libarchive(3),
 
 BSD                           February 2, 2012                            BSD
index bc74b05..24c0e84 100644 (file)
 ARCHIVE_ENTRY_PERMS(3)  BSD Library Functions Manual   ARCHIVE_ENTRY_PERMS(3)
 
-NAME
-     archive_entry_gid, archive_entry_set_gid, archive_entry_uid,
-     archive_entry_set_uid, archive_entry_perm, archive_entry_set_perm,
-     archive_entry_strmode, archive_entry_uname archive_entry_uname_w
-     archive_entry_set_uname, archive_entry_copy_uname,
-     archive_entry_copy_uname_w, archive_entry_update_uname_utf8,
-     archive_entry_gname, archive_entry_gname_w, archive_entry_set_gname,
-     archive_entry_copy_gname, archive_entry_copy_gname_w,
-     archive_entry_update_gname_utf8, archive_entry_fflags,
-     archive_entry_fflags_text, archive_entry_set_fflags,
-     archive_entry_copy_fflags_text, archive_entry_copy_fflags_text_w — func‐
+1mNAME0m
+     1marchive_entry_gid22m, 1marchive_entry_set_gid22m, 1marchive_entry_uid22m,
+     1marchive_entry_set_uid22m, 1marchive_entry_perm22m, 1marchive_entry_set_perm22m,
+     1marchive_entry_strmode22m, 1marchive_entry_uname archive_entry_uname_w0m
+     1marchive_entry_set_uname22m, 1marchive_entry_copy_uname22m,
+     1marchive_entry_copy_uname_w22m, 1marchive_entry_update_uname_utf822m,
+     1marchive_entry_gname22m, 1marchive_entry_gname_w22m, 1marchive_entry_set_gname22m,
+     1marchive_entry_copy_gname22m, 1marchive_entry_copy_gname_w22m,
+     1marchive_entry_update_gname_utf822m, 1marchive_entry_fflags22m,
+     1marchive_entry_fflags_text22m, 1marchive_entry_set_fflags22m,
+     1marchive_entry_copy_fflags_text22m, 1marchive_entry_copy_fflags_text_w 22m— func‐
      tions for manipulating ownership and permissions in archive entry
      descriptions
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive_entry.h>
+1mSYNOPSIS0m
+     1m#include <archive_entry.h>0m
 
-     gid_t
-     archive_entry_gid(struct archive_entry *a);
+     4mgid_t0m
+     1marchive_entry_gid22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_gid(struct archive_entry *a, gid_t gid);
+     4mvoid0m
+     1marchive_entry_set_gid22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mgid_t24m 4mgid24m);
 
-     uid_t
-     archive_entry_uid(struct archive_entry *a);
+     4muid_t0m
+     1marchive_entry_uid22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_uid(struct archive_entry *a, uid_t uid);
+     4mvoid0m
+     1marchive_entry_set_uid22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4muid_t24m 4muid24m);
 
-     mode_t
-     archive_entry_perm(struct archive_entry *a);
+     4mmode_t0m
+     1marchive_entry_perm22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_perm(struct archive_entry *a, mode_t mode);
+     4mvoid0m
+     1marchive_entry_set_perm22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mmode_t24m 4mmode24m);
 
-     const char *
-     archive_entry_strmode(struct archive_entry *a);
+     4mconst24m 4mchar24m 4m*0m
+     1marchive_entry_strmode22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     const char *
-     archive_entry_gname(struct archive_entry *a);
+     4mconst24m 4mchar24m 4m*0m
+     1marchive_entry_gname22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     const wchar_t *
-     archive_entry_gname_w(struct archive_entry *a);
+     4mconst24m 4mwchar_t24m 4m*0m
+     1marchive_entry_gname_w22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_gname(struct archive_entry *a, const char *a);
+     4mvoid0m
+     1marchive_entry_set_gname22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mchar24m 4m*a24m);
 
-     void
-     archive_entry_copy_gname(struct archive_entry *a, const char *name);
+     4mvoid0m
+     1marchive_entry_copy_gname22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mchar24m 4m*name24m);
 
-     void
-     archive_entry_copy_gname_w(struct archive_entry *a, const wchar_t *name);
+     4mvoid0m
+     1marchive_entry_copy_gname_w22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mwchar_t24m 4m*name24m);
 
-     int
-     archive_entry_update_gname_utf8(struct archive_entry *a,
-        const char *name);
+     4mint0m
+     1marchive_entry_update_gname_utf822m(4mstruct24m 4marchive_entry24m 4m*a24m,
+        4mconst24m 4mchar24m 4m*name24m);
 
-     const char *
-     archive_entry_uname(struct archive_entry *a);
+     4mconst24m 4mchar24m 4m*0m
+     1marchive_entry_uname22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     const wchar_t *
-     archive_entry_uname_w(struct archive_entry *a);
+     4mconst24m 4mwchar_t24m 4m*0m
+     1marchive_entry_uname_w22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_uname(struct archive_entry *a, const char *name);
+     4mvoid0m
+     1marchive_entry_set_uname22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mchar24m 4m*name24m);
 
-     void
-     archive_entry_copy_uname(struct archive_entry *a, const char *name);
+     4mvoid0m
+     1marchive_entry_copy_uname22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mchar24m 4m*name24m);
 
-     void
-     archive_entry_copy_uname_w(struct archive_entry *a, const wchar_t *name);
+     4mvoid0m
+     1marchive_entry_copy_uname_w22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mwchar_t24m 4m*name24m);
 
-     int
-     archive_entry_update_uname_utf8(struct archive_entry *a,
-        const char *name);
+     4mint0m
+     1marchive_entry_update_uname_utf822m(4mstruct24m 4marchive_entry24m 4m*a24m,
+        4mconst24m 4mchar24m 4m*name24m);
 
-     void
-     archive_entry_fflags(struct archive_entry *a, unsigned long *set_bits,
-        unsigned long *clear_bits);
+     4mvoid0m
+     1marchive_entry_fflags22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4munsigned24m 4mlong24m 4m*set_bits24m,
+        4munsigned24m 4mlong24m 4m*clear_bits24m);
 
-     const char *
-     archive_entry_fflags_text(struct archive_entry *a);
+     4mconst24m 4mchar24m 4m*0m
+     1marchive_entry_fflags_text22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_fflags(struct archive_entry *a, unsigned long set_bits,
-        unsigned long clear_bits);
+     4mvoid0m
+     1marchive_entry_set_fflags22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4munsigned24m 4mlong24m 4mset_bits24m,
+        4munsigned24m 4mlong24m 4mclear_bits24m);
 
-     const char *
-     archive_entry_copy_fflags_text(struct archive_entry *a,
-        const char *text);
+     4mconst24m 4mchar24m 4m*0m
+     1marchive_entry_copy_fflags_text22m(4mstruct24m 4marchive_entry24m 4m*a24m,
+        4mconst24m 4mchar24m 4m*text24m);
 
-     const wchar_t *
-     archive_entry_copy_fflags_text_w(struct archive_entry *a,
-        const wchar_t *text);
+     4mconst24m 4mwchar_t24m 4m*0m
+     1marchive_entry_copy_fflags_text_w22m(4mstruct24m 4marchive_entry24m 4m*a24m,
+        4mconst24m 4mwchar_t24m 4m*text24m);
 
-DESCRIPTION
-   User id, group id and mode
-     The functions archive_entry_uid(), archive_entry_gid(), and
-     archive_entry_perm() can be used to extract the user id, group id and
+1mDESCRIPTION0m
+   1mUser id, group id and mode0m
+     The functions 1marchive_entry_uid22m(), 1marchive_entry_gid22m(), and
+     1marchive_entry_perm22m() can be used to extract the user id, group id and
      permission from the given entry.  The corresponding functions
-     archive_entry_set_uid(), archive_entry_set_gid(), and
-     archive_entry_set_perm() store the given user id, group id and permission
+     1marchive_entry_set_uid22m(), 1marchive_entry_set_gid22m(), and
+     1marchive_entry_set_perm22m() store the given user id, group id and permission
      in the entry.  The permission is also set as side effect of calling
-     archive_entry_set_mode().
+     1marchive_entry_set_mode22m().
 
-     archive_entry_strmode() returns a string representation of the permission
+     1marchive_entry_strmode22m() returns a string representation of the permission
      as used by the long mode of ls(1).
 
-   User and group name
+   1mUser and group name0m
      User and group names can be provided in one of three different ways:
 
      char *    Multibyte strings in the current locale.
 
      wchar_t * Wide character strings in the current locale.  The accessor
-               functions are named XXX_w().
+               functions are named 1mXXX_w22m().
 
      UTF-8     Unicode strings encoded as UTF-8.  This are convience func‐
                tions to update both the multibyte and wide character strings
                at the same time.
 
-     archive_entry_set_XXX() is an alias for archive_entry_copy_XXX().
+     1marchive_entry_set_XXX22m() is an alias for 1marchive_entry_copy_XXX22m().
 
-   File Flags
+   1mFile Flags0m
      File flags are transparently converted between a bitmap representation
      and a textual format.  For example, if you set the bitmap and ask for
      text, the library will build a canonical text format.  However, if you
@@ -147,7 +147,7 @@ DESCRIPTION
      bits that are not meaningful on the current platform will be ignored.
 
      The canonical text format is a comma-separated list of flag names.  The
-     archive_entry_copy_fflags_text() and archive_entry_copy_fflags_text_w()
+     1marchive_entry_copy_fflags_text22m() and 1marchive_entry_copy_fflags_text_w22m()
      functions parse the provided text and sets the internal bitmap values.
      This is a platform-specific operation; names that are not meaningful on
      the current platform will be ignored.  The function returns a pointer to
@@ -157,12 +157,12 @@ DESCRIPTION
      reflect every name that is recognized.  (In particular, this differs from
      strtofflags(3), which stops parsing at the first unrecognized name.)
 
-SEE ALSO
+1mSEE ALSO0m
      archive_entry(3), archive_entry_acl(3), archive_read_disk(3),
      archive_write_disk(3) libarchive(3),
 
-BUGS
-     The platform types uid_t and gid_t are often 16 or 32 bit wide.  In this
+1mBUGS0m
+     The platform types 4muid_t24m and 4mgid_t24m are often 16 or 32 bit wide. In this
      case it is possible that the ids can not be correctly restored from ar‐
      chives and get truncated.
 
index 32270ed..0027660 100644 (file)
 ARCHIVE_ENTRY_STAT(3)   BSD Library Functions Manual    ARCHIVE_ENTRY_STAT(3)
 
-NAME
-     archive_entry_stat, archive_entry_copy_stat, archive_entry_filetype,
-     archive_entry_set_filetype, archive_entry_mode, archive_entry_set_mode,
-     archive_entry_size, archive_entry_size_is_set, archive_entry_set_size,
-     archive_entry_unset_size, archive_entry_dev, archive_entry_set_dev,
-     archive_entry_dev_is_set, archive_entry_devmajor,
-     archive_entry_set_devmajor, archive_entry_devminor,
-     archive_entry_set_devminor, archive_entry_ino, archive_entry_set_ino,
-     archive_entry_ino_is_set, archive_entry_ino64, archive_entry_set_ino64,
-     archive_entry_nlink, archive_entry_rdev, archive_entry_set_rdev,
-     archive_entry_rdevmajor, archive_entry_set_rdevmajor,
-     archive_entry_rdevminor, archive_entry_set_rdevminor, — accessor func‐
+1mNAME0m
+     1marchive_entry_stat22m, 1marchive_entry_copy_stat22m, 1marchive_entry_filetype22m,
+     1marchive_entry_set_filetype22m, 1marchive_entry_mode22m, 1marchive_entry_set_mode22m,
+     1marchive_entry_size22m, 1marchive_entry_size_is_set22m, 1marchive_entry_set_size22m,
+     1marchive_entry_unset_size22m, 1marchive_entry_dev22m, 1marchive_entry_set_dev22m,
+     1marchive_entry_dev_is_set22m, 1marchive_entry_devmajor22m,
+     1marchive_entry_set_devmajor22m, 1marchive_entry_devminor22m,
+     1marchive_entry_set_devminor22m, 1marchive_entry_ino22m, 1marchive_entry_set_ino22m,
+     1marchive_entry_ino_is_set22m, 1marchive_entry_ino6422m, 1marchive_entry_set_ino6422m,
+     1marchive_entry_nlink22m, 1marchive_entry_rdev22m, 1marchive_entry_set_rdev22m,
+     1marchive_entry_rdevmajor22m, 1marchive_entry_set_rdevmajor22m,
+     1marchive_entry_rdevminor22m, 1marchive_entry_set_rdevminor22m, — accessor func‐
      tions for manipulating archive entry descriptions
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive_entry.h>
+1mSYNOPSIS0m
+     1m#include <archive_entry.h>0m
 
-     const struct stat *
-     archive_entry_stat(struct archive_entry *a);
+     4mconst24m 4mstruct24m 4mstat24m 4m*0m
+     1marchive_entry_stat22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_copy_stat(struct archive_entry *a, const struct stat *sb);
+     4mvoid0m
+     1marchive_entry_copy_stat22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mconst24m 4mstruct24m 4mstat24m 4m*sb24m);
 
-     mode_t
-     archive_entry_filetype(struct archive_entry *a);
+     4mmode_t0m
+     1marchive_entry_filetype22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_filetype(struct archive_entry *a, unsigned int type);
+     4mvoid0m
+     1marchive_entry_set_filetype22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4munsigned24m 4mint24m 4mtype24m);
 
-     mode_t
-     archive_entry_mode(struct archive_entry *a);
+     4mmode_t0m
+     1marchive_entry_mode22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_mode(struct archive_entry *a, mode_t mode);
+     4mvoid0m
+     1marchive_entry_set_mode22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mmode_t24m 4mmode24m);
 
-     int64_t
-     archive_entry_size(struct archive_entry *a);
+     4mint64_t0m
+     1marchive_entry_size22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     int
-     archive_entry_size_is_set(struct archive_entry *a);
+     4mint0m
+     1marchive_entry_size_is_set22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_size(struct archive_entry *a, int64_t size);
+     4mvoid0m
+     1marchive_entry_set_size22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mint64_t24m 4msize24m);
 
-     void
-     archive_entry_unset_size(struct archive_entry *a);
+     4mvoid0m
+     1marchive_entry_unset_size22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     dev_t
-     archive_entry_dev(struct archive_entry *a);
+     4mdev_t0m
+     1marchive_entry_dev22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_dev(struct archive_entry *a, dev_t dev);
+     4mvoid0m
+     1marchive_entry_set_dev22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mdev_t24m 4mdev24m);
 
-     int
-     archive_entry_dev_is_set(struct archive_entry *a);
+     4mint0m
+     1marchive_entry_dev_is_set22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     dev_t
-     archive_entry_devmajor(struct archive_entry *a);
+     4mdev_t0m
+     1marchive_entry_devmajor22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_devmajor(struct archive_entry *a, dev_t major);
+     4mvoid0m
+     1marchive_entry_set_devmajor22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mdev_t24m 4mmajor24m);
 
-     dev_t
-     archive_entry_devminor(struct archive_entry *a);
+     4mdev_t0m
+     1marchive_entry_devminor22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_devminor(struct archive_entry *a, dev_t minor);
+     4mvoid0m
+     1marchive_entry_set_devminor22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mdev_t24m 4mminor24m);
 
-     ino_t
-     archive_entry_ino(struct archive_entry *a);
+     4mino_t0m
+     1marchive_entry_ino22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_ino(struct archive_entry *a, unsigned long ino);
+     4mvoid0m
+     1marchive_entry_set_ino22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4munsigned24m 4mlong24m 4mino24m);
 
-     int
-     archive_entry_ino_is_set(struct archive_entry *a);
+     4mint0m
+     1marchive_entry_ino_is_set22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     int64_t
-     archive_entry_ino64(struct archive_entry *a);
+     4mint64_t0m
+     1marchive_entry_ino6422m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_ino64(struct archive_entry *a, int64_t ino);
+     4mvoid0m
+     1marchive_entry_set_ino6422m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mint64_t24m 4mino24m);
 
-     unsigned int
-     archive_entry_nlink(struct archive_entry *a);
+     4munsigned24m 4mint0m
+     1marchive_entry_nlink22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_nlink(struct archive_entry *a, unsigned int count);
+     4mvoid0m
+     1marchive_entry_set_nlink22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4munsigned24m 4mint24m 4mcount24m);
 
-     dev_t
-     archive_entry_rdev(struct archive_entry *a);
+     4mdev_t0m
+     1marchive_entry_rdev22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     dev_t
-     archive_entry_rdevmajor(struct archive_entry *a);
+     4mdev_t0m
+     1marchive_entry_rdevmajor22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     dev_t
-     archive_entry_rdevminor(struct archive_entry *a);
+     4mdev_t0m
+     1marchive_entry_rdevminor22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_rdev(struct archive_entry *a, dev_t dev);
+     4mvoid0m
+     1marchive_entry_set_rdev22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mdev_t24m 4mdev24m);
 
-     void
-     archive_entry_set_rdevmajor(struct archive_entry *a, dev_t major);
+     4mvoid0m
+     1marchive_entry_set_rdevmajor22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mdev_t24m 4mmajor24m);
 
-     void
-     archive_entry_set_rdevminor(struct archive_entry *a, dev_t minor);
+     4mvoid0m
+     1marchive_entry_set_rdevminor22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mdev_t24m 4mminor24m);
 
-DESCRIPTION
-   Copying to and from struct stat
-     The function archive_entry_stat() converts the various fields stored in
+1mDESCRIPTION0m
+   1mCopying to and from 4m22mstruct24m 4mstat0m
+     The function 1marchive_entry_stat22m() converts the various fields stored in
      the archive entry to the format used by stat(2).  The return value
-     remains valid until either archive_entry_clear() or archive_entry_free()
+     remains valid until either 1marchive_entry_clear22m() or 1marchive_entry_free22m()
      is called.  It is not affected by calls to the set accessor functions.
-     It currently sets the following values in struct stat: st_atime,
-     st_ctime, st_dev, st_gid, st_ino, st_mode, st_mtime, st_nlink, st_rdev,
-     st_size, st_uid.  In addition, st_birthtime and high-precision informa‐
+     It currently sets the following values in 4mstruct24m 4mstat24m: 4mst_atime24m,
+     4mst_ctime24m, 4mst_dev24m, 4mst_gid24m, 4mst_ino24m, 4mst_mode24m, 4mst_mtime24m, 4mst_nlink24m, 4mst_rdev24m,
+     4mst_size24m, 4mst_uid24m.  In addition, 4mst_birthtime24m and high-precision informa‐
      tion for time-related fields will be included on platforms that support
      it.
 
-     The function archive_entry_copy_stat() copies fields from the platform's
-     struct stat.  Fields not provided by struct stat are unchanged.
+     The function 1marchive_entry_copy_stat22m() copies fields from the platform's
+     4mstruct24m 4mstat24m.  Fields not provided by 4mstruct24m 4mstat24m are unchanged.
 
-   General accessor functions
-     The functions archive_entry_filetype() and archive_entry_set_filetype()
+   1mGeneral accessor functions0m
+     The functions 1marchive_entry_filetype22m() and 1marchive_entry_set_filetype22m()
      get respectively set the filetype.  The file type is one of the following
      constants:
           AE_IFREG   Regular file
@@ -140,50 +140,50 @@ DESCRIPTION
      stat(2) may have different numeric values from the corresponding con‐
      stants above.
 
-     The functions archive_entry_mode() and archive_entry_set_mode() get/set a
+     The functions 1marchive_entry_mode22m() and 1marchive_entry_set_mode22m() get/set a
      combination of file type and permissions and provide the equivalent of
-     st_mode.  Use of archive_entry_filetype() and archive_entry_perm() for
-     getting and archive_entry_set_filetype() and archive_entry_set_perm() for
+     4mst_mode24m.  Use of 1marchive_entry_filetype22m() and 1marchive_entry_perm22m() for
+     getting and 1marchive_entry_set_filetype22m() and 1marchive_entry_set_perm22m() for
      setting is recommended.
 
-     The function archive_entry_size() returns the file size, if it has been
-     set, and 0 otherwise.  archive_entry_size() can be used to query that
-     status.  archive_entry_set_size() and archive_entry_unset_size() set and
+     The function 1marchive_entry_size22m() returns the file size, if it has been
+     set, and 0 otherwise.  1marchive_entry_size22m() can be used to query that
+     status.  1marchive_entry_set_size22m() and 1marchive_entry_unset_size22m() set and
      unset the size, respectively.
 
      The number of references (hardlinks) can be obtained by calling
-     archive_entry_nlinks() and set with archive_entry_set_nlinks().
+     1marchive_entry_nlinks22m() and set with 1marchive_entry_set_nlinks22m().
 
-   Identifying unique files
-     The functions archive_entry_dev() and archive_entry_ino64() are used by
+   1mIdentifying unique files0m
+     The functions 1marchive_entry_dev22m() and 1marchive_entry_ino6422m() are used by
      archive_entry_linkify(3) to find hardlinks.  The pair of device and inode
      is supposed to identify hardlinked files.
 
      The device major and minor number can be obtained independently using
-     archive_entry_devmajor() and archive_entry_devminor().  The device can be
-     set either via archive_entry_set_dev() or by the combination of major and
-     minor number using archive_entry_set_devmajor() and
-     archive_entry_set_devminor().
-
-     The inode number can be obtained using archive_entry_ino().  This is a
-     legacy interface that uses the platform ino_t, which may be very small.
-     To set the inode number, archive_entry_set_ino64() is the preferred
+     1marchive_entry_devmajor22m() and 1marchive_entry_devminor22m().  The device can be
+     set either via 1marchive_entry_set_dev22m() or by the combination of major and
+     minor number using 1marchive_entry_set_devmajor22m() and
+     1marchive_entry_set_devminor22m().
+
+     The inode number can be obtained using 1marchive_entry_ino22m().  This is a
+     legacy interface that uses the platform 4mino_t24m, which may be very small.
+     To set the inode number, 1marchive_entry_set_ino6422m() is the preferred
      interface.
 
-   Accessor functions for block and character devices
+   1mAccessor functions for block and character devices0m
      Block and character devices are characterised either using a device num‐
      ber or a pair of major and minor number.  The combined device number can
-     be obtained with archive_device_rdev() and set with
-     archive_device_set_rdev().  The major and minor numbers are accessed by
-     archive_device_rdevmajor(), archive_device_rdevminor()
-     archive_device_set_rdevmajor() and archive_device_set_rdevminor().
+     be obtained with 1marchive_device_rdev22m() and set with
+     1marchive_device_set_rdev22m().  The major and minor numbers are accessed by
+     1marchive_device_rdevmajor22m(), 1marchive_device_rdevminor22m()
+     1marchive_device_set_rdevmajor22m() and 1marchive_device_set_rdevminor22m().
 
      The process of splitting the combined device number into major and minor
      number and the reverse process of combing them differs between platforms.
      Some archive formats use the combined form, while other formats use the
      split form.
 
-SEE ALSO
+1mSEE ALSO0m
      archive_entry_acl(3), archive_entry_perms(3), archive_entry_time(3),
      libarchive(3), stat(2)
 
index 227a7aa..2a63a37 100644 (file)
@@ -1,91 +1,91 @@
 ARCHIVE_ENTRY_TIME(3)   BSD Library Functions Manual    ARCHIVE_ENTRY_TIME(3)
 
-NAME
-     archive_entry_atime, archive_entry_atime_nsec,
-     archive_entry_atime_is_set, archive_entry_set_atime,
-     archive_entry_unset_atime, archive_entry_birthtime,
-     archive_entry_birthtime_nsec, archive_entry_birthtime_is_set,
-     archive_entry_set_birthtime, archive_entry_unset_birthtime,
-     archive_entry_ctime, archive_entry_ctime_nsec,
-     archive_entry_ctime_is_set, archive_entry_set_ctime,
-     archive_entry_unset_ctime, archive_entry_mtime, archive_entry_mtime_nsec,
-     archive_entry_mtime_is_set, archive_entry_set_mtime,
-     archive_entry_unset_mtime, — functions for manipulating times in archive
+1mNAME0m
+     1marchive_entry_atime22m, 1marchive_entry_atime_nsec22m,
+     1marchive_entry_atime_is_set22m, 1marchive_entry_set_atime22m,
+     1marchive_entry_unset_atime22m, 1marchive_entry_birthtime22m,
+     1marchive_entry_birthtime_nsec22m, 1marchive_entry_birthtime_is_set22m,
+     1marchive_entry_set_birthtime22m, 1marchive_entry_unset_birthtime22m,
+     1marchive_entry_ctime22m, 1marchive_entry_ctime_nsec22m,
+     1marchive_entry_ctime_is_set22m, 1marchive_entry_set_ctime22m,
+     1marchive_entry_unset_ctime22m, 1marchive_entry_mtime22m, 1marchive_entry_mtime_nsec22m,
+     1marchive_entry_mtime_is_set22m, 1marchive_entry_set_mtime22m,
+     1marchive_entry_unset_mtime22m, — functions for manipulating times in archive
      entry descriptions
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive_entry.h>
+1mSYNOPSIS0m
+     1m#include <archive_entry.h>0m
 
-     time_t
-     archive_entry_atime(struct archive_entry *a);
+     4mtime_t0m
+     1marchive_entry_atime22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     long
-     archive_entry_atime_nsec(struct archive_entry *a);
+     4mlong0m
+     1marchive_entry_atime_nsec22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     int
-     archive_entry_atime_is_set(struct archive_entry *a);
+     4mint0m
+     1marchive_entry_atime_is_set22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_atime(struct archive_entry *a, time_t sec,
-        long nanosec);
+     4mvoid0m
+     1marchive_entry_set_atime22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mtime_t24m 4msec24m,
+        4mlong24m 4mnanosec24m);
 
-     void
-     archive_entry_unset_atime(struct archive_entry *a);
+     4mvoid0m
+     1marchive_entry_unset_atime22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     time_t
-     archive_entry_birthtime(struct archive_entry *a);
+     4mtime_t0m
+     1marchive_entry_birthtime22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     long
-     archive_entry_birthtime_nsec(struct archive_entry *a);
+     4mlong0m
+     1marchive_entry_birthtime_nsec22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     int
-     archive_entry_birthtime_is_set(struct archive_entry *a);
+     4mint0m
+     1marchive_entry_birthtime_is_set22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_birthtime(struct archive_entry *a, time_t sec,
-        long nanosec);
+     4mvoid0m
+     1marchive_entry_set_birthtime22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mtime_t24m 4msec24m,
+        4mlong24m 4mnanosec24m);
 
-     void
-     archive_entry_unset_birthtime(struct archive_entry *a);
+     4mvoid0m
+     1marchive_entry_unset_birthtime22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     time_t
-     archive_entry_ctime(struct archive_entry *a);
+     4mtime_t0m
+     1marchive_entry_ctime22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     long
-     archive_entry_ctime_nsec(struct archive_entry *a);
+     4mlong0m
+     1marchive_entry_ctime_nsec22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     int
-     archive_entry_ctime_is_set(struct archive_entry *a);
+     4mint0m
+     1marchive_entry_ctime_is_set22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_ctime(struct archive_entry *a, time_t sec,
-        long nanosec);
+     4mvoid0m
+     1marchive_entry_set_ctime22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mtime_t24m 4msec24m,
+        4mlong24m 4mnanosec24m);
 
-     void
-     archive_entry_unset_ctime(struct archive_entry *a);
+     4mvoid0m
+     1marchive_entry_unset_ctime22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     time_t
-     archive_entry_mtime(struct archive_entry *a);
+     4mtime_t0m
+     1marchive_entry_mtime22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     long
-     archive_entry_mtime_nsec(struct archive_entry *a);
+     4mlong0m
+     1marchive_entry_mtime_nsec22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     int
-     archive_entry_mtime_is_set(struct archive_entry *a);
+     4mint0m
+     1marchive_entry_mtime_is_set22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-     void
-     archive_entry_set_mtime(struct archive_entry *a, time_t sec,
-        long nanosec);
+     4mvoid0m
+     1marchive_entry_set_mtime22m(4mstruct24m 4marchive_entry24m 4m*a24m, 4mtime_t24m 4msec24m,
+        4mlong24m 4mnanosec24m);
 
-     void
-     archive_entry_unset_mtime(struct archive_entry *a);
+     4mvoid0m
+     1marchive_entry_unset_mtime22m(4mstruct24m 4marchive_entry24m 4m*a24m);
 
-DESCRIPTION
+1mDESCRIPTION0m
      These functions create and manipulate the time fields in an
-     archive_entry.  Supported time fields are atime (access time), birthtime
+     4marchive_entry24m.  Supported time fields are atime (access time), birthtime
      (creation time), ctime (last time an inode property was changed) and
      mtime (modification time).
 
@@ -93,18 +93,18 @@ DESCRIPTION
      truncated automatically depending on the archive format (for archiving)
      or the filesystem capabilities (for restoring).
 
-     All timestamp fields are optional.  The XXX_unset() functions can be used
+     All timestamp fields are optional.  The 1mXXX_unset22m() functions can be used
      to mark the corresponding field as missing.  The current state can be
-     queried using XXX_is_set().  Unset time fields have a second and nanosec‐
+     queried using 1mXXX_is_set22m().  Unset time fields have a second and nanosec‐
      ond field of 0.
 
-SEE ALSO
+1mSEE ALSO0m
      archive_entry(3) libarchive(3),
 
-HISTORY
-     The libarchive library first appeared in FreeBSD 5.3.
+1mHISTORY0m
+     The 1mlibarchive 22mlibrary first appeared in FreeBSD 5.3.
 
-AUTHORS
-     The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
+1mAUTHORS0m
+     The 1mlibarchive 22mlibrary was written by Tim Kientzle <kientzle@acm.org>.
 
 BSD                           February 2, 2012                            BSD
index 3421d88..8de8fff 100644 (file)
@@ -1,86 +1,86 @@
 ARCHIVE_READ(3)         BSD Library Functions Manual          ARCHIVE_READ(3)
 
-NAME
-     archive_read — functions for reading streaming archives
+1mNAME0m
+     1marchive_read 22m— functions for reading streaming archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-DESCRIPTION
+1mDESCRIPTION0m
      These functions provide a complete API for reading streaming archives.
      The general process is to first create the struct archive object, set
      options, initialize the reader, iterate over the archive headers and
      associated data, then close the archive and release all resources.
 
-   Create archive object
+   1mCreate archive object0m
      See archive_read_new(3).
 
      To read an archive, you must first obtain an initialized struct archive
-     object from archive_read_new().
+     object from 1marchive_read_new22m().
 
-   Enable filters and formats
+   1mEnable filters and formats0m
      See archive_read_filter(3) and archive_read_format(3).
 
      You can then modify this object for the desired operations with the vari‐
-     ous archive_read_set_XXX() and archive_read_support_XXX() functions.  In
+     ous 1marchive_read_set_XXX22m() and 1marchive_read_support_XXX22m() functions.  In
      particular, you will need to invoke appropriate
-     archive_read_support_XXX() functions to enable the corresponding compres‐
+     1marchive_read_support_XXX22m() functions to enable the corresponding compres‐
      sion and format support.  Note that these latter functions perform two
      distinct operations: they cause the corresponding support code to be
      linked into your program, and they enable the corresponding auto-detect
      code.  Unless you have specific constraints, you will generally want to
-     invoke archive_read_support_filter_all() and
-     archive_read_support_format_all() to enable auto-detect for all formats
+     invoke 1marchive_read_support_filter_all22m() and
+     1marchive_read_support_format_all22m() to enable auto-detect for all formats
      and compression types currently supported by the library.
 
-   Set options
+   1mSet options0m
      See archive_read_set_options(3).
 
-   Open archive
+   1mOpen archive0m
      See archive_read_open(3).
 
      Once you have prepared the struct archive object, you call
-     archive_read_open() to actually open the archive and prepare it for read‐
+     1marchive_read_open22m() to actually open the archive and prepare it for read‐
      ing.  There are several variants of this function; the most basic expects
      you to provide pointers to several functions that can provide blocks of
      bytes from the archive.  There are convenience forms that allow you to
-     specify a filename, file descriptor, FILE * object, or a block of memory
+     specify a filename, file descriptor, 4mFILE24m 4m*24m object, or a block of memory
      from which to read the archive data.  Note that the core library makes no
      assumptions about the size of the blocks read; callback functions are
      free to read whatever block size is most appropriate for the medium.
 
-   Consume archive
+   1mConsume archive0m
      See archive_read_header(3), archive_read_data(3) and
      archive_read_extract(3).
 
      Each archive entry consists of a header followed by a certain amount of
-     data.  You can obtain the next header with archive_read_next_header(),
+     data.  You can obtain the next header with 1marchive_read_next_header22m(),
      which returns a pointer to an struct archive_entry structure with infor‐
      mation about the current archive element. If the entry is a regular
      file, then the header will be followed by the file data.  You can use
-     archive_read_data() (which works much like the read(2) system call) to
-     read this data from the archive, or archive_read_data_block() which pro‐
+     1marchive_read_data22m() (which works much like the read(2) system call) to
+     read this data from the archive, or 1marchive_read_data_block22m() which pro‐
      vides a slightly more efficient interface.  You may prefer to use the
-     higher-level archive_read_data_skip(), which reads and discards the data
-     for this entry, archive_read_data_into_fd(), which copies the data to the
-     provided file descriptor, or archive_read_extract(), which recreates the
+     higher-level 1marchive_read_data_skip22m(), which reads and discards the data
+     for this entry, 1marchive_read_data_into_fd22m(), which copies the data to the
+     provided file descriptor, or 1marchive_read_extract22m(), which recreates the
      specified entry on disk and copies data from the archive. In particular,
-     note that archive_read_extract() uses the struct archive_entry structure
+     note that 1marchive_read_extract22m() uses the struct archive_entry structure
      that you provide it, which may differ from the entry just read from the
      archive.  In particular, many applications will want to override the
      pathname, file permissions, or ownership.
 
-   Release resources
+   1mRelease resources0m
      See archive_read_free(3).
 
      Once you have finished reading data from the archive, you should call
-     archive_read_close() to close the archive, then call archive_read_free()
+     1marchive_read_close22m() to close the archive, then call 1marchive_read_free22m()
      to release all resources, including all memory allocated by the library.
 
-EXAMPLE
+1mEXAMPLE0m
      The following illustrates basic usage of the library.  In this example,
      the callback functions are simply wrappers around the standard open(2),
      read(2), and close(2) system calls.
@@ -134,19 +134,19 @@ EXAMPLE
             return (ARCHIVE_OK);
           }
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_read_new(3), archive_read_data(3),
      archive_read_extract(3), archive_read_filter(3), archive_read_format(3),
      archive_read_header(3), archive_read_open(3),
      archive_read_set_options(3), archive_util(3), tar(5)
 
-HISTORY
-     The libarchive library first appeared in FreeBSD 5.3.
+1mHISTORY0m
+     The 1mlibarchive 22mlibrary first appeared in FreeBSD 5.3.
 
-AUTHORS
-     The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
+1mAUTHORS0m
+     The 1mlibarchive 22mlibrary was written by Tim Kientzle <kientzle@acm.org>.
 
-BUGS
+1mBUGS0m
      Many traditional archiver programs treat empty files as valid empty ar‐
      chives.  For example, many implementations of tar(1) allow you to append
      entries to an empty file. Of course, it is impossible to determine the
index 745ada7..7e90d73 100644 (file)
@@ -1,35 +1,35 @@
 ARCHIVE_READ_ADD_PASS... BSD Library Functions Manual ARCHIVE_READ_ADD_PASS...
 
-NAME
-     archive_read_add_passphrase, archive_read_set_passphrase_callback — func‐
+1mNAME0m
+     1marchive_read_add_passphrase22m, 1marchive_read_set_passphrase_callback 22m— func‐
      tions for reading encrypted archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     int
-     archive_read_add_passphrase(struct archive *, const char *passphrase);
+     4mint0m
+     1marchive_read_add_passphrase22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*passphrase24m);
 
-     int
-     archive_read_set_passphrase_callback(struct archive *, void *client_data,
-        archive_passphrase_callback *);
+     4mint0m
+     1marchive_read_set_passphrase_callback22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid24m 4m*client_data24m,
+        4marchive_passphrase_callback24m 4m*24m);
 
-DESCRIPTION
-     archive_read_add_passphrase()
+1mDESCRIPTION0m
+     1marchive_read_add_passphrase22m()
             Register passphrases for reading an encryption archive.  If
-            passphrase is NULL or empty, this function will do nothing and
-            ARCHIVE_FAILED will be returned.  Otherwise, ARCHIVE_OK will be
+            4mpassphrase24m is NULL or empty, this function will do nothing and
+            1mARCHIVE_FAILED 22mwill be returned.  Otherwise, 1mARCHIVE_OK 22mwill be
             returned.
 
-     archive_read_set_passphrase_callback()
+     1marchive_read_set_passphrase_callback22m()
             Register callback function that will be invoked to get a
             passphrase for decrption after trying all passphrases registered
-            by the archive_read_add_passphrase() function failed.
+            by the 1marchive_read_add_passphrase22m() function failed.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_read(3), archive_read_set_options(3)
 
 BSD                          September 14, 2014                           BSD
index 499b0c5..05d30df 100644 (file)
@@ -1,71 +1,71 @@
 ARCHIVE_READ_DATA(3)    BSD Library Functions Manual     ARCHIVE_READ_DATA(3)
 
-NAME
-     archive_read_data archive_read_data_block, archive_read_data_skip,
-     archive_read_data_into_fd — functions for reading streaming archives
+1mNAME0m
+     1marchive_read_data archive_read_data_block22m, 1marchive_read_data_skip22m,
+     1marchive_read_data_into_fd 22m— functions for reading streaming archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     la_ssize_t
-     archive_read_data(struct archive *, void *buff, size_t len);
+     4mla_ssize_t0m
+     1marchive_read_data22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid24m 4m*buff24m, 4msize_t24m 4mlen24m);
 
-     int
-     archive_read_data_block(struct archive *, const void **buff, size_t *len,
-        off_t *offset);
+     4mint0m
+     1marchive_read_data_block22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mvoid24m 4m**buff24m, 4msize_t24m 4m*len24m,
+        4moff_t24m 4m*offset24m);
 
-     int
-     archive_read_data_skip(struct archive *);
+     4mint0m
+     1marchive_read_data_skip22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_data_into_fd(struct archive *, int fd);
+     4mint0m
+     1marchive_read_data_into_fd22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m 4mfd24m);
 
-DESCRIPTION
-     archive_read_data()
+1mDESCRIPTION0m
+     1marchive_read_data22m()
             Read data associated with the header just read.  Internally, this
-            is a convenience function that calls archive_read_data_block()
+            is a convenience function that calls 1marchive_read_data_block22m()
             and fills any gaps with nulls so that callers see a single con‐
             tinuous stream of data.
-     archive_read_data_block()
+     1marchive_read_data_block22m()
             Return the next available block of data for this entry.  Unlike
-            archive_read_data(), the archive_read_data_block() function
+            1marchive_read_data22m(), the 1marchive_read_data_block22m() function
             avoids copying data and allows you to correctly handle sparse
             files, as supported by some archive formats.  The library guaran‐
             tees that offsets will increase and that blocks will not overlap.
             Note that the blocks returned from this function can be much
             larger than the block size read from disk, due to compression and
             internal buffer optimizations.
-     archive_read_data_skip()
+     1marchive_read_data_skip22m()
             A convenience function that repeatedly calls
-            archive_read_data_block() to skip all of the data for this ar‐
+            1marchive_read_data_block22m() to skip all of the data for this ar‐
             chive entry.  Note that this function is invoked automatically by
-            archive_read_next_header2() if the previous entry was not com‐
+            1marchive_read_next_header222m() if the previous entry was not com‐
             pletely consumed.
-     archive_read_data_into_fd()
+     1marchive_read_data_into_fd22m()
             A convenience function that repeatedly calls
-            archive_read_data_block() to copy the entire entry to the pro‐
+            1marchive_read_data_block22m() to copy the entire entry to the pro‐
             vided file descriptor.
 
-RETURN VALUES
+1mRETURN VALUES0m
      Most functions return zero on success, non-zero on error. The possible
-     return codes include: ARCHIVE_OK (the operation succeeded), ARCHIVE_WARN
+     return codes include: 1mARCHIVE_OK 22m(the operation succeeded), 1mARCHIVE_WARN0m
      (the operation succeeded but a non-critical error was encountered),
-     ARCHIVE_EOF (end-of-archive was encountered), ARCHIVE_RETRY (the opera‐
-     tion failed but can be retried), and ARCHIVE_FATAL (there was a fatal
+     1mARCHIVE_EOF 22m(end-of-archive was encountered), 1mARCHIVE_RETRY 22m(the opera‐
+     tion failed but can be retried), and 1mARCHIVE_FATAL 22m(there was a fatal
      error; the archive should be closed immediately).
 
-     archive_read_data() returns a count of bytes actually read or zero at the
-     end of the entry. On error, a value of ARCHIVE_FATAL, ARCHIVE_WARN, or
-     ARCHIVE_RETRY is returned.
+     1marchive_read_data22m() returns a count of bytes actually read or zero at the
+     end of the entry. On error, a value of 1mARCHIVE_FATAL22m, 1mARCHIVE_WARN22m, or
+     1mARCHIVE_RETRY 22mis returned.
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_read(3), archive_read_extract(3),
      archive_read_filter(3), archive_read_format(3), archive_read_header(3),
      archive_read_open(3), archive_read_set_options(3), archive_util(3),
index ace4c07..f4f6342 100644 (file)
@@ -1,93 +1,93 @@
 ARCHIVE_READ_DISK(3)    BSD Library Functions Manual     ARCHIVE_READ_DISK(3)
 
-NAME
-     archive_read_disk_new, archive_read_disk_set_symlink_logical,
-     archive_read_disk_set_symlink_physical,
-     archive_read_disk_set_symlink_hybrid, archive_read_disk_entry_from_file,
-     archive_read_disk_gname, archive_read_disk_uname,
-     archive_read_disk_set_uname_lookup, archive_read_disk_set_gname_lookup,
-     archive_read_disk_set_standard_lookup, archive_read_close,
-     archive_read_finish, archive_read_free — functions for reading objects
+1mNAME0m
+     1marchive_read_disk_new22m, 1marchive_read_disk_set_symlink_logical22m,
+     1marchive_read_disk_set_symlink_physical22m,
+     1marchive_read_disk_set_symlink_hybrid22m, 1marchive_read_disk_entry_from_file22m,
+     1marchive_read_disk_gname22m, 1marchive_read_disk_uname22m,
+     1marchive_read_disk_set_uname_lookup22m, 1marchive_read_disk_set_gname_lookup22m,
+     1marchive_read_disk_set_standard_lookup22m, 1marchive_read_close22m,
+     1marchive_read_finish22m, 1marchive_read_free 22m— functions for reading objects
      from disk
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     struct archive *
-     archive_read_disk_new(void);
+     4mstruct24m 4marchive24m 4m*0m
+     1marchive_read_disk_new22m(4mvoid24m);
 
-     int
-     archive_read_disk_set_symlink_logical(struct archive *);
+     4mint0m
+     1marchive_read_disk_set_symlink_logical22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_disk_set_symlink_physical(struct archive *);
+     4mint0m
+     1marchive_read_disk_set_symlink_physical22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_disk_set_symlink_hybrid(struct archive *);
+     4mint0m
+     1marchive_read_disk_set_symlink_hybrid22m(4mstruct24m 4marchive24m 4m*24m);
 
-     const char *
-     archive_read_disk_gname(struct archive *, gid_t);
+     4mconst24m 4mchar24m 4m*0m
+     1marchive_read_disk_gname22m(4mstruct24m 4marchive24m 4m*24m, 4mgid_t24m);
 
-     const char *
-     archive_read_disk_uname(struct archive *, uid_t);
+     4mconst24m 4mchar24m 4m*0m
+     1marchive_read_disk_uname22m(4mstruct24m 4marchive24m 4m*24m, 4muid_t24m);
 
-     int
-     archive_read_disk_set_gname_lookup(struct archive *, void *,
-        const char *(*lookup)(void *, gid_t), void (*cleanup)(void *));
+     4mint0m
+     1marchive_read_disk_set_gname_lookup22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid24m 4m*24m,
+        4mconst24m 4mchar24m 4m*(*lookup)(void24m 4m*,24m 4mgid_t)24m, 4mvoid24m 4m(*cleanup)(void24m 4m*)24m);
 
-     int
-     archive_read_disk_set_uname_lookup(struct archive *, void *,
-        const char *(*lookup)(void *, uid_t), void (*cleanup)(void *));
+     4mint0m
+     1marchive_read_disk_set_uname_lookup22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid24m 4m*24m,
+        4mconst24m 4mchar24m 4m*(*lookup)(void24m 4m*,24m 4muid_t)24m, 4mvoid24m 4m(*cleanup)(void24m 4m*)24m);
 
-     int
-     archive_read_disk_set_standard_lookup(struct archive *);
+     4mint0m
+     1marchive_read_disk_set_standard_lookup22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_disk_entry_from_file(struct archive *,
-        struct archive_entry *, int fd, const struct stat *);
+     4mint0m
+     1marchive_read_disk_entry_from_file22m(4mstruct24m 4marchive24m 4m*24m,
+        4mstruct24m 4marchive_entry24m 4m*24m, 4mint24m 4mfd24m, 4mconst24m 4mstruct24m 4mstat24m 4m*24m);
 
-     int
-     archive_read_close(struct archive *);
+     4mint0m
+     1marchive_read_close22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_finish(struct archive *);
+     4mint0m
+     1marchive_read_finish22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_free(struct archive *);
+     4mint0m
+     1marchive_read_free22m(4mstruct24m 4marchive24m 4m*24m);
 
-DESCRIPTION
+1mDESCRIPTION0m
      These functions provide an API for reading information about objects on
      disk.  In particular, they provide an interface for populating struct
      archive_entry objects.
 
-     archive_read_disk_new()
+     1marchive_read_disk_new22m()
             Allocates and initializes a struct archive object suitable for
             reading object information from disk.
 
-     archive_read_disk_set_symlink_logical(),
-            archive_read_disk_set_symlink_physical(),
-            archive_read_disk_set_symlink_hybrid()
+     1marchive_read_disk_set_symlink_logical22m(),
+            1marchive_read_disk_set_symlink_physical22m(),
+            1marchive_read_disk_set_symlink_hybrid22m()
             This sets the mode used for handling symbolic links.  The
             “logical” mode follows all symbolic links.  The “physical” mode
             does not follow any symbolic links.  The “hybrid” mode currently
             behaves identically to the “logical” mode.
 
-     archive_read_disk_gname(), archive_read_disk_uname()
+     1marchive_read_disk_gname22m(), 1marchive_read_disk_uname22m()
             Returns a user or group name given a gid or uid value.  By
             default, these always return a NULL string.
 
-     archive_read_disk_set_gname_lookup(),
-            archive_read_disk_set_uname_lookup()
+     1marchive_read_disk_set_gname_lookup22m(),
+            1marchive_read_disk_set_uname_lookup22m()
             These allow you to override the functions used for user and group
             name lookups.  You may also provide a void * pointer to a private
             data structure and a cleanup function for that data.  The cleanup
             function will be invoked when the struct archive object is
             destroyed or when new lookup functions are registered.
 
-     archive_read_disk_set_standard_lookup()
+     1marchive_read_disk_set_standard_lookup22m()
             This convenience function installs a standard set of user and
             group name lookup functions.  These functions use getpwuid(3) and
             getgrgid(3) to convert ids to names, defaulting to NULL if the
@@ -95,7 +95,7 @@ DESCRIPTION
             ple memory cache to reduce the number of calls to getpwuid(3) and
             getgrgid(3).
 
-     archive_read_disk_entry_from_file()
+     1marchive_read_disk_entry_from_file22m()
             Populates a struct archive_entry object with information about a
             particular file.  The archive_entry object must have already been
             created with archive_entry_new(3) and at least one of the source
@@ -119,19 +119,19 @@ DESCRIPTION
             above.  This affects the file ownership fields and ACL values in
             the struct archive_entry object.
 
-     archive_read_close()
+     1marchive_read_close22m()
             Does nothing for archive_read_disk handles.
 
-     archive_read_finish()
-            This is a deprecated synonym for archive_read_free().
+     1marchive_read_finish22m()
+            This is a deprecated synonym for 1marchive_read_free22m().
 
-     archive_read_free()
-            Invokes archive_read_close() if it was not invoked manually, then
+     1marchive_read_free22m()
+            Invokes 1marchive_read_close22m() if it was not invoked manually, then
             releases all resources.
-     More information about the struct archive object and the overall design
+     More information about the 4mstruct24m 4marchive24m object and the overall design
      of the library can be found in the libarchive(3) overview.
 
-EXAMPLE
+1mEXAMPLE0m
      The following illustrates basic usage of the library by showing how to
      use it to copy an item on disk into an archive.
 
@@ -160,50 +160,50 @@ EXAMPLE
             archive_entry_free(entry);
           }
 
-RETURN VALUES
-     Most functions return ARCHIVE_OK (zero) on success, or one of several
+1mRETURN VALUES0m
+     Most functions return 1mARCHIVE_OK 22m(zero) on success, or one of several
      negative error codes for errors.  Specific error codes include:
-     ARCHIVE_RETRY for operations that might succeed if retried, ARCHIVE_WARN
+     1mARCHIVE_RETRY 22mfor operations that might succeed if retried, 1mARCHIVE_WARN0m
      for unusual conditions that do not prevent further operations, and
-     ARCHIVE_FATAL for serious errors that make remaining operations impossi‐
+     1mARCHIVE_FATAL 22mfor serious errors that make remaining operations impossi‐
      ble.
 
-     archive_read_disk_new() returns a pointer to a newly-allocated struct
+     1marchive_read_disk_new22m() returns a pointer to a newly-allocated struct
      archive object or NULL if the allocation failed for any reason.
 
-     archive_read_disk_gname() and archive_read_disk_uname() return const char
+     1marchive_read_disk_gname22m() and 1marchive_read_disk_uname22m() return const char
      * pointers to the textual name or NULL if the lookup failed for any rea‐
      son.  The returned pointer points to internal storage that may be reused
      on the next call to either of these functions; callers should copy the
      string if they need to continue accessing it.
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      archive_read(3), archive_util(3), archive_write(3),
      archive_write_disk(3), tar(1), libarchive(3)
 
-HISTORY
-     The libarchive library first appeared in FreeBSD 5.3.  The
-     archive_read_disk interface was added to libarchive 2.6 and first
+1mHISTORY0m
+     The 1mlibarchive 22mlibrary first appeared in FreeBSD 5.3.  The
+     1marchive_read_disk 22minterface was added to 1mlibarchive 2.6 22mand first
      appeared in FreeBSD 8.0.
 
-AUTHORS
-     The libarchive library was written by Tim Kientzle
+1mAUTHORS0m
+     The 1mlibarchive 22mlibrary was written by Tim Kientzle
      <kientzle@FreeBSD.org>.
 
-BUGS
+1mBUGS0m
      The “standard” user name and group name lookup functions are not the
      defaults because getgrgid(3) and getpwuid(3) are sometimes too large for
      particular applications.  The current design allows the application
      author to use a more compact implementation when appropriate.
 
      The full list of metadata read from disk by
-     archive_read_disk_entry_from_file() is necessarily system-dependent.
+     1marchive_read_disk_entry_from_file22m() is necessarily system-dependent.
 
-     The archive_read_disk_entry_from_file() function reads as much informa‐
+     The 1marchive_read_disk_entry_from_file22m() function reads as much informa‐
      tion as it can from disk. Some method should be provided to limit this
      so that clients who do not need ACLs, for instance, can avoid the extra
      work needed to look up such information.
index ca1fec5..a78cb35 100644 (file)
@@ -1,50 +1,50 @@
 ARCHIVE_READ_EXTRACT(3)  BSD Library Functions Manual  ARCHIVE_READ_EXTRACT(3)
 
-NAME
-     archive_read_extract, archive_read_extract2,
-     archive_read_extract_set_progress_callback — functions for reading
+1mNAME0m
+     1marchive_read_extract22m, 1marchive_read_extract222m,
+     1marchive_read_extract_set_progress_callback 22m— functions for reading
      streaming archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     int
-     archive_read_extract(struct archive *, struct archive_entry *,
-        int flags);
+     4mint0m
+     1marchive_read_extract22m(4mstruct24m 4marchive24m 4m*24m, 4mstruct24m 4marchive_entry24m 4m*24m,
+        4mint24m 4mflags24m);
 
-     int
-     archive_read_extract2(struct archive *src, struct archive_entry *,
-        struct archive *dest);
+     4mint0m
+     1marchive_read_extract222m(4mstruct24m 4marchive24m 4m*src24m, 4mstruct24m 4marchive_entry24m 4m*24m,
+        4mstruct24m 4marchive24m 4m*dest24m);
 
-     void
-     archive_read_extract_set_progress_callback(struct archive *,
-        void (*func)(void *), void *user_data);
+     4mvoid0m
+     1marchive_read_extract_set_progress_callback22m(4mstruct24m 4marchive24m 4m*24m,
+        4mvoid24m 4m(*func)(void24m 4m*)24m, 4mvoid24m 4m*user_data24m);
 
-DESCRIPTION
-     archive_read_extract(), archive_read_extract_set_skip_file()
+1mDESCRIPTION0m
+     1marchive_read_extract22m(), 1marchive_read_extract_set_skip_file22m()
             A convenience function that wraps the corresponding
             archive_write_disk(3) interfaces.  The first call to
-            archive_read_extract() creates a restore object using
+            1marchive_read_extract22m() creates a restore object using
             archive_write_disk_new(3) and
             archive_write_disk_set_standard_lookup(3), then transparently
             invokes archive_write_disk_set_options(3),
             archive_write_header(3), archive_write_data(3), and
             archive_write_finish_entry(3) to create the entry on disk and
-            copy data into it.  The flags argument is passed unmodified to
+            copy data into it.  The 4mflags24m argument is passed unmodified to
             archive_write_disk_set_options(3).
-     archive_read_extract2()
-            This is another version of archive_read_extract() that allows you
+     1marchive_read_extract222m()
+            This is another version of 1marchive_read_extract22m() that allows you
             to provide your own restore object.  In particular, this allows
             you to override the standard lookup functions using
             archive_write_disk_set_group_lookup(3), and
             archive_write_disk_set_user_lookup(3).  Note that
-            archive_read_extract2() does not accept a flags argument; you
-            should use archive_write_disk_set_options() to set the restore
+            1marchive_read_extract222m() does not accept a 4mflags24m argument; you
+            should use 1marchive_write_disk_set_options22m() to set the restore
             options yourself.
-     archive_read_extract_set_progress_callback()
+     1marchive_read_extract_set_progress_callback22m()
             Sets a pointer to a user-defined callback that can be used for
             updating progress displays during extraction.  The progress func‐
             tion will be invoked during the extraction of large regular
@@ -54,19 +54,19 @@ DESCRIPTION
             object so that various statistics can be retrieved for the
             progress display.
 
-RETURN VALUES
+1mRETURN VALUES0m
      Most functions return zero on success, non-zero on error. The possible
-     return codes include: ARCHIVE_OK (the operation succeeded), ARCHIVE_WARN
+     return codes include: 1mARCHIVE_OK 22m(the operation succeeded), 1mARCHIVE_WARN0m
      (the operation succeeded but a non-critical error was encountered),
-     ARCHIVE_EOF (end-of-archive was encountered), ARCHIVE_RETRY (the opera‐
-     tion failed but can be retried), and ARCHIVE_FATAL (there was a fatal
+     1mARCHIVE_EOF 22m(end-of-archive was encountered), 1mARCHIVE_RETRY 22m(the opera‐
+     tion failed but can be retried), and 1mARCHIVE_FATAL 22m(there was a fatal
      error; the archive should be closed immediately).
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_read(3), archive_read_data(3),
      archive_read_filter(3), archive_read_format(3), archive_read_open(3),
      archive_read_set_options(3), archive_util(3), tar(5)
index 3af7cdf..6ae9915 100644 (file)
 ARCHIVE_READ_FILTER(3)  BSD Library Functions Manual   ARCHIVE_READ_FILTER(3)
 
-NAME
-     archive_read_support_filter_all, archive_read_support_filter_bzip2,
-     archive_read_support_filter_compress, archive_read_support_filter_gzip,
-     archive_read_support_filter_lz4, archive_read_support_filter_lzma,
-     archive_read_support_filter_none, archive_read_support_filter_rpm,
-     archive_read_support_filter_uu, archive_read_support_filter_xz,
-     archive_read_support_filter_program,
-     archive_read_support_filter_program_signature — functions for reading
+1mNAME0m
+     1marchive_read_support_filter_all22m, 1marchive_read_support_filter_bzip222m,
+     1marchive_read_support_filter_compress22m, 1marchive_read_support_filter_gzip22m,
+     1marchive_read_support_filter_lz422m, 1marchive_read_support_filter_lzma22m,
+     1marchive_read_support_filter_none22m, 1marchive_read_support_filter_rpm22m,
+     1marchive_read_support_filter_uu22m, 1marchive_read_support_filter_xz22m,
+     1marchive_read_support_filter_program22m,
+     1marchive_read_support_filter_program_signature 22m— functions for reading
      streaming archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     int
-     archive_read_support_filter_all(struct archive *);
+     4mint0m
+     1marchive_read_support_filter_all22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_filter_bzip2(struct archive *);
+     4mint0m
+     1marchive_read_support_filter_bzip222m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_filter_compress(struct archive *);
+     4mint0m
+     1marchive_read_support_filter_compress22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_filter_grzip(struct archive *);
+     4mint0m
+     1marchive_read_support_filter_grzip22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_filter_gzip(struct archive *);
+     4mint0m
+     1marchive_read_support_filter_gzip22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_filter_lrzip(struct archive *);
+     4mint0m
+     1marchive_read_support_filter_lrzip22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_filter_lz4(struct archive *);
+     4mint0m
+     1marchive_read_support_filter_lz422m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_filter_lzma(struct archive *);
+     4mint0m
+     1marchive_read_support_filter_lzma22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_filter_lzop(struct archive *);
+     4mint0m
+     1marchive_read_support_filter_lzop22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_filter_none(struct archive *);
+     4mint0m
+     1marchive_read_support_filter_none22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_filter_rpm(struct archive *);
+     4mint0m
+     1marchive_read_support_filter_rpm22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_filter_uu(struct archive *);
+     4mint0m
+     1marchive_read_support_filter_uu22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_filter_xz(struct archive *);
+     4mint0m
+     1marchive_read_support_filter_xz22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_filter_program(struct archive *, const char *cmd);
+     4mint0m
+     1marchive_read_support_filter_program22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*cmd24m);
 
-     int
-     archive_read_support_filter_program_signature(struct archive *,
-        const char *cmd, const void *signature, size_t signature_length);
+     4mint0m
+     1marchive_read_support_filter_program_signature22m(4mstruct24m 4marchive24m 4m*24m,
+        4mconst24m 4mchar24m 4m*cmd24m, 4mconst24m 4mvoid24m 4m*signature24m, 4msize_t24m 4msignature_length24m);
 
-DESCRIPTION
-     archive_read_support_filter_bzip2(),
-            archive_read_support_filter_compress(),
-            archive_read_support_filter_grzip(),
-            archive_read_support_filter_gzip(),
-            archive_read_support_filter_lrzip(),
-            archive_read_support_filter_lz4(),
-            archive_read_support_filter_lzma(),
-            archive_read_support_filter_lzop(),
-            archive_read_support_filter_none(),
-            archive_read_support_filter_rpm(),
-            archive_read_support_filter_uu(),
-            archive_read_support_filter_xz()
+1mDESCRIPTION0m
+     1marchive_read_support_filter_bzip222m(),
+            1marchive_read_support_filter_compress22m(),
+            1marchive_read_support_filter_grzip22m(),
+            1marchive_read_support_filter_gzip22m(),
+            1marchive_read_support_filter_lrzip22m(),
+            1marchive_read_support_filter_lz422m(),
+            1marchive_read_support_filter_lzma22m(),
+            1marchive_read_support_filter_lzop22m(),
+            1marchive_read_support_filter_none22m(),
+            1marchive_read_support_filter_rpm22m(),
+            1marchive_read_support_filter_uu22m(),
+            1marchive_read_support_filter_xz22m()
             Enables auto-detection code and decompression support for the
             specified compression.  These functions may fall back on external
             programs if an appropriate library was not available at build
             time.  Decompression using an external program is usually slower
             than decompression through built-in libraries.  Note that “none”
             is always enabled by default.
-     archive_read_support_filter_all()
+     1marchive_read_support_filter_all22m()
             Enables all available decompression filters.
-     archive_read_support_filter_program()
+     1marchive_read_support_filter_program22m()
             Data is fed through the specified external program before being
             dearchived.  Note that this disables automatic detection of the
             compression format, so it makes no sense to specify this in con‐
             junction with any other decompression option.
-     archive_read_support_filter_program_signature()
+     1marchive_read_support_filter_program_signature22m()
             This feeds data through the specified external program but only
             if the initial bytes of the data match the specified signature
             value.
 
-RETURN VALUES
-     These functions return ARCHIVE_OK if the compression is fully supported,
-     ARCHIVE_WARN if the compression is supported only through an external
+1mRETURN VALUES0m
+     These functions return 1mARCHIVE_OK 22mif the compression is fully supported,
+     1mARCHIVE_WARN 22mif the compression is supported only through an external
      program.
 
-     archive_read_support_filter_none() always succeeds.
+     1marchive_read_support_filter_none22m() always succeeds.
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      libarchive(3), archive_read(3), archive_read_data(3),
      archive_read_format(3), archive_read_format(3)
 
index 38f1d8a..7820986 100644 (file)
 ARCHIVE_READ_FORMAT(3)  BSD Library Functions Manual   ARCHIVE_READ_FORMAT(3)
 
-NAME
-     archive_read_support_format_7zip, archive_read_support_format_all,
-     archive_read_support_format_ar, archive_read_support_format_by_code,
-     archive_read_support_format_cab, archive_read_support_format_cpio,
-     archive_read_support_format_empty, archive_read_support_format_iso9660,
-     archive_read_support_format_lha, archive_read_support_format_mtree,
-     archive_read_support_format_rar, archive_read_support_format_raw,
-     archive_read_support_format_tar, archive_read_support_format_xar,
-     archive_read_support_format_zip — functions for reading streaming ar‐
+1mNAME0m
+     1marchive_read_support_format_7zip22m, 1marchive_read_support_format_all22m,
+     1marchive_read_support_format_ar22m, 1marchive_read_support_format_by_code22m,
+     1marchive_read_support_format_cab22m, 1marchive_read_support_format_cpio22m,
+     1marchive_read_support_format_empty22m, 1marchive_read_support_format_iso966022m,
+     1marchive_read_support_format_lha22m, 1marchive_read_support_format_mtree,0m
+     1marchive_read_support_format_rar, archive_read_support_format_raw,0m
+     1marchive_read_support_format_tar22m, 1marchive_read_support_format_xar22m,
+     1marchive_read_support_format_zip 22m— functions for reading streaming ar‐
      chives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     int
-     archive_read_support_format_7zip(struct archive *);
+     4mint0m
+     1marchive_read_support_format_7zip22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_format_all(struct archive *);
+     4mint0m
+     1marchive_read_support_format_all22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_format_ar(struct archive *);
+     4mint0m
+     1marchive_read_support_format_ar22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_format_by_code(struct archive *, int);
+     4mint0m
+     1marchive_read_support_format_by_code22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m);
 
-     int
-     archive_read_support_format_cab(struct archive *);
+     4mint0m
+     1marchive_read_support_format_cab22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_format_cpio(struct archive *);
+     4mint0m
+     1marchive_read_support_format_cpio22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_format_empty(struct archive *);
+     4mint0m
+     1marchive_read_support_format_empty22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_format_iso9660(struct archive *);
+     4mint0m
+     1marchive_read_support_format_iso966022m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_format_lha(struct archive *);
+     4mint0m
+     1marchive_read_support_format_lha22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_format_mtree(struct archive *);
+     4mint0m
+     1marchive_read_support_format_mtree22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_format_rar(struct archive *);
+     4mint0m
+     1marchive_read_support_format_rar22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_format_raw(struct archive *);
+     4mint0m
+     1marchive_read_support_format_raw22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_format_tar(struct archive *);
+     4mint0m
+     1marchive_read_support_format_tar22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_format_xar(struct archive *);
+     4mint0m
+     1marchive_read_support_format_xar22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_support_format_zip(struct archive *);
+     4mint0m
+     1marchive_read_support_format_zip22m(4mstruct24m 4marchive24m 4m*24m);
 
-DESCRIPTION
-     archive_read_support_format_7zip(), archive_read_support_format_ar(),
-            archive_read_support_format_cab(),
-            archive_read_support_format_cpio(),
-            archive_read_support_format_iso9660(),
-            archive_read_support_format_lha(),
-            archive_read_support_format_mtree(),
-            archive_read_support_format_rar(),
-            archive_read_support_format_raw(),
-            archive_read_support_format_tar(),
-            archive_read_support_format_xar(),
-            archive_read_support_format_zip()
+1mDESCRIPTION0m
+     1marchive_read_support_format_7zip22m(), 1marchive_read_support_format_ar22m(),
+            1marchive_read_support_format_cab22m(),
+            1marchive_read_support_format_cpio22m(),
+            1marchive_read_support_format_iso966022m(),
+            1marchive_read_support_format_lha22m(),
+            1marchive_read_support_format_mtree22m(),
+            1marchive_read_support_format_rar22m(),
+            1marchive_read_support_format_raw22m(),
+            1marchive_read_support_format_tar22m(),
+            1marchive_read_support_format_xar22m(),
+            1marchive_read_support_format_zip22m()
             Enables support---including auto-detection code---for the speci‐
             fied archive format.  For example,
-            archive_read_support_format_tar() enables support for a variety
+            1marchive_read_support_format_tar22m() enables support for a variety
             of standard tar formats, old-style tar, ustar, pax interchange
             format, and many common variants.
-     archive_read_support_format_all()
+     1marchive_read_support_format_all22m()
             Enables support for all available formats except the “raw” format
             (see below).
-     archive_read_support_format_by_code()
+     1marchive_read_support_format_by_code22m()
             Enables a single format specified by the format code.  This can
             be useful when reading a single archive twice; use
-            archive_format() after reading the first time and pass the
+            1marchive_format22m() after reading the first time and pass the
             resulting code to this function to selectively enable only the
             necessary format support.  Note:  In statically-linked executa‐
             bles, this will cause your program to include support for every
             format.  If executable size is a concern, you may wish to avoid
             using this function.
-     archive_read_support_format_empty()
+     1marchive_read_support_format_empty22m()
             Enables support for treating empty files as empty archives.
             Because empty files are valid for several different formats, it
             is not possible to accurately determine a format for an empty
             file based purely on contents.  So empty files are treated by
             libarchive as a distinct format.
-     archive_read_support_format_raw()
+     1marchive_read_support_format_raw22m()
             The “raw” format handler allows libarchive to be used to read
             arbitrary data.  It treats any data stream as an archive with a
             single entry.  The pathname of this entry is “data”; all other
             entry fields are unset.  This is not enabled by
-            archive_read_support_format_all() in order to avoid erroneous
+            1marchive_read_support_format_all22m() in order to avoid erroneous
             handling of damaged archives.
 
-RETURN VALUES
-     These functions return ARCHIVE_OK on success, or ARCHIVE_FATAL.
+1mRETURN VALUES0m
+     These functions return 1mARCHIVE_OK 22mon success, or 1mARCHIVE_FATAL22m.
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_read_data(3), archive_read_filter(3),
      archive_read_set_options(3), archive_util(3), tar(5)
 
-BUGS
+1mBUGS0m
      Many traditional archiver programs treat empty files as valid empty ar‐
      chives.  For example, many implementations of tar(1) allow you to append
      entries to an empty file. Of course, it is impossible to determine the
index 2e8c2ef..98ccb10 100644 (file)
@@ -1,50 +1,50 @@
 ARCHIVE_READ_FREE(3)    BSD Library Functions Manual     ARCHIVE_READ_FREE(3)
 
-NAME
-     archive_read_close, archive_read_finish, archive_read_free — functions
+1mNAME0m
+     1marchive_read_close22m, 1marchive_read_finish22m, 1marchive_read_free 22m— functions
      for reading streaming archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     int
-     archive_read_close(struct archive *);
+     4mint0m
+     1marchive_read_close22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_finish(struct archive *);
+     4mint0m
+     1marchive_read_finish22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_read_free(struct archive *);
+     4mint0m
+     1marchive_read_free22m(4mstruct24m 4marchive24m 4m*24m);
 
-DESCRIPTION
-     archive_read_close()
+1mDESCRIPTION0m
+     1marchive_read_close22m()
             Complete the archive and invoke the close callback.
-     archive_read_finish()
-            This is a deprecated synonym for archive_read_free().  The new
+     1marchive_read_finish22m()
+            This is a deprecated synonym for 1marchive_read_free22m().  The new
             name was introduced with libarchive 3.0.  Applications that need
             to compile with either libarchive 2 or libarchive 3 should con‐
-            tinue to use the archive_read_finish() name.  Both names will be
+            tinue to use the 1marchive_read_finish22m() name.  Both names will be
             supported until libarchive 4.0 is released, which is not expected
             to occur earlier than 2013.
-     archive_read_free()
-            Invokes archive_read_close() if it was not invoked manually, then
+     1marchive_read_free22m()
+            Invokes 1marchive_read_close22m() if it was not invoked manually, then
             release all resources.  Note: In libarchive 1.x, this function
-            was declared to return void, which made it impossible to detect
-            certain errors when archive_read_close() was invoked implicitly
+            was declared to return 4mvoid24m, which made it impossible to detect
+            certain errors when 1marchive_read_close22m() was invoked implicitly
             from this function.  The declaration is corrected beginning with
             libarchive 2.0.
 
-RETURN VALUES
-     These functions return ARCHIVE_OK on success, or ARCHIVE_FATAL.
+1mRETURN VALUES0m
+     These functions return 1mARCHIVE_OK 22mon success, or 1mARCHIVE_FATAL22m.
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      libarchive(3), archive_read_new(3), archive_read_data(3),
      archive_read_filter(3), archive_read_format(3), archive_read_open(3),
      archive_read_set_options(3), archive_util(3)
index 29f29a4..3338ba2 100644 (file)
@@ -1,43 +1,43 @@
 ARCHIVE_READ_HEADER(3)  BSD Library Functions Manual   ARCHIVE_READ_HEADER(3)
 
-NAME
-     archive_read_next_header, archive_read_next_header2 — functions for read‐
+1mNAME0m
+     1marchive_read_next_header22m, 1marchive_read_next_header2 22m— functions for read‐
      ing streaming archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     int
-     archive_read_next_header(struct archive *, struct archive_entry **);
+     4mint0m
+     1marchive_read_next_header22m(4mstruct24m 4marchive24m 4m*24m, 4mstruct24m 4marchive_entry24m 4m**24m);
 
-     int
-     archive_read_next_header2(struct archive *, struct archive_entry *);
+     4mint0m
+     1marchive_read_next_header222m(4mstruct24m 4marchive24m 4m*24m, 4mstruct24m 4marchive_entry24m 4m*24m);
 
-DESCRIPTION
-     archive_read_next_header()
+1mDESCRIPTION0m
+     1marchive_read_next_header22m()
             Read the header for the next entry and return a pointer to a
             struct archive_entry.  This is a convenience wrapper around
-            archive_read_next_header2() that reuses an internal struct
+            1marchive_read_next_header222m() that reuses an internal struct
             archive_entry object for each request.
-     archive_read_next_header2()
+     1marchive_read_next_header222m()
             Read the header for the next entry and populate the provided
             struct archive_entry.
 
-RETURN VALUES
-     These functions return ARCHIVE_OK (the operation succeeded), ARCHIVE_WARN
+1mRETURN VALUES0m
+     These functions return 1mARCHIVE_OK 22m(the operation succeeded), 1mARCHIVE_WARN0m
      (the operation succeeded but a non-critical error was encountered),
-     ARCHIVE_EOF (end-of-archive was encountered), ARCHIVE_RETRY (the opera‐
-     tion failed but can be retried), and ARCHIVE_FATAL (there was a fatal
+     1mARCHIVE_EOF 22m(end-of-archive was encountered), 1mARCHIVE_RETRY 22m(the opera‐
+     tion failed but can be retried), and 1mARCHIVE_FATAL 22m(there was a fatal
      error; the archive should be closed immediately).
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_read(3), archive_read_data(3),
      archive_read_extract(3), archive_read_filter(3), archive_read_format(3),
      archive_read_open(3), archive_read_set_options(3), archive_util(3),
index 5e518f9..6e574f1 100644 (file)
@@ -1,25 +1,25 @@
 ARCHIVE_READ_NEW(3)     BSD Library Functions Manual      ARCHIVE_READ_NEW(3)
 
-NAME
-     archive_read_new — functions for reading streaming archives
+1mNAME0m
+     1marchive_read_new 22m— functions for reading streaming archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     struct archive *
-     archive_read_new(void);
+     4mstruct24m 4marchive24m 4m*0m
+     1marchive_read_new22m(4mvoid24m);
 
-DESCRIPTION
+1mDESCRIPTION0m
      Allocates and initializes a struct archive object suitable for reading
      from an archive.  NULL is returned on error.
 
      A complete description of the struct archive object can be found in the
      overview manual page for libarchive(3).
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_read_data(3), archive_read_filter(3),
      archive_read_format(3), archive_read_set_options(3), archive_util(3),
      tar(5)
index 1de9148..df653c7 100644 (file)
@@ -1,94 +1,94 @@
 ARCHIVE_READ_OPEN(3)    BSD Library Functions Manual     ARCHIVE_READ_OPEN(3)
 
-NAME
-     archive_read_open, archive_read_open2, archive_read_open_fd,
-     archive_read_open_FILE, archive_read_open_filename,
-     archive_read_open_memory, — functions for reading streaming archives
+1mNAME0m
+     1marchive_read_open22m, 1marchive_read_open222m, 1marchive_read_open_fd22m,
+     1marchive_read_open_FILE22m, 1marchive_read_open_filename22m,
+     1marchive_read_open_memory22m, — functions for reading streaming archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     int
-     archive_read_open(struct archive *, void *client_data,
-        archive_open_callback *, archive_read_callback *,
-        archive_close_callback *);
+     4mint0m
+     1marchive_read_open22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid24m 4m*client_data24m,
+        4marchive_open_callback24m 4m*24m, 4marchive_read_callback24m 4m*24m,
+        4marchive_close_callback24m 4m*24m);
 
-     int
-     archive_read_open2(struct archive *, void *client_data,
-        archive_open_callback *, archive_read_callback *,
-        archive_skip_callback *, archive_close_callback *);
+     4mint0m
+     1marchive_read_open222m(4mstruct24m 4marchive24m 4m*24m, 4mvoid24m 4m*client_data24m,
+        4marchive_open_callback24m 4m*24m, 4marchive_read_callback24m 4m*24m,
+        4marchive_skip_callback24m 4m*24m, 4marchive_close_callback24m 4m*24m);
 
-     int
-     archive_read_open_FILE(struct archive *, FILE *file);
+     4mint0m
+     1marchive_read_open_FILE22m(4mstruct24m 4marchive24m 4m*24m, 4mFILE24m 4m*file24m);
 
-     int
-     archive_read_open_fd(struct archive *, int fd, size_t block_size);
+     4mint0m
+     1marchive_read_open_fd22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m 4mfd24m, 4msize_t24m 4mblock_size24m);
 
-     int
-     archive_read_open_filename(struct archive *, const char *filename,
-        size_t block_size);
+     4mint0m
+     1marchive_read_open_filename22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*filename24m,
+        4msize_t24m 4mblock_size24m);
 
-     int
-     archive_read_open_memory(struct archive *, void *buff, size_t size);
+     4mint0m
+     1marchive_read_open_memory22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid24m 4m*buff24m, 4msize_t24m 4msize24m);
 
-DESCRIPTION
-     archive_read_open()
-            The same as archive_read_open2(), except that the skip callback
+1mDESCRIPTION0m
+     1marchive_read_open22m()
+            The same as 1marchive_read_open222m(), except that the skip callback
             is assumed to be NULL.
-     archive_read_open2()
+     1marchive_read_open222m()
             Freeze the settings, open the archive, and prepare for reading
             entries.  This is the most generic version of this call, which
             accepts four callback functions.  Most clients will want to use
-            archive_read_open_filename(), archive_read_open_FILE(),
-            archive_read_open_fd(), or archive_read_open_memory() instead.
+            1marchive_read_open_filename22m(), 1marchive_read_open_FILE22m(),
+            1marchive_read_open_fd22m(), or 1marchive_read_open_memory22m() instead.
             The library invokes the client-provided functions to obtain raw
             bytes from the archive.
-     archive_read_open_FILE()
-            Like archive_read_open(), except that it accepts a FILE *
+     1marchive_read_open_FILE22m()
+            Like 1marchive_read_open22m(), except that it accepts a 4mFILE24m 4m*0m
             pointer.  This function should not be used with tape drives or
             other devices that require strict I/O blocking.
-     archive_read_open_fd()
-            Like archive_read_open(), except that it accepts a file descrip‐
+     1marchive_read_open_fd22m()
+            Like 1marchive_read_open22m(), except that it accepts a file descrip‐
             tor and block size rather than a set of function pointers.  Note
             that the file descriptor will not be automatically closed at end-
             of-archive.  This function is safe for use with tape drives or
             other blocked devices.
-     archive_read_open_file()
-            This is a deprecated synonym for archive_read_open_filename().
-     archive_read_open_filename()
-            Like archive_read_open(), except that it accepts a simple file‐
+     1marchive_read_open_file22m()
+            This is a deprecated synonym for 1marchive_read_open_filename22m().
+     1marchive_read_open_filename22m()
+            Like 1marchive_read_open22m(), except that it accepts a simple file‐
             name and a block size.  A NULL filename represents standard
             input.  This function is safe for use with tape drives or other
             blocked devices.
-     archive_read_open_memory()
-            Like archive_read_open(), except that it accepts a pointer and
+     1marchive_read_open_memory22m()
+            Like 1marchive_read_open22m(), except that it accepts a pointer and
             size of a block of memory containing the archive data.
 
      A complete description of the struct archive and struct archive_entry
      objects can be found in the overview manual page for libarchive(3).
 
-CLIENT CALLBACKS
+1mCLIENT CALLBACKS0m
      The callback functions must match the following prototypes:
 
-          typedef la_ssize_t archive_read_callback(struct archive *,
-          void *client_data, const void **buffer)
+          4mtypedef24m 4mla_ssize_t24m 1marchive_read_callback22m(4mstruct24m 4marchive24m 4m*24m,
+          4mvoid24m 4m*client_data24m, 4mconst24m 4mvoid24m 4m**buffer24m)
 
-          typedef la_int64_t archive_skip_callback(struct archive *,
-          void *client_data, off_t request)
+          4mtypedef24m 4mla_int64_t24m 1marchive_skip_callback22m(4mstruct24m 4marchive24m 4m*24m,
+          4mvoid24m 4m*client_data24m, 4moff_t24m 4mrequest24m)
 
-          typedef int archive_open_callback(struct archive *, void
-          *client_data)
+          4mtypedef24m 4mint24m 1marchive_open_callback22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid0m
+          4m*client_data24m)
 
-          typedef int archive_close_callback(struct archive *, void
-          *client_data)
+          4mtypedef24m 4mint24m 1marchive_close_callback22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid0m
+          4m*client_data24m)
 
-     The open callback is invoked by archive_open().  It should return
-     ARCHIVE_OK if the underlying file or data source is successfully opened.
-     If the open fails, it should call archive_set_error() to register an
-     error code and message and return ARCHIVE_FATAL.
+     The open callback is invoked by 1marchive_open22m().  It should return
+     1mARCHIVE_OK 22mif the underlying file or data source is successfully opened.
+     If the open fails, it should call 1marchive_set_error22m() to register an
+     error code and message and return 1mARCHIVE_FATAL22m.
 
      The read callback is invoked whenever the library requires raw bytes from
      the archive.  The read callback should read data into a buffer, set the
@@ -97,7 +97,7 @@ CLIENT CALLBACKS
      callback again only after it has consumed this data.  The library imposes
      no constraints on the size of the data blocks returned.  On end-of-file,
      the read callback should return zero.  On error, the read callback should
-     invoke archive_set_error() to register an error code and message and
+     invoke 1marchive_set_error22m() to register an error code and message and
      return -1.
 
      The skip callback is invoked when the library wants to ignore a block of
@@ -110,18 +110,18 @@ CLIENT CALLBACKS
      media that can skip quickly.
 
      The close callback is invoked by archive_close when the archive process‐
-     ing is complete.  The callback should return ARCHIVE_OK on success.  On
-     failure, the callback should invoke archive_set_error() to register an
-     error code and message and return ARCHIVE_FATAL.
+     ing is complete.  The callback should return 1mARCHIVE_OK 22mon success.  On
+     failure, the callback should invoke 1marchive_set_error22m() to register an
+     error code and message and return 1mARCHIVE_FATAL.0m
 
-RETURN VALUES
-     These functions return ARCHIVE_OK on success, or ARCHIVE_FATAL.
+1mRETURN VALUES0m
+     These functions return 1mARCHIVE_OK 22mon success, or 1mARCHIVE_FATAL22m.
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_read(3), archive_read_data(3),
      archive_read_filter(3), archive_read_format(3),
      archive_read_set_options(3), archive_util(3), tar(5)
index 8aa919f..aaf7307 100644 (file)
 ARCHIVE_READ_OPTIONS(3)  BSD Library Functions Manual  ARCHIVE_READ_OPTIONS(3)
 
-NAME
-     archive_read_set_filter_option, archive_read_set_format_option,
-     archive_read_set_option, archive_read_set_options — functions controlling
+1mNAME0m
+     1marchive_read_set_filter_option22m, 1marchive_read_set_format_option22m,
+     1marchive_read_set_option22m, 1marchive_read_set_options 22m— functions controlling
      options for reading archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     int
-     archive_read_set_filter_option(struct archive *, const char *module,
-        const char *option, const char *value);
+1mSYNOPSIS0m
+     4mint0m
+     1marchive_read_set_filter_option22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*module24m,
+        4mconst24m 4mchar24m 4m*option24m, 4mconst24m 4mchar24m 4m*value24m);
 
-     int
-     archive_read_set_format_option(struct archive *, const char *module,
-        const char *option, const char *value);
+     4mint0m
+     1marchive_read_set_format_option22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*module24m,
+        4mconst24m 4mchar24m 4m*option24m, 4mconst24m 4mchar24m 4m*value24m);
 
-     int
-     archive_read_set_option(struct archive *, const char *module,
-        const char *option, const char *value);
+     4mint0m
+     1marchive_read_set_option22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*module24m,
+        4mconst24m 4mchar24m 4m*option24m, 4mconst24m 4mchar24m 4m*value24m);
 
-     int
-     archive_read_set_options(struct archive *, const char *options);
+     4mint0m
+     1marchive_read_set_options22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*options24m);
 
-DESCRIPTION
+1mDESCRIPTION0m
      These functions provide a way for libarchive clients to configure spe‐
      cific read modules.
 
-     archive_read_set_filter_option(), archive_read_set_format_option()
+     1marchive_read_set_filter_option22m(), 1marchive_read_set_format_option22m()
             Specifies an option that will be passed to currently-registered
             filters (including decompression filters) or format readers.
 
-            If option and value are both NULL, these functions will do noth‐
-            ing and ARCHIVE_OK will be returned.  If option is NULL but value
-            is not, these functions will do nothing and ARCHIVE_FAILED will
+            If 4moption24m and 4mvalue24m are both NULL, these functions will do noth‐
+            ing and 1mARCHIVE_OK 22mwill be returned.  If 4moption24m is NULL but 4mvalue0m
+            is not, these functions will do nothing and 1mARCHIVE_FAILED 22mwill
             be returned.
 
-            If module is not NULL, option and value will be provided to the
-            filter or reader named module.  The return value will be that of
-            the module.  If there is no such module, ARCHIVE_FAILED will be
+            If 4mmodule24m is not NULL, 4moption24m and 4mvalue24m will be provided to the
+            filter or reader named 4mmodule24m.  The return value will be that of
+            the module.  If there is no such module, 1mARCHIVE_FAILED 22mwill be
             returned.
 
-            If module is NULL, option and value will be provided to every
-            registered module.  If any module returns ARCHIVE_FATAL, this
-            value will be returned immediately.  Otherwise, ARCHIVE_OK will
-            be returned if any module accepts the option, and ARCHIVE_FAILED
+            If 4mmodule24m is NULL, 4moption24m and 4mvalue24m will be provided to every
+            registered module.  If any module returns 1mARCHIVE_FATAL22m, this
+            value will be returned immediately.  Otherwise, 1mARCHIVE_OK 22mwill
+            be returned if any module accepts the option, and 1mARCHIVE_FAILED0m
             in all other cases.
 
-     archive_read_set_option()
-            Calls archive_read_set_format_option(), then
-            archive_read_set_filter_option().  If either function returns
-            ARCHIVE_FATAL, ARCHIVE_FATAL will be returned immediately.  Oth‐
+     1marchive_read_set_option22m()
+            Calls 1marchive_read_set_format_option22m(), then
+            1marchive_read_set_filter_option22m().  If either function returns
+            1mARCHIVE_FATAL22m, 1mARCHIVE_FATAL 22mwill be returned immediately.  Oth‐
             erwise, greater of the two values will be returned.
 
-     archive_read_set_options()
-            options is a comma-separated list of options.  If options is NULL
-            or empty, ARCHIVE_OK will be returned immediately.
+     1marchive_read_set_options22m()
+            4moptions24m is a comma-separated list of options.  If 4moptions24m is NULL
+            or empty, 1mARCHIVE_OK 22mwill be returned immediately.
 
-            Calls archive_read_set_option() with each option in turn.  If any
-            archive_read_set_option() call returns ARCHIVE_FATAL,
-            ARCHIVE_FATAL will be returned immediately.
+            Calls 1marchive_read_set_option22m() with each option in turn.  If any
+            1marchive_read_set_option22m() call returns 1mARCHIVE_FATAL22m,
+            1mARCHIVE_FATAL 22mwill be returned immediately.
 
             Individual options have one of the following forms:
-            option=value
+            4moption=value0m
                     The option/value pair will be provided to every module.
                     Modules that do not accept an option with this name will
                     ignore it.
-            option  The option will be provided to every module with a value
+            4moption24m  The option will be provided to every module with a value
                     of “1”.
-            !option
+            4m!option0m
                     The option will be provided to every module with a NULL
                     value.
-            module:option=value, module:option, module:!option
+            4mmodule:option=value24m, 4mmodule:option24m, 4mmodule:!option0m
                     As above, but the corresponding option and value will be
-                    provided only to modules whose name matches module.
+                    provided only to modules whose name matches 4mmodule24m.
 
-OPTIONS
+1mOPTIONS0m
      Format iso9660
-            joliet  Support Joliet extensions.  Defaults to enabled, use
-                    !joliet to disable.
-            rockridge
+            1mjoliet  22mSupport Joliet extensions.  Defaults to enabled, use
+                    1m!joliet 22mto disable.
+            1mrockridge0m
                     Support RockRidge extensions.  Defaults to enabled, use
-                    !rockridge to disable.
+                    1m!rockridge 22mto disable.
      Format tar
-            compat-2x
+            1mcompat-2x0m
                     Libarchive 2.x incorrectly encoded Unicode filenames on
                     some platforms.  This option mimics the libarchive 2.x
                     filename handling so that such archives can be read cor‐
                     rectly.
-            hdrcharset
+            1mhdrcharset0m
                     The value is used as a character set name that will be
                     used when translating filenames.
-            mac-ext
+            1mmac-ext0m
                     Support Mac OS metadata extension that records data in
                     special files beginning with a period and underscore.
                     Defaults to enabled on Mac OS, disabled on other plat‐
-                    forms.  Use !mac-ext to disable.
-            read_concatenated_archives
+                    forms.  Use 1m!mac-ext 22mto disable.
+            1mread_concatenated_archives0m
                     Ignore zeroed blocks in the archive, which occurs when
                     multiple tar archives have been concatenated together.
                     Without this option, only the contents of the first con‐
                     catenated archive would be read.
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_write_set_options(3), archive_read(3)
 
 BSD                           February 2, 2012                            BSD
index 94d7c6c..07221c1 100644 (file)
@@ -1,96 +1,96 @@
 ARCHIVE_UTIL(3)         BSD Library Functions Manual          ARCHIVE_UTIL(3)
 
-NAME
-     archive_clear_error, archive_compression, archive_compression_name,
-     archive_copy_error, archive_errno, archive_error_string,
-     archive_file_count, archive_filter_code, archive_filter_count,
-     archive_filter_name, archive_format, archive_format_name,
-     archive_position, archive_set_error — libarchive utility functions
-
-LIBRARY
+1mNAME0m
+     1marchive_clear_error22m, 1marchive_compression22m, 1marchive_compression_name22m,
+     1marchive_copy_error22m, 1marchive_errno22m, 1marchive_error_string22m,
+     1marchive_file_count22m, 1marchive_filter_code22m, 1marchive_filter_count22m,
+     1marchive_filter_name22m, 1marchive_format22m, 1marchive_format_name22m,
+     1marchive_position22m, 1marchive_set_error 22m— libarchive utility functions
+
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     void
-     archive_clear_error(struct archive *);
+     4mvoid0m
+     1marchive_clear_error22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_compression(struct archive *);
+     4mint0m
+     1marchive_compression22m(4mstruct24m 4marchive24m 4m*24m);
 
-     const char *
-     archive_compression_name(struct archive *);
+     4mconst24m 4mchar24m 4m*0m
+     1marchive_compression_name22m(4mstruct24m 4marchive24m 4m*24m);
 
-     void
-     archive_copy_error(struct archive *, struct archive *);
+     4mvoid0m
+     1marchive_copy_error22m(4mstruct24m 4marchive24m 4m*24m, 4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_errno(struct archive *);
+     4mint0m
+     1marchive_errno22m(4mstruct24m 4marchive24m 4m*24m);
 
-     const char *
-     archive_error_string(struct archive *);
+     4mconst24m 4mchar24m 4m*0m
+     1marchive_error_string22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_file_count(struct archive *);
+     4mint0m
+     1marchive_file_count22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_filter_code(struct archive *, int);
+     4mint0m
+     1marchive_filter_code22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m);
 
-     int
-     archive_filter_count(struct archive *, int);
+     4mint0m
+     1marchive_filter_count22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m);
 
-     const char *
-     archive_filter_name(struct archive *, int);
+     4mconst24m 4mchar24m 4m*0m
+     1marchive_filter_name22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m);
 
-     int
-     archive_format(struct archive *);
+     4mint0m
+     1marchive_format22m(4mstruct24m 4marchive24m 4m*24m);
 
-     const char *
-     archive_format_name(struct archive *);
+     4mconst24m 4mchar24m 4m*0m
+     1marchive_format_name22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int64_t
-     archive_position(struct archive *, int);
+     4mint64_t0m
+     1marchive_position22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m);
 
-     void
-     archive_set_error(struct archive *, int error_code, const char *fmt,
-        ...);
+     4mvoid0m
+     1marchive_set_error22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m 4merror_code24m, 4mconst24m 4mchar24m 4m*fmt24m,
+        4m...24m);
 
-DESCRIPTION
+1mDESCRIPTION0m
      These functions provide access to various information about the struct
      archive object used in the libarchive(3) library.
-     archive_clear_error()
+     1marchive_clear_error22m()
             Clears any error information left over from a previous call.  Not
             generally used in client code.
-     archive_compression()
-            Synonym for archive_filter_code(a,(0)).
-     archive_compression_name()
-            Synonym for archive_filter_name(a,(0)).
-     archive_copy_error()
+     1marchive_compression22m()
+            Synonym for 1marchive_filter_code(a,22m(4m0)24m).
+     1marchive_compression_name22m()
+            Synonym for 1marchive_filter_name(a,22m(4m0)24m).
+     1marchive_copy_error22m()
             Copies error information from one archive to another.
-     archive_errno()
+     1marchive_errno22m()
             Returns a numeric error code (see errno(2)) indicating the reason
             for the most recent error return.  Note that this can not be
             reliably used to detect whether an error has occurred.  It should
             be used only after another libarchive function has returned an
             error status.
-     archive_error_string()
+     1marchive_error_string22m()
             Returns a textual error message suitable for display.  The error
             message here is usually more specific than that obtained from
-            passing the result of archive_errno() to strerror(3).
-     archive_file_count()
+            passing the result of 1marchive_errno22m() to strerror(3).
+     1marchive_file_count22m()
             Returns a count of the number of files processed by this archive
             object.  The count is incremented by calls to
             archive_write_header(3) or archive_read_next_header(3).
-     archive_filter_code()
+     1marchive_filter_code22m()
             Returns a numeric code identifying the indicated filter.  See
-            archive_filter_count() for details of the numbering.
-     archive_filter_count()
+            1marchive_filter_count22m() for details of the numbering.
+     1marchive_filter_count22m()
             Returns the number of filters in the current pipeline.  For read
             archive handles, these filters are added automatically by the
             automatic format detection.  For write archive handles, these
             filters are added by calls to the various
-            archive_write_add_filter_XXX() functions.  Filters in the result‐
+            1marchive_write_add_filter_XXX22m() functions.  Filters in the result‐
             ing pipeline are numbered so that filter 0 is the filter closest
             to the format handler.  As a convenience, functions that expect a
             filter number will accept -1 as a synonym for the highest-num‐
@@ -100,35 +100,35 @@ DESCRIPTION
             are three filters: filter 0 is the gunzip filter, filter 1 is the
             uudecode filter, and filter 2 is the pseudo-filter that wraps the
             archive read functions.  In this case, requesting
-            archive_position(a,(-1)) would be a synonym for
-            archive_position(a,(2)) which would return the number of bytes
-            currently read from the archive, while archive_position(a,(1))
+            1marchive_position(a,22m(4m-1)24m) would be a synonym for
+            1marchive_position(a,22m(4m2)24m) which would return the number of bytes
+            currently read from the archive, while 1marchive_position(a,22m(4m1)24m)
             would return the number of bytes after uudecoding, and
-            archive_position(a,(0)) would return the number of bytes after
+            1marchive_position(a,22m(4m0)24m) would return the number of bytes after
             decompression.
-     archive_filter_name()
+     1marchive_filter_name22m()
             Returns a textual name identifying the indicated filter.  See
-            archive_filter_count() for details of the numbering.
-     archive_format()
+            1marchive_filter_count22m() for details of the numbering.
+     1marchive_format22m()
             Returns a numeric code indicating the format of the current ar‐
             chive entry.  This value is set by a successful call to
-            archive_read_next_header().  Note that it is common for this
+            1marchive_read_next_header22m().  Note that it is common for this
             value to change from entry to entry.  For example, a tar archive
             might have several entries that utilize GNU tar extensions and
             several entries that do not.  These entries will have different
             format codes.
-     archive_format_name()
+     1marchive_format_name22m()
             A textual description of the format of the current entry.
-     archive_position()
+     1marchive_position22m()
             Returns the number of bytes read from or written to the indicated
-            filter.  In particular, archive_position(a,(0)) returns the num‐
+            filter.  In particular, 1marchive_position(a,22m(4m0)24m) returns the num‐
             ber of bytes read or written by the format handler, while
-            archive_position(a,(-1)) returns the number of bytes read or
-            written to the archive.  See archive_filter_count() for details
+            1marchive_position(a,22m(4m-1)24m) returns the number of bytes read or
+            written to the archive.  See 1marchive_filter_count22m() for details
             of the numbering here.
-     archive_set_error()
+     1marchive_set_error22m()
             Sets the numeric error code and error description that will be
-            returned by archive_errno() and archive_error_string().  This
+            returned by 1marchive_errno22m() and 1marchive_error_string22m().  This
             function should be used within I/O callbacks to set system-spe‐
             cific error codes and error descriptions.  This function accepts
             a printf-like format string and arguments.  However, you should
@@ -138,13 +138,13 @@ DESCRIPTION
             other printf features are not uniformly supported and should not
             be used.
 
-SEE ALSO
+1mSEE ALSO0m
      archive_read(3), archive_write(3), libarchive(3), printf(3)
 
-HISTORY
-     The libarchive library first appeared in FreeBSD 5.3.
+1mHISTORY0m
+     The 1mlibarchive 22mlibrary first appeared in FreeBSD 5.3.
 
-AUTHORS
-     The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
+1mAUTHORS0m
+     The 1mlibarchive 22mlibrary was written by Tim Kientzle <kientzle@acm.org>.
 
 BSD                           February 2, 2012                            BSD
index 7f779c8..ee525ef 100644 (file)
@@ -1,66 +1,66 @@
 ARCHIVE_WRITE(3)        BSD Library Functions Manual         ARCHIVE_WRITE(3)
 
-NAME
-     archive_write — functions for creating archives
+1mNAME0m
+     1marchive_write 22m— functions for creating archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-DESCRIPTION
+1mDESCRIPTION0m
      These functions provide a complete API for creating streaming archive
      files.  The general process is to first create the struct archive object,
      set any desired options, initialize the archive, append entries, then
      close the archive and release all resources.
 
-   Create archive object
+   1mCreate archive object0m
      See archive_write_new(3).
 
      To write an archive, you must first obtain an initialized struct archive
-     object from archive_write_new().
+     object from 1marchive_write_new22m().
 
-   Enable filters and formats, configure block size and padding
+   1mEnable filters and formats, configure block size and padding0m
      See archive_write_filter(3), archive_write_format(3) and
      archive_write_blocksize(3).
 
      You can then modify this object for the desired operations with the vari‐
-     ous archive_write_set_XXX() functions.  In particular, you will need to
-     invoke appropriate archive_write_add_XXX() and archive_write_set_XXX()
+     ous 1marchive_write_set_XXX22m() functions.  In particular, you will need to
+     invoke appropriate 1marchive_write_add_XXX22m() and 1marchive_write_set_XXX22m()
      functions to enable the corresponding compression and format support.
 
-   Set options
+   1mSet options0m
      See archive_read_set_options(3).
 
-   Open archive
+   1mOpen archive0m
      See archive_write_open(3).
 
      Once you have prepared the struct archive object, you call
-     archive_write_open() to actually open the archive and prepare it for
+     1marchive_write_open22m() to actually open the archive and prepare it for
      writing.  There are several variants of this function; the most basic
      expects you to provide pointers to several functions that can provide
      blocks of bytes from the archive. There are convenience forms that allow
-     you to specify a filename, file descriptor, FILE * object, or a block of
+     you to specify a filename, file descriptor, 4mFILE24m 4m*24m object, or a block of
      memory from which to write the archive data.
 
-   Produce archive
+   1mProduce archive0m
      See archive_write_header(3) and archive_write_data(3).
 
      Individual archive entries are written in a three-step process: You first
      initialize a struct archive_entry structure with information about the
      new entry.  At a minimum, you should set the pathname of the entry and
-     provide a struct stat with a valid st_mode field, which specifies the
-     type of object and st_size field, which specifies the size of the data
+     provide a 4mstruct24m 4mstat24m with a valid 4mst_mode24m field, which specifies the
+     type of object and 4mst_size24m field, which specifies the size of the data
      portion of the object.
 
-   Release resources
+   1mRelease resources0m
      See archive_write_free(3).
 
-     After all entries have been written, use the archive_write_free() func‐
+     After all entries have been written, use the 1marchive_write_free22m() func‐
      tion to release all resources.
 
-EXAMPLE
+1mEXAMPLE0m
      The following sketch illustrates basic usage of the library.  In this
      example, the callback functions are simply wrappers around the standard
      open(2), write(2), and close(2) system calls.
@@ -160,17 +160,17 @@ EXAMPLE
             return 0;
           }
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_write_set_options(3), cpio(5), mtree(5),
      tar(5)
 
-HISTORY
-     The libarchive library first appeared in FreeBSD 5.3.
+1mHISTORY0m
+     The 1mlibarchive 22mlibrary first appeared in FreeBSD 5.3.
 
-AUTHORS
-     The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
+1mAUTHORS0m
+     The 1mlibarchive 22mlibrary was written by Tim Kientzle <kientzle@acm.org>.
 
-BUGS
+1mBUGS0m
      There are many peculiar bugs in historic tar implementations that may
      cause certain programs to reject archives written by this library.  For
      example, several historic implementations calculated header checksums
@@ -184,7 +184,7 @@ BUGS
      a standard attribute for large device numbers.  This library uses
      “SCHILY.devminor” and “SCHILY.devmajor” for device numbers that exceed
      the range supported by the backwards-compatible ustar header.  These keys
-     are compatible with Joerg Schilling's star archiver.  Other implementa‐
+     are compatible with Joerg Schilling's 1mstar 22marchiver. Other implementa‐
      tions may not recognize these keys and will thus be unable to correctly
      restore device nodes with large device numbers from archives created by
      this library.
index d8cf943..0493703 100644 (file)
@@ -1,30 +1,30 @@
 ARCHIVE_WRITE_BLOCKSI... BSD Library Functions Manual ARCHIVE_WRITE_BLOCKSI...
 
-NAME
-     archive_write_get_bytes_per_block, archive_write_set_bytes_per_block,
-     archive_write_get_bytes_in_last_block,
-     archive_write_set_bytes_in_last_block — functions for creating archives
+1mNAME0m
+     1marchive_write_get_bytes_per_block22m, 1marchive_write_set_bytes_per_block22m,
+     1marchive_write_get_bytes_in_last_block22m,
+     1marchive_write_set_bytes_in_last_block 22m— functions for creating archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     int
-     archive_write_get_bytes_per_block(struct archive *);
+     4mint0m
+     1marchive_write_get_bytes_per_block22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_bytes_per_block(struct archive *, int bytes_per_block);
+     4mint0m
+     1marchive_write_set_bytes_per_block22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m 4mbytes_per_block24m);
 
-     int
-     archive_write_get_bytes_in_last_block(struct archive *);
+     4mint0m
+     1marchive_write_get_bytes_in_last_block22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_bytes_in_last_block(struct archive *, int);
+     4mint0m
+     1marchive_write_set_bytes_in_last_block22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m);
 
-DESCRIPTION
-     archive_write_set_bytes_per_block()
+1mDESCRIPTION0m
+     1marchive_write_set_bytes_per_block22m()
             Sets the block size used for writing the archive data.  Every
             call to the write callback function, except possibly the last
             one, will use this value for the length.  The default is to use a
@@ -32,12 +32,12 @@ DESCRIPTION
             suppress internal blocking and cause writes to be sent directly
             to the write callback as they occur.
 
-     archive_write_get_bytes_per_block()
+     1marchive_write_get_bytes_per_block22m()
             Retrieve the block size to be used for writing.  A value of -1
             here indicates that the library should use default values.  A
             value of zero indicates that internal blocking is suppressed.
 
-     archive_write_set_bytes_in_last_block()
+     1marchive_write_set_bytes_in_last_block22m()
             Sets the block size used for writing the last block.  If this
             value is zero, the last block will be padded to the same size as
             the other blocks.  Otherwise, the final block will be padded to a
@@ -46,28 +46,28 @@ DESCRIPTION
             padding generated by this option is applied only after the com‐
             pression.  The uncompressed data is always unpadded.  The default
             is to pad the last block to the full block size (note that
-            archive_write_open_filename() will set this based on the file
+            1marchive_write_open_filename22m() will set this based on the file
             type).  Unlike the other “set” functions, this function can be
             called after the archive is opened.
 
-     archive_write_get_bytes_in_last_block()
+     1marchive_write_get_bytes_in_last_block22m()
             Retrieve the currently-set value for last block size.  A value of
             -1 here indicates that the library should use default values.
 
-RETURN VALUES
-     archive_write_set_bytes_per_block() and
-     archive_write_set_bytes_in_last_block() return ARCHIVE_OK on success, or
-     ARCHIVE_FATAL.
+1mRETURN VALUES0m
+     1marchive_write_set_bytes_per_block22m() and
+     1marchive_write_set_bytes_in_last_block22m() return 1mARCHIVE_OK 22mon success, or
+     1mARCHIVE_FATAL22m.
 
-     archive_write_get_bytes_per_block() and
-     archive_write_get_bytes_in_last_block() return currently configured block
-     size (-1 indicates the default block size), or ARCHIVE_FATAL.
+     1marchive_write_get_bytes_per_block22m() and
+     1marchive_write_get_bytes_in_last_block22m() return currently configured block
+     size (-1 indicates the default block size), or 1mARCHIVE_FATAL22m.
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_write_set_options(3), cpio(5), mtree(5),
      tar(5)
 
index 69f4282..97a9331 100644 (file)
@@ -1,36 +1,36 @@
 ARCHIVE_WRITE_DATA(3)   BSD Library Functions Manual    ARCHIVE_WRITE_DATA(3)
 
-NAME
-     archive_write_data — functions for creating archives
+1mNAME0m
+     1marchive_write_data 22m— functions for creating archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     la_ssize_t
-     archive_write_data(struct archive *, const void *, size_t);
+     4mla_ssize_t0m
+     1marchive_write_data22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mvoid24m 4m*24m, 4msize_t24m);
 
-DESCRIPTION
+1mDESCRIPTION0m
      Write data corresponding to the header just written.
 
-RETURN VALUES
+1mRETURN VALUES0m
      This function returns the number of bytes actually written, or a negative
      error code on error.
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-BUGS
+1mBUGS0m
      In libarchive 3.x, this function sometimes returns zero on success
      instead of returning the number of bytes written. Specifically, this
-     occurs when writing to an archive_write_disk handle.  Clients should
+     occurs when writing to an 4marchive_write_disk24m handle. Clients should
      treat any value less than zero as an error and consider any non-negative
      value as success.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_write_finish_entry(3),
      archive_write_set_options(3), cpio(5), mtree(5), tar(5)
 
index 12afe67..9980c1c 100644 (file)
 ARCHIVE_WRITE_DISK(3)   BSD Library Functions Manual    ARCHIVE_WRITE_DISK(3)
 
-NAME
-     archive_write_disk_new, archive_write_disk_set_options,
-     archive_write_disk_set_skip_file, archive_write_disk_set_group_lookup,
-     archive_write_disk_set_standard_lookup,
-     archive_write_disk_set_user_lookup, archive_write_header,
-     archive_write_data, archive_write_data_block, archive_write_finish_entry,
-     archive_write_close, archive_write_finish archive_write_free — functions
+1mNAME0m
+     1marchive_write_disk_new22m, 1marchive_write_disk_set_options22m,
+     1marchive_write_disk_set_skip_file22m, 1marchive_write_disk_set_group_lookup22m,
+     1marchive_write_disk_set_standard_lookup22m,
+     1marchive_write_disk_set_user_lookup22m, 1marchive_write_header22m,
+     1marchive_write_data22m, 1marchive_write_data_block22m, 1marchive_write_finish_entry22m,
+     1marchive_write_close22m, 1marchive_write_finish archive_write_free 22m— functions
      for creating objects on disk
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     struct archive *
-     archive_write_disk_new(void);
+     4mstruct24m 4marchive24m 4m*0m
+     1marchive_write_disk_new22m(4mvoid24m);
 
-     int
-     archive_write_disk_set_options(struct archive *, int flags);
+     4mint0m
+     1marchive_write_disk_set_options22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m 4mflags24m);
 
-     int
-     archive_write_disk_set_skip_file(struct archive *, dev_t, ino_t);
+     4mint0m
+     1marchive_write_disk_set_skip_file22m(4mstruct24m 4marchive24m 4m*24m, 4mdev_t24m, 4mino_t24m);
 
-     int
-     archive_write_disk_set_group_lookup(struct archive *, void *,
-        gid_t (*)(void *, const char *gname, gid_t gid),
-        void (*cleanup)(void *));
+     4mint0m
+     1marchive_write_disk_set_group_lookup22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid24m 4m*24m,
+        4mgid_t24m 4m(*)(void24m 4m*,24m 4mconst24m 4mchar24m 4m*gname,24m 4mgid_t24m 4mgid)24m,
+        4mvoid24m 4m(*cleanup)(void24m 4m*)24m);
 
-     int
-     archive_write_disk_set_standard_lookup(struct archive *);
+     4mint0m
+     1marchive_write_disk_set_standard_lookup22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_disk_set_user_lookup(struct archive *, void *,
-        uid_t (*)(void *, const char *uname, uid_t uid),
-        void (*cleanup)(void *));
+     4mint0m
+     1marchive_write_disk_set_user_lookup22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid24m 4m*24m,
+        4muid_t24m 4m(*)(void24m 4m*,24m 4mconst24m 4mchar24m 4m*uname,24m 4muid_t24m 4muid)24m,
+        4mvoid24m 4m(*cleanup)(void24m 4m*)24m);
 
-     int
-     archive_write_header(struct archive *, struct archive_entry *);
+     4mint0m
+     1marchive_write_header22m(4mstruct24m 4marchive24m 4m*24m, 4mstruct24m 4marchive_entry24m 4m*24m);
 
-     la_ssize_t
-     archive_write_data(struct archive *, const void *, size_t);
+     4mla_ssize_t0m
+     1marchive_write_data22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mvoid24m 4m*24m, 4msize_t24m);
 
-     la_ssize_t
-     archive_write_data_block(struct archive *, const void *, size_t size,
-        int64_t offset);
+     4mla_ssize_t0m
+     1marchive_write_data_block22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mvoid24m 4m*24m, 4msize_t24m 4msize24m,
+        4mint64_t24m 4moffset24m);
 
-     int
-     archive_write_finish_entry(struct archive *);
+     4mint0m
+     1marchive_write_finish_entry22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_close(struct archive *);
+     4mint0m
+     1marchive_write_close22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_finish(struct archive *);
+     4mint0m
+     1marchive_write_finish22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_free(struct archive *);
+     4mint0m
+     1marchive_write_free22m(4mstruct24m 4marchive24m 4m*24m);
 
-DESCRIPTION
+1mDESCRIPTION0m
      These functions provide a complete API for creating objects on disk from
      struct archive_entry descriptions.  They are most naturally used when
-     extracting objects from an archive using the archive_read() interface.
+     extracting objects from an archive using the 1marchive_read22m() interface.
      The general process is to read struct archive_entry objects from an ar‐
      chive, then write those objects to a struct archive object created using
-     the archive_write_disk() family functions.  This interface is deliber‐
-     ately very similar to the archive_write() interface used to write objects
+     the 1marchive_write_disk22m() family functions.  This interface is deliber‐
+     ately very similar to the 1marchive_write22m() interface used to write objects
      to a streaming archive.
 
-     archive_write_disk_new()
+     1marchive_write_disk_new22m()
             Allocates and initializes a struct archive object suitable for
             writing objects to disk.
 
-     archive_write_disk_set_skip_file()
+     1marchive_write_disk_set_skip_file22m()
             Records the device and inode numbers of a file that should not be
             overwritten.  This is typically used to ensure that an extraction
             process does not overwrite the archive from which objects are
             being read.  This capability is technically unnecessary but can
             be a significant performance optimization in practice.
 
-     archive_write_disk_set_options()
+     1marchive_write_disk_set_options22m()
             The options field consists of a bitwise OR of one or more of the
             following values:
-            ARCHIVE_EXTRACT_OWNER
+            1mARCHIVE_EXTRACT_OWNER0m
                     The user and group IDs should be set on the restored
                     file.  By default, the user and group IDs are not
                     restored.
-            ARCHIVE_EXTRACT_PERM
+            1mARCHIVE_EXTRACT_PERM0m
                     Full permissions (including SGID, SUID, and sticky bits)
                     should be restored exactly as specified, without obeying
                     the current umask.  Note that SUID and SGID bits can only
                     be restored if the user and group ID of the object on
-                    disk are correct.  If ARCHIVE_EXTRACT_OWNER is not speci‐
+                    disk are correct.  If 1mARCHIVE_EXTRACT_OWNER 22mis not speci‐
                     fied, then SUID and SGID bits will only be restored if
                     the default user and group IDs of newly-created objects
                     on disk happen to match those specified in the archive
                     entry.  By default, only basic permissions are restored,
                     and umask is obeyed.
-            ARCHIVE_EXTRACT_TIME
+            1mARCHIVE_EXTRACT_TIME0m
                     The timestamps (mtime, ctime, and atime) should be
                     restored.  By default, they are ignored.  Note that
                     restoring of atime is not currently supported.
-            ARCHIVE_EXTRACT_NO_OVERWRITE
+            1mARCHIVE_EXTRACT_NO_OVERWRITE0m
                     Existing files on disk will not be overwritten.  By
                     default, existing regular files are truncated and over‐
                     written; existing directories will have their permissions
                     updated; other pre-existing objects are unlinked and
                     recreated from scratch.
-            ARCHIVE_EXTRACT_UNLINK
+            1mARCHIVE_EXTRACT_UNLINK0m
                     Existing files on disk will be unlinked before any
                     attempt to create them.  In some cases, this can prove to
                     be a significant performance improvement.  By default,
                     existing files are truncated and rewritten, but the file
                     is not recreated.  In particular, the default behavior
                     does not break existing hard links.
-            ARCHIVE_EXTRACT_ACL
+            1mARCHIVE_EXTRACT_ACL0m
                     Attempt to restore ACLs.  By default, extended ACLs are
                     ignored.
-            ARCHIVE_EXTRACT_FFLAGS
+            1mARCHIVE_EXTRACT_FFLAGS0m
                     Attempt to restore extended file flags.  By default, file
                     flags are ignored.
-            ARCHIVE_EXTRACT_XATTR
+            1mARCHIVE_EXTRACT_XATTR0m
                     Attempt to restore POSIX.1e extended attributes.  By
                     default, they are ignored.
-            ARCHIVE_EXTRACT_SECURE_SYMLINKS
+            1mARCHIVE_EXTRACT_SECURE_SYMLINKS0m
                     Refuse to extract any object whose final location would
                     be altered by a symlink on disk.  This is intended to
                     help guard against a variety of mischief caused by ar‐
                     chives that (deliberately or otherwise) extract files
                     outside of the current directory.  The default is not to
-                    perform this check.  If ARCHIVE_EXTRACT_UNLINK is speci‐
+                    perform this check.  If 1mARCHIVE_EXTRACT_UNLINK 22mis speci‐
                     fied together with this option, the library will remove
                     any intermediate symlinks it finds and return an error
                     only if such symlink could not be removed.
-            ARCHIVE_EXTRACT_SECURE_NODOTDOT
-                    Refuse to extract a path that contains a .. element any‐
+            1mARCHIVE_EXTRACT_SECURE_NODOTDOT0m
+                    Refuse to extract a path that contains a 4m..24m element any‐
                     where within it.  The default is to not refuse such
-                    paths.  Note that paths ending in .. always cause an
+                    paths.  Note that paths ending in 4m..24m always cause an
                     error, regardless of this flag.
-            ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
+            1mARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS0m
                     Refuse to extract an absolute path.  The default is to
                     not refuse such paths.
-            ARCHIVE_EXTRACT_SPARSE
+            1mARCHIVE_EXTRACT_SPARSE0m
                     Scan data for blocks of NUL bytes and try to recreate
                     them with holes.  This results in sparse files, indepen‐
                     dent of whether the archive format supports or uses them.
-            ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS
+            1mARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS0m
                     Before removing a file system object prior to replacing
                     it, clear platform-specific file flags which might pre‐
                     vent its removal.
 
-     archive_write_disk_set_group_lookup(),
-            archive_write_disk_set_user_lookup()
+     1marchive_write_disk_set_group_lookup22m(),
+            1marchive_write_disk_set_user_lookup22m()
             The struct archive_entry objects contain both names and ids that
             can be used to identify users and groups.  These names and ids
             describe the ownership of the file itself and also appear in ACL
@@ -164,7 +164,7 @@ DESCRIPTION
             and a cleanup function for that data.  The cleanup function will
             be invoked when the struct archive object is destroyed.
 
-     archive_write_disk_set_standard_lookup()
+     1marchive_write_disk_set_standard_lookup22m()
             This convenience function installs a standard set of user and
             group lookup functions.  These functions use getpwnam(3) and
             getgrnam(3) to convert names to ids, defaulting to the ids if the
@@ -172,111 +172,111 @@ DESCRIPTION
             ple memory cache to reduce the number of calls to getpwnam(3) and
             getgrnam(3).
 
-     archive_write_header()
+     1marchive_write_header22m()
             Build and write a header using the data in the provided struct
             archive_entry structure.  See archive_entry(3) for information on
             creating and populating struct archive_entry objects.
 
-     archive_write_data()
+     1marchive_write_data22m()
             Write data corresponding to the header just written.  Returns
             number of bytes written or -1 on error.
 
-     archive_write_data_block()
+     1marchive_write_data_block22m()
             Write data corresponding to the header just written.  This is
-            like archive_write_data() except that it performs a seek on the
+            like 1marchive_write_data22m() except that it performs a seek on the
             file being written to the specified offset before writing the
             data.  This is useful when restoring sparse files from archive
             formats that support sparse files.  Returns number of bytes writ‐
             ten or -1 on error.  (Note: This is currently not supported for
             archive_write handles, only for archive_write_disk handles.)
 
-     archive_write_finish_entry()
+     1marchive_write_finish_entry22m()
             Close out the entry just written.  Ordinarily, clients never need
             to call this, as it is called automatically by
-            archive_write_next_header() and archive_write_close() as needed.
+            1marchive_write_next_header22m() and 1marchive_write_close22m() as needed.
             However, some file attributes are written to disk only after the
             file is closed, so this can be necessary if you need to work with
             the file on disk right away.
 
-     archive_write_close()
+     1marchive_write_close22m()
             Set any attributes that could not be set during the initial
             restore.  For example, directory timestamps are not restored ini‐
             tially because restoring a subsequent file would alter that time‐
             stamp.  Similarly, non-writable directories are initially created
             with write permissions (so that their contents can be restored).
-            The archive_write_disk_new library maintains a list of all such
+            The 1marchive_write_disk_new 22mlibrary maintains a list of all such
             deferred attributes and sets them when this function is invoked.
 
-     archive_write_finish()
-            This is a deprecated synonym for archive_write_free().
+     1marchive_write_finish22m()
+            This is a deprecated synonym for 1marchive_write_free22m().
 
-     archive_write_free()
-            Invokes archive_write_close() if it was not invoked manually,
+     1marchive_write_free22m()
+            Invokes 1marchive_write_close22m() if it was not invoked manually,
             then releases all resources.
-     More information about the struct archive object and the overall design
+     More information about the 4mstruct24m 4marchive24m object and the overall design
      of the library can be found in the libarchive(3) overview.  Many of these
      functions are also documented under archive_write(3).
 
-RETURN VALUES
-     Most functions return ARCHIVE_OK (zero) on success, or one of several
+1mRETURN VALUES0m
+     Most functions return 1mARCHIVE_OK 22m(zero) on success, or one of several
      non-zero error codes for errors.  Specific error codes include:
-     ARCHIVE_RETRY for operations that might succeed if retried, ARCHIVE_WARN
+     1mARCHIVE_RETRY 22mfor operations that might succeed if retried, 1mARCHIVE_WARN0m
      for unusual conditions that do not prevent further operations, and
-     ARCHIVE_FATAL for serious errors that make remaining operations impossi‐
+     1mARCHIVE_FATAL 22mfor serious errors that make remaining operations impossi‐
      ble.
 
-     archive_write_disk_new() returns a pointer to a newly-allocated struct
+     1marchive_write_disk_new22m() returns a pointer to a newly-allocated struct
      archive object.
 
-     archive_write_data() returns a count of the number of bytes actually
+     1marchive_write_data22m() returns a count of the number of bytes actually
      written, or -1 on error.
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      archive_read(3), archive_write(3), tar(1), libarchive(3)
 
-HISTORY
-     The libarchive library first appeared in FreeBSD 5.3.  The
-     archive_write_disk interface was added to libarchive 2.0 and first
+1mHISTORY0m
+     The 1mlibarchive 22mlibrary first appeared in FreeBSD 5.3.  The
+     1marchive_write_disk 22minterface was added to 1mlibarchive 2.0 22mand first
      appeared in FreeBSD 6.3.
 
-AUTHORS
-     The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
+1mAUTHORS0m
+     The 1mlibarchive 22mlibrary was written by Tim Kientzle <kientzle@acm.org>.
 
-BUGS
+1mBUGS0m
      Directories are actually extracted in two distinct phases.  Directories
-     are created during archive_write_header(), but final permissions are not
-     set until archive_write_close().  This separation is necessary to cor‐
+     are created during 1marchive_write_header22m(), but final permissions are not
+     set until 1marchive_write_close22m().  This separation is necessary to cor‐
      rectly handle borderline cases such as a non-writable directory contain‐
      ing files, but can cause unexpected results.  In particular, directory
      permissions are not fully restored until the archive is closed.  If you
      use chdir(2) to change the current directory between calls to
-     archive_read_extract() or before calling archive_read_close(), you may
+     1marchive_read_extract22m() or before calling 1marchive_read_close22m(), you may
      confuse the permission-setting logic with the result that directory per‐
      missions are restored incorrectly.
 
      The library attempts to create objects with filenames longer than
-     PATH_MAX by creating prefixes of the full path and changing the current
+     1mPATH_MAX 22mby creating prefixes of the full path and changing the current
      directory.  Currently, this logic is limited in scope; the fixup pass
      does not work correctly for such objects and the symlink security check
      option disables the support for very long pathnames.
 
-     Restoring the path aa/../bb does create each intermediate directory.  In
-     particular, the directory aa is created as well as the final object bb.
+     Restoring the path 4maa/../bb24m does create each intermediate directory. In
+     particular, the directory 4maa24m is created as well as the final object 4mbb24m.
      In theory, this can be exploited to create an entire directory hierarchy
      with a single request.  Of course, this does not work if the
-     ARCHIVE_EXTRACT_NODOTDOT option is specified.
+     1mARCHIVE_EXTRACT_NODOTDOT 22moption is specified.
 
      Implicit directories are always created obeying the current umask.
      Explicit objects are created obeying the current umask unless
-     ARCHIVE_EXTRACT_PERM is specified, in which case they current umask is
+     1mARCHIVE_EXTRACT_PERM 22mis specified, in which case they current umask is
      ignored.
 
      SGID and SUID bits are restored only if the correct user and group could
-     be set.  If ARCHIVE_EXTRACT_OWNER is not specified, then no attempt is
+     be set.  If 1mARCHIVE_EXTRACT_OWNER 22mis not specified, then no attempt is
      made to set the ownership.  In this case, SGID and SUID bits are restored
      only if the user and group of the final object happen to match those
      specified in the entry.
@@ -286,7 +286,7 @@ BUGS
      lar applications. The current design allows the application author to
      use a more compact implementation when appropriate.
 
-     There should be a corresponding archive_read_disk interface that walks a
+     There should be a corresponding 1marchive_read_disk 22minterface that walks a
      directory hierarchy and returns archive entry objects.
 
 BSD                           February 2, 2012                            BSD
index f6e8be6..ce4ece9 100644 (file)
@@ -1,95 +1,95 @@
 ARCHIVE_WRITE_FILTER(3)  BSD Library Functions Manual  ARCHIVE_WRITE_FILTER(3)
 
-NAME
-     archive_write_add_filter_b64encode, archive_write_add_filter_by_name,
-     archive_write_add_filter_bzip2, archive_write_add_filter_compress,
-     archive_write_add_filter_grzip, archive_write_add_filter_gzip,
-     archive_write_add_filter_lrzip, archive_write_add_filter_lz4,
-     archive_write_add_filter_lzip, archive_write_add_filter_lzma,
-     archive_write_add_filter_lzop, archive_write_add_filter_none,
-     archive_write_add_filter_program, archive_write_add_filter_uuencode,
-     archive_write_add_filter_xz — functions enabling output filters
-
-LIBRARY
+1mNAME0m
+     1marchive_write_add_filter_b64encode22m, 1marchive_write_add_filter_by_name22m,
+     1marchive_write_add_filter_bzip222m, 1marchive_write_add_filter_compress22m,
+     1marchive_write_add_filter_grzip22m, 1marchive_write_add_filter_gzip22m,
+     1marchive_write_add_filter_lrzip22m, 1marchive_write_add_filter_lz422m,
+     1marchive_write_add_filter_lzip22m, 1marchive_write_add_filter_lzma22m,
+     1marchive_write_add_filter_lzop22m, 1marchive_write_add_filter_none22m,
+     1marchive_write_add_filter_program22m, 1marchive_write_add_filter_uuencode22m,
+     1marchive_write_add_filter_xz 22m— functions enabling output filters
+
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     int
-     archive_write_add_filter_b64encode(struct archive *);
+     4mint0m
+     1marchive_write_add_filter_b64encode22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_add_filter_bzip2(struct archive *);
+     4mint0m
+     1marchive_write_add_filter_bzip222m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_add_filter_compress(struct archive *);
+     4mint0m
+     1marchive_write_add_filter_compress22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_add_filter_grzip(struct archive *);
+     4mint0m
+     1marchive_write_add_filter_grzip22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_add_filter_gzip(struct archive *);
+     4mint0m
+     1marchive_write_add_filter_gzip22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_add_filter_lrzip(struct archive *);
+     4mint0m
+     1marchive_write_add_filter_lrzip22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_add_filter_lz4(struct archive *);
+     4mint0m
+     1marchive_write_add_filter_lz422m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_add_filter_lzip(struct archive *);
+     4mint0m
+     1marchive_write_add_filter_lzip22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_add_filter_lzma(struct archive *);
+     4mint0m
+     1marchive_write_add_filter_lzma22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_add_filter_lzop(struct archive *);
+     4mint0m
+     1marchive_write_add_filter_lzop22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_add_filter_none(struct archive *);
+     4mint0m
+     1marchive_write_add_filter_none22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_add_filter_program(struct archive *, const char * cmd);
+     4mint0m
+     1marchive_write_add_filter_program22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*24m 4mcmd24m);
 
-     int
-     archive_write_add_filter_uuencode(struct archive *);
+     4mint0m
+     1marchive_write_add_filter_uuencode22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_add_filter_xz(struct archive *);
+     4mint0m
+     1marchive_write_add_filter_xz22m(4mstruct24m 4marchive24m 4m*24m);
 
-DESCRIPTION
-     archive_write_add_filter_bzip2(), archive_write_add_filter_compress(),
-            archive_write_add_filter_grzip(),
-            archive_write_add_filter_gzip(),
-            archive_write_add_filter_lrzip(), archive_write_add_filter_lz4(),
-            archive_write_add_filter_lzip(), archive_write_add_filter_lzma(),
-            archive_write_add_filter_lzop(), archive_write_add_filter_xz(),
+1mDESCRIPTION0m
+     1marchive_write_add_filter_bzip222m(), 1marchive_write_add_filter_compress22m(),
+            1marchive_write_add_filter_grzip22m(),
+            1marchive_write_add_filter_gzip22m(),
+            1marchive_write_add_filter_lrzip22m(), 1marchive_write_add_filter_lz422m(),
+            1marchive_write_add_filter_lzip22m(), 1marchive_write_add_filter_lzma22m(),
+            1marchive_write_add_filter_lzop22m(), 1marchive_write_add_filter_xz22m(),
             The resulting archive will be compressed as specified.  Note that
             the compressed output is always properly blocked.
 
-     archive_write_add_filter_b64encode(),
-            archive_write_add_filter_uuencode(),
+     1marchive_write_add_filter_b64encode22m(),
+            1marchive_write_add_filter_uuencode22m(),
             The output will be encoded as specified.  The encoded output is
             always properly blocked.
 
-     archive_write_add_filter_none()
+     1marchive_write_add_filter_none22m()
             This is never necessary.  It is provided only for backwards com‐
             patibility.
 
-     archive_write_add_filter_program()
+     1marchive_write_add_filter_program22m()
             The archive will be fed into the specified compression program.
             The output of that program is blocked and written to the client
             write callbacks.
 
-RETURN VALUES
-     These functions return ARCHIVE_OK on success, or ARCHIVE_FATAL.
+1mRETURN VALUES0m
+     These functions return 1mARCHIVE_OK 22mon success, or 1mARCHIVE_FATAL22m.
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_write(3), archive_write_format(3),
      archive_write_set_options(3), cpio(5), mtree(5), tar(5)
 
index df42000..68ee1d1 100644 (file)
@@ -1,35 +1,35 @@
 ARCHIVE_WRITE_FINISH_... BSD Library Functions Manual ARCHIVE_WRITE_FINISH_...
 
-NAME
-     archive_write_finish_entry — functions for creating archives
+1mNAME0m
+     1marchive_write_finish_entry 22m— functions for creating archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     int
-     archive_write_finish_entry(struct archive *);
+     4mint0m
+     1marchive_write_finish_entry22m(4mstruct24m 4marchive24m 4m*24m);
 
-DESCRIPTION
+1mDESCRIPTION0m
      Close out the entry just written. In particular, this writes out the
      final padding required by some formats.  Ordinarily, clients never need
-     to call this, as it is called automatically by archive_write_header() and
-     archive_write_close() as needed.
-
-RETURN VALUES
-     This function returns ARCHIVE_OK on success, or one of several non-zero
-     error codes for errors.  Specific error codes include: ARCHIVE_RETRY for
-     operations that might succeed if retried, ARCHIVE_WARN for unusual condi‐
-     tions that do not prevent further operations, and ARCHIVE_FATAL for seri‐
+     to call this, as it is called automatically by 1marchive_write_header22m() and
+     1marchive_write_close22m() as needed.
+
+1mRETURN VALUES0m
+     This function returns 1mARCHIVE_OK 22mon success, or one of several non-zero
+     error codes for errors.  Specific error codes include: 1mARCHIVE_RETRY 22mfor
+     operations that might succeed if retried, 1mARCHIVE_WARN 22mfor unusual condi‐
+     tions that do not prevent further operations, and 1mARCHIVE_FATAL 22mfor seri‐
      ous errors that make remaining operations impossible.
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_write_data(3),
      archive_write_set_options(3), cpio(5), mtree(5), tar(5)
 
index a6bd7a6..7dd6c4f 100644 (file)
 ARCHIVE_WRITE_FORMAT(3)  BSD Library Functions Manual  ARCHIVE_WRITE_FORMAT(3)
 
-NAME
-     archive_write_set_format, archive_write_set_format_7zip,
-     archive_write_set_format_ar, archive_write_set_format_ar_bsd,
-     archive_write_set_format_ar_svr4, archive_write_set_format_by_name,
-     archive_write_set_format_cpio, archive_write_set_format_cpio_newc,
-     archive_write_set_format_filter_by_ext,
-     archive_write_set_format_filter_by_ext_def,
-     archive_write_set_format_gnutar, archive_write_set_format_iso9660,
-     archive_write_set_format_mtree, archive_write_set_format_mtree_classic,
-     archive_write_set_format_mtree_default, archive_write_set_format_pax,
-     archive_write_set_format_pax_restricted, archive_write_set_format_raw,
-     archive_write_set_format_shar, archive_write_set_format_shar_dump,
-     archive_write_set_format_ustar, archive_write_set_format_v7tar,
-     archive_write_set_format_warc, archive_write_set_format_xar,
-     archive_write_set_format_zip, — functions for creating archives
-
-LIBRARY
+1mNAME0m
+     1marchive_write_set_format22m, 1marchive_write_set_format_7zip22m,
+     1marchive_write_set_format_ar22m, 1marchive_write_set_format_ar_bsd22m,
+     1marchive_write_set_format_ar_svr422m, 1marchive_write_set_format_by_name22m,
+     1marchive_write_set_format_cpio22m, 1marchive_write_set_format_cpio_newc22m,
+     1marchive_write_set_format_filter_by_ext22m,
+     1marchive_write_set_format_filter_by_ext_def22m,
+     1marchive_write_set_format_gnutar22m, 1marchive_write_set_format_iso966022m,
+     1marchive_write_set_format_mtree22m, 1marchive_write_set_format_mtree_classic22m,
+     1marchive_write_set_format_mtree_default22m, 1marchive_write_set_format_pax22m,
+     1marchive_write_set_format_pax_restricted22m, 1marchive_write_set_format_raw22m,
+     1marchive_write_set_format_shar22m, 1marchive_write_set_format_shar_dump22m,
+     1marchive_write_set_format_ustar22m, 1marchive_write_set_format_v7tar22m,
+     1marchive_write_set_format_warc22m, 1marchive_write_set_format_xar22m,
+     1marchive_write_set_format_zip22m, — functions for creating archives
+
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     int
-     archive_write_set_format(struct archive *, int code);
+     4mint0m
+     1marchive_write_set_format22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m 4mcode24m);
 
-     int
-     archive_write_set_format_7zip(struct archive *);
+     4mint0m
+     1marchive_write_set_format_7zip22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_ar(struct archive *);
+     4mint0m
+     1marchive_write_set_format_ar22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_ar_bsd(struct archive *);
+     4mint0m
+     1marchive_write_set_format_ar_bsd22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_ar_svr4(struct archive *);
+     4mint0m
+     1marchive_write_set_format_ar_svr422m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_by_name(struct archive *, const char *name);
+     4mint0m
+     1marchive_write_set_format_by_name22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*name24m);
 
-     int
-     archive_write_set_format_cpio(struct archive *);
+     4mint0m
+     1marchive_write_set_format_cpio22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_cpio_newc(struct archive *);
+     4mint0m
+     1marchive_write_set_format_cpio_newc22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_filter_by_ext(struct archive *,
-        const char *filename);
+     4mint0m
+     1marchive_write_set_format_filter_by_ext22m(4mstruct24m 4marchive24m 4m*24m,
+        4mconst24m 4mchar24m 4m*filename24m);
 
-     int
-     archive_write_set_format_filter_by_ext_def(struct archive *,
-        const char *filename, const char *def_ext);
+     4mint0m
+     1marchive_write_set_format_filter_by_ext_def22m(4mstruct24m 4marchive24m 4m*24m,
+        4mconst24m 4mchar24m 4m*filename24m, 4mconst24m 4mchar24m 4m*def_ext24m);
 
-     int
-     archive_write_set_format_gnutar(struct archive *);
+     4mint0m
+     1marchive_write_set_format_gnutar22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_iso9660(struct archive *);
+     4mint0m
+     1marchive_write_set_format_iso966022m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_mtree(struct archive *);
+     4mint0m
+     1marchive_write_set_format_mtree22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_pax(struct archive *);
+     4mint0m
+     1marchive_write_set_format_pax22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_pax_restricted(struct archive *);
+     4mint0m
+     1marchive_write_set_format_pax_restricted22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_raw(struct archive *);
+     4mint0m
+     1marchive_write_set_format_raw22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_shar(struct archive *);
+     4mint0m
+     1marchive_write_set_format_shar22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_shar_dump(struct archive *);
+     4mint0m
+     1marchive_write_set_format_shar_dump22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_ustar(struct archive *);
+     4mint0m
+     1marchive_write_set_format_ustar22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_v7tar(struct archive *);
+     4mint0m
+     1marchive_write_set_format_v7tar22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_warc(struct archive *);
+     4mint0m
+     1marchive_write_set_format_warc22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_xar(struct archive *);
+     4mint0m
+     1marchive_write_set_format_xar22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_set_format_zip(struct archive *);
+     4mint0m
+     1marchive_write_set_format_zip22m(4mstruct24m 4marchive24m 4m*24m);
 
-DESCRIPTION
+1mDESCRIPTION0m
      These functions set the format that will be used for the archive.
 
      The library can write a variety of common archive formats.
 
 
-     archive_write_set_format()
-            Sets the format based on the format code (see archive.h for the
+     1marchive_write_set_format22m()
+            Sets the format based on the format code (see 4marchive.h24m for the
             full list of format codes).  In particular, this can be used in
-            conjunction with archive_format() to create a new archive with
+            conjunction with 1marchive_format22m() to create a new archive with
             the same format as an existing archive.
 
-     archive_write_set_format_by_name()
+     1marchive_write_set_format_by_name22m()
             Sets the corresponding format based on the common name.
 
-     archive_write_set_format_filter_by_ext(),
-            archive_write_set_format_filter_by_ext_def()
+     1marchive_write_set_format_filter_by_ext22m(),
+            1marchive_write_set_format_filter_by_ext_def22m()
             Sets both filters and format based on the output filename.  Sup‐
             ported extensions: .7z, .zip, .jar, .cpio, .iso, .a, .ar, .tar,
             .tgz, .tar.gz, .tar.bz2, .tar.xz
 
-     archive_write_set_format_7zip() archive_write_set_format_ar_bsd(),
-            archive_write_set_format_ar_svr4(),
-            archive_write_set_format_cpio()
-            archive_write_set_format_cpio_newc()
-            archive_write_set_format_gnutar()
-            archive_write_set_format_iso9660()
-            archive_write_set_format_mtree()
-            archive_write_set_format_mtree_classic()
-            archive_write_set_format_pax()
-            archive_write_set_format_pax_restricted()
-            archive_write_set_format_raw() archive_write_set_format_shar()
-            archive_write_set_format_shar_dump()
-            archive_write_set_format_ustar() archive_write_set_format_v7tar()
-            archive_write_set_format_warc() archive_write_set_format_xar()
-            archive_write_set_format_zip()
+     1marchive_write_set_format_7zip22m() 1marchive_write_set_format_ar_bsd22m(),
+            1marchive_write_set_format_ar_svr422m(),
+            1marchive_write_set_format_cpio22m()
+            1marchive_write_set_format_cpio_newc22m()
+            1marchive_write_set_format_gnutar22m()
+            1marchive_write_set_format_iso966022m()
+            1marchive_write_set_format_mtree22m()
+            1marchive_write_set_format_mtree_classic22m()
+            1marchive_write_set_format_pax22m()
+            1marchive_write_set_format_pax_restricted22m()
+            1marchive_write_set_format_raw22m() 1marchive_write_set_format_shar22m()
+            1marchive_write_set_format_shar_dump22m()
+            1marchive_write_set_format_ustar22m() 1marchive_write_set_format_v7tar22m()
+            1marchive_write_set_format_warc22m() 1marchive_write_set_format_xar22m()
+            1marchive_write_set_format_zip22m()
             Set the format as specified.  More details on the formats sup‐
             ported by libarchive can be found in the libarchive-formats(5)
             manual page.
 
-RETURN VALUES
-     These functions return ARCHIVE_OK on success, or ARCHIVE_FATAL.
+1mRETURN VALUES0m
+     These functions return 1mARCHIVE_OK 22mon success, or 1mARCHIVE_FATAL22m.
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_write(3), archive_write_set_options(3),
      cpio(5), libarchive-formats(5), mtree(5), tar(5)
 
index d599ca3..5bb02e0 100644 (file)
@@ -1,57 +1,57 @@
 ARCHIVE_WRITE_FREE(3)   BSD Library Functions Manual    ARCHIVE_WRITE_FREE(3)
 
-NAME
-     archive_write_fail, archive_write_close, archive_write_finish,
-     archive_write_free — functions for creating archives
+1mNAME0m
+     1marchive_write_fail22m, 1marchive_write_close22m, 1marchive_write_finish22m,
+     1marchive_write_free 22m— functions for creating archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     int
-     archive_write_fail(struct archive *);
+     4mint0m
+     1marchive_write_fail22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_close(struct archive *);
+     4mint0m
+     1marchive_write_close22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_finish(struct archive *);
+     4mint0m
+     1marchive_write_finish22m(4mstruct24m 4marchive24m 4m*24m);
 
-     int
-     archive_write_free(struct archive *);
+     4mint0m
+     1marchive_write_free22m(4mstruct24m 4marchive24m 4m*24m);
 
-DESCRIPTION
-     archive_write_fail()
-            Always returns ARCHIVE_FATAL.  This marks the archive object as
+1mDESCRIPTION0m
+     1marchive_write_fail22m()
+            Always returns 1mARCHIVE_FATAL22m.  This marks the archive object as
             being unusable; after calling this function, the only call that
-            can succeed is archive_write_free() to release the resources.
+            can succeed is 1marchive_write_free22m() to release the resources.
             This can be used to speed recovery when the archive creation must
             be aborted.  Note that the created archive is likely to be mal‐
             formed in this case;
 
-     archive_write_close()
+     1marchive_write_close22m()
             Complete the archive and invoke the close callback.
 
-     archive_write_finish()
-            This is a deprecated synonym for archive_write_free().
+     1marchive_write_finish22m()
+            This is a deprecated synonym for 1marchive_write_free22m().
 
-     archive_write_free()
-            Invokes archive_write_close() if necessary, then releases all
+     1marchive_write_free22m()
+            Invokes 1marchive_write_close22m() if necessary, then releases all
             resources.  If you need detailed information about
-            archive_write_close() failures, you should be careful to call it
+            1marchive_write_close22m() failures, you should be careful to call it
             separately, as you cannot obtain error information after
-            archive_write_free() returns.
+            1marchive_write_free22m() returns.
 
-RETURN VALUES
-     These functions return ARCHIVE_OK on success, or ARCHIVE_FATAL.
+1mRETURN VALUES0m
+     These functions return 1mARCHIVE_OK 22mon success, or 1mARCHIVE_FATAL22m.
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_write_set_options(3), cpio(5), mtree(5),
      tar(5)
 
index 4b46433..bbcf8d3 100644 (file)
@@ -1,34 +1,34 @@
 ARCHIVE_WRITE_HEADER(3)  BSD Library Functions Manual  ARCHIVE_WRITE_HEADER(3)
 
-NAME
-     archive_write_header — functions for creating archives
+1mNAME0m
+     1marchive_write_header 22m— functions for creating archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     int
-     archive_write_header(struct archive *, struct archive_entry *);
+     4mint0m
+     1marchive_write_header22m(4mstruct24m 4marchive24m 4m*24m, 4mstruct24m 4marchive_entry24m 4m*24m);
 
-DESCRIPTION
+1mDESCRIPTION0m
      Build and write a header using the data in the provided struct
      archive_entry structure.  See archive_entry(3) for information on creat‐
      ing and populating struct archive_entry objects.
 
-RETURN VALUES
-     This function returns ARCHIVE_OK on success, or one of the following on
-     error: ARCHIVE_RETRY for operations that might succeed if retried,
-     ARCHIVE_WARN for unusual conditions that do not prevent further opera‐
-     tions, and ARCHIVE_FATAL for serious errors that make remaining opera‐
+1mRETURN VALUES0m
+     This function returns 1mARCHIVE_OK 22mon success, or one of the following on
+     error: 1mARCHIVE_RETRY 22mfor operations that might succeed if retried,
+     1mARCHIVE_WARN 22mfor unusual conditions that do not prevent further opera‐
+     tions, and 1mARCHIVE_FATAL 22mfor serious errors that make remaining opera‐
      tions impossible.
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_write_set_options(3), cpio(5), mtree(5),
      tar(5)
 
index 04cfd97..5eef9fa 100644 (file)
@@ -1,25 +1,25 @@
 ARCHIVE_WRITE_NEW(3)    BSD Library Functions Manual     ARCHIVE_WRITE_NEW(3)
 
-NAME
-     archive_write_new — functions for creating archives
+1mNAME0m
+     1marchive_write_new 22m— functions for creating archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     struct archive *
-     archive_write_new(void);
+     4mstruct24m 4marchive24m 4m*0m
+     1marchive_write_new22m(4mvoid24m);
 
-DESCRIPTION
+1mDESCRIPTION0m
      Allocates and initializes a struct archive object suitable for writing a
      tar archive.  NULL is returned on error.
 
      A complete description of the struct archive object can be found in the
      overview manual page for libarchive(3).
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_write(3), archive_write_set_options(3),
      cpio(5), mtree(5), tar(5)
 
index 7341359..ebe78f8 100644 (file)
 ARCHIVE_WRITE_OPEN(3)   BSD Library Functions Manual    ARCHIVE_WRITE_OPEN(3)
 
-NAME
-     archive_write_open, archive_write_open_fd, archive_write_open_FILE,
-     archive_write_open_filename, archive_write_open_memory — functions for
+1mNAME0m
+     1marchive_write_open22m, 1marchive_write_open_fd22m, 1marchive_write_open_FILE22m,
+     1marchive_write_open_filename22m, 1marchive_write_open_memory 22m— functions for
      creating archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     int
-     archive_write_open(struct archive *, void *client_data,
-        archive_open_callback *, archive_write_callback *,
-        archive_close_callback *);
+     4mint0m
+     1marchive_write_open22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid24m 4m*client_data24m,
+        4marchive_open_callback24m 4m*24m, 4marchive_write_callback24m 4m*24m,
+        4marchive_close_callback24m 4m*24m);
 
-     int
-     archive_write_open_fd(struct archive *, int fd);
+     4mint0m
+     1marchive_write_open_fd22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m 4mfd24m);
 
-     int
-     archive_write_open_FILE(struct archive *, FILE *file);
+     4mint0m
+     1marchive_write_open_FILE22m(4mstruct24m 4marchive24m 4m*24m, 4mFILE24m 4m*file24m);
 
-     int
-     archive_write_open_filename(struct archive *, const char *filename);
+     4mint0m
+     1marchive_write_open_filename22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*filename24m);
 
-     int
-     archive_write_open_memory(struct archive *, void *buffer,
-        size_t bufferSize, size_t *outUsed);
+     4mint0m
+     1marchive_write_open_memory22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid24m 4m*buffer24m,
+        4msize_t24m 4mbufferSize24m, 4msize_t24m 4m*outUsed24m);
 
-DESCRIPTION
-     archive_write_open()
+1mDESCRIPTION0m
+     1marchive_write_open22m()
             Freeze the settings, open the archive, and prepare for writing
             entries.  This is the most generic form of this function, which
             accepts pointers to three callback functions which will be
             invoked by the compression layer to write the constructed ar‐
             chive.  This does not alter the default archive padding.
 
-     archive_write_open_fd()
-            A convenience form of archive_write_open() that accepts a file
-            descriptor.  The archive_write_open_fd() function is safe for use
+     1marchive_write_open_fd22m()
+            A convenience form of 1marchive_write_open22m() that accepts a file
+            descriptor.  The 1marchive_write_open_fd22m() function is safe for use
             with tape drives or other block-oriented devices.
 
-     archive_write_open_FILE()
-            A convenience form of archive_write_open() that accepts a FILE *
-            pointer.  Note that archive_write_open_FILE() is not safe for
+     1marchive_write_open_FILE22m()
+            A convenience form of 1marchive_write_open22m() that accepts a 4mFILE24m 4m*0m
+            pointer.  Note that 1marchive_write_open_FILE22m() is not safe for
             writing to tape drives or other devices that require correct
             blocking.
 
-     archive_write_open_file()
-            A deprecated synonym for archive_write_open_filename().
+     1marchive_write_open_file22m()
+            A deprecated synonym for 1marchive_write_open_filename22m().
 
-     archive_write_open_filename()
-            A convenience form of archive_write_open() that accepts a file‐
+     1marchive_write_open_filename22m()
+            A convenience form of 1marchive_write_open22m() that accepts a file‐
             name.  A NULL argument indicates that the output should be writ‐
             ten to standard output; an argument of “-” will open a file with
             that name.  If you have not invoked
-            archive_write_set_bytes_in_last_block(), then
-            archive_write_open_filename() will adjust the last-block padding
+            1marchive_write_set_bytes_in_last_block22m(), then
+            1marchive_write_open_filename22m() will adjust the last-block padding
             depending on the file: it will enable padding when writing to
             standard output or to a character or block device node, it will
             disable padding otherwise.  You can override this by manually
-            invoking archive_write_set_bytes_in_last_block() before calling
-            archive_write_open().  The archive_write_open_filename() function
+            invoking 1marchive_write_set_bytes_in_last_block22m() before calling
+            1marchive_write_open22m().  The 1marchive_write_open_filename22m() function
             is safe for use with tape drives or other block-oriented devices.
 
-     archive_write_open_memory()
-            A convenience form of archive_write_open() that accepts a pointer
+     1marchive_write_open_memory22m()
+            A convenience form of 1marchive_write_open22m() that accepts a pointer
             to a block of memory that will receive the archive.  The final
-            size_t * argument points to a variable that will be updated after
+            4msize_t24m 4m*24m argument points to a variable that will be updated after
             each write to reflect how much of the buffer is currently in use.
             You should be careful to ensure that this variable remains allo‐
             cated until after the archive is closed.  This function will dis‐
             able padding unless you have specifically set the block size.
-     More information about the struct archive object and the overall design
+     More information about the 4mstruct24m 4marchive24m object and the overall design
      of the library can be found in the libarchive(3) overview.
 
      Note that the convenience forms above vary in how they block the output.
      See archive_write_blocksize(3) if you need to control the block size used
      for writes or the end-of-file padding behavior.
 
-CLIENT CALLBACKS
+1mCLIENT CALLBACKS0m
      To use this library, you will need to define and register callback func‐
      tions that will be invoked to write data to the resulting archive.  These
-     functions are registered by calling archive_write_open():
+     functions are registered by calling 1marchive_write_open22m():
 
-          typedef int archive_open_callback(struct archive *, void
-          *client_data)
+          4mtypedef24m 4mint24m 1marchive_open_callback22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid0m
+          4m*client_data24m)
 
-     The open callback is invoked by archive_write_open().  It should return
-     ARCHIVE_OK if the underlying file or data source is successfully opened.
-     If the open fails, it should call archive_set_error() to register an
-     error code and message and return ARCHIVE_FATAL.
+     The open callback is invoked by 1marchive_write_open22m().  It should return
+     1mARCHIVE_OK 22mif the underlying file or data source is successfully opened.
+     If the open fails, it should call 1marchive_set_error22m() to register an
+     error code and message and return 1mARCHIVE_FATAL22m.
 
-          typedef la_ssize_t archive_write_callback(struct archive *,
-          void *client_data, const void *buffer, size_t length)
+          4mtypedef24m 4mla_ssize_t24m 1marchive_write_callback22m(4mstruct24m 4marchive24m 4m*24m,
+          4mvoid24m 4m*client_data24m, 4mconst24m 4mvoid24m 4m*buffer24m, 4msize_t24m 4mlength24m)
 
      The write callback is invoked whenever the library needs to write raw
      bytes to the archive.  For correct blocking, each call to the write call‐
      back function should translate into a single write(2) system call.  This
      is especially critical when writing archives to tape drives.  On success,
      the write callback should return the number of bytes actually written.
-     On error, the callback should invoke archive_set_error() to register an
+     On error, the callback should invoke 1marchive_set_error22m() to register an
      error code and message and return -1.
 
-          typedef int archive_close_callback(struct archive *, void
-          *client_data)
+          4mtypedef24m 4mint24m 1marchive_close_callback22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid0m
+          4m*client_data24m)
 
      The close callback is invoked by archive_close when the archive process‐
-     ing is complete.  The callback should return ARCHIVE_OK on success.  On
-     failure, the callback should invoke archive_set_error() to register an
-     error code and message and return ARCHIVE_FATAL.
+     ing is complete.  The callback should return 1mARCHIVE_OK 22mon success.  On
+     failure, the callback should invoke 1marchive_set_error22m() to register an
+     error code and message and return 1mARCHIVE_FATAL.0m
 
      Note that if the client-provided write callback function returns a non-
      zero value, that error will be propagated back to the caller through
      whatever API function resulted in that call, which may include
-     archive_write_header(), archive_write_data(), archive_write_close(),
-     archive_write_finish(), or archive_write_free().  The client callback can
-     call archive_set_error() to provide values that can then be retrieved by
-     archive_errno() and archive_error_string().
+     1marchive_write_header22m(), 1marchive_write_data22m(), 1marchive_write_close22m(),
+     1marchive_write_finish22m(), or 1marchive_write_free22m().  The client callback can
+     call 1marchive_set_error22m() to provide values that can then be retrieved by
+     1marchive_errno22m() and 1marchive_error_string22m().
 
-RETURN VALUES
-     These functions return ARCHIVE_OK on success, or ARCHIVE_FATAL.
+1mRETURN VALUES0m
+     These functions return 1mARCHIVE_OK 22mon success, or 1mARCHIVE_FATAL22m.
 
-ERRORS
+1mERRORS0m
      Detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_write(3), archive_write_blocksize(3),
      archive_write_filter(3), archive_write_format(3), archive_write_new(3),
      archive_write_set_options(3), cpio(5), mtree(5), tar(5)
index 2a10224..60922c5 100644 (file)
 ARCHIVE_WRITE_OPTIONS(3) BSD Library Functions Manual ARCHIVE_WRITE_OPTIONS(3)
 
-NAME
-     archive_write_set_filter_option, archive_write_set_format_option,
-     archive_write_set_option, archive_write_set_options — functions control‐
+1mNAME0m
+     1marchive_write_set_filter_option22m, 1marchive_write_set_format_option22m,
+     1marchive_write_set_option22m, 1marchive_write_set_options 22m— functions control‐
      ling options for writing archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     int
-     archive_write_set_filter_option(struct archive *, const char *module,
-        const char *option, const char *value);
+1mSYNOPSIS0m
+     4mint0m
+     1marchive_write_set_filter_option22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*module24m,
+        4mconst24m 4mchar24m 4m*option24m, 4mconst24m 4mchar24m 4m*value24m);
 
-     int
-     archive_write_set_format_option(struct archive *, const char *module,
-        const char *option, const char *value);
+     4mint0m
+     1marchive_write_set_format_option22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*module24m,
+        4mconst24m 4mchar24m 4m*option24m, 4mconst24m 4mchar24m 4m*value24m);
 
-     int
-     archive_write_set_option(struct archive *, const char *module,
-        const char *option, const char *value);
+     4mint0m
+     1marchive_write_set_option22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*module24m,
+        4mconst24m 4mchar24m 4m*option24m, 4mconst24m 4mchar24m 4m*value24m);
 
-     int
-     archive_write_set_options(struct archive *, const char *options);
+     4mint0m
+     1marchive_write_set_options22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*options24m);
 
-DESCRIPTION
+1mDESCRIPTION0m
      These functions provide a way for libarchive clients to configure spe‐
      cific write modules.
 
-     archive_write_set_filter_option(), archive_write_set_format_option()
+     1marchive_write_set_filter_option22m(), 1marchive_write_set_format_option22m()
             Specifies an option that will be passed to currently-registered
             filters (including decompression filters) or format readers.
 
-            If option and value are both NULL, these functions will do noth‐
-            ing and ARCHIVE_OK will be returned.  If option is NULL but value
-            is not, these functions will do nothing and ARCHIVE_FAILED will
+            If 4moption24m and 4mvalue24m are both NULL, these functions will do noth‐
+            ing and 1mARCHIVE_OK 22mwill be returned.  If 4moption24m is NULL but 4mvalue0m
+            is not, these functions will do nothing and 1mARCHIVE_FAILED 22mwill
             be returned.
 
-            If module is not NULL, option and value will be provided to the
-            filter or reader named module.  The return value will be either
-            ARCHIVE_OK if the option was successfully handled or ARCHIVE_WARN
+            If 4mmodule24m is not NULL, 4moption24m and 4mvalue24m will be provided to the
+            filter or reader named 4mmodule24m.  The return value will be either
+            1mARCHIVE_OK 22mif the option was successfully handled or 1mARCHIVE_WARN0m
             if the option was unrecognized by the module or could otherwise
-            not be handled.  If there is no such module, ARCHIVE_FAILED will
+            not be handled.  If there is no such module, 1mARCHIVE_FAILED 22mwill
             be returned.
 
-            If module is NULL, option and value will be provided to every
-            registered module.  If any module returns ARCHIVE_FATAL, this
-            value will be returned immediately.  Otherwise, ARCHIVE_OK will
-            be returned if any module accepts the option, and ARCHIVE_FAILED
+            If 4mmodule24m is NULL, 4moption24m and 4mvalue24m will be provided to every
+            registered module.  If any module returns 1mARCHIVE_FATAL22m, this
+            value will be returned immediately.  Otherwise, 1mARCHIVE_OK 22mwill
+            be returned if any module accepts the option, and 1mARCHIVE_FAILED0m
             in all other cases.
 
-     archive_write_set_option()
-            Calls archive_write_set_format_option(), then
-            archive_write_set_filter_option().  If either function returns
-            ARCHIVE_FATAL, ARCHIVE_FATAL will be returned immediately.  Oth‐
+     1marchive_write_set_option22m()
+            Calls 1marchive_write_set_format_option22m(), then
+            1marchive_write_set_filter_option22m().  If either function returns
+            1mARCHIVE_FATAL22m, 1mARCHIVE_FATAL 22mwill be returned immediately.  Oth‐
             erwise, greater of the two values will be returned.
 
-     archive_write_set_options()
-            options is a comma-separated list of options.  If options is NULL
-            or empty, ARCHIVE_OK will be returned immediately.
+     1marchive_write_set_options22m()
+            4moptions24m is a comma-separated list of options.  If 4moptions24m is NULL
+            or empty, 1mARCHIVE_OK 22mwill be returned immediately.
 
             Individual options have one of the following forms:
-            option=value
+            4moption=value0m
                     The option/value pair will be provided to every module.
                     Modules that do not accept an option with this name will
                     ignore it.
-            option  The option will be provided to every module with a value
+            4moption24m  The option will be provided to every module with a value
                     of “1”.
-            !option
+            4m!option0m
                     The option will be provided to every module with a NULL
                     value.
-            module:option=value, module:option, module:!option
+            4mmodule:option=value24m, 4mmodule:option24m, 4mmodule:!option0m
                     As above, but the corresponding option and value will be
-                    provided only to modules whose name matches module.
+                    provided only to modules whose name matches 4mmodule24m.
 
-OPTIONS
+1mOPTIONS0m
      Filter gzip
-            compression-level
+            1mcompression-level0m
                     The value is interpreted as a decimal integer specifying
                     the gzip compression level.
      Filter xz
-            compression-level
+            1mcompression-level0m
                     The value is interpreted as a decimal integer specifying
                     the compression level.
      Format mtree
-            cksum, device, flags, gid, gname, indent, link, md5, mode, nlink,
-                    rmd160, sha1, sha256, sha384, sha512, size, time, uid,
-                    uname
+            1mcksum22m, 1mdevice22m, 1mflags22m, 1mgid22m, 1mgname22m, 1mindent22m, 1mlink22m, 1mmd522m, 1mmode22m, 1mnlink22m,
+                    1mrmd16022m, 1msha122m, 1msha25622m, 1msha38422m, 1msha51222m, 1msize22m, 1mtime22m, 1muid22m,
+                    1muname0m
                     Enable a particular keyword in the mtree output.  Prefix
                     with an exclamation mark to disable the corresponding
                     keyword.  The default is equivalent to “device, flags,
                     gid, gname, link, mode, nlink, size, time, type, uid,
                     uname”.
-            all     Enables all of the above keywords.
-            use-set
-                    Enables generation of /set lines that specify default
+            1mall     22mEnables all of the above keywords.
+            1muse-set0m
+                    Enables generation of 1m/set 22mlines that specify default
                     values for the following files and/or directories.
-            indent  XXX needs explanation XXX
+            1mindent  22mXXX needs explanation XXX
      Format iso9660 - volume metadata
             These options are used to set standard ISO9660 metadata.
-            abstract-file=filename
+            1mabstract-file22m=4mfilename0m
                     The file with the specified name will be identified in
                     the ISO9660 metadata as holding the abstract for this
                     volume.  Default: none.
-            application-id=filename
+            1mapplication-id22m=4mfilename0m
                     The file with the specified name will be identified in
                     the ISO9660 metadata as holding the application identi‐
                     fier for this volume.  Default: none.
-            biblio-file=filename
+            1mbiblio-file22m=4mfilename0m
                     The file with the specified name will be identified in
                     the ISO9660 metadata as holding the bibliography for this
                     volume.  Default: none.
-            copyright-file=filename
+            1mcopyright-file22m=4mfilename0m
                     The file with the specified name will be identified in
                     the ISO9660 metadata as holding the copyright for this
                     volume.  Default: none.
-            publisher=filename
+            1mpublisher22m=4mfilename0m
                     The file with the specified name will be identified in
                     the ISO9660 metadata as holding the publisher information
                     for this volume.  Default: none.
-            volume-id=string
+            1mvolume-id22m=4mstring0m
                     The specified string will be used as the Volume Identi‐
                     fier in the ISO9660 metadata.  It is limited to 32 bytes.
                     Default: none.
      Format iso9660 - boot support
             These options are used to make an ISO9660 image that can be
             directly booted on various systems.
-            boot=filename
+            1mboot22m=4mfilename0m
                     The file matching this name will be used as the El Torito
                     boot image file.
-            boot-catalog=name
+            1mboot-catalog22m=4mname0m
                     The name that will be used for the El Torito boot cata‐
-                    log.  Default: boot.catalog
-            boot-info-table
-                    The boot image file provided by the boot=filename option
+                    log.  Default: 4mboot.catalog0m
+            1mboot-info-table0m
+                    The boot image file provided by the 1mboot22m=4mfilename24m option
                     will be edited with appropriate boot information in bytes
                     8 through 64.  Default: disabled
-            boot-load-seg=hexadecimal-number
+            1mboot-load-seg22m=4mhexadecimal-number0m
                     The load segment for a no-emulation boot image.
-            boot-load-size=decimal-number
+            1mboot-load-size22m=4mdecimal-number0m
                     The number of "virtual" 512-byte sectors to be loaded
                     from a no-emulation boot image.  Some very old BIOSes can
                     only load very small images, setting this value to 4 will
@@ -147,105 +147,105 @@ OPTIONS
                     to load the rest of itself).  This should not be needed
                     unless you are trying to support systems with very old
                     BIOSes.  This defaults to the full size of the image.
-            boot-type=value
+            1mboot-type22m=4mvalue0m
                     Specifies the boot semantics used by the El Torito boot
-                    image: If the value is fd, then the boot image is assumed
-                    to be a bootable floppy image.  If the value is hd, then
+                    image: If the 4mvalue24m is 1mfd22m, then the boot image is assumed
+                    to be a bootable floppy image.  If the 4mvalue24m is 1mhd22m, then
                     the boot image is assumed to be a bootable hard disk
-                    image.  If the value is no-emulation, the boot image is
+                    image.  If the 4mvalue24m is 1mno-emulation22m, the boot image is
                     used without floppy or hard disk emulation.  If the boot
                     image is exactly 1.2MB, 1.44MB, or 2.88MB, then the
-                    default is fd, otherwise the default is no-emulation.
+                    default is 1mfd22m, otherwise the default is 1mno-emulation.0m
      Format iso9660 - filename and size extensions
             Various extensions to the base ISO9660 format.
-            allow-ldots
+            1mallow-ldots0m
                     If enabled, allows filenames to begin with a leading
                     period.  If disabled, filenames that begin with a leading
                     period will have that period replaced by an underscore
                     character in the standard ISO9660 namespace.  This does
                     not impact names stored in the Rockridge or Joliet exten‐
                     sion area.  Default: disabled.
-            allow-lowercase
+            1mallow-lowercase0m
                     If enabled, allows filenames to contain lowercase charac‐
                     ters.  If disabled, filenames will be forced to upper‐
                     case.  This does not impact names stored in the Rockridge
                     or Joliet extension area.  Default: disabled.
-            allow-multidot
+            1mallow-multidot0m
                     If enabled, allows filenames to contain multiple period
                     characters, in violation of the ISO9660 specification.
                     If disabled, additional periods will be converted to
                     underscore characters.  This does not impact names stored
                     in the Rockridge or Joliet extension area.  Default: dis‐
                     abled.
-            allow-period
+            1mallow-period0m
                     If enabled, allows filenames to contain trailing period
                     characters, in violation of the ISO9660 specification.
                     If disabled,trailing periods will be converted to under‐
                     score characters.  This does not impact names stored in
                     the Rockridge or Joliet extension area.  Default: dis‐
                     abled.
-            allow-pvd-lowercase
+            1mallow-pvd-lowercase0m
                     If enabled, the Primary Volume Descriptor may contain
                     lowercase ASCII characters, in violation of the ISO9660
                     specification.  If disabled, characters will be converted
                     to uppercase ASCII.  Default: disabled.
-            allow-sharp-tilde
+            1mallow-sharp-tilde0m
                     If enabled, sharp and tilde characters will be permitted
                     in filenames, in violation if the ISO9660 specification.
                     If disabled, such characters will be converted to under‐
                     score characters.  Default: disabled.
-            allow-vernum
+            1mallow-vernum0m
                     If enabled, version numbers will be included with files.
                     If disabled, version numbers will be suppressed, in vio‐
                     lation of the ISO9660 standard.  This does not impact
                     names stored in the Rockridge or Joliet extension area.
                     Default: enabled.
-            iso-level
+            1miso-level0m
                     This enables support for file size and file name exten‐
                     sions in the core ISO9660 area.  The name extensions
                     specified here do not affect the names stored in the
                     Rockridge or Joliet extension areas.
-                    iso-level=1
+                    1miso-level=10m
                             The most compliant form of ISO9660 image.  File‐
                             names are limited to 8.3 uppercase format, direc‐
                             tory names are limited to 8 uppercase characters,
                             files are limited to 4 GiB, the complete ISO9660
                             image cannot exceed 4 GiB.
-                    iso-level=2
+                    1miso-level=20m
                             Filenames are limited to 30 uppercase characters
                             with a 30-character extension, directory names
                             are limited to 30 characters, files are limited
                             to 4 GiB.
-                    iso-level=3
-                            As with iso-level=2, except that files may exceed
+                    1miso-level=30m
+                            As with 1miso-level=222m, except that files may exceed
                             4 GiB.
-                    iso-level=4
-                            As with iso-level=3, except that filenames may be
+                    1miso-level=40m
+                            As with 1miso-level=322m, except that filenames may be
                             up to 193 characters and may include arbitrary
                             8-bit characters.
-            joliet  Microsoft's Joliet extensions store a completely separate
+            1mjoliet  22mMicrosoft's Joliet extensions store a completely separate
                     set of directory information about each file.  In partic‐
                     ular, this information includes Unicode filenames of up
                     to 255 characters.  Default: enabled.
-            limit-depth
+            1mlimit-depth0m
                     If enabled, libarchive will use directory relocation
                     records to ensure that no pathname exceeds the ISO9660
                     limit of 8 directory levels.  If disabled, no relocation
                     will occur.  Default: enabled.
-            limit-dirs
+            1mlimit-dirs0m
                     If enabled, libarchive will cause an error if there are
                     more than 65536 directories.  If disabled, there is no
                     limit on the number of directories.  Default: enabled
-            pad     If enabled, 300 kiB of zero bytes will be appended to the
+            1mpad     22mIf enabled, 300 kiB of zero bytes will be appended to the
                     end of the archive.  Default: enabled
-            relaxed-filenames
+            1mrelaxed-filenames0m
                     If enabled, all 7-bit ASCII characters are permitted in
                     filenames (except lowercase characters unless
-                    allow-lowercase is also specified).  This violates
+                    1mallow-lowercase 22mis also specified).  This violates
                     ISO9660 standards.  This does not impact names stored in
                     the Rockridge or Joliet extension area.  Default: dis‐
                     abled.
-            rockridge
+            1mrockridge0m
                     The Rockridge extensions store an additional set of
                     POSIX-style file information with each file, including
                     mtime, atime, ctime, permissions, and long filenames with
@@ -258,46 +258,46 @@ OPTIONS
             significant size savings, but requires the reading system to have
             support for these extensions.  These extensions are disabled by
             default.
-            compression-level=number
+            1mcompression-level22m=number
                     The compression level used by the deflate compressor.
                     Ranges from 0 (least effort) to 9 (most effort).
                     Default: 6
-            zisofs  Synonym for zisofs=direct.
-            zisofs=direct
+            1mzisofs  22mSynonym for 1mzisofs=direct22m.
+            1mzisofs=direct0m
                     Compress each file in the archive.  Unlike
-                    zisofs=indirect, this is handled entirely within
+                    1mzisofs=indirect22m, this is handled entirely within
                     libarchive and does not require a separate utility.  For
                     best results, libarchive tests each file and will store
                     the file uncompressed if the compression does not actu‐
                     ally save any space.  In particular, files under 2k will
                     never be compressed.  Note that boot image files are
                     never compressed.
-            zisofs=indirect
+            1mzisofs=indirect0m
                     Recognizes files that have already been compressed with
-                    the mkzftree utility and sets up the necessary file meta‐
+                    the 1mmkzftree 22mutility and sets up the necessary file meta‐
                     data so that readers will correctly identify these as
                     zisofs-compressed files.
-            zisofs-exclude=filename
+            1mzisofs-exclude22m=4mfilename0m
                     Specifies a filename that should not be compressed when
-                    using zisofs=direct.  This option can be provided multi‐
+                    using 1mzisofs=direct22m.  This option can be provided multi‐
                     ple times to suppress compression on many files.
      Format zip
-            compression
+            1mcompression0m
                     The value is either “store” or “deflate” to indicate how
                     the following entries should be compressed.  Note that
                     this setting is ignored for directories, symbolic links,
                     and other special entries.
-            experimental
+            1mexperimental0m
                     This boolean option enables or disables experimental Zip
                     features that may not be compatible with other Zip imple‐
                     mentations.
-            fakecrc32
+            1mfakecrc320m
                     This boolean option disables CRC calculations.  All CRC
                     fields are set to zero.  It should not be used except for
                     testing purposes.
-            hdrcharset
+            1mhdrcharset0m
                     This sets the character set used for filenames.
-            zip64   Zip64 extensions provide additional file size information
+            1mzip64   22mZip64 extensions provide additional file size information
                     for entries larger than 4 GiB.  They also provide
                     extended file offset and archive size information when
                     archives exceed 4 GiB.  By default, the Zip writer selec‐
@@ -311,7 +311,7 @@ OPTIONS
                     erwise require them.  This is primarily useful for test‐
                     ing.
 
-                    Disabling this option with !zip64 will force the Zip
+                    Disabling this option with 1m!zip64 22mwill force the Zip
                     writer to avoid Zip64 extensions: It will reject files
                     with size greater than 4 GiB, it will reject any new
                     entries once the total archive size reaches 4 GiB, and it
@@ -320,10 +320,10 @@ OPTIONS
                     generating archives where the entry sizes are not known
                     in advance.
 
-EXAMPLES
+1mEXAMPLES0m
      The following example creates an archive write handle to create a gzip-
      compressed ISO9660 format image.  The two options here specify that the
-     ISO9660 archive will use kernel.img as the boot image for El Torito boot‐
+     ISO9660 archive will use 4mkernel.img24m as the boot image for El Torito boot‐
      ing, and that the gzip compressor should use the maximum compression
      level.
 
@@ -333,19 +333,19 @@ EXAMPLES
           archive_write_set_options(a, "boot=kernel.img,compression=9");
           archive_write_open_filename(a, filename, blocksize);
 
-ERRORS
+1mERRORS0m
      More detailed error codes and textual descriptions are available from the
-     archive_errno() and archive_error_string() functions.
+     1marchive_errno22m() and 1marchive_error_string22m() functions.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_read_set_options(3), archive_write(3)
 
-HISTORY
-     The libarchive library first appeared in FreeBSD 5.3.
+1mHISTORY0m
+     The 1mlibarchive 22mlibrary first appeared in FreeBSD 5.3.
 
-AUTHORS
+1mAUTHORS0m
      The options support for libarchive was originally implemented by
      Michihiro NAKAJIMA.
 
-BUGS
+1mBUGS0m
 BSD                           February 2, 2012                            BSD
index 75f5cb9..1cccccd 100644 (file)
@@ -1,35 +1,35 @@
 ARCHIVE_WRITE_SET_PAS... BSD Library Functions Manual ARCHIVE_WRITE_SET_PAS...
 
-NAME
-     archive_write_set_passphrase, archive_write_set_passphrase_callback 
+1mNAME0m
+     1marchive_write_set_passphrase22m, 1marchive_write_set_passphrase_callback 22m
      functions for writing encrypted archives
 
-LIBRARY
+1mLIBRARY0m
      Streaming Archive Library (libarchive, -larchive)
 
-SYNOPSIS
-     #include <archive.h>
+1mSYNOPSIS0m
+     1m#include <archive.h>0m
 
-     int
-     archive_write_set_passphrase(struct archive *, const char *passphrase);
+     4mint0m
+     1marchive_write_set_passphrase22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*passphrase24m);
 
-     int
-     archive_write_set_passphrase_callback(struct archive *,
-        void *client_data, archive_passphrase_callback *);
+     4mint0m
+     1marchive_write_set_passphrase_callback22m(4mstruct24m 4marchive24m 4m*24m,
+        4mvoid24m 4m*client_data24m, 4marchive_passphrase_callback24m 4m*24m);
 
-DESCRIPTION
-     archive_write_set_passphrase()
+1mDESCRIPTION0m
+     1marchive_write_set_passphrase22m()
             Set a passphrase for writing an encryption archive.  If
-            passphrase is NULL or empty, this function will do nothing and
-            ARCHIVE_FAILED will be returned.  Otherwise, ARCHIVE_OK will be
+            4mpassphrase24m is NULL or empty, this function will do nothing and
+            1mARCHIVE_FAILED 22mwill be returned.  Otherwise, 1mARCHIVE_OK 22mwill be
             returned.
 
-     archive_write_set_passphrase_callback()
+     1marchive_write_set_passphrase_callback22m()
             Register callback function that will be invoked to get a
             passphrase for encrption if the passphrase was not set by the
-            archive_write_set_passphrase() function.
+            1marchive_write_set_passphrase22m() function.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), libarchive(3), archive_write(3), archive_write_set_options(3)
 
 BSD                          September 21, 2014                           BSD
index 15920c0..03c9ff9 100644 (file)
 CPIO(1)                  BSD General Commands Manual                  CPIO(1)
 
-NAME
-     cpio — copy files to and from archives
+1mNAME0m
+     1mcpio 22m— copy files to and from archives
 
-SYNOPSIS
-     cpio -i [options] [pattern ...] [< archive]
-     cpio -o [options] < name-list [> archive]
-     cpio -p [options] dest-dir < name-list
+1mSYNOPSIS0m
+     1mcpio -i 22m[4moptions24m] [4mpattern24m 4m...24m] [4m<24m 4marchive24m]
+     1mcpio -o 22m[4moptions24m] 4m<24m 4mname-list24m [4m>24m 4marchive24m]
+     1mcpio -p 22m[4moptions24m] 4mdest-dir24m 4m<24m 4mname-list0m
 
-DESCRIPTION
-     cpio copies files between archives and directories.  This implementation
+1mDESCRIPTION0m
+     1mcpio 22mcopies files between archives and directories.  This implementation
      can extract from tar, pax, cpio, zip, jar, ar, and ISO 9660 cdrom images
      and can create tar, pax, cpio, ar, and shar archives.
 
-     The first option to cpio is a mode indicator from the following list:
-     -i      Input.  Read an archive from standard input (unless overridden)
-            and extract the contents to disk or (if the -t option is speci‐
+     The first option to 1mcpio 22mis a mode indicator from the following list:
+     1m-i      22mInput.  Read an archive from standard input (unless overridden)
+            and extract the contents to disk or (if the 1m-t 22moption is speci‐
             fied) list the contents to standard output.  If one or more file
             patterns are specified, only files matching one of the patterns
             will be extracted.
-     -o      Output.  Read a list of filenames from standard input and produce
+     1m-o      22mOutput.  Read a list of filenames from standard input and produce
             a new archive on standard output (unless overridden) containing
             the specified items.
-     -p      Pass-through.  Read a list of filenames from standard input and
+     1m-p      22mPass-through.  Read a list of filenames from standard input and
             copy the files to the specified directory.
 
-OPTIONS
+1mOPTIONS0m
      Unless specifically stated otherwise, options are applicable in all oper‐
      ating modes.
 
-     -0, --null
+     1m-022m, 1m--null0m
             Read filenames separated by NUL characters instead of newlines.
             This is necessary if any of the filenames being read might con‐
             tain newlines.
 
-     -A      (o mode only) Append to the specified archive.  (Not yet imple‐
+     1m-A      22m(o mode only) Append to the specified archive.  (Not yet imple‐
             mented.)
 
-     -a      (o and p modes) Reset access times on files after they are read.
+     1m-a      22m(o and p modes) Reset access times on files after they are read.
 
-     -B      (o mode only) Block output to records of 5120 bytes.
+     1m-B      22m(o mode only) Block output to records of 5120 bytes.
 
-     -C size
-            (o mode only) Block output to records of size bytes.
+     1m-C 4m22msize0m
+            (o mode only) Block output to records of 4msize24m bytes.
 
-     -c      (o mode only) Use the old POSIX portable character format.
-            Equivalent to --format odc.
+     1m-c      22m(o mode only) Use the old POSIX portable character format.
+            Equivalent to 1m--format 4m22modc24m.
 
-     -d, --make-directories
+     1m-d22m, 1m--make-directories0m
             (i and p modes) Create directories as necessary.
 
-     -E file
-            (i mode only) Read list of file name patterns from file to list
+     1m-E 4m22mfile0m
+            (i mode only) Read list of file name patterns from 4mfile24m to list
             and extract.
 
-     -F file, --file file
-            Read archive from or write archive to file.
+     1m-F 4m22mfile24m, 1m--file 4m22mfile0m
+            Read archive from or write archive to 4mfile24m.
 
-     -f pattern
-            (i mode only) Ignore files that match pattern.
+     1m-f 4m22mpattern0m
+            (i mode only) Ignore files that match 4mpattern24m.
 
-     -H format, --format format
+     1m-H 4m22mformat24m, 1m--format 4m22mformat0m
             (o mode only) Produce the output archive in the specified format.
             Supported formats include:
 
-            cpio     Synonym for odc.
-            newc     The SVR4 portable cpio format.
-            odc      The old POSIX.1 portable octet-oriented cpio format.
-            pax      The POSIX.1 pax format, an extension of the ustar for‐
+            4mcpio24m     Synonym for 4modc24m.
+            4mnewc24m     The SVR4 portable cpio format.
+            4modc24m      The old POSIX.1 portable octet-oriented cpio format.
+            4mpax24m      The POSIX.1 pax format, an extension of the ustar for‐
                      mat.
-            ustar    The POSIX.1 tar format.
+            4mustar24m    The POSIX.1 tar format.
 
-            The default format is odc.  See libarchive-formats(5) for more
+            The default format is 4modc24m.  See libarchive-formats(5) for more
             complete information about the formats currently supported by the
             underlying libarchive(3) library.
 
-     -h, --help
+     1m-h22m, 1m--help0m
             Print usage information.
 
-     -I file
-            Read archive from file.
+     1m-I 4m22mfile0m
+            Read archive from 4mfile24m.
 
-     -i, --extract
+     1m-i22m, 1m--extract0m
             Input mode.  See above for description.
 
-     --insecure
+     1m--insecure0m
             (i and p mode only) Disable security checks during extraction or
             copying.  This allows extraction via symbolic links, absolute
             paths, and path names containing ‘..’ in the name.
 
-     -J, --xz
+     1m-J22m, 1m--xz0m
             (o mode only) Compress the file with xz-compatible compression
             before writing it.  In input mode, this option is ignored; xz
             compression is recognized automatically on input.
 
-     -j      Synonym for -y.
+     1m-j      22mSynonym for 1m-y22m.
 
-     -L      (o and p modes) All symbolic links will be followed.  Normally,
+     1m-L      22m(o and p modes) All symbolic links will be followed. Normally,
             symbolic links are archived and copied as symbolic links.  With
             this option, the target of the link will be archived or copied
             instead.
 
-     -l, --link
+     1m-l22m, 1m--link0m
             (p mode only) Create links from the target directory to the orig‐
             inal files, instead of copying.
 
-     --lrzip
+     1m--lrzip0m
             (o mode only) Compress the resulting archive with lrzip(1).  In
             input mode, this option is ignored.
 
-     --lz4   (o mode only) Compress the archive with lz4-compatible compres‐
+     1m--lz4   22m(o mode only) Compress the archive with lz4-compatible compres‐
             sion before writing it.  In input mode, this option is ignored;
             lz4 compression is recognized automatically on input.
 
-     --lzma  (o mode only) Compress the file with lzma-compatible compression
+     1m--lzma  22m(o mode only) Compress the file with lzma-compatible compression
             before writing it.  In input mode, this option is ignored; lzma
             compression is recognized automatically on input.
 
-     --lzop  (o mode only) Compress the resulting archive with lzop(1).  In
+     1m--lzop  22m(o mode only) Compress the resulting archive with lzop(1).  In
             input mode, this option is ignored.
 
-     --passphrase passphrase
-            The passphrase is used to extract or create an encrypted archive.
-            Currently, zip is only a format that cpio can handle encrypted
+     1m--passphrase 4m22mpassphrase0m
+            The 4mpassphrase24m is used to extract or create an encrypted archive.
+            Currently, zip is only a format that 1mcpio 22mcan handle encrypted
             archives.  You shouldn't use this option unless you realize how
             insecure use of this option is.
 
-     -m, --preserve-modification-time
+     1m-m22m, 1m--preserve-modification-time0m
             (i and p modes) Set file modification time on created files to
             match those in the source.
 
-     -n, --numeric-uid-gid
-            (i mode, only with -t) Display numeric uid and gid.  By default,
-            cpio displays the user and group names when they are provided in
+     1m-n22m, 1m--numeric-uid-gid0m
+            (i mode, only with 1m-t22m) Display numeric uid and gid.  By default,
+            1mcpio 22mdisplays the user and group names when they are provided in
             the archive, or looks up the user and group names in the system
             password database.
 
-     --no-preserve-owner
+     1m--no-preserve-owner0m
             (i mode only) Do not attempt to restore file ownership.  This is
             the default when run by non-root users.
 
-     -O file
-            Write archive to file.
+     1m-O 4m22mfile0m
+            Write archive to 4mfile24m.
 
-     -o, --create
+     1m-o22m, 1m--create0m
             Output mode.  See above for description.
 
-     -p, --pass-through
+     1m-p22m, 1m--pass-through0m
             Pass-through mode.  See above for description.
 
-     --preserve-owner
+     1m--preserve-owner0m
             (i mode only) Restore file ownership.  This is the default when
             run by the root user.
 
-     --quiet
+     1m--quiet0m
             Suppress unnecessary messages.
 
-     -R [user][:][group], --owner [user][:][group]
+     1m-R 22m[user][:][group], 1m--owner 22m[user][:][group]
             Set the owner and/or group on files in the output.  If group is
-            specified with no user (for example, -R :wheel) then the group
+            specified with no user (for example, 1m-R 4m22m:wheel24m) then the group
             will be set but not the user.  If the user is specified with a
-            trailing colon and no group (for example, -R root:) then the
+            trailing colon and no group (for example, 1m-R 4m22mroot:24m) then the
             group will be set to the user's default group.  If the user is
             specified with no trailing colon, then the user will be set but
-            not the group.  In -i and -p modes, this option can only be used
+            not the group.  In 1m-i 22mand 1m-p 22mmodes, this option can only be used
             by the super-user.  (For compatibility, a period can be used in
             place of the colon.)
 
-     -r      (All modes.)  Rename files interactively. For each file, a
-            prompt is written to /dev/tty containing the name of the file and
-            a line is read from /dev/tty.  If the line read is blank, the
+     1m-r      22m(All modes.) Rename files interactively.  For each file, a
+            prompt is written to 4m/dev/tty24m containing the name of the file and
+            a line is read from 4m/dev/tty24m.  If the line read is blank, the
             file is skipped.  If the line contains a single period, the file
             is processed normally.  Otherwise, the line is taken to be the
             new name of the file.
 
-     -t, --list
+     1m-t22m, 1m--list0m
             (i mode only) List the contents of the archive to stdout; do not
             restore the contents to disk.
 
-     -u, --unconditional
+     1m-u22m, 1m--unconditional0m
             (i and p modes) Unconditionally overwrite existing files.  Ordi‐
             narily, an older file will not overwrite a newer file on disk.
 
-     -V, --dot
+     1m-V22m, 1m--dot0m
             Print a dot to stderr for each file as it is processed.  Super‐
-            seded by -v.
+            seded by 1m-v22m.
 
-     -v, --verbose
+     1m-v22m, 1m--verbose0m
             Print the name of each file to stderr as it is processed.  With
-            -t, provide a detailed listing of each file.
+            1m-t22m, provide a detailed listing of each file.
 
-     --version
+     1m--version0m
             Print the program version information and exit.
 
-     -y      (o mode only) Compress the archive with bzip2-compatible compres‐
+     1m-y      22m(o mode only) Compress the archive with bzip2-compatible compres‐
             sion before writing it.  In input mode, this option is ignored;
             bzip2 compression is recognized automatically on input.
 
-     -Z      (o mode only) Compress the archive with compress-compatible com‐
+     1m-Z      22m(o mode only) Compress the archive with compress-compatible com‐
             pression before writing it.  In input mode, this option is
             ignored; compression is recognized automatically on input.
 
-     -z      (o mode only) Compress the archive with gzip-compatible compres‐
+     1m-z      22m(o mode only) Compress the archive with gzip-compatible compres‐
             sion before writing it.  In input mode, this option is ignored;
             gzip compression is recognized automatically on input.
 
-EXIT STATUS
-     The cpio utility exits 0 on success, and >0 if an error occurs.
+1mEXIT STATUS0m
+     The 1mcpio 22mutility exits 0 on success, and >0 if an error occurs.
 
-ENVIRONMENT
-     The following environment variables affect the execution of cpio:
+1mENVIRONMENT0m
+     The following environment variables affect the execution of 1mcpio22m:
 
      LANG      The locale to use.  See environ(7) for more information.
 
      TZ        The timezone to use when displaying dates.  See environ(7) for
                more information.
 
-EXAMPLES
-     The cpio command is traditionally used to copy file hierarchies in con‐
+1mEXAMPLES0m
+     The 1mcpio 22mcommand is traditionally used to copy file hierarchies in con‐
      junction with the find(1) command.  The first example here simply copies
-     all files from src to dest:
-          find src | cpio -pmud dest
+     all files from 4msrc24m to 4mdest24m:
+          1mfind 4m22msrc24m | 1mcpio -pmud 4m22mdest0m
 
      By carefully selecting options to the find(1) command and combining it
      with other standard utilities, it is possible to exercise very fine con‐
      trol over which files are copied. This next example copies files from
-     src to dest that are more than 2 days old and whose names match a partic‐
+     4msrc24m to 4mdest24m that are more than 2 days old and whose names match a partic‐
      ular pattern:
-          find src -mtime +2 | grep foo[bar] | cpio -pdmu dest
+          1mfind 4m22msrc24m 1m-mtime 4m22m+224m | 1mgrep foo[bar] 22m| 1mcpio -pdmu 4m22mdest0m
 
-     This example copies files from src to dest that are more than 2 days old
+     This example copies files from 4msrc24m to 4mdest24m that are more than 2 days old
      and which contain the word “foobar”:
-          find src -mtime +2 | xargs grep -l foobar | cpio -pdmu dest
+          1mfind 4m22msrc24m 1m-mtime 4m22m+224m | 1mxargs grep -l foobar 22m| 1mcpio -pdmu 4m22mdest0m
 
-COMPATIBILITY
+1mCOMPATIBILITY0m
      The mode options i, o, and p and the options a, B, c, d, f, l, m, r, t,
      u, and v comply with SUSv2.
 
-     The old POSIX.1 standard specified that only -i, -o, and -p were inter‐
+     The old POSIX.1 standard specified that only 1m-i22m, 1m-o22m, and 1m-p 22mwere inter‐
      preted as command-line options.  Each took a single argument of a list of
-     modifier characters.  For example, the standard syntax allows -imu but
-     does not support -miu or -i -m -u, since m and u are only modifiers to
-     -i, they are not command-line options in their own right. The syntax
+     modifier characters.  For example, the standard syntax allows 1m-imu 22mbut
+     does not support 1m-miu 22mor 1m-i -m -u22m, since 4mm24m and 4mu24m are only modifiers to
+     1m-i22m, they are not command-line options in their own right.  The syntax
      supported by this implementation is backwards-compatible with the stan‐
      dard.  For best compatibility, scripts should limit themselves to the
      standard syntax.
 
-SEE ALSO
+1mSEE ALSO0m
      bzip2(1), tar(1), gzip(1), mt(1), pax(1), libarchive(3), cpio(5),
      libarchive-formats(5), tar(5)
 
-STANDARDS
+1mSTANDARDS0m
      There is no current POSIX standard for the cpio command; it appeared in
      ISO/IEC 9945-1:1996 (“POSIX.1”) but was dropped from IEEE Std 1003.1-2001
      (“POSIX.1”).
@@ -258,17 +258,17 @@ STANDARDS
      The cpio, ustar, and pax interchange file formats are defined by IEEE Std
      1003.1-2001 (“POSIX.1”) for the pax command.
 
-HISTORY
-     The original cpio and find utilities were written by Dick Haight while
+1mHISTORY0m
+     The original 1mcpio 22mand 1mfind 22mutilities were written by Dick Haight while
      working in AT&T's Unix Support Group.  They first appeared in 1977 in
      PWB/UNIX 1.0, the “Programmer's Work Bench” system developed for use
      within AT&T.  They were first released outside of AT&T as part of System
-     III Unix in 1981. As a result, cpio actually predates tar, even though
+     III Unix in 1981. As a result, 1mcpio 22mactually predates 1mtar22m, even though
      it was not well-known outside of AT&T until some time later.
 
      This is a complete re-implementation based on the libarchive(3) library.
 
-BUGS
+1mBUGS0m
      The cpio archive format has several basic limitations: It does not store
      user and group names, only numbers.  As a result, it cannot be reliably
      used to transfer files between systems with dissimilar user and group
index 94b949a..971cedd 100644 (file)
@@ -1,16 +1,16 @@
 TAR(1)                   BSD General Commands Manual                   TAR(1)
 
-NAME
-     tar — manipulate tape archives
+1mNAME0m
+     1mtar 22m— manipulate tape archives
 
-SYNOPSIS
-     tar [bundled-flags ⟨args⟩] [⟨file⟩ | ⟨pattern⟩ ...]
-     tar {-c} [options] [files | directories]
-     tar {-r | -u} -f archive-file [options] [files | directories]
-     tar {-t | -x} [options] [patterns]
+1mSYNOPSIS0m
+     1mtar 22m[4mbundled-flags24m ⟨args⟩] [⟨4mfile24m⟩ | ⟨4mpattern24m⟩ ...]
+     1mtar 22m{1m-c22m} [4moptions24m] [4mfiles24m | 4mdirectories24m]
+     1mtar 22m{1m-r 22m| 1m-u22m} 1m-f 4m22marchive-file24m [4moptions24m] [4mfiles24m | 4mdirectories24m]
+     1mtar 22m{1m-t 22m| 1m-x22m} [4moptions24m] [4mpatterns24m]
 
-DESCRIPTION
-     tar creates and manipulates streaming archive files.  This implementation
+1mDESCRIPTION0m
+     1mtar 22mcreates and manipulates streaming archive files. This implementation
      can extract from tar, pax, cpio, zip, jar, ar, xar, rpm, 7-zip, and ISO
      9660 cdrom images and can create tar, pax, cpio, ar, zip, 7-zip, and shar
      archives.
@@ -20,24 +20,24 @@ DESCRIPTION
      BILITY below for details.
 
      The other synopsis forms show the preferred usage.  The first option to
-     tar is a mode indicator from the following list:
-     -c      Create a new archive containing the specified items.  The long
-            option form is --create.
-     -r      Like -c, but new entries are appended to the archive.  Note that
+     1mtar 22mis a mode indicator from the following list:
+     1m-c      22mCreate a new archive containing the specified items. The long
+            option form is 1m--create22m.
+     1m-r      22mLike 1m-c22m, but new entries are appended to the archive.  Note that
             this only works on uncompressed archives stored in regular files.
-            The -f option is required.  The long option form is --append.
-     -t      List archive contents to stdout.  The long option form is --list.
-     -u      Like -r, but new entries are added only if they have a modifica‐
+            The 1m-f 22moption is required.  The long option form is 1m--append22m.
+     1m-t      22mList archive contents to stdout.  The long option form is 1m--list22m.
+     1m-u      22mLike 1m-r22m, but new entries are added only if they have a modifica‐
             tion date newer than the corresponding entry in the archive.
             Note that this only works on uncompressed archives stored in reg‐
-            ular files.  The -f option is required.  The long form is
-            --update.
-     -x      Extract to disk from the archive. If a file with the same name
+            ular files.  The 1m-f 22moption is required.  The long form is
+            1m--update22m.
+     1m-x      22mExtract to disk from the archive.  If a file with the same name
             appears more than once in the archive, each copy will be
             extracted, with later copies overwriting (replacing) earlier
-            copies.  The long option form is --extract.
+            copies.  The long option form is 1m--extract22m.
 
-     In -c, -r, or -u mode, each specified file or directory is added to the
+     In 1m-c22m, 1m-r22m, or 1m-u 22mmode, each specified file or directory is added to the
      archive in the order specified on the command line.  By default, the con‐
      tents of each directory are also archived.
 
@@ -46,75 +46,84 @@ DESCRIPTION
      line indicate which items in the archive should be processed.  Patterns
      are shell-style globbing patterns as documented in tcsh(1).
 
-OPTIONS
+1mOPTIONS0m
      Unless specifically stated otherwise, options are applicable in all oper‐
      ating modes.
 
-     @archive
-            (c and r mode only) The specified archive is opened and the
+     1m@4m22marchive0m
+            (c and r modes only) The specified archive is opened and the
             entries in it will be appended to the current archive.  As a sim‐
             ple example,
-                  tar -c -f - newfile @original.tar
-            writes a new archive to standard output containing a file newfile
-            and all of the entries from original.tar.  In contrast,
-                  tar -c -f - newfile original.tar
+                  1mtar -c -f 4m22m-24m 4mnewfile24m 1m@4m22moriginal.tar0m
+            writes a new archive to standard output containing a file 4mnewfile0m
+            and all of the entries from 4moriginal.tar24m.  In contrast,
+                  1mtar -c -f 4m22m-24m 4mnewfile24m 4moriginal.tar0m
             creates a new archive with only two entries.  Similarly,
-                  tar -czf - --format pax @-
+                  1mtar -czf 4m22m-24m 1m--format pax @4m22m-0m
             reads an archive from standard input (whose format will be deter‐
             mined automatically) and converts it into a gzip-compressed pax-
-            format archive on stdout.  In this way, tar can be used to con‐
+            format archive on stdout.  In this way, 1mtar 22mcan be used to con‐
             vert archives from one format to another.
 
-     -a, --auto-compress
+     1m-a22m, 1m--auto-compress0m
             (c mode only) Use the archive suffix to decide a set of the for‐
             mat and the compressions.  As a simple example,
-                  tar -a -cf archive.tgz source.c source.h
+                  1mtar -a -cf 4m22marchive.tgz24m 4msource.c24m 4msource.h0m
             creates a new archive with restricted pax format and gzip com‐
             pression,
-                  tar -a -cf archive.tar.bz2.uu source.c source.h
+                  1mtar -a -cf 4m22marchive.tar.bz2.uu24m 4msource.c24m 4msource.h0m
             creates a new archive with restricted pax format and bzip2 com‐
             pression and uuencode compression,
-                  tar -a -cf archive.zip source.c source.h
+                  1mtar -a -cf 4m22marchive.zip24m 4msource.c24m 4msource.h0m
             creates a new archive with zip format,
-                  tar -a -jcf archive.tgz source.c source.h
+                  1mtar -a -jcf 4m22marchive.tgz24m 4msource.c24m 4msource.h0m
             ignores the “-j” option, and creates a new archive with
             restricted pax format and gzip compression,
-                  tar -a -jcf archive.xxx source.c source.h
+                  1mtar -a -jcf 4m22marchive.xxx24m 4msource.c24m 4msource.h0m
             if it is unknown suffix or no suffix, creates a new archive with
             restricted pax format and bzip2 compression.
 
-     -B, --read-full-blocks
+     1m--acls  22m(c, r, u, x modes only) Archive or extract POSIX.1e or NFSv4
+            ACLs. This is the reverse of 1m--no-acls 22mand the default behavior
+            in c, r, and u modes (except Mac OS X) or if 1mtar 22mis run in x mode
+            as root. On Mac OS X this option translates extended ACLs to
+            NFSv4 ACLs. To store extended ACLs the 1m--mac-metadata 22moption is
+            preferred.
+
+     1m-B22m, 1m--read-full-blocks0m
             Ignored for compatibility with other tar(1) implementations.
 
-     -b blocksize, --block-size blocksize
+     1m-b 4m22mblocksize24m, 1m--block-size 4m22mblocksize0m
             Specify the block size, in 512-byte records, for tape drive I/O.
             As a rule, this argument is only needed when reading from or
             writing to tape drives, and usually not even then as the default
             block size of 20 records (10240 bytes) is very common.
 
-     -C directory, --cd directory, --directory directory
+     1m-C 4m22mdirectory24m, 1m--cd 4m22mdirectory24m, 1m--directory 4m22mdirectory0m
             In c and r mode, this changes the directory before adding the
             following files.  In x mode, change directories after opening the
             archive but before extracting entries from the archive.
 
-     --chroot
-            (x mode only) chroot() to the current directory after processing
-            any -C options and before extracting any files.
+     1m--chroot0m
+            (x mode only) 1mchroot22m() to the current directory after processing
+            any 1m-C 22moptions and before extracting any files.
 
-     --clear-nochange-fflags
+     1m--clear-nochange-fflags0m
             (x mode only) Before removing file system objects to replace
             them, clear platform-specific file flags that might prevent
             removal.
 
-     --disable-copyfile
-            Mac OS X specific.  Disable the use of copyfile(3).
-
-     --exclude pattern
+     1m--exclude 4m22mpattern0m
             Do not process files or directories that match the specified pat‐
             tern.  Note that exclusions take precedence over patterns or
             filenames specified on the command line.
 
-     --format format
+     1m--fflags0m
+            (c, r, u, x modes only) Archive or extract file flags. This is
+            the reverse of 1m--no-fflags 22mand the default behavior in c, r, and
+            u modes or if 1mtar 22mis run in x mode as root.
+
+     1m--format 4m22mformat0m
             (c, r, u mode only) Use the specified format for the created ar‐
             chive.  Supported formats include “cpio”, “pax”, “shar”, and
             “ustar”.  Other formats may also be supported; see
@@ -123,310 +132,343 @@ OPTIONS
             chive, the format specified here must be compatible with the for‐
             mat of the existing archive on disk.
 
-     -f file, --file file
+     1m-f 4m22mfile24m, 1m--file 4m22mfile0m
             Read the archive from or write the archive to the specified file.
-            The filename can be - for standard input or standard output.  The
-            default varies by system; on FreeBSD, the default is /dev/sa0; on
-            Linux, the default is /dev/st0.
+            The filename can be 4m-24m for standard input or standard output.  The
+            default varies by system; on FreeBSD, the default is 4m/dev/sa024m; on
+            Linux, the default is 4m/dev/st024m.
 
-     --gid id
+     1m--gid 4m22mid0m
             Use the provided group id number.  On extract, this overrides the
             group id in the archive; the group name in the archive will be
             ignored.  On create, this overrides the group id read from disk;
-            if --gname is not also specified, the group name will be set to
+            if 1m--gname 22mis not also specified, the group name will be set to
             match the group id.
 
-     --gname name
+     1m--gname 4m22mname0m
             Use the provided group name.  On extract, this overrides the
             group name in the archive; if the provided group name does not
             exist on the system, the group id (from the archive or from the
-            --gid option) will be used instead.  On create, this sets the
+            1m--gid 22moption) will be used instead.  On create, this sets the
             group name that will be stored in the archive; the name will not
             be verified against the system group database.
 
-     -H      (c and r mode only) Symbolic links named on the command line will
-            be followed; the target of the link will be archived, not the
-            link itself.
+     1m-H      22m(c and r modes only) Symbolic links named on the command line
+            will be followed; the target of the link will be archived, not
+            the link itself.
 
-     -h      (c and r mode only) Synonym for -L.
+     1m-h      22m(c and r modes only) Synonym for 1m-L22m.
 
-     -I      Synonym for -T.
+     1m-I      22mSynonym for 1m-T22m.
 
-     --help  Show usage.
+     1m--help  22mShow usage.
 
-     --hfsCompression
-            (x mode only) Mac OS X specific(v10.6 or later). Compress
+     1m--hfsCompression0m
+            (x mode only) Mac OS X specific (v10.6 or later). Compress
             extracted regular files with HFS+ compression.
 
-     --ignore-zeros
-            An alias of --options read_concatenated_archives for compatibil‐
+     1m--ignore-zeros0m
+            An alias of 1m--options read_concatenated_archives 22mfor compatibil‐
             ity with GNU tar.
 
-     --include pattern
+     1m--include 4m22mpattern0m
             Process only files or directories that match the specified pat‐
-            tern.  Note that exclusions specified with --exclude take prece‐
+            tern.  Note that exclusions specified with 1m--exclude 22mtake prece‐
             dence over inclusions.  If no inclusions are explicitly speci‐
-            fied, all entries are processed by default.  The --include option
+            fied, all entries are processed by default.  The 1m--include 22moption
             is especially useful when filtering archives.  For example, the
             command
-                  tar -c -f new.tar --include='*foo*' @old.tgz
-            creates a new archive new.tar containing only the entries from
-            old.tgz containing the string ‘foo’.
+                  1mtar -c -f 4m22mnew.tar24m 1m--include='*foo*' @4m22mold.tgz0m
+            creates a new archive 4mnew.tar24m containing only the entries from
+            4mold.tgz24m containing the string ‘foo’.
 
-     -J, --xz
+     1m-J22m, 1m--xz0m
             (c mode only) Compress the resulting archive with xz(1).  In
             extract or list modes, this option is ignored.  Note that, unlike
-            other tar implementations, this implementation recognizes XZ com‐
+            other 1mtar 22mimplementations, this implementation recognizes XZ com‐
             pression automatically when reading archives.
 
-     -j, --bzip, --bzip2, --bunzip2
+     1m-j22m, 1m--bzip22m, 1m--bzip222m, 1m--bunzip20m
             (c mode only) Compress the resulting archive with bzip2(1).  In
             extract or list modes, this option is ignored.  Note that, unlike
-            other tar implementations, this implementation recognizes bzip2
+            other 1mtar 22mimplementations, this implementation recognizes bzip2
             compression automatically when reading archives.
 
-     -k, --keep-old-files
+     1m-k22m, 1m--keep-old-files0m
             (x mode only) Do not overwrite existing files.  In particular, if
             a file appears more than once in an archive, later copies will
             not overwrite earlier copies.
 
-     --keep-newer-files
+     1m--keep-newer-files0m
             (x mode only) Do not overwrite existing files that are newer than
             the versions appearing in the archive being extracted.
 
-     -L, --dereference
-            (c and r mode only) All symbolic links will be followed.  Nor‐
+     1m-L22m, 1m--dereference0m
+            (c and r modes only) All symbolic links will be followed.  Nor‐
             mally, symbolic links are archived as such.  With this option,
             the target of the link will be archived instead.
 
-     -l, --check-links
+     1m-l22m, 1m--check-links0m
             (c and r modes only) Issue a warning message unless all links to
             each file are archived.
 
-     --lrzip
+     1m--lrzip0m
             (c mode only) Compress the resulting archive with lrzip(1).  In
             extract or list modes, this option is ignored.
 
-     --lz4   (c mode only) Compress the archive with lz4-compatible compres‐
+     1m--lz4   22m(c mode only) Compress the archive with lz4-compatible compres‐
             sion before writing it.  In input mode, this option is ignored;
             lz4 compression is recognized automatically on input.
 
-     --lzma  (c mode only) Compress the resulting archive with the original
+     1m--lzma  22m(c mode only) Compress the resulting archive with the original
             LZMA algorithm.  Use of this option is discouraged and new ar‐
-            chives should be created with --xz instead.  Note that, unlike
-            other tar implementations, this implementation recognizes LZMA
+            chives should be created with 1m--xz 22minstead.  Note that, unlike
+            other 1mtar 22mimplementations, this implementation recognizes LZMA
             compression automatically when reading archives.
 
-     --lzop  (c mode only) Compress the resulting archive with lzop(1).  In
+     1m--lzop  22m(c mode only) Compress the resulting archive with lzop(1).  In
             extract or list modes, this option is ignored.
 
-     -m, --modification-time
+     1m-m22m, 1m--modification-time0m
             (x mode only) Do not extract modification time.  By default, the
             modification time is set to the time stored in the archive.
 
-     -n, --norecurse, --no-recursion
+     1m--mac-metadata0m
+            (c, r, u and x mode only) Mac OS X specific. Archive or extract
+            extended ACLs and extended attributes using copyfile(3) in Apple‐
+            Double format. This is the reverse of 1m--no-mac-metadata22m.  and the
+            default behavior in c, r, and u modes or if 1mtar 22mis run in x mode
+            as root.
+
+     1m-n22m, 1m--norecurse22m, 1m--no-recursion0m
             (c, r, u modes only) Do not recursively archive the contents of
             directories.
 
-     --newer date
+     1m--newer 4m22mdate0m
             (c, r, u modes only) Only include files and directories newer
             than the specified date.  This compares ctime entries.
 
-     --newer-mtime date
-            (c, r, u modes only) Like --newer, except it compares mtime
+     1m--newer-mtime 4m22mdate0m
+            (c, r, u modes only) Like 1m--newer22m, except it compares mtime
             entries instead of ctime entries.
 
-     --newer-than file
+     1m--newer-than 4m22mfile0m
             (c, r, u modes only) Only include files and directories newer
             than the specified file.  This compares ctime entries.
 
-     --newer-mtime-than file
-            (c, r, u modes only) Like --newer-than, except it compares mtime
+     1m--newer-mtime-than 4m22mfile0m
+            (c, r, u modes only) Like 1m--newer-than22m, except it compares mtime
             entries instead of ctime entries.
 
-     --nodump
+     1m--nodump0m
             (c and r modes only) Honor the nodump file flag by skipping this
             file.
 
-     --nopreserveHFSCompression
+     1m--nopreserveHFSCompression0m
             (x mode only) Mac OS X specific(v10.6 or later). Do not compress
             extracted regular files which were compressed with HFS+ compres‐
             sion before archived.  By default, compress the regular files
             again with HFS+ compression.
 
-     --null  (use with -I or -T) Filenames or patterns are separated by null
+     1m--null  22m(use with 1m-I 22mor 1m-T22m) Filenames or patterns are separated by null
             characters, not by newlines.  This is often used to read file‐
-            names output by the -print0 option to find(1).
+            names output by the 1m-print0 22moption to find(1).
+
+     1m--no-acls0m
+            (c, r, u, x modes only) Do not archive or extract POSIX.1e or
+            NFSv4 ACLs. This is the reverse of 1m--acls 22mand the default behav‐
+            ior if 1mtar 22mis run as non-root in x mode (on Mac OS X also in c, r
+            and u modes).
+
+     1m--no-fflags0m
+            (c, r, u, x modes only) Do not archive or extract file flags.
+            This is the reverse of 1m--fflags 22mand the default behavior if 1mtar0m
+            is run as non-root in x mode.
 
-     --no-same-owner
+     1m--no-mac-metadata0m
+            (x mode only) Mac OS X specific. Do not archive or extract ACLs
+            and extended attributes using copyfile(3) in AppleDouble format.
+            This is the reverse of 1m--mac-metadata22m.  and the default behavior
+            if 1mtar 22mis run as non-root in x mode.
+
+     1m-n22m, 1m--norecurse22m, 1m--no-recursion0m
+
+     1m--no-same-owner0m
             (x mode only) Do not extract owner and group IDs.  This is the
-            reverse of --same-owner and the default behavior if tar is run as
+            reverse of 1m--same-owner 22mand the default behavior if 1mtar 22mis run as
             non-root.
 
-     --no-same-permissions
+     1m--no-same-permissions0m
             (x mode only) Do not extract full permissions (SGID, SUID, sticky
             bit, ACLs, extended attributes or extended file flags).  This is
-            the reverse of -p and the default behavior if tar is run as non-
-            root.
+            the reverse of 1m-p 22mand the default behavior if 1mtar 22mis run as non-
+            root and can be overridden by also specifying 1m--acls22m, 1m--fflags22m,
+            1m--mac-metadata, --same-owner22m, 1m--same-permissions 22mand 1m--xattrs22m.
 
-     --numeric-owner
-            This is equivalent to --uname "" --gname "".  On extract, it
+     1m--no-xattrs0m
+            (c, r, u, x modes only) Do not archive or extract extended
+            attributes. This is the reverse of 1m--xattrs 22mand the default
+            behavior if 1mtar 22mis run as non-root in x mode.
+
+     1m--numeric-owner0m
+            This is equivalent to 1m--uname 22m"" 1m--gname 22m"".  On extract, it
             causes user and group names in the archive to be ignored in favor
             of the numeric user and group ids.  On create, it causes user and
             group names to not be stored in the archive.
 
-     -O, --to-stdout
+     1m-O22m, 1m--to-stdout0m
             (x, t modes only) In extract (-x) mode, files will be written to
             standard out rather than being extracted to disk.  In list (-t)
             mode, the file listing will be written to stderr rather than the
             usual stdout.
 
-     -o      (x mode) Use the user and group of the user running the program
+     1m-o      22m(x mode) Use the user and group of the user running the program
             rather than those specified in the archive.  Note that this has
-            no significance unless -p is specified, and the program is being
+            no significance unless 1m-p 22mis specified, and the program is being
             run by the root user.  In this case, the file modes and flags
             from the archive will be restored, but ACLs or owner information
             in the archive will be discarded.
 
-     -o      (c, r, u mode) A synonym for --format ustar
+     1m-o      22m(c, r, u mode) A synonym for 1m--format 4m22mustar0m
 
-     --older date
+     1m--older 4m22mdate0m
             (c, r, u modes only) Only include files and directories older
             than the specified date.  This compares ctime entries.
 
-     --older-mtime date
-            (c, r, u modes only) Like --older, except it compares mtime
+     1m--older-mtime 4m22mdate0m
+            (c, r, u modes only) Like 1m--older22m, except it compares mtime
             entries instead of ctime entries.
 
-     --older-than file
+     1m--older-than 4m22mfile0m
             (c, r, u modes only) Only include files and directories older
             than the specified file.  This compares ctime entries.
 
-     --older-mtime-than file
-            (c, r, u modes only) Like --older-than, except it compares mtime
+     1m--older-mtime-than 4m22mfile0m
+            (c, r, u modes only) Like 1m--older-than22m, except it compares mtime
             entries instead of ctime entries.
 
-     --one-file-system
+     1m--one-file-system0m
             (c, r, and u modes) Do not cross mount points.
 
-     --options options
+     1m--options 4m22moptions0m
             Select optional behaviors for particular modules.  The argument
             is a text string containing comma-separated keywords and values.
             These are passed to the modules that handle particular formats to
             control how those formats will behave.  Each option has one of
             the following forms:
-            key=value
+            4mkey=value0m
                     The key will be set to the specified value in every mod‐
                     ule that supports it.  Modules that do not support this
                     key will ignore it.
-            key     The key will be enabled in every module that supports it.
-                    This is equivalent to key=1.
-            !key    The key will be disabled in every module that supports
+            4mkey24m     The key will be enabled in every module that supports it.
+                    This is equivalent to 4mkey24m1m=122m.
+            4m!key24m    The key will be disabled in every module that supports
                     it.
-            module:key=value, module:key, module:!key
+            4mmodule:key=value24m, 4mmodule:key24m, 4mmodule:!key0m
                     As above, but the corresponding key and value will be
-                    provided only to modules whose name matches module.
+                    provided only to modules whose name matches 4mmodule24m.
             The currently supported modules and keys are:
-            iso9660:joliet
+            1miso9660:joliet0m
                     Support Joliet extensions.  This is enabled by default,
-                    use !joliet or iso9660:!joliet to disable.
-            iso9660:rockridge
+                    use 1m!joliet 22mor 1miso9660:!joliet 22mto disable.
+            1miso9660:rockridge0m
                     Support Rock Ridge extensions.  This is enabled by
-                    default, use !rockridge or iso9660:!rockridge to disable.
-            gzip:compression-level
+                    default, use 1m!rockridge 22mor 1miso9660:!rockridge 22mto disable.
+            1mgzip:compression-level0m
                     A decimal integer from 1 to 9 specifying the gzip com‐
                     pression level.
-            gzip:timestamp
+            1mgzip:timestamp0m
                     Store timestamp. This is enabled by default, use
-                    !timestamp or gzip:!timestamp to disable.
-            lrzip:compression=type
-                    Use type as compression method.  Supported values are
+                    1m!timestamp 22mor 1mgzip:!timestamp 22mto disable.
+            1mlrzip:compression22m=4mtype0m
+                    Use 4mtype24m as compression method.  Supported values are
                     bzip2, gzip, lzo (ultra fast), and zpaq (best, extremely
                     slow).
-            lrzip:compression-level
+            1mlrzip:compression-level0m
                     A decimal integer from 1 to 9 specifying the lrzip com‐
                     pression level.
-            lz4:compression-level
+            1mlz4:compression-level0m
                     A decimal integer from 1 to 9 specifying the lzop com‐
                     pression level.
-            lz4:stream-checksum
+            1mlz4:stream-checksum0m
                     Enable stream checksum. This is by default, use
-                    lz4:!stream-checksum to disable.
-            lz4:block-checksum
+                    1mlz4:!stream-checksum 22mto disable.
+            1mlz4:block-checksum0m
                     Enable block checksum (Disabled by default).
-            lz4:block-size
+            1mlz4:block-size0m
                     A decimal integer from 4 to 7 specifying the lz4 compres‐
                     sion block size (7 is set by default).
-            lz4:block-dependence
+            1mlz4:block-dependence0m
                     Use the previous block of the block being compressed for
                     a compression dictionary to improve compression ratio.
-            lzop:compression-level
+            1mlzop:compression-level0m
                     A decimal integer from 1 to 9 specifying the lzop com‐
                     pression level.
-            xz:compression-level
+            1mxz:compression-level0m
                     A decimal integer from 0 to 9 specifying the xz compres‐
                     sion level.
-            mtree:keyword
+            1mmtree:4m22mkeyword0m
                     The mtree writer module allows you to specify which mtree
                     keywords will be included in the output.  Supported key‐
-                    words include: cksum, device, flags, gid, gname, indent,
-                    link, md5, mode, nlink, rmd160, sha1, sha256, sha384,
-                    sha512, size, time, uid, uname.  The default is equiva‐
+                    words include: 1mcksum22m, 1mdevice22m, 1mflags22m, 1mgid22m, 1mgname22m, 1mindent22m,
+                    1mlink22m, 1mmd522m, 1mmode22m, 1mnlink22m, 1mrmd16022m, 1msha122m, 1msha25622m, 1msha38422m,
+                    1msha51222m, 1msize22m, 1mtime22m, 1muid22m, 1muname22m.  The default is equiva‐
                     lent to: “device, flags, gid, gname, link, mode, nlink,
                     size, time, type, uid, uname”.
-            mtree:all
+            1mmtree:all0m
                     Enables all of the above keywords.  You can also use
-                    mtree:!all to disable all keywords.
-            mtree:use-set
-                    Enable generation of /set lines in the output.
-            mtree:indent
+                    1mmtree:!all 22mto disable all keywords.
+            1mmtree:use-set0m
+                    Enable generation of 1m/set 22mlines in the output.
+            1mmtree:indent0m
                     Produce human-readable output by indenting options and
                     splitting lines to fit into 80 columns.
-            zip:compression=type
-                    Use type as compression method.  Supported values are
+            1mzip:compression22m=4mtype0m
+                    Use 4mtype24m as compression method.  Supported values are
                     store (uncompressed) and deflate (gzip algorithm).
-            zip:encryption
+            1mzip:encryption0m
                     Enable encryption using traditional zip encryption.
-            zip:encryption=type
-                    Use type as encryption type.  Supported values are
+            1mzip:encryption22m=4mtype0m
+                    Use 4mtype24m as encryption type.  Supported values are
                     zipcrypt (traditional zip encryption), aes128 (WinZip
                     AES-128 encryption) and aes256 (WinZip AES-256 encryp‐
                     tion).
-            read_concatenated_archives
+            1mread_concatenated_archives0m
                     Ignore zeroed blocks in the archive, which occurs when
                     multiple tar archives have been concatenated together.
                     Without this option, only the contents of the first con‐
                     catenated archive would be read.  This option is compara‐
-                    ble to the -i, --ignore-zeros option of GNU tar.
+                    ble to the 1m-i22m, 1m--ignore-zeros 22moption of GNU tar.
             If a provided option is not supported by any module, that is a
             fatal error.
 
-     -P, --absolute-paths
+     1m-P22m, 1m--absolute-paths0m
             Preserve pathnames.  By default, absolute pathnames (those that
             begin with a / character) have the leading slash removed both
-            when creating archives and extracting from them.  Also, tar will
-            refuse to extract archive entries whose pathnames contain .. or
+            when creating archives and extracting from them.  Also, 1mtar 22mwill
+            refuse to extract archive entries whose pathnames contain 4m..24m or
             whose target directory would be altered by a symlink.  This
             option suppresses these behaviors.
 
-     -p, --insecure, --preserve-permissions
+     1m-p22m, 1m--insecure22m, 1m--preserve-permissions0m
             (x mode only) Preserve file permissions.  Attempt to restore the
-            full permissions, including owner, file modes, file flags and
-            ACLs, if available, for each item extracted from the archive.
-            This is the default, if tar is being run by root and can be over‐
-            ridden by also specifying --no-same-owner and
-            --no-same-permissions.
-
-     --passphrase passphrase
-            The passphrase is used to extract or create an encrypted archive.
+            full permissions, including owner, file modes, ACLs, extended
+            atributes and extended file flags, if available, for each item
+            extracted from the archive. This is the default, if 1mtar 22mis being
+            run by root and can be overridden by also specifying 1m--no-acls22m,
+            1m--no-fflags22m, 1m--no-mac-metadata, --no-same-owner22m,
+            1m--no-same-permissions 22mand 1m--no-xattrs22m.
+
+     1m--passphrase 4m22mpassphrase0m
+            The 4mpassphrase24m is used to extract or create an encrypted archive.
             Currently, zip is the only supported format that supports encryp‐
             tion.  You shouldn't use this option unless you realize how inse‐
             cure use of this option is.
 
-     --posix
-            (c, r, u mode only) Synonym for --format pax
+     1m--posix0m
+            (c, r, u mode only) Synonym for 1m--format 4m22mpax0m
 
-     -q, --fast-read
+     1m-q22m, 1m--fast-read0m
             (x and t mode only) Extract or list only the first archive entry
             that matches each pattern or filename operand.  Exit as soon as
             each specified pattern or filename has been matched.  By default,
@@ -435,17 +477,17 @@ OPTIONS
             entries overwrite earlier entries.  This option is provided as a
             performance optimization.
 
-     -S      (x mode only) Extract files as sparse files.  For every block on
+     1m-S      22m(x mode only) Extract files as sparse files. For every block on
             disk, check first if it contains only NULL bytes and seek over it
             otherwise.  This works similar to the conv=sparse option of dd.
 
-     -s pattern
-            Modify file or archive member names according to pattern.  The
-            pattern has the format /old/new/[ghHprRsS] where old is a basic
-            regular expression, new is the replacement string of the matched
+     1m-s 4m22mpattern0m
+            Modify file or archive member names according to 4mpattern24m.  The
+            pattern has the format 4m/old/new/24m[ghHprRsS] where 4mold24m is a basic
+            regular expression, 4mnew24m is the replacement string of the matched
             part, and the optional trailing letters modify how the replace‐
-            ment is handled.  If old is not matched, the pattern is skipped.
-            Within new, ~ is substituted with the match, \1 to \9 with the
+            ment is handled.  If 4mold24m is not matched, the pattern is skipped.
+            Within 4mnew24m, ~ is substituted with the match, \1 to \9 with the
             content of the corresponding captured group.  The optional trail‐
             ing g specifies that matching should continue after the matched
             part and stop on the first unmatched pattern.  The optional
@@ -457,143 +499,148 @@ OPTIONS
             regular filenames, or symlink targets, respectively.  Optional
             trailing h, r, or s characters enable substitutions for hardlink
             targets, regular filenames, or symlink targets, respectively.
-            The default is hrs which applies substitutions to all names.  In
+            The default is 4mhrs24m which applies substitutions to all names.  In
             particular, it is never necessary to specify h, r, or s.
 
-     --same-owner
+     1m--same-owner0m
             (x mode only) Extract owner and group IDs.  This is the reverse
-            of --no-same-owner and the default behavior if tar is run as
+            of 1m--no-same-owner 22mand the default behavior if 1mtar 22mis run as
             root.
 
-     --strip-components count
+     1m--strip-components 4m22mcount0m
             Remove the specified number of leading path elements.  Pathnames
             with fewer elements will be silently skipped.  Note that the
             pathname is edited after checking inclusion/exclusion patterns
             but before security checks.
 
-     -T filename, --files-from filename
-            In x or t mode, tar will read the list of names to be extracted
-            from filename.  In c mode, tar will read names to be archived
-            from filename.  The special name “-C” on a line by itself will
+     1m-T 4m22mfilename24m, 1m--files-from 4m22mfilename0m
+            In x or t mode, 1mtar 22mwill read the list of names to be extracted
+            from 4mfilename24m.  In c mode, 1mtar 22mwill read names to be archived
+            from 4mfilename24m.  The special name “-C” on a line by itself will
             cause the current directory to be changed to the directory speci‐
             fied on the following line.  Names are terminated by newlines
-            unless --null is specified.  Note that --null also disables the
+            unless 1m--null 22mis specified.  Note that 1m--null 22malso disables the
             special handling of lines containing “-C”.  Note:      If you are
             generating lists of files using find(1), you probably want to use
-            -n as well.
+            1m-n 22mas well.
 
-     --totals
-            (c, r, u mode only) After archiving all files, print a summary to
-            stderr.
+     1m--totals0m
+            (c, r, u modes only) After archiving all files, print a summary
+            to stderr.
 
-     -U, --unlink, --unlink-first
+     1m-U22m, 1m--unlink22m, 1m--unlink-first0m
             (x mode only) Unlink files before creating them.  This can be a
             minor performance optimization if most files already exist, but
             can make things slower if most files do not already exist.  This
-            flag also causes tar to remove intervening directory symlinks
+            flag also causes 1mtar 22mto remove intervening directory symlinks
             instead of reporting an error.  See the SECURITY section below
             for more details.
 
-     --uid id
+     1m--uid 4m22mid0m
             Use the provided user id number and ignore the user name from the
-            archive.  On create, if --uname is not also specified, the user
+            archive.  On create, if 1m--uname 22mis not also specified, the user
             name will be set to match the user id.
 
-     --uname name
+     1m--uname 4m22mname0m
             Use the provided user name.  On extract, this overrides the user
             name in the archive; if the provided user name does not exist on
             the system, it will be ignored and the user id (from the archive
-            or from the --uid option) will be used instead.  On create, this
+            or from the 1m--uid 22moption) will be used instead.  On create, this
             sets the user name that will be stored in the archive; the name
             is not verified against the system user database.
 
-     --use-compress-program program
+     1m--use-compress-program 4m22mprogram0m
             Pipe the input (in x or t mode) or the output (in c mode) through
-            program instead of using the builtin compression support.
+            4mprogram24m instead of using the builtin compression support.
 
-     -v, --verbose
-            Produce verbose output.  In create and extract modes, tar will
+     1m-v22m, 1m--verbose0m
+            Produce verbose output.  In create and extract modes, 1mtar 22mwill
             list each file name as it is read from or written to the archive.
-            In list mode, tar will produce output similar to that of ls(1).
-            An additional -v option will also provide ls-like details in cre‐
+            In list mode, 1mtar 22mwill produce output similar to that of ls(1).
+            An additional 1m-v 22moption will also provide ls-like details in cre‐
             ate and extract mode.
 
-     --version
-            Print version of tar and libarchive, and exit.
+     1m--version0m
+            Print version of 1mtar 22mand 1mlibarchive22m, and exit.
 
-     -w, --confirmation, --interactive
+     1m-w22m, 1m--confirmation22m, 1m--interactive0m
             Ask for confirmation for every action.
 
-     -X filename, --exclude-from filename
+     1m-X 4m22mfilename24m, 1m--exclude-from 4m22mfilename0m
             Read a list of exclusion patterns from the specified file.  See
-            --exclude for more information about the handling of exclusions.
+            1m--exclude 22mfor more information about the handling of exclusions.
+
+     1m--xattrs0m
+            (c, r, u, x modes only) Archive or extract extended attributes.
+            This is the reverse of 1m--no-xattrs 22mand the default behavior in c,
+            r, and u modes or if 1mtar 22mis run in x mode as root.
 
-     -y      (c mode only) Compress the resulting archive with bzip2(1).  In
+     1m-y      22m(c mode only) Compress the resulting archive with bzip2(1).  In
             extract or list modes, this option is ignored.  Note that, unlike
-            other tar implementations, this implementation recognizes bzip2
+            other 1mtar 22mimplementations, this implementation recognizes bzip2
             compression automatically when reading archives.
 
-     -Z, --compress, --uncompress
+     1m-Z22m, 1m--compress22m, 1m--uncompress0m
             (c mode only) Compress the resulting archive with compress(1).
             In extract or list modes, this option is ignored.  Note that,
-            unlike other tar implementations, this implementation recognizes
+            unlike other 1mtar 22mimplementations, this implementation recognizes
             compress compression automatically when reading archives.
 
-     -z, --gunzip, --gzip
+     1m-z22m, 1m--gunzip22m, 1m--gzip0m
             (c mode only) Compress the resulting archive with gzip(1).  In
             extract or list modes, this option is ignored.  Note that, unlike
-            other tar implementations, this implementation recognizes gzip
+            other 1mtar 22mimplementations, this implementation recognizes gzip
             compression automatically when reading archives.
 
-ENVIRONMENT
-     The following environment variables affect the execution of tar:
+1mENVIRONMENT0m
+     The following environment variables affect the execution of 1mtar22m:
 
      TAR_READER_OPTIONS
                The default options for format readers and compression read‐
-               ers.  The --options option overrides this.
+               ers.  The 1m--options 22moption overrides this.
 
      TAR_WRITER_OPTIONS
                The default options for format writers and compression writ‐
-               ers.  The --options option overrides this.
+               ers.  The 1m--options 22moption overrides this.
 
      LANG      The locale to use.  See environ(7) for more information.
 
-     TAPE      The default device.  The -f option overrides this.  Please see
-               the description of the -f option above for more details.
+     TAPE      The default device.  The 1m-f 22moption overrides this.  Please see
+               the description of the 1m-f 22moption above for more details.
 
      TZ        The timezone to use when displaying dates.  See environ(7) for
                more information.
 
-EXIT STATUS
-     The tar utility exits 0 on success, and >0 if an error occurs.
+1mEXIT STATUS0m
+     The 1mtar 22mutility exits 0 on success, and >0 if an error occurs.
 
-EXAMPLES
-     The following creates a new archive called file.tar.gz that contains two
-     files source.c and source.h:
-          tar -czf file.tar.gz source.c source.h
+1mEXAMPLES0m
+     The following creates a new archive called 4mfile.tar.gz24m that contains two
+     files 4msource.c24m and 4msource.h24m:
+          1mtar -czf 4m22mfile.tar.gz24m 4msource.c24m 4msource.h0m
 
      To view a detailed table of contents for this archive:
-          tar -tvf file.tar.gz
+          1mtar -tvf 4m22mfile.tar.gz0m
 
      To extract all entries from the archive on the default tape drive:
-          tar -x
+          1mtar -x0m
 
      To examine the contents of an ISO 9660 cdrom image:
-          tar -tf image.iso
+          1mtar -tf 4m22mimage.iso0m
 
-     To move file hierarchies, invoke tar as
-          tar -cf - -C srcdir . | tar -xpf - -C destdir
+     To move file hierarchies, invoke 1mtar 22mas
+          1mtar -cf 4m22m-24m 1m-C 4m22msrcdir24m 4m.24m | 1mtar -xpf 4m22m-24m 1m-C 4m22mdestdir0m
      or more traditionally
-          cd srcdir ; tar -cf - . | (cd destdir ; tar -xpf -)
+          cd srcdir ; 1mtar -cf 4m22m-24m 4m.24m | (4mcd24m 4mdestdir24m 4m;24m 1mtar -xpf 4m22m-24m)
 
      In create mode, the list of files and directories to be archived can also
-     include directory change instructions of the form -Cfoo/baz and archive
-     inclusions of the form @archive-file.  For example, the command line
-          tar -c -f new.tar foo1 @old.tgz -C/tmp foo2
-     will create a new archive new.tar.  tar will read the file foo1 from the
+     include directory change instructions of the form 1m-C4m22mfoo/baz24m and archive
+     inclusions of the form 1m@4m22marchive-file24m.  For example, the command line
+          1mtar -c -f 4m22mnew.tar24m 4mfoo124m 1m@4m22mold.tgz24m 1m-C4m22m/tmp24m 4mfoo20m
+     will create a new archive 4mnew.tar24m.  1mtar 22mwill read the file 4mfoo124m from the
      current directory and add it to the output archive.  It will then read
-     each entry from old.tgz and add those entries to the output archive.
-     Finally, it will switch to the /tmp directory and add foo2 to the output
+     each entry from 4mold.tgz24m and add those entries to the output archive.
+     Finally, it will switch to the 4m/tmp24m directory and add 4mfoo224m to the output
      archive.
 
      An input file in mtree(5) format can be used to create an output archive
@@ -606,85 +653,85 @@ EXAMPLES
           usr/bin/ls uid=0 gid=0 mode=0755 type=file content=myls
           $ tar -cvf output.tar @input.mtree
 
-     The --newer and --newer-mtime switches accept a variety of common date
+     The 1m--newer 22mand 1m--newer-mtime 22mswitches accept a variety of common date
      and time specifications, including “12 Mar 2005 7:14:29pm”, “2005-03-12
      19:14”, “5 minutes ago”, and “19:14 PST May 1”.
 
-     The --options argument can be used to control various details of archive
+     The 1m--options 22margument can be used to control various details of archive
      generation or reading.  For example, you can generate mtree output which
-     only contains type, time, and uid keywords:
-          tar -cf file.tar --format=mtree --options='!all,type,time,uid' dir
+     only contains 1mtype22m, 1mtime22m, and 1muid 22mkeywords:
+          1mtar -cf 4m22mfile.tar24m 1m--format=mtree --options='!all,type,time,uid' 4m22mdir0m
      or you can set the compression level used by gzip or xz compression:
-          tar -czf file.tar --options='compression-level=9'.
-     For more details, see the explanation of the archive_read_set_options()
-     and archive_write_set_options() API calls that are described in
+          1mtar -czf 4m22mfile.tar24m 1m--options='compression-level=9'22m.
+     For more details, see the explanation of the 1marchive_read_set_options22m()
+     and 1marchive_write_set_options22m() API calls that are described in
      archive_read(3) and archive_write(3).
 
-COMPATIBILITY
+1mCOMPATIBILITY0m
      The bundled-arguments format is supported for compatibility with historic
      implementations.  It consists of an initial word (with no leading - char‐
      acter) in which each character indicates an option.  Arguments follow as
      separate words.  The order of the arguments must match the order of the
      corresponding characters in the bundled command word.  For example,
-          tar tbf 32 file.tar
-     specifies three flags t, b, and f.  The b and f flags both require argu‐
-     ments, so there must be two additional items on the command line. The 32
-     is the argument to the b flag, and file.tar is the argument to the f
+          1mtar tbf 32 4m22mfile.tar0m
+     specifies three flags 1mt22m, 1mb22m, and 1mf22m. The 1mb 22mand 1mf 22mflags both require argu‐
+     ments, so there must be two additional items on the command line. The 4m320m
+     is the argument to the 1mb 22mflag, and 4mfile.tar24m is the argument to the 1mf0m
      flag.
 
      The mode options c, r, t, u, and x and the options b, f, l, m, o, v, and
      w comply with SUSv2.
 
-     For maximum portability, scripts that invoke tar should use the bundled-
-     argument format above, should limit themselves to the c, t, and x modes,
-     and the b, f, m, v, and w options.
+     For maximum portability, scripts that invoke 1mtar 22mshould use the bundled-
+     argument format above, should limit themselves to the 1mc22m, 1mt22m, and 1mx 22mmodes,
+     and the 1mb22m, 1mf22m, 1mm22m, 1mv22m, and 1mw 22moptions.
 
      Additional long options are provided to improve compatibility with other
      tar implementations.
 
-SECURITY
+1mSECURITY0m
      Certain security issues are common to many archiving programs, including
-     tar.  In particular, carefully-crafted archives can request that tar
+     1mtar22m. In particular, carefully-crafted archives can request that 1mtar0m
      extract files to locations outside of the target directory.  This can
      potentially be used to cause unwitting users to overwrite files they did
      not intend to overwrite.  If the archive is being extracted by the supe‐
      ruser, any file on the system can potentially be overwritten.  There are
-     three ways this can happen.  Although tar has mechanisms to protect
+     three ways this can happen.  Although 1mtar 22mhas mechanisms to protect
      against each one, savvy users should be aware of the implications:
 
-     ·             Archive entries can have absolute pathnames.  By default, tar
-            removes the leading / character from filenames before restoring
+     1m·       22mArchive entries can have absolute pathnames.        By default, 1mtar0m
+            removes the leading 4m/24m character from filenames before restoring
             them to guard against this problem.
 
-     ·             Archive entries can have pathnames that include .. components.
-            By default, tar will not extract files containing .. components
+     1m·       22mArchive entries can have pathnames that include 4m..24m components.
+            By default, 1mtar 22mwill not extract files containing 4m..24m components
             in their pathname.
 
-     ·             Archive entries can exploit symbolic links to restore files to
+     1m·       22mArchive entries can exploit symbolic links to restore files to
             other directories.  An archive can restore a symbolic link to
             another directory, then use that link to restore a file into that
-            directory.  To guard against this, tar checks each extracted path
+            directory.  To guard against this, 1mtar 22mchecks each extracted path
             for symlinks.  If the final path element is a symlink, it will be
-            removed and replaced with the archive entry.  If -U is specified,
+            removed and replaced with the archive entry.  If 1m-U 22mis specified,
             any intermediate symlink will also be unconditionally removed.
-            If neither -U nor -P is specified, tar will refuse to extract the
+            If neither 1m-U 22mnor 1m-P 22mis specified, 1mtar 22mwill refuse to extract the
             entry.
      To protect yourself, you should be wary of any archives that come from
      untrusted sources.  You should examine the contents of an archive with
-          tar -tf filename
-     before extraction.  You should use the -k option to ensure that tar will
-     not overwrite any existing files or the -U option to remove any pre-
+          1mtar -tf 4m22mfilename0m
+     before extraction.  You should use the 1m-k 22moption to ensure that 1mtar 22mwill
+     not overwrite any existing files or the 1m-U 22moption to remove any pre-
      existing files.  You should generally not extract archives while running
-     with super-user privileges.  Note that the -P option to tar disables the
+     with super-user privileges.  Note that the 1m-P 22moption to 1mtar 22mdisables the
      security checks above and allows you to extract an archive while preserv‐
-     ing any absolute pathnames, .. components, or symlinks to other directo‐
+     ing any absolute pathnames, 4m..24m components, or symlinks to other directo‐
      ries.
 
-SEE ALSO
+1mSEE ALSO0m
      bzip2(1), compress(1), cpio(1), gzip(1), mt(1), pax(1), shar(1), xz(1),
      libarchive(3), libarchive-formats(5), tar(5)
 
-STANDARDS
+1mSTANDARDS0m
      There is no current POSIX standard for the tar command; it appeared in
      ISO/IEC 9945-1:1996 (“POSIX.1”) but was dropped from IEEE Std 1003.1-2001
      (“POSIX.1”).  The options supported by this implementation were developed
@@ -694,10 +741,10 @@ STANDARDS
      The ustar and pax interchange file formats are defined by IEEE Std
      1003.1-2001 (“POSIX.1”) for the pax command.
 
-HISTORY
-     A tar command appeared in Seventh Edition Unix, which was released in
+1mHISTORY0m
+     A 1mtar 22mcommand appeared in Seventh Edition Unix, which was released in
      January, 1979.  There have been numerous other implementations, many of
-     which extended the file format.  John Gilmore's pdtar public-domain
+     which extended the file format.  John Gilmore's 1mpdtar 22mpublic-domain
      implementation (circa November, 1987) was quite influential, and formed
      the basis of GNU tar.  GNU tar was included as the standard system tar in
      FreeBSD beginning with FreeBSD 1.0.
@@ -705,12 +752,12 @@ HISTORY
      This is a complete re-implementation based on the libarchive(3) library.
      It was first released with FreeBSD 5.4 in May, 2005.
 
-BUGS
+1mBUGS0m
      This program follows ISO/IEC 9945-1:1996 (“POSIX.1”) for the definition
-     of the -l option. Note that GNU tar prior to version 1.15 treated -l as
-     a synonym for the --one-file-system option.
+     of the 1m-l 22moption.  Note that GNU tar prior to version 1.15 treated 1m-l 22mas
+     a synonym for the 1m--one-file-system 22moption.
 
-     The -C dir option may differ from historic implementations.
+     The 1m-C 4m22mdir24m option may differ from historic implementations.
 
      All archive output is written in correctly-sized blocks, even if the out‐
      put is being compressed.  Whether or not the last output block is padded
@@ -720,27 +767,27 @@ BUGS
      a character or block device such as a tape drive. If the output is being
      written to a regular file, the last block will not be padded.  Many com‐
      pressors, including gzip(1) and bzip2(1), complain about the null padding
-     when decompressing an archive created by tar, although they still extract
+     when decompressing an archive created by 1mtar22m, although they still extract
      it correctly.
 
      The compression and decompression is implemented internally, so there may
      be insignificant differences between the compressed output generated by
-          tar -czf - file
+          1mtar -czf 4m22m-24m 4mfile0m
      and that generated by
-          tar -cf - file | gzip
+          1mtar -cf 4m22m-24m 4mfile24m | 1mgzip0m
 
      The default should be to read and write archives to the standard I/O
      paths, but tradition (and POSIX) dictates otherwise.
 
-     The r and u modes require that the archive be uncompressed and located in
-     a regular file on disk.  Other archives can be modified using mode with
-     the @archive-file extension.
+     The 1mr 22mand 1mu 22mmodes require that the archive be uncompressed and located in
+     a regular file on disk.  Other archives can be modified using 1mc 22mmode with
+     the 4m@archive-file24m extension.
 
-     To archive a file called @foo or -foo you must specify it as ./@foo or
-     ./-foo, respectively.
+     To archive a file called 4m@foo24m or 4m-foo24m you must specify it as 4m./@foo24m or
+     4m./-foo24m, respectively.
 
-     In create mode, a leading ./ is always removed.  A leading / is stripped
-     unless the -P option is specified.
+     In create mode, a leading 4m./24m is always removed.  A leading 4m/24m is stripped
+     unless the 1m-P 22moption is specified.
 
      There needs to be better support for file selection on both create and
      extract.
@@ -748,8 +795,8 @@ BUGS
      There is not yet any support for multi-volume archives.
 
      Converting between dissimilar archive formats (such as tar and cpio)
-     using the @- convention can cause hard link information to be lost.
+     using the 1m@4m22m-24m convention can cause hard link information to be lost.
      (This is a consequence of the incompatible ways that different archive
      formats store hardlink information.)
 
-BSD                          September 16, 2014                           BSD
+BSD                           February 24, 2017                           BSD
index 395a560..2b6174e 100644 (file)
@@ -1,29 +1,29 @@
 CPIO(5)                    BSD File Formats Manual                    CPIO(5)
 
-NAME
-     cpio — format of cpio archive files
+1mNAME0m
+     1mcpio 22m— format of cpio archive files
 
-DESCRIPTION
-     The cpio archive format collects any number of files, directories, and
+1mDESCRIPTION0m
+     The 1mcpio 22marchive format collects any number of files, directories, and
      other file system objects (symbolic links, device nodes, etc.) into a
      single stream of bytes.
 
-   General Format
-     Each file system object in a cpio archive comprises a header record with
+   1mGeneral Format0m
+     Each file system object in a 1mcpio 22marchive comprises a header record with
      basic numeric metadata followed by the full pathname of the entry and the
      file data.  The header record stores a series of integer values that gen‐
-     erally follow the fields in struct stat.  (See stat(2) for details.)  The
+     erally follow the fields in 4mstruct24m 4mstat24m.  (See stat(2) for details.)  The
      variants differ primarily in how they store those integers (binary,
      octal, or hexadecimal).  The header is followed by the pathname of the
      entry (the length of the pathname is stored in the header) and any file
      data.  The end of the archive is indicated by a special record with the
      pathname “TRAILER!!!”.
 
-   PWB format
+   1mPWB format0m
      XXX Any documentation of the original PWB/UNIX 1.0 format? XXX
 
-   Old Binary Format
-     The old binary cpio format stores numbers as 2-byte and 4-byte binary
+   1mOld Binary Format0m
+     The old binary 1mcpio 22mformat stores numbers as 2-byte and 4-byte binary
      values.  Each entry begins with a header in the following format:
 
           struct header_old_cpio {
@@ -40,20 +40,20 @@ DESCRIPTION
                   unsigned short   c_filesize[2];
           };
 
-     The unsigned short fields here are 16-bit integer values; the unsigned
-     int fields are 32-bit integer values.  The fields are as follows
+     The 4munsigned24m 4mshort24m fields here are 16-bit integer values; the 4munsigned0m
+     4mint24m fields are 32-bit integer values.  The fields are as follows
 
-     magic   The integer value octal 070707.  This value can be used to deter‐
+     4mmagic24m   The integer value octal 070707.  This value can be used to deter‐
             mine whether this archive is written with little-endian or big-
             endian integers.
 
-     dev, ino
+     4mdev24m, 4mino0m
             The device and inode numbers from the disk.  These are used by
-            programs that read cpio archives to determine when two entries
-            refer to the same file.  Programs that synthesize cpio archives
+            programs that read 1mcpio 22marchives to determine when two entries
+            refer to the same file.  Programs that synthesize 1mcpio 22marchives
             should be careful to set these to distinct values for each entry.
 
-     mode    The mode specifies both the regular permissions and the file
+     4mmode24m   The mode specifies both the regular permissions and the file
             type.  It consists of several bit fields as follows:
             0170000  This masks the file type bits.
             0140000  File type value for sockets.
@@ -72,40 +72,40 @@ DESCRIPTION
                      for world, group, and user following standard POSIX con‐
                      ventions.
 
-     uid, gid
+     4muid24m, 4mgid0m
             The numeric user id and group id of the owner.
 
-     nlink   The number of links to this file. Directories always have a
+     4mnlink24m   The number of links to this file.  Directories always have a
             value of at least two here.  Note that hardlinked files include
             file data with every copy in the archive.
 
-     rdev    For block special and character special entries, this field con‐
+     4mrdev24m   For block special and character special entries, this field con‐
             tains the associated device number.  For all other entry types,
             it should be set to zero by writers and ignored by readers.
 
-     mtime   Modification time of the file, indicated as the number of seconds
+     4mmtime24m   Modification time of the file, indicated as the number of seconds
             since the start of the epoch, 00:00:00 UTC January 1, 1970.  The
             four-byte integer is stored with the most-significant 16 bits
             first followed by the least-significant 16 bits.  Each of the two
             16 bit values are stored in machine-native byte order.
 
-     namesize
+     4mnamesize0m
             The number of bytes in the pathname that follows the header.
             This count includes the trailing NUL byte.
 
-     filesize
+     4mfilesize0m
             The size of the file.  Note that this archive format is limited
-            to four gigabyte file sizes.  See mtime above for a description
+            to four gigabyte file sizes.  See 4mmtime24m above for a description
             of the storage of four-byte integers.
 
-     The pathname immediately follows the fixed header.  If the namesize is
+     The pathname immediately follows the fixed header.  If the 1mnamesize 22mis
      odd, an additional NUL byte is added after the pathname.  The file data
      is then appended, padded with NUL bytes to an even length.
 
      Hardlinked files are not given special treatment; the full file contents
      are included with each copy of the file.
 
-   Portable ASCII Format
+   1mPortable ASCII Format0m
      Version 2 of the Single UNIX Specification (“SUSv2”) standardized an
      ASCII variant that is portable across all platforms.  It is commonly
      known as the “old character” format or as the “odc” format.  It stores
@@ -133,7 +133,7 @@ DESCRIPTION
      archive will be entirely ASCII, except for the NUL byte that terminates
      the name field.
 
-   New ASCII Format
+   1mNew ASCII Format0m
      The "new" ASCII format uses 8-byte hexadecimal fields for all numbers and
      separates device numbers into separate fields for major and minor num‐
      bers.
@@ -158,9 +158,9 @@ DESCRIPTION
      Except as specified below, the fields here match those specified for the
      old binary format above.
 
-     magic   The string “070701”.
+     4mmagic24m   The string “070701”.
 
-     check   This field is always set to zero by writers and ignored by read‐
+     4mcheck24m   This field is always set to zero by writers and ignored by read‐
             ers.  See the next section for more details.
 
      The pathname is followed by NUL bytes so that the total size of the fixed
@@ -172,35 +172,35 @@ DESCRIPTION
      In this format, hardlinked files are handled by setting the filesize to
      zero for each entry except the last one that appears in the archive.
 
-   New CRC Format
+   1mNew CRC Format0m
      The CRC format is identical to the new ASCII format described in the pre‐
      vious section except that the magic field is set to “070702” and the
-     check field is set to the sum of all bytes in the file data.  This sum is
+     4mcheck24m field is set to the sum of all bytes in the file data. This sum is
      computed treating all bytes as unsigned values and using unsigned arith‐
      metic.  Only the least-significant 32 bits of the sum are stored.
 
-   HP variants
-     The cpio implementation distributed with HPUX used XXXX but stored device
+   1mHP variants0m
+     The 1mcpio 22mimplementation distributed with HPUX used XXXX but stored device
      numbers differently XXX.
 
-   Other Extensions and Variants
+   1mOther Extensions and Variants0m
      Sun Solaris uses additional file types to store extended file data,
      including ACLs and extended attributes, as special entries in cpio ar‐
      chives.
 
      XXX Others? XXX
 
-SEE ALSO
+1mSEE ALSO0m
      cpio(1), tar(5)
 
-STANDARDS
-     The cpio utility is no longer a part of POSIX or the Single Unix Stan‐
+1mSTANDARDS0m
+     The 1mcpio 22mutility is no longer a part of POSIX or the Single Unix Stan‐
      dard.  It last appeared in Version 2 of the Single UNIX Specification
      (“SUSv2”).  It has been supplanted in subsequent standards by pax(1).
      The portable ASCII format is currently part of the specification for the
      pax(1) utility.
 
-HISTORY
+1mHISTORY0m
      The original cpio utility was written by Dick Haight while working in
      AT&T's Unix Support Group.  It appeared in 1977 as part of PWB/UNIX 1.0,
      the “Programmer's Work Bench” derived from Version 6 AT&T UNIX that was
@@ -211,7 +211,7 @@ HISTORY
      Who invented it?  When did HP come out with their variant?  When did Sun
      introduce ACLs and extended attributes? XXX
 
-BUGS
+1mBUGS0m
      The “CRC” format is mis-named, as it uses a simple checksum and not a
      cyclic redundancy check.
 
index fe095e3..429dd74 100644 (file)
@@ -1,9 +1,9 @@
 LIBARCHIVE-FORMATS(5)      BSD File Formats Manual      LIBARCHIVE-FORMATS(5)
 
-NAME
-     libarchive-formats — archive formats supported by the libarchive library
+1mNAME0m
+     1mlibarchive-formats 22m— archive formats supported by the libarchive library
 
-DESCRIPTION
+1mDESCRIPTION0m
      The libarchive(3) library reads and writes a variety of streaming archive
      formats.  Generally speaking, all of these archive formats consist of a
      series of “entries”.  Each entry stores a single file system object, such
@@ -17,7 +17,7 @@ DESCRIPTION
      specify which formats they wish to support, though many programs do use
      libarchive convenience functions to enable all supported formats.
 
-   Tar Formats
+   1mTar Formats0m
      The libarchive(3) library can read most tar archives.  It can write
      POSIX-standard “ustar” and “pax interchange” formats as well as v7 tar
      format and a subset of the legacy GNU tar format.
@@ -30,7 +30,7 @@ DESCRIPTION
      storing special entries that modify the interpretation of subsequent
      entries.
 
-     gnutar  The libarchive(3) library can read most GNU-format tar archives.
+     1mgnutar  22mThe libarchive(3) library can read most GNU-format tar archives.
             It currently supports the most popular GNU extensions, including
             modern long filename and linkname support, as well as atime and
             ctime data.  The libarchive library does not support multi-volume
@@ -41,7 +41,7 @@ DESCRIPTION
             long filename and linkname support, as well as atime and ctime
             data.
 
-     pax     The libarchive(3) library can read and write POSIX-compliant pax
+     1mpax     22mThe libarchive(3) library can read and write POSIX-compliant pax
             interchange format archives.  Pax interchange format archives are
             an extension of the older ustar format that adds a separate entry
             with additional attributes stored as key/value pairs immediately
@@ -64,7 +64,7 @@ DESCRIPTION
             dle non-ASCII filenames on systems that did not satisfy this
             assumption.
 
-     restricted pax
+     1mrestricted pax0m
             The libarchive library can also write pax archives in which it
             attempts to suppress the extended attributes entry whenever pos‐
             sible.  The result will be identical to a ustar archive unless
@@ -76,38 +76,38 @@ DESCRIPTION
             pliant pax interchange format archives.  Programs that correctly
             read ustar format (see below) will also be able to read this for‐
             mat; any extended attributes will be extracted as separate files
-            stored in PaxHeader directories.
+            stored in 4mPaxHeader24m directories.
 
-     ustar   The libarchive library can both read and write this format.  This
+     1mustar   22mThe libarchive library can both read and write this format.  This
             format has the following limitations:
-            ·  Device major and minor numbers are limited to 21 bits.  Nodes
+            1m·   22mDevice major and minor numbers are limited to 21 bits.  Nodes
                 with larger numbers will not be added to the archive.
-            ·  Path names in the archive are limited to 255 bytes.  (Shorter
+            1m·   22mPath names in the archive are limited to 255 bytes.  (Shorter
                 if there is no / character in exactly the right place.)
-            ·  Symbolic links and hard links are stored in the archive with
+            1m·   22mSymbolic links and hard links are stored in the archive with
                 the name of the referenced file.  This name is limited to 100
                 bytes.
-            ·  Extended attributes, file flags, and other extended security
+            1m·   22mExtended attributes, file flags, and other extended security
                 information cannot be stored.
-            ·  Archive entries are limited to 8 gigabytes in size.
+            1m·   22mArchive entries are limited to 8 gigabytes in size.
             Note that the pax interchange format has none of these restric‐
             tions.  The ustar format is old and widely supported.  It is rec‐
             ommended when compatibility is the primary concern.
 
-     v7      The libarchive library can read and write the legacy v7 tar for‐
+     1mv7      22mThe libarchive library can read and write the legacy v7 tar for‐
             mat.  This format has the following limitations:
-            ·  Only regular files, directories, and symbolic links can be
+            1m·   22mOnly regular files, directories, and symbolic links can be
                 archived.  Block and character device nodes, FIFOs, and sock‐
                 ets cannot be archived.
-            ·  Path names in the archive are limited to 100 bytes.
-            ·  Symbolic links and hard links are stored in the archive with
+            1m·   22mPath names in the archive are limited to 100 bytes.
+            1m·   22mSymbolic links and hard links are stored in the archive with
                 the name of the referenced file.  This name is limited to 100
                 bytes.
-            ·  User and group information are stored as numeric IDs; there
+            1m·   22mUser and group information are stored as numeric IDs; there
                 is no provision for storing user or group names.
-            ·  Extended attributes, file flags, and other extended security
+            1m·   22mExtended attributes, file flags, and other extended security
                 information cannot be stored.
-            ·  Archive entries are limited to 8 gigabytes in size.
+            1m·   22mArchive entries are limited to 8 gigabytes in size.
             Generally, users should prefer the ustar format for portability
             as the v7 tar format is both less useful and less portable.
 
@@ -134,7 +134,7 @@ DESCRIPTION
      Standard Tar) format defined by POSIX in 1988.  POSIX.1-2001 extended the
      ustar format to create the “pax interchange” format.
 
-   Cpio Formats
+   1mCpio Formats0m
      The libarchive library can read a number of common cpio variants and can
      write “odc” and “newc” format archives.  A cpio archive stores each entry
      as a fixed-size header followed by a variable-length filename and vari‐
@@ -144,12 +144,12 @@ DESCRIPTION
      the values as octal or hexadecimal numbers in ASCII, others as binary
      values of varying byte order and length.
 
-     binary  The libarchive library transparently reads both big-endian and
+     1mbinary  22mThe libarchive library transparently reads both big-endian and
             little-endian variants of the original binary cpio format.  This
             format used 32-bit binary values for file size and mtime, and
             16-bit binary values for the other fields.
 
-     odc     The libarchive library can both read and write this POSIX-stan‐
+     1modc     22mThe libarchive library can both read and write this POSIX-stan‐
             dard format, which is officially known as the “cpio interchange
             format” or the “octet-oriented cpio archive format” and sometimes
             unofficially referred to as the “old character format”.  This
@@ -158,7 +158,7 @@ DESCRIPTION
             File sizes and mtime are limited to 33 bits (8GB file size),
             other fields are limited to 18 bits.
 
-     SVR4/newc
+     1mSVR4/newc0m
             The libarchive library can read both CRC and non-CRC variants of
             this format.  The SVR4 format uses eight-digit hexadecimal values
             for all header fields.  This limits file size to 4GB, and also
@@ -171,7 +171,7 @@ DESCRIPTION
      of AT&T in 1981.  This makes cpio older than tar, although cpio was not
      included in Version 7 AT&T Unix.  As a result, the tar command became
      much better known in universities and research groups that used Version
-     7.  The combination of the find and cpio utilities provided very precise
+     7.  The combination of the 1mfind 22mand 1mcpio 22mutilities provided very precise
      control over file selection.  Unfortunately, the format has many limita‐
      tions that make it unsuitable for widespread use. Only the POSIX format
      permits files over 4GB, and its 18-bit limit for most other fields makes
@@ -180,19 +180,19 @@ DESCRIPTION
      very difficult to correctly transfer archives across systems with dissim‐
      ilar user numbering.
 
-   Shar Formats
+   1mShar Formats0m
      A “shell archive” is a shell script that, when executed on a POSIX-com‐
      pliant system, will recreate a collection of file system objects. The
      libarchive library can write two different kinds of shar archives:
 
-     shar    The traditional shar format uses a limited set of POSIX commands,
+     1mshar    22mThe traditional shar format uses a limited set of POSIX commands,
             including echo(1), mkdir(1), and sed(1).  It is suitable for
             portably archiving small collections of plain text files.  How‐
             ever, it is not generally well-suited for large archives (many
             implementations of sh(1) have limits on the size of a script) nor
             should it be used with non-text files.
 
-     shardump
+     1mshardump0m
             This format is similar to shar but encodes files using
             uuencode(1) so that the result will be a plain text file regard‐
             less of the file contents.  It also includes additional shell
@@ -201,7 +201,7 @@ DESCRIPTION
             mands used to restore file attributes make shardump archives less
             portable than plain shar archives.
 
-   ISO9660 format
+   1mISO9660 format0m
      Libarchive can read and extract from files containing ISO9660-compliant
      CDROM images.  In many cases, this can remove the need to burn a physical
      CDROM just in order to read the files contained in an ISO9660 image.  It
@@ -230,7 +230,7 @@ DESCRIPTION
      tion used for the temporary file can be changed by the usual environment
      variables.
 
-   Zip format
+   1mZip format0m
      Libarchive can read and write zip format archives that have uncompressed
      entries and entries compressed with the “deflate” algorithm.  Other zip
      compression algorithms are not supported. It can extract jar archives,
@@ -260,7 +260,7 @@ DESCRIPTION
      modified in-place can have deleted entries or other garbage data that can
      only be accurately detected by first reading the Central Directory.
 
-   Archive (library) file format
+   1mArchive (library) file format0m
      The Unix archive format (commonly created by the ar(1) archiver) is a
      general-purpose format which is used almost exclusively for object files
      to be read by the link editor ld(1).  The ar format has never been stan‐
@@ -271,13 +271,13 @@ DESCRIPTION
      the BSD format stores each long filename in an extension area adjacent to
      the entry.  Libarchive can read both extensions, including archives that
      may include both types of long filenames. Programs using libarchive can
-     write GNU/SVR4 format if they provide an entry called // containing a
+     write GNU/SVR4 format if they provide an entry called 4m//24m containing a
      filename table to be written into the archive before any of the entries.
      Any entries whose names are not in the filename table will be written
      using BSD-style long filenames.  This can cause problems for programs
      such as GNU ld that do not support the BSD-style long filenames.
 
-   mtree
+   1mmtree0m
      Libarchive can read and write files in mtree(5) format.  This format is
      not a true archive format, but rather a textual description of a file
      hierarchy in which each line specifies the name of a file and provides
@@ -288,44 +288,44 @@ DESCRIPTION
      archive_write_set_options(3) interface to specify which keywords should
      be included in the output.  If libarchive was compiled with access to
      suitable cryptographic libraries (such as the OpenSSL libraries), it can
-     compute hash entries such as sha512 or md5 from file data being written
+     compute hash entries such as 1msha512 22mor 1mmd5 22mfrom file data being written
      to the mtree writer.
 
      When reading an mtree file, libarchive will locate the corresponding
-     files on disk using the contents keyword if present or the regular file‐
+     files on disk using the 1mcontents 22mkeyword if present or the regular file‐
      name.  If it can locate and open the file on disk, it will use that to
      fill in any metadata that is missing from the mtree file and will read
      the file contents and return those to the program using libarchive.  If
      it cannot locate and open the file on disk, libarchive will return an
      error for any attempt to read the entry body.
 
-   7-Zip
+   1m7-Zip0m
      Libarchive can read and write 7-Zip format archives.  TODO: Need more
      information
 
-   CAB
+   1mCAB0m
      Libarchive can read Microsoft Cabinet ( “CAB”) format archives.  TODO:
      Need more information.
 
-   LHA
+   1mLHA0m
      TODO: Information about libarchive's LHA support
 
-   RAR
+   1mRAR0m
      Libarchive has limited support for reading RAR format archives.  Cur‐
      rently, libarchive can read RARv3 format archives which have been either
      created uncompressed, or compressed using any of the compression methods
      supported by the RARv3 format.  Libarchive can also read self-extracting
      RAR archives.
 
-   Warc
+   1mWarc0m
      Libarchive can read and write “web archives”.  TODO: Need more informa‐
      tion
 
-   XAR
+   1mXAR0m
      Libarchive can read and write the XAR format used by many Apple tools.
      TODO: Need more information
 
-SEE ALSO
+1mSEE ALSO0m
      ar(1), cpio(1), mkisofs(1), shar(1), tar(1), zip(1), zlib(3), cpio(5),
      mtree(5), tar(5)
 
index 4846424..0c24e19 100644 (file)
@@ -1,11 +1,11 @@
 LIBARCHIVE(3)           BSD Library Functions Manual            LIBARCHIVE(3)
 
-NAME
-     libarchive — functions for reading and writing streaming archives
+1mNAME0m
+     1mlibarchive 22m— functions for reading and writing streaming archives
 
-OVERVIEW
-     The libarchive library provides a flexible interface for reading and
-     writing archives in various formats such as tar and cpio. libarchive
+1mOVERVIEW0m
+     The 1mlibarchive 22mlibrary provides a flexible interface for reading and
+     writing archives in various formats such as tar and cpio. 1mlibarchive0m
      also supports reading and writing archives compressed using various com‐
      pression filters such as gzip and bzip2.  The library is inherently
      stream-oriented; readers serially iterate through the archive, writers
@@ -15,19 +15,19 @@ OVERVIEW
 
      When reading an archive, the library automatically detects the format and
      the compression.  The library currently has read support for:
-     ·         old-style tar archives,
-     ·         most variants of the POSIX “ustar” format,
-     ·         the POSIX “pax interchange” format,
-     ·         GNU-format tar archives,
-     ·         most common cpio archive formats,
-     ·         ISO9660 CD images (including RockRidge and Joliet extensions),
-     ·         Zip archives,
-     ·         ar archives (including GNU/SysV and BSD extensions),
-     ·         Microsoft CAB archives,
-     ·         LHA archives,
-     ·         mtree file tree descriptions,
-     ·         RAR archives,
-     ·         XAR archives.
+     1m·   22mold-style tar archives,
+     1m·   22mmost variants of the POSIX “ustar” format,
+     1m·   22mthe POSIX “pax interchange” format,
+     1m·   22mGNU-format tar archives,
+     1m·   22mmost common cpio archive formats,
+     1m·   22mISO9660 CD images (including RockRidge and Joliet extensions),
+     1m·   22mZip archives,
+     1m·   22mar archives (including GNU/SysV and BSD extensions),
+     1m·   22mMicrosoft CAB archives,
+     1m·   22mLHA archives,
+     1m·   22mmtree file tree descriptions,
+     1m·   22mRAR archives,
+     1m·   22mXAR archives.
      The library automatically detects archives compressed with gzip(1),
      bzip2(1), xz(1), lzip(1), or compress(1) and decompresses them transpar‐
      ently.  It can similarly detect and decode archives processed with
@@ -35,16 +35,16 @@ OVERVIEW
 
      When writing an archive, you can specify the compression to be used and
      the format to use.  The library can write
-     ·         POSIX-standard “ustar” archives,
-     ·         POSIX “pax interchange format” archives,
-     ·         POSIX octet-oriented cpio archives,
-     ·         Zip archive,
-     ·         two different variants of shar archives,
-     ·         ISO9660 CD images,
-     ·         7-Zip archives,
-     ·         ar archives,
-     ·         mtree file tree descriptions,
-     ·         XAR archives.
+     1m·   22mPOSIX-standard “ustar” archives,
+     1m·   22mPOSIX “pax interchange format” archives,
+     1m·   22mPOSIX octet-oriented cpio archives,
+     1m·   22mZip archive,
+     1m·   22mtwo different variants of shar archives,
+     1m·   22mISO9660 CD images,
+     1m·   22m7-Zip archives,
+     1m·   22mar archives,
+     1m·   22mmtree file tree descriptions,
+     1m·   22mXAR archives.
      Pax interchange format is an extension of the tar archive format that
      eliminates essentially all of the limitations of historic tar formats in
      a standard fashion that is supported by POSIX-compliant pax(1) implemen‐
@@ -53,29 +53,29 @@ OVERVIEW
      extended attributes for most entries; explicitly requesting pax format
      will enable those attributes for all entries.
 
-     The read and write APIs are accessed through the archive_read_XXX() func‐
-     tions and the archive_write_XXX() functions, respectively, and either can
+     The read and write APIs are accessed through the 1marchive_read_XXX22m() func‐
+     tions and the 1marchive_write_XXX22m() functions, respectively, and either can
      be used independently of the other.
 
      The rest of this manual page provides an overview of the library opera‐
      tion.  More detailed information can be found in the individual manual
      pages for each API or utility function.
 
-READING AN ARCHIVE
+1mREADING AN ARCHIVE0m
      See archive_read(3).
 
-WRITING AN ARCHIVE
+1mWRITING AN ARCHIVE0m
      See archive_write(3).
 
-WRITING ENTRIES TO DISK
+1mWRITING ENTRIES TO DISK0m
      The archive_write_disk(3) API allows you to write archive_entry(3)
      objects to disk using the same API used by archive_write(3).  The
-     archive_write_disk(3) API is used internally by archive_read_extract();
+     archive_write_disk(3) API is used internally by 1marchive_read_extract22m();
      using it directly can provide greater control over how entries get writ‐
      ten to disk.  This API also makes it possible to share code between ar‐
      chive-to-archive copy and archive-to-disk extraction operations.
 
-READING ENTRIES FROM DISK
+1mREADING ENTRIES FROM DISK0m
      The archive_read_disk(3) supports for populating archive_entry(3) objects
      from information in the filesystem.  This includes the information acces‐
      sible from the stat(2) system call as well as ACLs, extended attributes,
@@ -83,7 +83,7 @@ READING ENTRIES FROM DISK
      over directory trees, which allows directories of files to be read using
      an API compatible with the archive_read(3) API.
 
-DESCRIPTION
+1mDESCRIPTION0m
      Detailed descriptions of each function are provided by the corresponding
      manual pages.
 
@@ -99,43 +99,43 @@ DESCRIPTION
      Clients should not assume that filenames, link names, user names, or
      group names are limited in length.  In particular, pax interchange format
      can easily accommodate pathnames in arbitrary character sets that exceed
-     PATH_MAX.
+     4mPATH_MAX24m.
 
-RETURN VALUES
-     Most functions return ARCHIVE_OK (zero) on success, non-zero on error.
+1mRETURN VALUES0m
+     Most functions return 1mARCHIVE_OK 22m(zero) on success, non-zero on error.
      The return value indicates the general severity of the error, ranging
-     from ARCHIVE_WARN, which indicates a minor problem that should probably
-     be reported to the user, to ARCHIVE_FATAL, which indicates a serious
+     from 1mARCHIVE_WARN22m, which indicates a minor problem that should probably
+     be reported to the user, to 1mARCHIVE_FATAL22m, which indicates a serious
      problem that will prevent any further operations on this archive. On
-     error, the archive_errno() function can be used to retrieve a numeric
-     error code (see errno(2)).  The archive_error_string() returns a textual
+     error, the 1marchive_errno22m() function can be used to retrieve a numeric
+     error code (see errno(2)).  The 1marchive_error_string22m() returns a textual
      error message suitable for display.
 
-     archive_read_new() and archive_write_new() return pointers to an allo‐
+     1marchive_read_new22m() and 1marchive_write_new22m() return pointers to an allo‐
      cated and initialized struct archive object.
 
-     archive_read_data() and archive_write_data() return a count of the number
+     1marchive_read_data22m() and 1marchive_write_data22m() return a count of the number
      of bytes actually read or written.  A value of zero indicates the end of
      the data for this entry.  A negative value indicates an error, in which
-     case the archive_errno() and archive_error_string() functions can be used
+     case the 1marchive_errno22m() and 1marchive_error_string22m() functions can be used
      to obtain more information.
 
-ENVIRONMENT
+1mENVIRONMENT0m
      There are character set conversions within the archive_entry(3) functions
      that are impacted by the currently-selected locale.
 
-SEE ALSO
+1mSEE ALSO0m
      tar(1), archive_entry(3), archive_read(3), archive_util(3),
      archive_write(3), tar(5)
 
-HISTORY
-     The libarchive library first appeared in FreeBSD 5.3.
+1mHISTORY0m
+     The 1mlibarchive 22mlibrary first appeared in FreeBSD 5.3.
 
-AUTHORS
-     The libarchive library was originally written by Tim Kientzle
+1mAUTHORS0m
+     The 1mlibarchive 22mlibrary was originally written by Tim Kientzle
      <kientzle@acm.org>.
 
-BUGS
+1mBUGS0m
      Some archive formats support information that is not supported by struct
      archive_entry.  Such information cannot be fully archived or restored
      using this library.  This includes, for example, comments, character
index dbd3568..e7133aa 100644 (file)
@@ -1,21 +1,21 @@
 LIBARCHIVE_CHANGES(3)   BSD Library Functions Manual    LIBARCHIVE_CHANGES(3)
 
-NAME
+1mNAME0m
      — changes in libarchive interface
 
-CHANGES IN LIBARCHIVE 3
+1mCHANGES IN LIBARCHIVE 30m
      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
+   1mMultiple Filters0m
      Libarchive2 permitted a single (input or output) filter active on an ar‐
      chive.  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
+     1marchive_write_set_compression_XXX22m() would replace any existing filter,
+     1marchive_write_add_filter_XXX22m() extends the write pipeline with another
      filter.
 
-   Character Set Handling
+   1mCharacter Set Handling0m
      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 ar‐
@@ -35,7 +35,7 @@ CHANGES IN LIBARCHIVE 3
      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.
+     1mnl_langinfo22m(4mCHARSET24m)) will be used if nothing else is specified.
 
      Libarchive3 also introduces charset options to many of the archive read‐
      ers and writers to control the character set that will be used for file‐
@@ -46,7 +46,7 @@ CHANGES IN LIBARCHIVE 3
      have the filenames and other information transparently converted to the
      character encoding suitable for your application.
 
-   Prototype Changes
+   1mPrototype Changes0m
      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,
@@ -54,12 +54,12 @@ CHANGES IN LIBARCHIVE 3
 
      There are a few cases where these changes will affect your source code:
 
-     ·          In some cases, libarchive's wider types will introduce the possibil‐
+     1m·    22mIn some cases, libarchive's wider types will introduce the possibil‐
          ity of truncation: for example, on a system with a 16-bit uid_t, you
          risk having uid 65536 be truncated to uid 0, which can cause serious
          security problems.
 
-     ·          Typedef function pointer types will be incompatible.  For example,
+     1m·    22mTypedef function pointer types will be incompatible.  For example,
          if you define custom skip callbacks, you may have to use code simi‐
          lar to the following if you want to support building against
          libarchive2 and libarchive3:
@@ -78,130 +78,130 @@ CHANGES IN LIBARCHIVE 3
 
      Affected functions:
 
-     ·         archive_entry_gid(), archive_entry_set_gid()
-     ·         archive_entry_uid(), archive_entry_set_uid()
-     ·         archive_entry_ino(), archive_entry_set_ino()
-     ·         archive_read_data_block(), archive_write_data_block()
-     ·         archive_read_disk_gname(), archive_read_disk_uname()
-     ·         archive_read_disk_set_gname_lookup(),
-        archive_read_disk_set_group_lookup(),
-        archive_read_disk_set_uname_lookup(),
-        archive_read_disk_set_user_lookup()
-     ·         archive_skip_callback()
-     ·         archive_read_extract_set_skip_file(),
-        archive_write_disk_set_skip_file(), archive_write_set_skip_file()
-     ·         archive_write_disk_set_group_lookup(),
-        archive_write_disk_set_user_lookup()
+     1m·   archive_entry_gid22m(), 1marchive_entry_set_gid22m()
+     1m·   archive_entry_uid22m(), 1marchive_entry_set_uid22m()
+     1m·   archive_entry_ino22m(), 1marchive_entry_set_ino22m()
+     1m·   archive_read_data_block22m(), 1marchive_write_data_block22m()
+     1m·   archive_read_disk_gname22m(), 1marchive_read_disk_uname22m()
+     1m·   archive_read_disk_set_gname_lookup22m(),
+        1marchive_read_disk_set_group_lookup22m(),
+        1marchive_read_disk_set_uname_lookup22m(),
+        1marchive_read_disk_set_user_lookup22m()
+     1m·   archive_skip_callback22m()
+     1m·   archive_read_extract_set_skip_file22m(),
+        1marchive_write_disk_set_skip_file22m(), 1marchive_write_set_skip_file22m()
+     1m·   archive_write_disk_set_group_lookup22m(),
+        1marchive_write_disk_set_user_lookup22m()
 
      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
+   1mDeprecated Symbols0m
      Symbols deprecated in libarchive3 will be removed in libarchive4. These
      symbols, along with their replacements if any, are listed below:
 
-     archive_position_compressed(), archive_position_uncompressed()
-         archive_filter_bytes()
+     1marchive_position_compressed22m(), 1marchive_position_uncompressed22m()
+         1marchive_filter_bytes22m()
 
-     archive_compression()
-         archive_filter_code()
+     1marchive_compression22m()
+         1marchive_filter_code22m()
 
-     archive_compression_name()
-         archive_filter_name()
+     1marchive_compression_name22m()
+         1marchive_filter_name22m()
 
-     archive_read_finish(), archive_write_finish()
-         archive_read_free(), archive_write_free()
+     1marchive_read_finish22m(), 1marchive_write_finish22m()
+         1marchive_read_free22m(), 1marchive_write_free22m()
 
-     archive_read_open_file(), archive_write_open_file()
-         archive_read_open_filename(), archive_write_open_filename()
+     1marchive_read_open_file22m(), 1marchive_write_open_file22m()
+         1marchive_read_open_filename22m(), 1marchive_write_open_filename22m()
 
-     archive_read_support_compression_all()
-         archive_read_support_filter_all()
+     1marchive_read_support_compression_all22m()
+         1marchive_read_support_filter_all22m()
 
-     archive_read_support_compression_bzip2()
-         archive_read_support_filter_bzip2()
+     1marchive_read_support_compression_bzip222m()
+         1marchive_read_support_filter_bzip222m()
 
-     archive_read_support_compression_compress()
-         archive_read_support_filter_compress()
+     1marchive_read_support_compression_compress22m()
+         1marchive_read_support_filter_compress22m()
 
-     archive_read_support_compression_gzip()
-         archive_read_support_filter_gzip()
+     1marchive_read_support_compression_gzip22m()
+         1marchive_read_support_filter_gzip22m()
 
-     archive_read_support_compression_lzip()
-         archive_read_support_filter_lzip()
+     1marchive_read_support_compression_lzip22m()
+         1marchive_read_support_filter_lzip22m()
 
-     archive_read_support_compression_lzma()
-         archive_read_support_filter_lzma()
+     1marchive_read_support_compression_lzma22m()
+         1marchive_read_support_filter_lzma22m()
 
-     archive_read_support_compression_none()
-         archive_read_support_filter_none()
+     1marchive_read_support_compression_none22m()
+         1marchive_read_support_filter_none22m()
 
-     archive_read_support_compression_program()
-         archive_read_support_filter_program()
+     1marchive_read_support_compression_program22m()
+         1marchive_read_support_filter_program22m()
 
-     archive_read_support_compression_program_signature()
-         archive_read_support_filter_program_signature()
+     1marchive_read_support_compression_program_signature22m()
+         1marchive_read_support_filter_program_signature22m()
 
-     archive_read_support_compression_rpm()
-         archive_read_support_filter_rpm()
+     1marchive_read_support_compression_rpm22m()
+         1marchive_read_support_filter_rpm22m()
 
-     archive_read_support_compression_uu()
-         archive_read_support_filter_uu()
+     1marchive_read_support_compression_uu22m()
+         1marchive_read_support_filter_uu22m()
 
-     archive_read_support_compression_xz()
-         archive_read_support_filter_xz()
+     1marchive_read_support_compression_xz22m()
+         1marchive_read_support_filter_xz22m()
 
-     archive_write_set_compression_bzip2()
-         archive_write_add_filter_bzip2()
+     1marchive_write_set_compression_bzip222m()
+         1marchive_write_add_filter_bzip222m()
 
-     archive_write_set_compression_compress()
-         archive_write_add_filter_compress()
+     1marchive_write_set_compression_compress22m()
+         1marchive_write_add_filter_compress22m()
 
-     archive_write_set_compression_gzip()
-         archive_write_add_filter_gzip()
+     1marchive_write_set_compression_gzip22m()
+         1marchive_write_add_filter_gzip22m()
 
-     archive_write_set_compression_lzip()
-         archive_write_add_filter_lzip()
+     1marchive_write_set_compression_lzip22m()
+         1marchive_write_add_filter_lzip22m()
 
-     archive_write_set_compression_lzma()
-         archive_write_add_filter_lzma()
+     1marchive_write_set_compression_lzma22m()
+         1marchive_write_add_filter_lzma22m()
 
-     archive_write_set_compression_none()
-         archive_write_add_filter_none()
+     1marchive_write_set_compression_none22m()
+         1marchive_write_add_filter_none22m()
 
-     archive_write_set_compression_program()
-         archive_write_add_filter_program()
+     1marchive_write_set_compression_program22m()
+         1marchive_write_add_filter_program22m()
 
-     archive_write_set_compression_filter()
-         archive_write_add_filter_filter()
+     1marchive_write_set_compression_filter22m()
+         1marchive_write_add_filter_filter22m()
 
-   Removed Symbols
+   1mRemoved Symbols0m
      These symbols, listed below along with their replacements if any, were
      deprecated in libarchive2, and are not part of libarchive3.
 
-     archive_api_feature()
-         archive_version_number()
+     1marchive_api_feature22m()
+         1marchive_version_number22m()
 
-     archive_api_version()
-         archive_version_number()
+     1marchive_api_version22m()
+         1marchive_version_number22m()
 
-     archive_version()
-         archive_version_string()
+     1marchive_version22m()
+         1marchive_version_string22m()
 
-     archive_version_stamp()
-         archive_version_number()
+     1marchive_version_stamp22m()
+         1marchive_version_number22m()
 
-     archive_read_set_filter_options()
-         archive_read_set_options() or archive_read_set_filter_option()
+     1marchive_read_set_filter_options22m()
+         1marchive_read_set_options22m() or 1marchive_read_set_filter_option22m()
 
-     archive_read_set_format_options()
-         archive_read_set_options() or archive_read_set_format_option()
+     1marchive_read_set_format_options22m()
+         1marchive_read_set_options22m() or 1marchive_read_set_format_option22m()
 
-     archive_write_set_filter_options()
-         archive_write_set_options() or archive_write_set_filter_option()
+     1marchive_write_set_filter_options22m()
+         1marchive_write_set_options22m() or 1marchive_write_set_filter_option22m()
 
-     archive_write_set_format_options()
-         archive_write_set_options() or archive_write_set_format_option()
+     1marchive_write_set_format_options22m()
+         1marchive_write_set_options22m() or 1marchive_write_set_format_option22m()
 
      ARCHIVE_API_FEATURE
          ARCHIVE_VERSION_NUMBER
@@ -251,7 +251,7 @@ CHANGES IN LIBARCHIVE 3
      ARCHIVE_DEFAULT_BYTES_PER_BLOCK
          10240
 
-SEE ALSO
+1mSEE ALSO0m
      libarchive(3), archive_read(3), archive_read_filter(3),
      archive_read_format(3), archive_read_set_options(3), archive_write(3),
      archive_write_filter(3), archive_write_format(3),
index 7b7fb35..4652938 100644 (file)
@@ -1,15 +1,15 @@
 LIBARCHIVE_INTERNALS(3)  BSD Library Functions Manual  LIBARCHIVE_INTERNALS(3)
 
-NAME
-     libarchive_internals — description of libarchive internal interfaces
+1mNAME0m
+     1mlibarchive_internals 22m— description of libarchive internal interfaces
 
-OVERVIEW
-     The libarchive library provides a flexible interface for reading and
+1mOVERVIEW0m
+     The 1mlibarchive 22mlibrary provides a flexible interface for reading and
      writing streaming archive files such as tar and cpio.  Internally, it
      follows a modular layered design that should make it easy to add new ar‐
      chive and compression formats.
 
-GENERAL ARCHITECTURE
+1mGENERAL ARCHITECTURE0m
      Externally, libarchive exposes most operations through an opaque, object-
      style interface.  The archive_entry(3) objects store information about a
      single filesystem object. The rest of the library provides facilities to
@@ -27,17 +27,17 @@ GENERAL ARCHITECTURE
      clients to open an archive or disk writer, and then use a single set of
      code to select and write entries, regardless of the target.
 
-READ ARCHITECTURE
+1mREAD ARCHITECTURE0m
      From the outside, clients use the archive_read(3) API to manipulate an
-     archive object to read entries and bodies from an archive stream. Inter‐
-     nally, the archive object is cast to an archive_read object, which holds
+     1marchive 22mobject to read entries and bodies from an archive stream.  Inter‐
+     nally, the 1marchive 22mobject is cast to an 1marchive_read 22mobject, which holds
      all read-specific data.  The API has four layers: The lowest layer is the
      I/O layer.  This layer can be overridden by clients, but most clients use
      the packaged I/O callbacks provided, for example, by
      archive_read_open_memory(3), and archive_read_open_fd(3). The compres‐
      sion layer calls the I/O layer to read bytes and decompresses them for
      the format layer. The format layer unpacks a stream of uncompressed
-     bytes and creates archive_entry objects from the incoming data.  The API
+     bytes and creates 1marchive_entry 22mobjects from the incoming data.  The API
      layer tracks overall state (for example, it prevents clients from reading
      data before reading a header) and invokes the format and compression
      layer operations through registered function pointers.  In particular,
@@ -49,7 +49,7 @@ READ ARCHITECTURE
      ders were invoked for each entry, but this design hindered error recov‐
      ery.)
 
-   I/O Layer and Client Callbacks
+   1mI/O Layer and Client Callbacks0m
      The read API goes to some lengths to be nice to clients.  As a result,
      there are few restrictions on the behavior of the client callbacks.
 
@@ -71,7 +71,7 @@ READ ARCHITECTURE
      single block; other clients may begin asynchronous I/O operations for the
      next block on each request.
 
-   Decompresssion Layer
+   1mDecompresssion Layer0m
      The decompression layer not only handles decompression, it also buffers
      data so that the format handlers see a much nicer I/O model.  The decom‐
      pression API is a two stage peek/consume model.  A read_ahead request
@@ -81,10 +81,10 @@ READ ARCHITECTURE
      asking for a minimum of one byte and then copying as much data as is
      available.
 
-     A subsequent call to the consume() function advances the read pointer.
-     Note that data returned from a read_ahead() call is guaranteed to remain
-     in place until the next call to read_ahead().  Intervening calls to
-     consume() should not cause the data to move.
+     A subsequent call to the 1mconsume22m() function advances the read pointer.
+     Note that data returned from a 1mread_ahead22m() call is guaranteed to remain
+     in place until the next call to 1mread_ahead22m().  Intervening calls to
+     1mconsume22m() should not cause the data to move.
 
      Skip requests must always be handled exactly.  Decompression handlers
      that cannot seek forward should not register a skip handler; the API
@@ -94,14 +94,14 @@ READ ARCHITECTURE
      Registration/Configuration
             When the client invokes the public support function, the decom‐
             pression handler invokes the internal
-            __archive_read_register_compression() function to provide bid and
-            initialization functions.  This function returns NULL on error or
-            else a pointer to a struct decompressor_t.  This structure con‐
-            tains a void * config slot that can be used for storing any cus‐
+            1m__archive_read_register_compression22m() function to provide bid and
+            initialization functions.  This function returns 1mNULL 22mon error or
+            else a pointer to a 1mstruct decompressor_t22m.  This structure con‐
+            tains a 4mvoid24m 4m*24m 4mconfig24m slot that can be used for storing any cus‐
             tomization information.
      Bid     The bid function is invoked with a pointer and size of a block of
             data.  The decompressor can access its config data through the
-            decompressor element of the archive_read object.  The bid func‐
+            4mdecompressor24m element of the 1marchive_read 22mobject.  The bid func‐
             tion is otherwise stateless.  In particular, it must not perform
             any I/O operations.
 
@@ -116,28 +116,28 @@ READ ARCHITECTURE
             require two bytes for correct bidding.)
      Initialize
             The winning bidder will have its init function called.  This
-            function should initialize the remaining slots of the struct
-            decompressor_t object pointed to by the decompressor element of
-            the archive_read object.  In particular, it should allocate any
-            working data it needs in the data slot of that structure.  The
+            function should initialize the remaining slots of the 4mstruct0m
+            4mdecompressor_t24m object pointed to by the 4mdecompressor24m element of
+            the 4marchive_read24m object.  In particular, it should allocate any
+            working data it needs in the 4mdata24m slot of that structure.  The
             init function is called with the block of data that was used for
             tasting.  At this point, the decompressor is responsible for all
             I/O requests to the client callbacks.  The decompressor is free
             to read more data as and when necessary.
      Satisfy I/O requests
-            The format handler will invoke the read_ahead, consume, and skip
+            The format handler will invoke the 4mread_ahead24m, 4mconsume24m, and 4mskip0m
             functions as needed.
      Finish  The finish method is called only once when the archive is closed.
-            It should release anything stored in the data and config slots of
-            the decompressor object.  It should not invoke the client close
+            It should release anything stored in the 4mdata24m and 4mconfig24m slots of
+            the 4mdecompressor24m object.  It should not invoke the client close
             callback.
 
-   Format Layer
+   1mFormat Layer0m
      The read formats have a similar lifecycle to the decompression handlers:
      Registration
             Allocate your private data and initialize your pointers.
-     Bid     Formats bid by invoking the read_ahead() decompression method but
-            not calling the consume() method.  This allows each bidder to
+     Bid     Formats bid by invoking the 1mread_ahead22m() decompression method but
+            not calling the 1mconsume22m() method.  This allows each bidder to
             look ahead in the input stream.  Bidders should not look further
             ahead than necessary, as long look aheads put pressure on the
             decompression layer to buffer lots of data.  Most formats only
@@ -168,47 +168,47 @@ READ ARCHITECTURE
             The skip data call should skip over all file data and trailing
             padding.  This is called automatically by the API layer just
             before each header read.  It is also called in response to the
-            client calling the public data_skip() function.
+            client calling the public 1mdata_skip22m() function.
      Cleanup
             On cleanup, the format should release all of its allocated mem‐
             ory.
 
-   API Layer
+   1mAPI Layer0m
      XXX to do XXX
 
-WRITE ARCHITECTURE
+1mWRITE ARCHITECTURE0m
      The write API has a similar set of four layers: an API layer, a format
      layer, a compression layer, and an I/O layer.  The registration here is
      much simpler because only one format and one compression can be regis‐
      tered at a time.
 
-   I/O Layer and Client Callbacks
+   1mI/O Layer and Client Callbacks0m
      XXX To be written XXX
 
-   Compression Layer
+   1mCompression Layer0m
      XXX To be written XXX
 
-   Format Layer
+   1mFormat Layer0m
      XXX To be written XXX
 
-   API Layer
+   1mAPI Layer0m
      XXX To be written XXX
 
-WRITE_DISK ARCHITECTURE
+1mWRITE_DISK ARCHITECTURE0m
      The write_disk API is intended to look just like the write API to
      clients.  Since it does not handle multiple formats or compression, it is
      not layered internally.
 
-GENERAL SERVICES
-     The archive_read, archive_write, and archive_write_disk objects all con‐
-     tain an initial archive object which provides common support for a set of
+1mGENERAL SERVICES0m
+     The 1marchive_read22m, 1marchive_write22m, and 1marchive_write_disk 22mobjects all con‐
+     tain an initial 1marchive 22mobject which provides common support for a set of
      standard services.  (Recall that ANSI/ISO C90 guarantees that you can
      cast freely between a pointer to a structure and a pointer to the first
-     element of that structure.)  The archive object has a magic value that
+     element of that structure.)  The 1marchive 22mobject has a magic value that
      indicates which API this object is associated with, slots for storing
      error information, and function pointers for virtualized API functions.
 
-MISCELLANEOUS NOTES
+1mMISCELLANEOUS NOTES0m
      Connecting existing archiving libraries into libarchive is generally
      quite difficult.  In particular, many existing libraries strongly assume
      that you are reading from a file; they seek forwards and backwards as
@@ -234,14 +234,14 @@ MISCELLANEOUS NOTES
      though it cannot always extract as much information as a dedicated ZIP
      program.
 
-SEE ALSO
+1mSEE ALSO0m
      archive_entry(3), archive_read(3), archive_write(3),
      archive_write_disk(3) libarchive(3),
 
-HISTORY
-     The libarchive library first appeared in FreeBSD 5.3.
+1mHISTORY0m
+     The 1mlibarchive 22mlibrary first appeared in FreeBSD 5.3.
 
-AUTHORS
-     The libarchive library was written by Tim Kientzle <kientzle@acm.org>.
+1mAUTHORS0m
+     The 1mlibarchive 22mlibrary was written by Tim Kientzle <kientzle@acm.org>.
 
 BSD                           January 26, 2011                            BSD
index b576548..bc20cbc 100644 (file)
@@ -1,15 +1,15 @@
 MTREE(5)                   BSD File Formats Manual                   MTREE(5)
 
-NAME
-     mtree — format of mtree dir hierarchy files
+1mNAME0m
+     1mmtree 22m— format of mtree dir hierarchy files
 
-DESCRIPTION
-     The mtree format is a textual format that describes a collection of
+1mDESCRIPTION0m
+     The 1mmtree 22mformat is a textual format that describes a collection of
      filesystem objects.  Such files are typically used to create or verify
      directory hierarchies.
 
-   General Format
-     An mtree file consists of a series of lines, each providing information
+   1mGeneral Format0m
+     An 1mmtree 22mfile consists of a series of lines, each providing information
      about a single filesystem object. Leading whitespace is always ignored.
 
      When encoding file or pathnames, any backslash character or character
@@ -22,44 +22,44 @@ DESCRIPTION
 
      Blank      Blank lines are ignored.
 
-     Comment    Lines beginning with are ignored.
+     Comment    Lines beginning with 1m# 22mare ignored.
 
-     Special    Lines beginning with are special commands that influence
+     Special    Lines beginning with 1m/ 22mare special commands that influence
                 the interpretation of later lines.
 
-     Relative   If the first whitespace-delimited word has no characters,
+     Relative   If the first whitespace-delimited word has no 1m/ 22mcharacters,
                 it is the name of a file in the current directory.  Any rela‐
                 tive entry that describes a directory changes the current
                 directory.
 
-     dot-dot    As a special case, a relative entry with the filename ..
+     dot-dot    As a special case, a relative entry with the filename 4m..0m
                 changes the current directory to the parent directory.
                 Options on dot-dot entries are always ignored.
 
-     Full       If the first whitespace-delimited word has a character
+     Full       If the first whitespace-delimited word has a 1m/ 22mcharacter
                 after the first character, it is the pathname of a file rela‐
                 tive to the starting directory.  There can be multiple full
                 entries describing the same file.
 
-     Some tools that process mtree files may require that multiple lines
+     Some tools that process 1mmtree 22mfiles may require that multiple lines
      describing the same file occur consecutively.  It is not permitted for
      the same file to be mentioned using both a relative and a full file spec‐
      ification.
 
-   Special commands
+   1mSpecial commands0m
      Two special commands are currently defined:
 
-     /set       This command defines default values for one or more keywords.
+     1m/set       22mThis command defines default values for one or more keywords.
                 It is followed on the same line by one or more whitespace-
                 separated keyword definitions.  These definitions apply to
                 all following files that do not specify a value for that key‐
                 word.
 
-     /unset     This command removes any default value set by a previous /set
+     1m/unset     22mThis command removes any default value set by a previous 1m/set0m
                 command.  It is followed on the same line by one or more key‐
                 words separated by whitespace.
 
-   Keywords
+   1mKeywords0m
      After the filename, a full or relative entry consists of zero or more
      whitespace-separated keyword definitions. Each such definition consists
      of a key from the following list immediately followed by an '=' sign and
@@ -68,113 +68,113 @@ DESCRIPTION
 
      Currently supported keywords are as follows:
 
-     cksum      The checksum of the file using the default algorithm speci‐
+     1mcksum      22mThe checksum of the file using the default algorithm speci‐
                 fied by the cksum(1) utility.
 
-     device     The device number for block or char file types.  The value
+     1mdevice     22mThe device number for 1mblock 22mor 1mchar 22mfile types.  The value
                 must be one of the following forms:
 
-                format,major,minor[,subunit]
-                      A device with major, minor and optional subunit fields.
+                4mformat24m,4mmajor24m,4mminor24m[,4msubunit24m]
+                      A device with 4mmajor24m, 4mminor24m and optional 4msubunit24m fields.
                       Their meaning is specified by the operating's system
-                      format.  See below for valid formats.
+                      4mformat24m.  See below for valid formats.
 
-                number
+                4mnumber0m
                       Opaque number (as stored on the file system).
 
-                The following values for format are recognized: native,
-                386bsd, 4bsd, bsdos, freebsd, hpux, isc, linux, netbsd, osf1,
-                sco, solaris, sunos, svr3, svr4, and ultrix.
+                The following values for 4mformat24m are recognized: 1mnative22m,
+                1m386bsd22m, 1m4bsd22m, 1mbsdos22m, 1mfreebsd22m, 1mhpux22m, 1misc22m, 1mlinux22m, 1mnetbsd22m, 1mosf122m,
+                1msco22m, 1msolaris22m, 1msunos22m, 1msvr322m, 1msvr422m, and 1multrix22m.
 
                 See mknod(8) for more details.
 
-     contents   The full pathname of a file that holds the contents of this
+     1mcontents    22mThe full pathname of a file that holds the contents of this
                 file.
 
-     flags      The file flags as a symbolic name.  See chflags(1) for infor‐
+     1mflags      22mThe file flags as a symbolic name.  See chflags(1) for infor‐
                 mation on these names.  If no flags are to be set the string
                 “none” may be used to override the current default.
 
-     gid        The file group as a numeric value.
+     1mgid        22mThe file group as a numeric value.
 
-     gname      The file group as a symbolic name.
+     1mgname      22mThe file group as a symbolic name.
 
-     ignore     Ignore any file hierarchy below this file.
+     1mignore     22mIgnore any file hierarchy below this file.
 
-     inode      The inode number.
+     1minode      22mThe inode number.
 
-     link       The target of the symbolic link when type=link.
+     1mlink       22mThe target of the symbolic link when type=link.
 
-     md5        The MD5 message digest of the file.
+     1mmd5        22mThe MD5 message digest of the file.
 
-     md5digest  A synonym for md5.
+     1mmd5digest   22mA synonym for 1mmd522m.
 
-     mode       The current file's permissions as a numeric (octal) or sym‐
+     1mmode       22mThe current file's permissions as a numeric (octal) or sym‐
                 bolic value.
 
-     nlink      The number of hard links the file is expected to have.
+     1mnlink      22mThe number of hard links the file is expected to have.
 
-     nochange   Make sure this file or directory exists but otherwise ignore
+     1mnochange    22mMake sure this file or directory exists but otherwise ignore
                 all attributes.
 
-     optional   The file is optional; do not complain about the file if it is
+     1moptional    22mThe file is optional; do not complain about the file if it is
                 not in the file hierarchy.
 
-     resdevice  The “resident” device number of the file, e.g. the ID of the
+     1mresdevice   22mThe “resident” device number of the file, e.g. the ID of the
                 device that contains the file.  Its format is the same as the
-                one for device.
+                one for 1mdevice22m.
 
-     ripemd160digest
+     1mripemd160digest0m
                 The RIPEMD160 message digest of the file.
 
-     rmd160     A synonym for ripemd160digest.
+     1mrmd160     22mA synonym for 1mripemd160digest22m.
 
-     rmd160digest
-                A synonym for ripemd160digest.
+     1mrmd160digest0m
+                A synonym for 1mripemd160digest22m.
 
-     sha1       The FIPS 160-1 (“SHA-1”) message digest of the file.
+     1msha1       22mThe FIPS 160-1 (“SHA-1”) message digest of the file.
 
-     sha1digest  A synonym for sha1.
+     1msha1digest  22mA synonym for 1msha122m.
 
-     sha256     The FIPS 180-2 (“SHA-256”) message digest of the file.
+     1msha256     22mThe FIPS 180-2 (“SHA-256”) message digest of the file.
 
-     sha256digest
-                A synonym for sha256.
+     1msha256digest0m
+                A synonym for 1msha25622m.
 
-     sha384     The FIPS 180-2 (“SHA-384”) message digest of the file.
+     1msha384     22mThe FIPS 180-2 (“SHA-384”) message digest of the file.
 
-     sha384digest
-                A synonym for sha384.
+     1msha384digest0m
+                A synonym for 1msha38422m.
 
-     sha512     The FIPS 180-2 (“SHA-512”) message digest of the file.
+     1msha512     22mThe FIPS 180-2 (“SHA-512”) message digest of the file.
 
-     sha512digest
-                A synonym for sha512.
+     1msha512digest0m
+                A synonym for 1msha51222m.
 
-     size       The size, in bytes, of the file.
+     1msize       22mThe size, in bytes, of the file.
 
-     time       The last modification time of the file.
+     1mtime       22mThe last modification time of the file.
 
-     type       The type of the file; may be set to any one of the following:
+     1mtype       22mThe type of the file; may be set to any one of the following:
 
-                block       block special device
-                char        character special device
-                dir         directory
-                fifo        fifo
-                file        regular file
-                link        symbolic link
-                socket      socket
+                1mblock       22mblock special device
+                1mchar        22mcharacter special device
+                1mdir         22mdirectory
+                1mfifo        22mfifo
+                1mfile        22mregular file
+                1mlink        22msymbolic link
+                1msocket      22msocket
 
-     uid        The file owner as a numeric value.
+     1muid        22mThe file owner as a numeric value.
 
-     uname      The file owner as a symbolic name.
+     1muname      22mThe file owner as a symbolic name.
 
-SEE ALSO
+1mSEE ALSO0m
      cksum(1), find(1), mtree(8)
 
-BUGS
-HISTORY
-     The mtree utility appeared in 4.3BSD-Reno.  The MD5 digest capability was
+1mBUGS0m
+1mHISTORY0m
+     The 1mmtree 22mutility appeared in 4.3BSD-Reno.  The MD5 digest capability was
      added in FreeBSD 2.1, in response to the widespread use of programs which
      can spoof cksum(1).  The SHA-1 and RIPEMD160 digests were added in
      FreeBSD 4.0, as new attacks have demonstrated weaknesses in MD5.  The
index e7c4609..b7d389f 100644 (file)
@@ -1,17 +1,17 @@
 TAR(5)                     BSD File Formats Manual                     TAR(5)
 
-NAME
-     tar — format of tape archive files
+1mNAME0m
+     1mtar 22m— format of tape archive files
 
-DESCRIPTION
-     The tar archive format collects any number of files, directories, and
+1mDESCRIPTION0m
+     The 1mtar 22marchive format collects any number of files, directories, and
      other file system objects (symbolic links, device nodes, etc.) into a
      single stream of bytes.  The format was originally designed to be used
      with tape drives that operate with fixed-size blocks, but is widely used
      as a general packaging mechanism.
 
-   General Format
-     A tar archive consists of a series of 512-byte records.  Each file system
+   1mGeneral Format0m
+     A 1mtar 22marchive consists of a series of 512-byte records.  Each file system
      object requires a header record which stores basic metadata (pathname,
      owner, permissions, etc.) and zero or more records containing any file
      data.  The end of the archive is indicated by two records consisting
@@ -25,16 +25,16 @@ DESCRIPTION
      implementations although block sizes of 1MiB (2048 records) or larger are
      commonly used with modern high-speed tape drives. (Note: the terms
      “block” and “record” here are not entirely standard; this document fol‐
-     lows the convention established by John Gilmore in documenting pdtar.)
+     lows the convention established by John Gilmore in documenting 1mpdtar22m.)
 
-   Old-Style Archive Format
+   1mOld-Style Archive Format0m
      The original tar archive format has been extended many times to include
      additional information that various implementors found necessary. This
      section describes the variant implemented by the tar command included in
      Version 7 AT&T UNIX, which seems to be the earliest widely-used version
      of the tar program.
 
-     The header record for an old-style tar archive consists of the following:
+     The header record for an old-style 1mtar 22marchive consists of the following:
 
           struct header_old_tar {
                   char name[100];
@@ -50,29 +50,29 @@ DESCRIPTION
           };
      All unused bytes in the header record are filled with nulls.
 
-     name    Pathname, stored as a null-terminated string.  Early tar imple‐
+     4mname24m   Pathname, stored as a null-terminated string.  Early tar imple‐
             mentations only stored regular files (including hardlinks to
             those files).  One common early convention used a trailing "/"
             character to indicate a directory name, allowing directory per‐
             missions and owner information to be archived and restored.
 
-     mode    File mode, stored as an octal number in ASCII.
+     4mmode24m   File mode, stored as an octal number in ASCII.
 
-     uid, gid
+     4muid24m, 4mgid0m
             User id and group id of owner, as octal numbers in ASCII.
 
-     size    Size of file, as octal number in ASCII.  For regular files only,
+     4msize24m   Size of file, as octal number in ASCII.  For regular files only,
             this indicates the amount of data that follows the header.  In
             particular, this field was ignored by early tar implementations
             when extracting hardlinks.  Modern writers should always store a
             zero length for hardlink entries.
 
-     mtime   Modification time of file, as an octal number in ASCII.  This
+     4mmtime24m   Modification time of file, as an octal number in ASCII.  This
             indicates the number of seconds since the start of the epoch,
             00:00:00 UTC January 1, 1970.  Note that negative values should
             be avoided here, as they are handled inconsistently.
 
-     checksum
+     4mchecksum0m
             Header checksum, stored as an octal number in ASCII.  To compute
             the checksum, set the checksum field to all spaces, then sum all
             bytes in the header using unsigned arithmetic.  This field should
@@ -83,13 +83,13 @@ DESCRIPTION
             Modern robust readers compute the checksum both ways and accept
             the header if either computation matches.
 
-     linkflag, linkname
+     4mlinkflag24m, 4mlinkname0m
             In order to preserve hardlinks and conserve tape, a file with
             multiple links is only written to the archive the first time it
-            is encountered.  The next time it is encountered, the linkflag is
-            set to an ASCII ‘1’ and the linkname field holds the first name
+            is encountered.  The next time it is encountered, the 4mlinkflag24m is
+            set to an ASCII ‘1’ and the 4mlinkname24m field holds the first name
             under which this file appears.  (Note that regular files have a
-            null value in the linkflag field.)
+            null value in the 4mlinkflag24m field.)
 
      Early tar implementations varied in how they terminated these fields.
      The tar command in Version 7 AT&T UNIX used the following conventions
@@ -102,20 +102,20 @@ DESCRIPTION
      For best portability, modern implementations should fill the numeric
      fields with leading zeros.
 
-   Pre-POSIX Archives
+   1mPre-POSIX Archives0m
      An early draft of IEEE Std 1003.1-1988 (“POSIX.1”) served as the basis
-     for John Gilmore's pdtar program and many system implementations from the
+     for John Gilmore's 1mpdtar 22mprogram and many system implementations from the
      late 1980s and early 1990s.  These archives generally follow the POSIX
      ustar format described below with the following variations:
-     ·             The magic value consists of the five characters “ustar” followed
+     1m·       22mThe magic value consists of the five characters “ustar” followed
             by a space.  The version field contains a space character fol‐
             lowed by a null.
-     ·             The numeric fields are generally filled with leading spaces (not
+     1m·       22mThe numeric fields are generally filled with leading spaces (not
             leading zeros as recommended in the final standard).
-     ·             The prefix field is often not used, limiting pathnames to the 100
+     1m·       22mThe prefix field is often not used, limiting pathnames to the 100
             characters of old-style archives.
 
-   POSIX ustar Archives
+   1mPOSIX ustar Archives0m
      IEEE Std 1003.1-1988 (“POSIX.1”) defined a standard tar file format to be
      read and written by compliant implementations of tar(1).  This format is
      often called the “ustar” format, after the magic value used in the
@@ -142,8 +142,8 @@ DESCRIPTION
                   char pad[12];
           };
 
-     typeflag
-            Type of entry.  POSIX extended the earlier linkflag field with
+     4mtypeflag0m
+            Type of entry.  POSIX extended the earlier 4mlinkflag24m field with
             several new type values:
             “0”     Regular file.  NUL should be treated as a synonym, for
                     compatibility purposes.
@@ -161,7 +161,7 @@ DESCRIPTION
                     support the corresponding extension.  Uppercase letters
                     "A" through "Z" are reserved for custom extensions.  Note
                     that sockets and whiteout entries are not archivable.
-            It is worth noting that the size field, in particular, has dif‐
+            It is worth noting that the 4msize24m field, in particular, has dif‐
             ferent meanings depending on the type.  For regular files, of
             course, it indicates the amount of data following the header.
             For directories, it may be used to indicate the total size of all
@@ -169,40 +169,40 @@ DESCRIPTION
             allocate directory space.  For all other types, it should be set
             to zero by writers and ignored by readers.
 
-     magic   Contains the magic value “ustar” followed by a NUL byte to indi‐
+     4mmagic24m   Contains the magic value “ustar” followed by a NUL byte to indi‐
             cate that this is a POSIX standard archive.  Full compliance
             requires the uname and gname fields be properly set.
 
-     version
+     4mversion0m
             Version.  This should be “00” (two copies of the ASCII digit
             zero) for POSIX standard archives.
 
-     uname, gname
+     4muname24m, 4mgname0m
             User and group names, as null-terminated ASCII strings.  These
             should be used in preference to the uid/gid values when they are
             set and the corresponding names exist on the system.
 
-     devmajor, devminor
+     4mdevmajor24m, 4mdevminor0m
             Major and minor numbers for character device or block device
             entry.
 
-     name, prefix
+     4mname24m, 4mprefix0m
             If the pathname is too long to fit in the 100 bytes provided by
-            the standard format, it can be split at any / character with the
+            the standard format, it can be split at any 4m/24m character with the
             first portion going into the prefix field.  If the prefix field
-            is not empty, the reader will prepend the prefix value and a /
+            is not empty, the reader will prepend the prefix value and a 4m/0m
             character to the regular name field to obtain the full pathname.
-            The standard does not require a trailing / character on directory
+            The standard does not require a trailing 4m/24m character on directory
             names, though most implementations still include this for compat‐
             ibility reasons.
 
      Note that all unused bytes must be set to NUL.
 
      Field termination is specified slightly differently by POSIX than by pre‐
-     vious implementations.  The magic, uname, and gname fields must have a
-     trailing NUL.  The pathname, linkname, and prefix fields must have a
+     vious implementations.  The 4mmagic24m, 4muname24m, and 4mgname24m fields must have a
+     trailing NUL.  The 4mpathname24m, 4mlinkname24m, and 4mprefix24m fields must have a
      trailing NUL unless they fill the entire field.  (In particular, it is
-     possible to store a 256-character pathname if it happens to have a / as
+     possible to store a 256-character pathname if it happens to have a 4m/24m as
      the 156th character.)  POSIX requires numeric fields to be zero-padded in
      the front, and requires them to be terminated with either space or NUL
      characters.
@@ -211,7 +211,7 @@ DESCRIPTION
      sionally extending it by adding new fields to the blank area at the end
      of the header record.
 
-   Numeric Extensions
+   1mNumeric Extensions0m
      There have been several attempts to extend the range of sizes or times
      supported by modifying how numbers are stored in the header.
 
@@ -221,7 +221,7 @@ DESCRIPTION
      the twelfth byte for a trailing NUL character.  Allowing 12 octal digits
      allows file sizes up to 64 GB.
 
-     Another extension, utilized by GNU tar, star, and other newer tar imple‐
+     Another extension, utilized by GNU tar, star, and other newer 1mtar 22mimple‐
      mentations, permits binary numbers in the standard numeric fields.  This
      is flagged by setting the high bit of the first byte.  The remainder of
      the field is treated as a signed twos-complement value.  This permits
@@ -237,7 +237,7 @@ DESCRIPTION
      This extension was short-lived and is no longer supported by any imple‐
      mentation.
 
-   Pax Interchange Format
+   1mPax Interchange Format0m
      There are many attributes that cannot be portably stored in a POSIX ustar
      archive.  IEEE Std 1003.1-2001 (“POSIX.1”) defined a “pax interchange
      format” that uses two new types of entries to hold text-formatted meta‐
@@ -265,12 +265,12 @@ DESCRIPTION
      that, unlike the historic header, numeric values are stored using deci‐
      mal, not octal.  A description of some common keys follows:
 
-     atime, ctime, mtime
+     1matime22m, 1mctime22m, 1mmtime0m
             File access, inode change, and modification times.  These fields
             can be negative or include a decimal point and a fractional
             value.
 
-     hdrcharset
+     1mhdrcharset0m
             The character set used by the pax extension values.  By default,
             all textual values in the pax extended attributes are assumed to
             be in UTF-8, including pathnames, user names, and group names.
@@ -285,32 +285,32 @@ DESCRIPTION
             this flag should not be used as a general mechanism to allow
             filenames to be stored in arbitrary encodings.
 
-     uname, uid, gname, gid
+     1muname22m, 1muid22m, 1mgname22m, 1mgid0m
             User name, group name, and numeric UID and GID values.  The user
             name and group name stored here are encoded in UTF8 and can thus
             include non-ASCII characters.  The UID and GID fields can be of
             arbitrary length.
 
-     linkpath
+     1mlinkpath0m
             The full path of the linked-to file.  Note that this is encoded
             in UTF8 and can thus include non-ASCII characters.
 
-     path    The full pathname of the entry.  Note that this is encoded in
+     1mpath    22mThe full pathname of the entry.  Note that this is encoded in
             UTF8 and can thus include non-ASCII characters.
 
-     realtime.*, security.*
+     1mrealtime.*22m, 1msecurity.*0m
             These keys are reserved and may be used for future standardiza‐
             tion.
 
-     size    The size of the file.  Note that there is no length limit on this
+     1msize    22mThe size of the file.  Note that there is no length limit on this
             field, allowing conforming archives to store files much larger
             than the historic 8GB limit.
 
-     SCHILY.*
-            Vendor-specific attributes used by Joerg Schilling's star imple‐
+     1mSCHILY.*0m
+            Vendor-specific attributes used by Joerg Schilling's 1mstar 22mimple‐
             mentation.
 
-     SCHILY.acl.access, SCHILY.acl.default, SCHILY.acl.ace
+     1mSCHILY.acl.access22m, 1mSCHILY.acl.default, SCHILY.acl.ace0m
             Stores the access, default and NFSv4 ACLs as textual strings in a
             format that is an extension of the format specified by POSIX.1e
             draft 17.  In particular, each user or group access specification
@@ -319,39 +319,39 @@ DESCRIPTION
             not have complete user or group information available (such as
             when NIS/YP or LDAP services are temporarily unavailable).
 
-     SCHILY.devminor, SCHILY.devmajor
+     1mSCHILY.devminor22m, 1mSCHILY.devmajor0m
             The full minor and major numbers for device nodes.
 
-     SCHILY.fflags
+     1mSCHILY.fflags0m
             The file flags.
 
-     SCHILY.realsize
+     1mSCHILY.realsize0m
             The full size of the file on disk.  XXX explain? XXX
 
-     SCHILY.dev, SCHILY.ino, SCHILY.nlinks
+     1mSCHILY.dev, SCHILY.ino22m, 1mSCHILY.nlinks0m
             The device number, inode number, and link count for the entry.
             In particular, note that a pax interchange format archive using
-            Joerg Schilling's SCHILY.* extensions can store all of the data
-            from struct stat.
+            Joerg Schilling's 1mSCHILY.* 22mextensions can store all of the data
+            from 4mstruct24m 4mstat24m.
 
-     LIBARCHIVE.*
-            Vendor-specific attributes used by the libarchive library and
+     1mLIBARCHIVE.*0m
+            Vendor-specific attributes used by the 1mlibarchive 22mlibrary and
             programs that use it.
 
-     LIBARCHIVE.creationtime
+     1mLIBARCHIVE.creationtime0m
             The time when the file was created.  (This should not be confused
             with the POSIX “ctime” attribute, which refers to the time when
             the file metadata was last changed.)
 
-     LIBARCHIVE.xattr.namespace.key
+     1mLIBARCHIVE.xattr.4m22mnamespace24m.4mkey0m
             Libarchive stores POSIX.1e-style extended attributes using keys
-            of this form.  The key value is URL-encoded: All non-ASCII char‐
+            of this form.  The 4mkey24m value is URL-encoded: All non-ASCII char‐
             acters and the two special characters “=” and “%” are encoded as
             “%” followed by two uppercase hexadecimal digits.      The value of
             this key is the extended attribute value encoded in base 64.  XXX
             Detail the base-64 format here XXX
 
-     VENDOR.*
+     1mVENDOR.*0m
             XXX document other vendor-specific extensions XXX
 
      Any values stored in an extended attribute override the corresponding
@@ -365,12 +365,12 @@ DESCRIPTION
      header and use extended attributes whenever a text value contains non-
      ASCII characters.
 
-     In addition to the entry described above, the pax interchange format
-     also supports a g entry.  The g entry is identical in format, but speci‐
+     In addition to the 1mx 22mentry described above, the pax interchange format
+     also supports a 1mg 22mentry.  The 1mg 22mentry is identical in format, but speci‐
      fies attributes that serve as defaults for all subsequent archive
-     entries.  The entry is not widely used.
+     entries.  The 1mg 22mentry is not widely used.
 
-     Besides the new x and g entries, the pax interchange format has a few
+     Besides the new 1mx 22mand 1mg 22mentries, the pax interchange format has a few
      other minor variations from the earlier ustar format.  The most troubling
      one is that hardlinks are permitted to have data following them.  This
      allows readers to restore any hardlink to a file without having to rewind
@@ -378,15 +378,15 @@ DESCRIPTION
      for robust readers, as it is no longer clear whether or not they should
      ignore the size field for hardlink entries.
 
-   GNU Tar Archives
+   1mGNU Tar Archives0m
      The GNU tar program started with a pre-POSIX format similar to that
      described earlier and has extended it using several different mechanisms:
      It added new fields to the empty space in the header (some of which was
      later used by POSIX for conflicting purposes); it allowed the header to
      be continued over multiple records; and it defined new entries that mod‐
-     ify following entries (similar in principle to the entry described
+     ify following entries (similar in principle to the 1mx 22mentry described
      above, but each GNU special entry is single-purpose, unlike the general-
-     purpose x entry). As a result, GNU tar archives are not POSIX compati‐
+     purpose 1mx 22mentry).  As a result, GNU tar archives are not POSIX compati‐
      ble, although more lenient POSIX-compliant readers can successfully
      extract most GNU tar archives.
 
@@ -420,7 +420,7 @@ DESCRIPTION
                   char pad[17];
           };
 
-     typeflag
+     4mtypeflag0m
             GNU tar uses the following special entry types, in addition to
             those defined by POSIX:
 
@@ -461,11 +461,11 @@ DESCRIPTION
                     ume.  The "M" typeflag indicates that this entry contin‐
                     ues an existing file.  Such entries can only occur as the
                     first or second entry in an archive (the latter only if
-                    the first entry is a volume label).  The size field spec‐
-                    ifies the size of this entry.  The offset field at bytes
+                    the first entry is a volume label).  The 4msize24m field spec‐
+                    ifies the size of this entry.  The 4moffset24m field at bytes
                     369-380 specifies the offset where this file fragment
-                    begins.  The realsize field specifies the total size of
-                    the file (which must equal size plus offset).  When
+                    begins.  The 4mrealsize24m field specifies the total size of
+                    the file (which must equal 4msize24m plus 4moffset24m).  When
                     extracting, GNU tar checks that the header file name is
                     the one it is expecting, that the header offset is in the
                     correct sequence, and that the sum of offset and size is
@@ -488,26 +488,26 @@ DESCRIPTION
                     with “extra” header extensions (an older format that is
                     no longer used), or “sparse” extensions.
 
-            V       The name field should be interpreted as a tape/volume
+            V       The 4mname24m field should be interpreted as a tape/volume
                     header name.  This entry should generally be ignored on
                     extraction.
 
-     magic   The magic field holds the five characters “ustar” followed by a
+     4mmagic24m   The magic field holds the five characters “ustar” followed by a
             space.  Note that POSIX ustar archives have a trailing null.
 
-     version
+     4mversion0m
             The version field holds a space character followed by a null.
             Note that POSIX ustar archives use two copies of the ASCII digit
             “0”.
 
-     atime, ctime
+     4matime24m, 4mctime0m
             The time the file was last accessed and the time of last change
-            of file information, stored in octal as with mtime.
+            of file information, stored in octal as with 4mmtime24m.
 
-     longnames
+     4mlongnames0m
             This field is apparently no longer used.
 
-     Sparse offset / numbytes
+     Sparse 4moffset24m 4m/24m 4mnumbytes0m
             Each such structure specifies a single fragment of a sparse file.
             The two fields store values as octal numbers.  The fragments are
             each padded to a multiple of 512 bytes in the archive.  On
@@ -515,7 +515,7 @@ DESCRIPTION
             (including any extension headers), and the data is then read and
             written to the file at appropriate offsets.
 
-     isextended
+     4misextended0m
             If this is set to non-zero, the header will be followed by addi‐
             tional “sparse header” records.  Each such record contains infor‐
             mation about as many as 21 additional sparse blocks as shown
@@ -530,28 +530,28 @@ DESCRIPTION
                           char    padding[7];
                   };
 
-     realsize
+     4mrealsize0m
             A binary representation of the file's complete size, with a much
-            larger range than the POSIX file size.  In particular, with M
+            larger range than the POSIX file size.  In particular, with 1mM0m
             type files, the current entry is only a portion of the file.  In
             that case, the POSIX size field will indicate the size of this
-            entry; the realsize field will indicate the total size of the
+            entry; the 4mrealsize24m field will indicate the total size of the
             file.
 
-   GNU tar pax archives
+   1mGNU tar pax archives0m
      GNU tar 1.14 (XXX check this XXX) and later will write pax interchange
-     format archives when you specify the --posix flag.  This format follows
-     the pax interchange format closely, using some SCHILY tags and introduc‐
+     format archives when you specify the 1m--posix 22mflag.  This format follows
+     the pax interchange format closely, using some 1mSCHILY 22mtags and introduc‐
      ing new keywords to store sparse file information.  There have been three
      iterations of the sparse file support, referred to as “0.0”, “0.1”, and
      “1.0”.
 
-     GNU.sparse.numblocks, GNU.sparse.offset, GNU.sparse.numbytes,
-            GNU.sparse.size
-            The “0.0” format used an initial GNU.sparse.numblocks attribute
+     1mGNU.sparse.numblocks22m, 1mGNU.sparse.offset22m, 1mGNU.sparse.numbytes22m,
+            1mGNU.sparse.size0m
+            The “0.0” format used an initial 1mGNU.sparse.numblocks 22mattribute
             to indicate the number of blocks in the file, a pair of
-            GNU.sparse.offset and GNU.sparse.numbytes to indicate the offset
-            and size of each block, and a single GNU.sparse.size to indicate
+            1mGNU.sparse.offset 22mand 1mGNU.sparse.numbytes 22mto indicate the offset
+            and size of each block, and a single 1mGNU.sparse.size 22mto indicate
             the full size of the file.  This is not the same as the size in
             the tar header because the latter value does not include the size
             of any holes.  This format required that the order of attributes
@@ -559,7 +559,7 @@ DESCRIPTION
             of the same attribute names, which is not officially permitted by
             the standards.
 
-     GNU.sparse.map
+     1mGNU.sparse.map0m
             The “0.1” format used a single attribute that stored a comma-sep‐
             arated list of decimal numbers.  Each pair of numbers indicated
             the offset and size, respectively, of a block of data.  This does
@@ -567,50 +567,50 @@ DESCRIPTION
             does not recognize this extension, since many pax implementations
             simply discard unrecognized attributes.
 
-     GNU.sparse.major, GNU.sparse.minor, GNU.sparse.name, GNU.sparse.realsize
+     1mGNU.sparse.major22m, 1mGNU.sparse.minor22m, 1mGNU.sparse.name22m, 1mGNU.sparse.realsize0m
             The “1.0” format stores the sparse block map in one or more
             512-byte blocks prepended to the file data in the entry body.
             The pax attributes indicate the existence of this map (via the
-            GNU.sparse.major and GNU.sparse.minor fields) and the full size
-            of the file.  The GNU.sparse.name holds the true name of the
+            1mGNU.sparse.major 22mand 1mGNU.sparse.minor 22mfields) and the full size
+            of the file.  The 1mGNU.sparse.name 22mholds the true name of the
             file.  To avoid confusion, the name stored in the regular tar
             header is a modified name so that extraction errors will be
             apparent to users.
 
-   Solaris Tar
+   1mSolaris Tar0m
      XXX More Details Needed XXX
 
      Solaris tar (beginning with SunOS XXX 5.7 ?? XXX) supports an “extended”
      format that is fundamentally similar to pax interchange format, with the
      following differences:
-     ·             Extended attributes are stored in an entry whose type is X, not
-            x, as used by pax interchange format.  The detailed format of
-            this entry appears to be the same as detailed above for the x
+     1m·       22mExtended attributes are stored in an entry whose type is 1mX22m, not
+            1mx22m, as used by pax interchange format.  The detailed format of
+            this entry appears to be the same as detailed above for the 1mx0m
             entry.
-     ·             An additional A header is used to store an ACL for the following
+     1m·       22mAn additional 1mA 22mheader is used to store an ACL for the following
             regular entry.  The body of this entry contains a seven-digit
             octal number followed by a zero byte, followed by the textual ACL
             description.  The octal value is the number of ACL entries plus a
             constant that indicates the ACL type: 01000000 for POSIX.1e ACLs
             and 03000000 for NFSv4 ACLs.
 
-   AIX Tar
+   1mAIX Tar0m
      XXX More details needed XXX
 
-     AIX Tar uses a ustar-formatted header with the type for storing coded
+     AIX Tar uses a ustar-formatted header with the type 1mA 22mfor storing coded
      ACL information.  Unlike the Solaris format, AIX tar writes this header
      after the regular file body to which it applies.  The pathname in this
-     header is either NFS4 or AIXC to indicate the type of ACL stored. The
+     header is either 1mNFS4 22mor 1mAIXC 22mto indicate the type of ACL stored.  The
      actual ACL is stored in platform-specific binary format.
 
-   Mac OS X Tar
+   1mMac OS X Tar0m
      The tar distributed with Apple's Mac OS X stores most regular files as
      two separate files in the tar archive.  The two files have the same name
      except that the first one has “._” prepended to the last path element.
      This special file stores an AppleDouble-encoded binary blob with addi‐
      tional metadata about the second file, including ACL, extended
      attributes, and resources.  To recreate the original file on disk, each
-     separate file can be extracted and the Mac OS X copyfile() function can
+     separate file can be extracted and the Mac OS X 1mcopyfile22m() function can
      be used to unpack the separate metadata file and apply it to th regular
      file.  Conversely, the same function provides a “pack” option to encode
      the extended metadata from a file into a separate file whose contents can
@@ -621,54 +621,54 @@ DESCRIPTION
      extensions needs to be included in the archive for each one, doubling the
      overhead required for files with long names.
 
-   Summary of tar type codes
+   1mSummary of tar type codes0m
      The following list is a condensed summary of the type codes used in tar
      header records generated by different tar implementations.  More details
      about specific implementations can be found above:
      NUL  Early tar programs stored a zero byte for regular files.
-     0   POSIX standard type code for a regular file.
-     1   POSIX standard type code for a hard link description.
-     2   POSIX standard type code for a symbolic link description.
-     3   POSIX standard type code for a character device node.
-     4   POSIX standard type code for a block device node.
-     5   POSIX standard type code for a directory.
-     6   POSIX standard type code for a FIFO.
-     7   POSIX reserved.
-     7   GNU tar used for pre-allocated files on some systems.
-     A   Solaris tar ACL description stored prior to a regular file header.
-     A   AIX tar ACL description stored after the file body.
-     D   GNU tar directory dump.
-     K   GNU tar long linkname for the following header.
-     L   GNU tar long pathname for the following header.
-     M   GNU tar multivolume marker, indicating the file is a continuation of
+     1m0    22mPOSIX standard type code for a regular file.
+     1m1    22mPOSIX standard type code for a hard link description.
+     1m2    22mPOSIX standard type code for a symbolic link description.
+     1m3    22mPOSIX standard type code for a character device node.
+     1m4    22mPOSIX standard type code for a block device node.
+     1m5    22mPOSIX standard type code for a directory.
+     1m6    22mPOSIX standard type code for a FIFO.
+     1m7    22mPOSIX reserved.
+     1m7    22mGNU tar used for pre-allocated files on some systems.
+     1mA    22mSolaris tar ACL description stored prior to a regular file header.
+     1mA    22mAIX tar ACL description stored after the file body.
+     1mD    22mGNU tar directory dump.
+     1mK    22mGNU tar long linkname for the following header.
+     1mL    22mGNU tar long pathname for the following header.
+     1mM    22mGNU tar multivolume marker, indicating the file is a continuation of
          a file from the previous volume.
-     N   GNU tar long filename support.  Deprecated.
-     S   GNU tar sparse regular file.
-     V   GNU tar tape/volume header name.
-     X   Solaris tar general-purpose extension header.
-     g   POSIX pax interchange format global extensions.
-     x   POSIX pax interchange format per-file extensions.
-
-SEE ALSO
+     1mN    22mGNU tar long filename support.  Deprecated.
+     1mS    22mGNU tar sparse regular file.
+     1mV    22mGNU tar tape/volume header name.
+     1mX    22mSolaris tar general-purpose extension header.
+     1mg    22mPOSIX pax interchange format global extensions.
+     1mx    22mPOSIX pax interchange format per-file extensions.
+
+1mSEE ALSO0m
      ar(1), pax(1), tar(1)
 
-STANDARDS
-     The tar utility is no longer a part of POSIX or the Single Unix Standard.
+1mSTANDARDS0m
+     The 1mtar 22mutility is no longer a part of POSIX or the Single Unix Standard.
      It last appeared in Version 2 of the Single UNIX Specification (“SUSv2”).
      It has been supplanted in subsequent standards by pax(1). The ustar for‐
      mat is currently part of the specification for the pax(1) utility.  The
      pax interchange file format is new with IEEE Std 1003.1-2001 (“POSIX.1”).
 
-HISTORY
-     A tar command appeared in Seventh Edition Unix, which was released in
-     January, 1979.  It replaced the tp program from Fourth Edition Unix which
-     in turn replaced the tap program from First Edition Unix. John Gilmore's
-     pdtar public-domain implementation (circa 1987) was highly influential
-     and formed the basis of GNU tar (circa 1988).  Joerg Shilling's star
+1mHISTORY0m
+     A 1mtar 22mcommand appeared in Seventh Edition Unix, which was released in
+     January, 1979.  It replaced the 1mtp 22mprogram from Fourth Edition Unix which
+     in turn replaced the 1mtap 22mprogram from First Edition Unix.  John Gilmore's
+     1mpdtar 22mpublic-domain implementation (circa 1987) was highly influential
+     and formed the basis of 1mGNU tar 22m(circa 1988).  Joerg Shilling's 1mstar0m
      archiver is another open-source (CDDL) archiver (originally developed
      circa 1985) which features complete support for pax interchange format.
 
-     This documentation was written as part of the libarchive and bsdtar
+     This documentation was written as part of the 1mlibarchive 22mand 1mbsdtar0m
      project by Tim Kientzle <kientzle@FreeBSD.org>.
 
 BSD                           December 27, 2016                           BSD
index a8e2799..c8d5221 100644 (file)
@@ -104,15 +104,15 @@ ManPageArchiveWriteSetPassphrase3.wiki: ../mdoc2wiki.awk ../../libarchive/archiv
 ManPageCpio5.wiki: ../mdoc2wiki.awk ../../libarchive/cpio.5
        awk -f ../mdoc2wiki.awk < ../../libarchive/cpio.5 > ManPageCpio5.wiki
 
+ManPageLibarchiveFormats5.wiki: ../mdoc2wiki.awk ../../libarchive/libarchive-formats.5
+       awk -f ../mdoc2wiki.awk < ../../libarchive/libarchive-formats.5 > ManPageLibarchiveFormats5.wiki
+
 ManPageLibarchive3.wiki: ../mdoc2wiki.awk ../../libarchive/libarchive.3
        awk -f ../mdoc2wiki.awk < ../../libarchive/libarchive.3 > ManPageLibarchive3.wiki
 
 ManPageLibarchiveChanges3.wiki: ../mdoc2wiki.awk ../../libarchive/libarchive_changes.3
        awk -f ../mdoc2wiki.awk < ../../libarchive/libarchive_changes.3 > ManPageLibarchiveChanges3.wiki
 
-ManPageLibarchiveFormats5.wiki: ../mdoc2wiki.awk ../../libarchive/libarchive-formats.5
-       awk -f ../mdoc2wiki.awk < ../../libarchive/libarchive-formats.5 > ManPageLibarchiveFormats5.wiki
-
 ManPageLibarchiveInternals3.wiki: ../mdoc2wiki.awk ../../libarchive/libarchive_internals.3
        awk -f ../mdoc2wiki.awk < ../../libarchive/libarchive_internals.3 > ManPageLibarchiveInternals3.wiki
 
@@ -127,4 +127,4 @@ ManPageBsdtar1.wiki: ../mdoc2wiki.awk ../../tar/bsdtar.1
 
 ManPageBsdcpio1.wiki: ../mdoc2wiki.awk ../../cpio/bsdcpio.1
        awk -f ../mdoc2wiki.awk < ../../cpio/bsdcpio.1 > ManPageBsdcpio1.wiki
-all: ManPageArchiveEntry3.wiki ManPageArchiveEntryAcl3.wiki ManPageArchiveEntryLinkify3.wiki ManPageArchiveEntryPaths3.wiki ManPageArchiveEntryPerms3.wiki ManPageArchiveEntryStat3.wiki ManPageArchiveEntryTime3.wiki ManPageArchiveRead3.wiki ManPageArchiveReadAddPassphrase3.wiki ManPageArchiveReadData3.wiki ManPageArchiveReadDisk3.wiki ManPageArchiveReadExtract3.wiki ManPageArchiveReadFilter3.wiki ManPageArchiveReadFormat3.wiki ManPageArchiveReadFree3.wiki ManPageArchiveReadHeader3.wiki ManPageArchiveReadNew3.wiki ManPageArchiveReadOpen3.wiki ManPageArchiveReadSetOptions3.wiki ManPageArchiveUtil3.wiki ManPageArchiveWrite3.wiki ManPageArchiveWriteBlocksize3.wiki ManPageArchiveWriteData3.wiki ManPageArchiveWriteDisk3.wiki ManPageArchiveWriteFilter3.wiki ManPageArchiveWriteFinishEntry3.wiki ManPageArchiveWriteFormat3.wiki ManPageArchiveWriteFree3.wiki ManPageArchiveWriteHeader3.wiki ManPageArchiveWriteNew3.wiki ManPageArchiveWriteOpen3.wiki ManPageArchiveWriteSetOptions3.wiki ManPageArchiveWriteSetPassphrase3.wiki ManPageCpio5.wiki ManPageLibarchive3.wiki ManPageLibarchiveChanges3.wiki ManPageLibarchiveFormats5.wiki ManPageLibarchiveInternals3.wiki ManPageMtree5.wiki ManPageTar5.wiki ManPageBsdtar1.wiki ManPageBsdcpio1.wiki
+all: ManPageArchiveEntry3.wiki ManPageArchiveEntryAcl3.wiki ManPageArchiveEntryLinkify3.wiki ManPageArchiveEntryPaths3.wiki ManPageArchiveEntryPerms3.wiki ManPageArchiveEntryStat3.wiki ManPageArchiveEntryTime3.wiki ManPageArchiveRead3.wiki ManPageArchiveReadAddPassphrase3.wiki ManPageArchiveReadData3.wiki ManPageArchiveReadDisk3.wiki ManPageArchiveReadExtract3.wiki ManPageArchiveReadFilter3.wiki ManPageArchiveReadFormat3.wiki ManPageArchiveReadFree3.wiki ManPageArchiveReadHeader3.wiki ManPageArchiveReadNew3.wiki ManPageArchiveReadOpen3.wiki ManPageArchiveReadSetOptions3.wiki ManPageArchiveUtil3.wiki ManPageArchiveWrite3.wiki ManPageArchiveWriteBlocksize3.wiki ManPageArchiveWriteData3.wiki ManPageArchiveWriteDisk3.wiki ManPageArchiveWriteFilter3.wiki ManPageArchiveWriteFinishEntry3.wiki ManPageArchiveWriteFormat3.wiki ManPageArchiveWriteFree3.wiki ManPageArchiveWriteHeader3.wiki ManPageArchiveWriteNew3.wiki ManPageArchiveWriteOpen3.wiki ManPageArchiveWriteSetOptions3.wiki ManPageArchiveWriteSetPassphrase3.wiki ManPageCpio5.wiki ManPageLibarchiveFormats5.wiki ManPageLibarchive3.wiki ManPageLibarchiveChanges3.wiki ManPageLibarchiveInternals3.wiki ManPageMtree5.wiki ManPageTar5.wiki ManPageBsdtar1.wiki ManPageBsdcpio1.wiki
index 195f6ce..83d692f 100644 (file)
@@ -36,7 +36,7 @@ it includes everything from
 '''struct stat''' 
 plus associated pathname, textual group and user names, etc. 
 These objects are used by 
-[[ManPageibarchive3]] 
+[[ManPageLibarchive3]] 
 to represent the metadata associated with a particular 
 entry in an archive. 
 === Create and Destroy=== 
@@ -64,16 +64,16 @@ object.
 Due to high number of functions, the accessor functions can be found in 
 man pages grouped by the purpose. 
 <dl> 
-<dt>[[ManPagerchiventrycl3]]</dt><dd> 
+<dt>[[ManPageArchiveEntryAcl3]]</dt><dd> 
 Access Control List manipulation 
-</dd><dt>[[ManPagerchiventryaths3]]</dt><dd> 
+</dd><dt>[[ManPageArchiveEntryPaths3]]</dt><dd> 
 Path name manipulation 
-</dd><dt>[[ManPagerchiventryerms3]]</dt><dd> 
+</dd><dt>[[ManPageArchiveEntryPerms3]]</dt><dd> 
 User, group and mode manipulation 
-</dd><dt>[[ManPagerchiventrytat3]]</dt><dd> 
+</dd><dt>[[ManPageArchiveEntryStat3]]</dt><dd> 
 Functions not in the other groups and copying to/from 
 ''struct'' stat. 
-</dd><dt>[[ManPagerchiventryime3]]</dt><dd> 
+</dd><dt>[[ManPageArchiveEntryTime3]]</dt><dd> 
 Time field manipulation 
 </dd></dl> 
 
@@ -107,11 +107,11 @@ narrow string for the same data, the previously-set wide string will
 be discarded in favor of the new data. 
 
 == SEE ALSO == 
-[[ManPagerchiventrycl3]], 
-[[ManPagerchiventryaths3]], 
-[[ManPagerchiventryerms3]], 
-[[ManPagerchiventryime3]] 
-[[ManPageibarchive3]], 
+[[ManPageArchiveEntryAcl3]], 
+[[ManPageArchiveEntryPaths3]], 
+[[ManPageArchiveEntryPerms3]], 
+[[ManPageArchiveEntryTime3]] 
+[[ManPageLibarchive3]], 
 == HISTORY == 
 The 
 '''libarchive''' 
index 07f42b1..41563d1 100644 (file)
@@ -345,7 +345,7 @@ or
 '''archive_entry_acl_next_w'''(). 
 The function returns either 0, if no non-extended ACLs are found. 
 In this case, the access permissions should be obtained by 
-[[ManPagerchiventryode3]] 
+[[ManPageArchiveEntryMode3]] 
 or set using 
 [[chmod(2)|http://www.freebsd.org/cgi/man.cgi?query=chmod&sektion=2]]. 
 Otherwise, the function returns the same value as 
@@ -456,5 +456,5 @@ and flags on success or NULL on error.
 '''archive_entry_acl_types'''() 
 returns a bitmask of ACL entry types or 0 if archive entry has no ACL entries. 
 == SEE ALSO == 
-[[ManPagerchiventry3]], 
-[[ManPageibarchive3]] 
+[[ManPageArchiveEntry3]], 
+[[ManPageLibarchive3]] 
index 1e35c59..a94b398 100644 (file)
@@ -64,7 +64,7 @@ The
 '''archive_entry_linkresolver_set_strategy'''() 
 function selects the optimal hardlink strategy for the given format. 
 The format code can be obtained from 
-[[ManPagerchiveormat3]]. 
+[[ManPageArchiveFormat3]]. 
 The function can be called more than once, but it is recommended to 
 flush all deferred entries first. 
 
@@ -194,4 +194,4 @@ on
 [[malloc(3)|http://www.freebsd.org/cgi/man.cgi?query=malloc&sektion=3]] 
 failures. 
 == SEE ALSO == 
-[[ManPagerchiventry3]] 
+[[ManPageArchiveEntry3]] 
index 56ebec2..8e4cd94 100644 (file)
@@ -127,7 +127,7 @@ Streaming Archive Library (libarchive, -larchive)
 '''archive_entry_update_symlink_utf8'''(''struct archive_entry *a'', ''const char *path''); 
 == DESCRIPTION == 
 Path names supported by 
-[[ManPagerchiventry3]]: 
+[[ManPageArchiveEntry3]]: 
 <dl> 
 <dt>hardlink</dt><dd> 
 Destination of the hardlink. 
@@ -140,7 +140,7 @@ the destination for that.
 Path in the archive 
 </dd><dt>sourcepath</dt><dd> 
 Path on the disk for use by 
-[[ManPagerchiveeadisk3]]. 
+[[ManPageArchiveReadDisk3]]. 
 </dd><dt>symlink</dt><dd> 
 Destination of the symbolic link. 
 </dd></dl> 
@@ -171,5 +171,5 @@ It doesn't have a corresponding get accessor function.
 is an alias for  
 '''archive_entry_copy_XXX'''(). 
 == SEE ALSO == 
-[[ManPagerchiventry3]] 
-[[ManPageibarchive3]], 
+[[ManPageArchiveEntry3]] 
+[[ManPageLibarchive3]], 
index 6e5a1da..079034c 100644 (file)
@@ -207,11 +207,11 @@ every name that is recognized.
 [[strtofflags(3)|http://www.freebsd.org/cgi/man.cgi?query=strtofflags&sektion=3]], 
 which stops parsing at the first unrecognized name.) 
 == SEE ALSO == 
-[[ManPagerchiventry3]], 
-[[ManPagerchiventrycl3]], 
-[[ManPagerchiveeadisk3]], 
-[[ManPagerchiveriteisk3]] 
-[[ManPageibarchive3]], 
+[[ManPageArchiveEntry3]], 
+[[ManPageArchiveEntryAcl3]], 
+[[ManPageArchiveReadDisk3]], 
+[[ManPageArchiveWriteDisk3]] 
+[[ManPageLibarchive3]], 
 == BUGS == 
 The platform types 
 ''uid_t'' 
index 55bfdef..e96169f 100644 (file)
@@ -258,7 +258,7 @@ The functions
 and 
 '''archive_entry_ino64'''() 
 are used by 
-[[ManPagerchiventryinkify3]] 
+[[ManPageArchiveEntryLinkify3]] 
 to find hardlinks. 
 The pair of device and inode is supposed to identify hardlinked files. 
 
@@ -301,8 +301,8 @@ platforms.
 Some archive formats use the combined form, while other formats use 
 the split form. 
 == SEE ALSO == 
-[[ManPagerchiventrycl3]], 
-[[ManPagerchiventryerms3]], 
-[[ManPagerchiventryime3]], 
-[[ManPageibarchive3]], 
+[[ManPageArchiveEntryAcl3]], 
+[[ManPageArchiveEntryPerms3]], 
+[[ManPageArchiveEntryTime3]], 
+[[ManPageLibarchive3]], 
 [[stat(2)|http://www.freebsd.org/cgi/man.cgi?query=stat&sektion=2]] 
index 2425c1c..bff8257 100644 (file)
@@ -111,7 +111,7 @@ These functions create and manipulate the time fields in an
 Supported time fields are atime (access time), birthtime (creation time), 
 ctime (last time an inode property was changed) and mtime (modification time). 
 
-[[ManPageibarchive3]] 
+[[ManPageLibarchive3]] 
 provides a high-resolution interface. 
 The timestamps are truncated automatically depending on the archive format 
 (for archiving) or the filesystem capabilities (for restoring). 
@@ -124,8 +124,8 @@ The current state can be queried using
 '''XXX_is_set'''(). 
 Unset time fields have a second and nanosecond field of 0. 
 == SEE ALSO == 
-[[ManPagerchiventry3]] 
-[[ManPageibarchive3]], 
+[[ManPageArchiveEntry3]] 
+[[ManPageLibarchive3]], 
 == HISTORY == 
 The 
 '''libarchive''' 
index 69b6c47..0b6e08d 100644 (file)
@@ -15,7 +15,7 @@ headers and associated data, then close the archive and release all
 resources. 
 === Create archive object=== 
 See 
-[[ManPagerchiveeadew3]]. 
+[[ManPageArchiveReadNew3]]. 
 
 To read an archive, you must first obtain an initialized 
 '''struct archive''' 
@@ -23,9 +23,9 @@ object from
 '''archive_read_new'''(). 
 === Enable filters and formats=== 
 See 
-[[ManPagerchiveeadilter3]] 
+[[ManPageArchiveReadFilter3]] 
 and 
-[[ManPagerchiveeadormat3]]. 
+[[ManPageArchiveReadFormat3]]. 
 
 You can then modify this object for the desired operations with the 
 various 
@@ -49,10 +49,10 @@ to enable auto-detect for all formats and compression types
 currently supported by the library. 
 === Set options=== 
 See 
-[[ManPagerchiveeadetptions3]]. 
+[[ManPageArchiveReadSetOptions3]]. 
 === Open archive=== 
 See 
-[[ManPagerchiveeadpen3]]. 
+[[ManPageArchiveReadOpen3]]. 
 
 Once you have prepared the 
 '''struct archive''' 
@@ -72,10 +72,10 @@ callback functions are free to read whatever block size is
 most appropriate for the medium. 
 === Consume archive=== 
 See 
-[[ManPagerchiveeadeader3]], 
-[[ManPagerchiveeadata3]] 
+[[ManPageArchiveReadHeader3]], 
+[[ManPageArchiveReadData3]] 
 and 
-[[ManPagerchiveeadxtract3]]. 
+[[ManPageArchiveReadExtract3]]. 
 
 Each archive entry consists of a header followed by a certain 
 amount of data. 
@@ -112,7 +112,7 @@ In particular, many applications will want to override the
 pathname, file permissions, or ownership. 
 === Release resources=== 
 See 
-[[ManPagerchiveeadree3]]. 
+[[ManPageArchiveReadFree3]]. 
 
 Once you have finished reading data from the archive, you 
 should call 
@@ -174,16 +174,16 @@ myclose(struct archive *a, void *client_data)
 ```
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiveeadew3]], 
-[[ManPagerchiveeadata3]], 
-[[ManPagerchiveeadxtract3]], 
-[[ManPagerchiveeadilter3]], 
-[[ManPagerchiveeadormat3]], 
-[[ManPagerchiveeadeader3]], 
-[[ManPagerchiveeadpen3]], 
-[[ManPagerchiveeadetptions3]], 
-[[ManPagerchivetil3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveReadNew3]], 
+[[ManPageArchiveReadData3]], 
+[[ManPageArchiveReadExtract3]], 
+[[ManPageArchiveReadFilter3]], 
+[[ManPageArchiveReadFormat3]], 
+[[ManPageArchiveReadHeader3]], 
+[[ManPageArchiveReadOpen3]], 
+[[ManPageArchiveReadSetOptions3]], 
+[[ManPageArchiveUtil3]], 
 [[ManPageTar5]] 
 == HISTORY == 
 The 
index 3f70ec9..466505c 100644 (file)
@@ -37,6 +37,6 @@ function failed.
 </dd></dl> 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiveead3]], 
-[[ManPagerchiveeadetptions3]] 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveRead3]], 
+[[ManPageArchiveReadSetOptions3]] 
index e6c7afc..da4647c 100644 (file)
@@ -89,13 +89,13 @@ and
 functions. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiveead3]], 
-[[ManPagerchiveeadxtract3]], 
-[[ManPagerchiveeadilter3]], 
-[[ManPagerchiveeadormat3]], 
-[[ManPagerchiveeadeader3]], 
-[[ManPagerchiveeadpen3]], 
-[[ManPagerchiveeadetptions3]], 
-[[ManPagerchivetil3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveRead3]], 
+[[ManPageArchiveReadExtract3]], 
+[[ManPageArchiveReadFilter3]], 
+[[ManPageArchiveReadFormat3]], 
+[[ManPageArchiveReadHeader3]], 
+[[ManPageArchiveReadOpen3]], 
+[[ManPageArchiveReadSetOptions3]], 
+[[ManPageArchiveUtil3]], 
 [[ManPageTar5]] 
index 3b52d9c..bb7d01a 100644 (file)
@@ -138,7 +138,7 @@ object with information about a particular file.
 The 
 '''archive_entry''' 
 object must have already been created with 
-[[ManPagerchiventryew3]] 
+[[ManPageArchiveEntryNew3]] 
 and at least one of the source path or path fields must already be set. 
 (If both are set, the source path will be used.) 
 
@@ -179,7 +179,7 @@ if it was not invoked manually, then releases all resources.
 More information about the 
 ''struct'' archive 
 object and the overall design of the library can be found in the 
-[[ManPageibarchive3]] 
+[[ManPageLibarchive3]] 
 overview. 
 == EXAMPLE == 
 The following illustrates basic usage of the library by 
@@ -243,12 +243,12 @@ and
 '''archive_error_string'''() 
 functions. 
 == SEE ALSO == 
-[[ManPagerchiveead3]], 
-[[ManPagerchivetil3]], 
-[[ManPagerchiverite3]], 
-[[ManPagerchiveriteisk3]], 
+[[ManPageArchiveRead3]], 
+[[ManPageArchiveUtil3]], 
+[[ManPageArchiveWrite3]], 
+[[ManPageArchiveWriteDisk3]], 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]] 
+[[ManPageLibarchive3]] 
 == HISTORY == 
 The 
 '''libarchive''' 
@@ -289,7 +289,7 @@ to look up such information.
 
 This API should provide a set of methods for walking a directory tree. 
 That would make it a direct parallel of the 
-[[ManPagerchiveead3]] 
+[[ManPageArchiveRead3]] 
 API. 
 When such methods are implemented, the 
 "hybrid" 
index b33adeb..e3ec018 100644 (file)
@@ -24,34 +24,34 @@ Streaming Archive Library (libarchive, -larchive)
 <dl> 
 <dt>'''archive_read_extract'''(), '''archive_read_extract_set_skip_file'''()</dt><dd> 
 A convenience function that wraps the corresponding 
-[[ManPagerchiveriteisk3]] 
+[[ManPageArchiveWriteDisk3]] 
 interfaces. 
 The first call to 
 '''archive_read_extract'''() 
 creates a restore object using 
-[[ManPagerchiveriteiskew3]] 
+[[ManPageArchiveWriteDiskNew3]] 
 and 
-[[ManPagerchiveriteiskettandardookup3]], 
+[[ManPageArchiveWriteDiskSetStandardLookup3]], 
 then transparently invokes 
-[[ManPagerchiveriteisketptions3]], 
-[[ManPagerchiveriteeader3]], 
-[[ManPagerchiveriteata3]], 
+[[ManPageArchiveWriteDiskSetOptions3]], 
+[[ManPageArchiveWriteHeader3]], 
+[[ManPageArchiveWriteData3]], 
 and 
-[[ManPagerchiveriteinishntry3]] 
+[[ManPageArchiveWriteFinishEntry3]] 
 to create the entry on disk and copy data into it. 
 The 
 ''flags'' 
 argument is passed unmodified to 
-[[ManPagerchiveriteisketptions3]]. 
+[[ManPageArchiveWriteDiskSetOptions3]]. 
 </dd><dt>'''archive_read_extract2'''()</dt><dd> 
 This is another version of 
 '''archive_read_extract'''() 
 that allows you to provide your own restore object. 
 In particular, this allows you to override the standard lookup functions 
 using 
-[[ManPagerchiveriteisketroupookup3]], 
+[[ManPageArchiveWriteDiskSetGroupLookup3]], 
 and 
-[[ManPagerchiveriteisketserookup3]]. 
+[[ManPageArchiveWriteDiskSetUserLookup3]]. 
 Note that 
 '''archive_read_extract2'''() 
 does not accept a 
@@ -91,12 +91,12 @@ and
 functions. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiveead3]], 
-[[ManPagerchiveeadata3]], 
-[[ManPagerchiveeadilter3]], 
-[[ManPagerchiveeadormat3]], 
-[[ManPagerchiveeadpen3]], 
-[[ManPagerchiveeadetptions3]], 
-[[ManPagerchivetil3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveRead3]], 
+[[ManPageArchiveReadData3]], 
+[[ManPageArchiveReadFilter3]], 
+[[ManPageArchiveReadFormat3]], 
+[[ManPageArchiveReadOpen3]], 
+[[ManPageArchiveReadSetOptions3]], 
+[[ManPageArchiveUtil3]], 
 [[ManPageTar5]] 
index f0e87b6..ead30b9 100644 (file)
@@ -130,8 +130,8 @@ and
 '''archive_error_string'''() 
 functions. 
 == SEE ALSO == 
-[[ManPageibarchive3]], 
-[[ManPagerchiveead3]], 
-[[ManPagerchiveeadata3]], 
-[[ManPagerchiveeadormat3]], 
-[[ManPagerchiveeadormat3]] 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveRead3]], 
+[[ManPageArchiveReadData3]], 
+[[ManPageArchiveReadFormat3]], 
+[[ManPageArchiveReadFormat3]] 
index f938a99..9ffe5b4 100644 (file)
@@ -150,11 +150,11 @@ and
 functions. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiveeadata3]], 
-[[ManPagerchiveeadilter3]], 
-[[ManPagerchiveeadetptions3]], 
-[[ManPagerchivetil3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveReadData3]], 
+[[ManPageArchiveReadFilter3]], 
+[[ManPageArchiveReadSetOptions3]], 
+[[ManPageArchiveUtil3]], 
 [[ManPageTar5]] 
 == BUGS == 
 Many traditional archiver programs treat 
index 10f372d..90b0949 100644 (file)
@@ -58,11 +58,11 @@ and
 '''archive_error_string'''() 
 functions. 
 == SEE ALSO == 
-[[ManPageibarchive3]], 
-[[ManPagerchiveeadew3]], 
-[[ManPagerchiveeadata3]], 
-[[ManPagerchiveeadilter3]], 
-[[ManPagerchiveeadormat3]], 
-[[ManPagerchiveeadpen3]], 
-[[ManPagerchiveeadetptions3]], 
-[[ManPagerchivetil3]] 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveReadNew3]], 
+[[ManPageArchiveReadData3]], 
+[[ManPageArchiveReadFilter3]], 
+[[ManPageArchiveReadFormat3]], 
+[[ManPageArchiveReadOpen3]], 
+[[ManPageArchiveReadSetOptions3]], 
+[[ManPageArchiveUtil3]] 
index 30611b2..7eb5949 100644 (file)
@@ -51,13 +51,13 @@ and
 functions. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiveead3]], 
-[[ManPagerchiveeadata3]], 
-[[ManPagerchiveeadxtract3]], 
-[[ManPagerchiveeadilter3]], 
-[[ManPagerchiveeadormat3]], 
-[[ManPagerchiveeadpen3]], 
-[[ManPagerchiveeadetptions3]], 
-[[ManPagerchivetil3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveRead3]], 
+[[ManPageArchiveReadData3]], 
+[[ManPageArchiveReadExtract3]], 
+[[ManPageArchiveReadFilter3]], 
+[[ManPageArchiveReadFormat3]], 
+[[ManPageArchiveReadOpen3]], 
+[[ManPageArchiveReadSetOptions3]], 
+[[ManPageArchiveUtil3]], 
 [[ManPageTar5]] 
index 41b3c2b..70c3cfd 100644 (file)
@@ -20,13 +20,13 @@ is returned on error.
 A complete description of the 
 '''struct archive''' 
 object can be found in the overview manual page for 
-[[ManPageibarchive3]]. 
+[[ManPageLibarchive3]]. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiveeadata3]], 
-[[ManPagerchiveeadilter3]], 
-[[ManPagerchiveeadormat3]], 
-[[ManPagerchiveeadetptions3]], 
-[[ManPagerchivetil3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveReadData3]], 
+[[ManPageArchiveReadFilter3]], 
+[[ManPageArchiveReadFormat3]], 
+[[ManPageArchiveReadSetOptions3]], 
+[[ManPageArchiveUtil3]], 
 [[ManPageTar5]] 
index 06f2453..d5028c5 100644 (file)
@@ -92,7 +92,7 @@ A complete description of the
 and 
 '''struct archive_entry''' 
 objects can be found in the overview manual page for 
-[[ManPageibarchive3]]. 
+[[ManPageLibarchive3]]. 
 == CLIENT CALLBACKS == 
 The callback functions must match the following prototypes: 
 <ul> 
@@ -180,11 +180,11 @@ and
 functions. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiveead3]], 
-[[ManPagerchiveeadata3]], 
-[[ManPagerchiveeadilter3]], 
-[[ManPagerchiveeadormat3]], 
-[[ManPagerchiveeadetptions3]], 
-[[ManPagerchivetil3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveRead3]], 
+[[ManPageArchiveReadData3]], 
+[[ManPageArchiveReadFilter3]], 
+[[ManPageArchiveReadFormat3]], 
+[[ManPageArchiveReadSetOptions3]], 
+[[ManPageArchiveUtil3]], 
 [[ManPageTar5]] 
index aef201e..b2bca41 100644 (file)
@@ -182,6 +182,6 @@ and
 functions. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiveriteetptions3]], 
-[[ManPagerchiveead3]] 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveWriteSetOptions3]], 
+[[ManPageArchiveRead3]] 
index 4834152..2f07b65 100644 (file)
@@ -79,7 +79,7 @@ Streaming Archive Library (libarchive, -larchive)
 These functions provide access to various information about the 
 '''struct archive''' 
 object used in the 
-[[ManPageibarchive3]] 
+[[ManPageLibarchive3]] 
 library. 
 <dl> 
 <dt>'''archive_clear_error'''()</dt><dd> 
@@ -111,9 +111,9 @@ to
 </dd><dt>'''archive_file_count'''()</dt><dd> 
 Returns a count of the number of files processed by this archive object. 
 The count is incremented by calls to 
-[[ManPagerchiveriteeader3]] 
+[[ManPageArchiveWriteHeader3]] 
 or 
-[[ManPagerchiveeadexteader3]]. 
+[[ManPageArchiveReadNextHeader3]]. 
 </dd><dt>'''archive_filter_code'''()</dt><dd> 
 Returns a numeric code identifying the indicated filter. 
 See 
@@ -202,9 +202,9 @@ Field-width specifiers and other printf features are
 not uniformly supported and should not be used. 
 </dd></dl> 
 == SEE ALSO == 
-[[ManPagerchiveead3]], 
-[[ManPagerchiverite3]], 
-[[ManPageibarchive3]], 
+[[ManPageArchiveRead3]], 
+[[ManPageArchiveWrite3]], 
+[[ManPageLibarchive3]], 
 [[printf(3)|http://www.freebsd.org/cgi/man.cgi?query=printf&sektion=3]] 
 == HISTORY == 
 The 
index 9f72181..301f75c 100644 (file)
@@ -15,7 +15,7 @@ object, set any desired options, initialize the archive, append entries, then
 close the archive and release all resources. 
 === Create archive object=== 
 See 
-[[ManPagerchiveriteew3]]. 
+[[ManPageArchiveWriteNew3]]. 
 
 To write an archive, you must first obtain an initialized 
 '''struct archive''' 
@@ -23,10 +23,10 @@ object from
 '''archive_write_new'''(). 
 === Enable filters and formats, configure block size and padding=== 
 See 
-[[ManPagerchiveriteilter3]], 
-[[ManPagerchiveriteormat3]] 
+[[ManPageArchiveWriteFilter3]], 
+[[ManPageArchiveWriteFormat3]] 
 and 
-[[ManPagerchiveritelocksize3]]. 
+[[ManPageArchiveWriteBlocksize3]]. 
 
 You can then modify this object for the desired operations with the 
 various 
@@ -40,10 +40,10 @@ functions to enable the corresponding compression and format
 support. 
 === Set options=== 
 See 
-[[ManPagerchiveeadetptions3]]. 
+[[ManPageArchiveReadSetOptions3]]. 
 === Open archive=== 
 See 
-[[ManPagerchiveritepen3]]. 
+[[ManPageArchiveWriteOpen3]]. 
 
 Once you have prepared the 
 '''struct archive''' 
@@ -59,9 +59,9 @@ specify a filename, file descriptor,
 object, or a block of memory from which to write the archive data. 
 === Produce archive=== 
 See 
-[[ManPagerchiveriteeader3]] 
+[[ManPageArchiveWriteHeader3]] 
 and 
-[[ManPagerchiveriteata3]]. 
+[[ManPageArchiveWriteData3]]. 
 
 Individual archive entries are written in a three-step 
 process: 
@@ -78,7 +78,7 @@ field, which specifies the type of object and
 field, which specifies the size of the data portion of the object. 
 === Release resources=== 
 See 
-[[ManPagerchiveriteree3]]. 
+[[ManPageArchiveWriteFree3]]. 
 
 After all entries have been written, use the 
 '''archive_write_free'''() 
@@ -180,8 +180,8 @@ int main(int argc, const char **argv)
 ```
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiveriteetptions3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveWriteSetOptions3]], 
 [[ManPageCpio5]], 
 [[ManPageMtree5]], 
 [[ManPageTar5]] 
index 8bdfd7d..7975a5a 100644 (file)
@@ -86,8 +86,8 @@ and
 functions. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiveriteetptions3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveWriteSetOptions3]], 
 [[ManPageCpio5]], 
 [[ManPageMtree5]], 
 [[ManPageTar5]] 
index 21f4ab4..b21eb42 100644 (file)
@@ -31,9 +31,9 @@ Clients should treat any value less than zero as an error
 and consider any non-negative value as success. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiveriteinishntry3]], 
-[[ManPagerchiveriteetptions3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveWriteFinishEntry3]], 
+[[ManPageArchiveWriteSetOptions3]], 
 [[ManPageCpio5]], 
 [[ManPageMtree5]], 
 [[ManPageTar5]] 
index f4868c9..11248c1 100644 (file)
@@ -216,7 +216,7 @@ Build and write a header using the data in the provided
 '''struct archive_entry''' 
 structure. 
 See 
-[[ManPagerchiventry3]] 
+[[ManPageArchiveEntry3]] 
 for information on creating and populating 
 '''struct archive_entry''' 
 objects. 
@@ -269,10 +269,10 @@ if it was not invoked manually, then releases all resources.
 More information about the 
 ''struct'' archive 
 object and the overall design of the library can be found in the 
-[[ManPageibarchive3]] 
+[[ManPageLibarchive3]] 
 overview. 
 Many of these functions are also documented under 
-[[ManPagerchiverite3]]. 
+[[ManPageArchiveWrite3]]. 
 == RETURN VALUES == 
 Most functions return 
 '''ARCHIVE_OK''' 
@@ -305,10 +305,10 @@ and
 '''archive_error_string'''() 
 functions. 
 == SEE ALSO == 
-[[ManPagerchiveead3]], 
-[[ManPagerchiverite3]], 
+[[ManPageArchiveRead3]], 
+[[ManPageArchiveWrite3]], 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]] 
+[[ManPageLibarchive3]] 
 == HISTORY == 
 The 
 '''libarchive''' 
index 3ec3e46..b9148e9 100644 (file)
@@ -119,10 +119,10 @@ and
 functions. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiverite3]], 
-[[ManPagerchiveriteormat3]], 
-[[ManPagerchiveriteetptions3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveWrite3]], 
+[[ManPageArchiveWriteFormat3]], 
+[[ManPageArchiveWriteSetOptions3]], 
 [[ManPageCpio5]], 
 [[ManPageMtree5]], 
 [[ManPageTar5]] 
index 405df8b..3d6ff14 100644 (file)
@@ -39,9 +39,9 @@ and
 functions. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiveriteata3]], 
-[[ManPagerchiveriteetptions3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveWriteData3]], 
+[[ManPageArchiveWriteSetOptions3]], 
 [[ManPageCpio5]], 
 [[ManPageMtree5]], 
 [[ManPageTar5]] 
index 697fb11..60fa69c 100644 (file)
@@ -165,7 +165,7 @@ Supported extensions: .7z, .zip, .jar, .cpio, .iso, .a, .ar, .tar, .tgz, .tar.gz
 </dt> <dd> 
 Set the format as specified. 
 More details on the formats supported by libarchive can be found in the 
-[[ManPageibarchiveormats5]] 
+[[ManPageLibarchiveFormats5]] 
 manual page. 
 </dd></dl> 
 == RETURN VALUES == 
@@ -181,10 +181,10 @@ and
 functions. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiverite3]], 
-[[ManPagerchiveriteetptions3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveWrite3]], 
+[[ManPageArchiveWriteSetOptions3]], 
 [[ManPageCpio5]], 
-[[ManPageibarchiveormats5]], 
+[[ManPageLibarchiveFormats5]], 
 [[ManPageMtree5]], 
 [[ManPageTar5]] 
index 4ca2cf9..1d94a56 100644 (file)
@@ -66,8 +66,8 @@ and
 functions. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiveriteetptions3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveWriteSetOptions3]], 
 [[ManPageCpio5]], 
 [[ManPageMtree5]], 
 [[ManPageTar5]] 
index 22547ea..412db20 100644 (file)
@@ -15,7 +15,7 @@ Build and write a header using the data in the provided
 '''struct archive_entry''' 
 structure. 
 See 
-[[ManPagerchiventry3]] 
+[[ManPageArchiveEntry3]] 
 for information on creating and populating 
 '''struct archive_entry''' 
 objects. 
@@ -37,8 +37,8 @@ and
 functions. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiveriteetptions3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveWriteSetOptions3]], 
 [[ManPageCpio5]], 
 [[ManPageMtree5]], 
 [[ManPageTar5]] 
index 3feb067..b8c311f 100644 (file)
@@ -20,12 +20,12 @@ is returned on error.
 A complete description of the 
 '''struct archive''' 
 object can be found in the overview manual page for 
-[[ManPageibarchive3]]. 
+[[ManPageLibarchive3]]. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiverite3]], 
-[[ManPagerchiveriteetptions3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveWrite3]], 
+[[ManPageArchiveWriteSetOptions3]], 
 [[ManPageCpio5]], 
 [[ManPageMtree5]], 
 [[ManPageTar5]] 
index aebd239..369d755 100644 (file)
@@ -101,13 +101,13 @@ have specifically set the block size.
 More information about the 
 ''struct'' archive 
 object and the overall design of the library can be found in the 
-[[ManPageibarchive3]] 
+[[ManPageLibarchive3]] 
 overview. 
 
 Note that the convenience forms above vary in how 
 they block the output. 
 See 
-[[ManPagerchiveritelocksize3]] 
+[[ManPageArchiveWriteBlocksize3]] 
 if you need to control the block size used for writes 
 or the end-of-file padding behavior. 
 == CLIENT CALLBACKS == 
@@ -196,13 +196,13 @@ and
 functions. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiverite3]], 
-[[ManPagerchiveritelocksize3]], 
-[[ManPagerchiveriteilter3]], 
-[[ManPagerchiveriteormat3]], 
-[[ManPagerchiveriteew3]], 
-[[ManPagerchiveriteetptions3]], 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveWrite3]], 
+[[ManPageArchiveWriteBlocksize3]], 
+[[ManPageArchiveWriteFilter3]], 
+[[ManPageArchiveWriteFormat3]], 
+[[ManPageArchiveWriteNew3]], 
+[[ManPageArchiveWriteSetOptions3]], 
 [[ManPageCpio5]], 
 [[ManPageMtree5]], 
 [[ManPageTar5]] 
index 7c78d80..f2c60fc 100644 (file)
@@ -422,9 +422,9 @@ and
 functions. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiveeadetptions3]], 
-[[ManPagerchiverite3]] 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveReadSetOptions3]], 
+[[ManPageArchiveWrite3]] 
 == HISTORY == 
 The 
 '''libarchive''' 
index ec9791d..4f6a97c 100644 (file)
@@ -37,6 +37,6 @@ function.
 </dd></dl> 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPageibarchive3]], 
-[[ManPagerchiverite3]], 
-[[ManPagerchiveriteetptions3]] 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveWrite3]], 
+[[ManPageArchiveWriteSetOptions3]] 
index d186bc5..d5a3a2d 100644 (file)
@@ -115,10 +115,10 @@ The POSIX.1 tar format.
 The default format is 
 ''odc''. 
 See 
-[[ManPageibarchiveormats5]] 
+[[ManPageLibarchiveFormats5]] 
 for more complete information about the 
 formats currently supported by the underlying 
-[[ManPageibarchive3]] 
+[[ManPageLibarchive3]] 
 library. 
 </dd><dt>-h, --help</dt><dd> 
 Print usage information. 
@@ -365,9 +365,9 @@ standard syntax.
 [[gzip(1)|http://www.freebsd.org/cgi/man.cgi?query=gzip&sektion=1]], 
 [[mt(1)|http://www.freebsd.org/cgi/man.cgi?query=mt&sektion=1]], 
 [[pax(1)|http://www.freebsd.org/cgi/man.cgi?query=pax&sektion=1]], 
-[[ManPageibarchive3]], 
+[[ManPageLibarchive3]], 
 [[ManPageCpio5]], 
-[[ManPageibarchiveormats5]], 
+[[ManPageLibarchiveFormats5]], 
 [[ManPageTar5]] 
 == STANDARDS == 
 There is no current POSIX standard for the cpio command; it appeared 
@@ -397,7 +397,7 @@ actually predates
 even though it was not well-known outside of AT&T until some time later. 
 
 This is a complete re-implementation based on the 
-[[ManPageibarchive3]] 
+[[ManPageLibarchive3]] 
 library. 
 == BUGS == 
 The cpio archive format has several basic limitations: 
index 46cc2c0..e6c5260 100644 (file)
@@ -100,7 +100,7 @@ Unless specifically stated otherwise, options are applicable in
 all operating modes. 
 <dl> 
 <dt>'''@'''''archive''</dt><dd> 
-(c and r mode only) 
+(c and r modes only) 
 The specified archive is opened and the entries 
 in it will be appended to the current archive. 
 As a simple example, 
@@ -156,6 +156,16 @@ tar -a -jcf archive.xxx source.c source.h
 ```
 if it is unknown suffix or no suffix, creates a new archive with 
 restricted pax format and bzip2 compression. 
+</dd><dt>--acls</dt><dd> 
+(c, r, u, x modes only) 
+Archive or extract POSIX.1e or NFSv4 ACLs. This is the reverse of 
+--no-acls 
+and the default behavior in c, r, and u modes (except Mac OS X) or if 
+'''tar''' 
+is run in x mode as root. On Mac OS X this option translates extended ACLs 
+to NFSv4 ACLs. To store extended ACLs the 
+--mac-metadata 
+option is preferred. 
 </dd><dt>-B, --read-full-blocks</dt><dd> 
 Ignored for compatibility with other 
 [[ManPageBsdtar1]] 
@@ -180,15 +190,18 @@ options and before extracting any files.
 (x mode only) 
 Before removing file system objects to replace them, clear platform-specific 
 file flags that might prevent removal. 
-</dd><dt>--disable-copyfile</dt><dd> 
-Mac OS X specific. 
-Disable the use of 
-[[copyfile(3)|http://www.freebsd.org/cgi/man.cgi?query=copyfile&sektion=3]]. 
 </dd><dt>--exclude ''pattern''</dt><dd> 
 Do not process files or directories that match the 
 specified pattern. 
 Note that exclusions take precedence over patterns or filenames 
 specified on the command line. 
+</dd><dt>--fflags</dt><dd> 
+(c, r, u, x modes only) 
+Archive or extract file flags. This is the reverse of 
+--no-fflags 
+and the default behavior in c, r, and u modes or if 
+'''tar''' 
+is run in x mode as root. 
 </dd><dt>--format ''format''</dt><dd> 
 (c, r, u mode only) 
 Use the specified format for the created archive. 
@@ -199,7 +212,7 @@ Supported formats include
 and 
 "ustar". 
 Other formats may also be supported; see 
-[[ManPageibarchiveormats5]] 
+[[ManPageLibarchiveFormats5]] 
 for more information about currently-supported formats. 
 In r and u modes, when extending an existing archive, the format specified 
 here must be compatible with the format of the existing archive on disk. 
@@ -237,11 +250,11 @@ On create, this sets the group name that will be stored
 in the archive; 
 the name will not be verified against the system group database. 
 </dd><dt>-H</dt><dd> 
-(c and r mode only) 
+(c and r modes only) 
 Symbolic links named on the command line will be followed; the 
 target of the link will be archived, not the link itself. 
 </dd><dt>-h</dt><dd> 
-(c and r mode only) 
+(c and r modes only) 
 Synonym for 
 -L. 
 </dd><dt>-I</dt><dd> 
@@ -251,7 +264,8 @@ Synonym for
 Show usage. 
 </dd><dt>--hfsCompression</dt><dd> 
 (x mode only) 
-Mac OS X specific(v10.6 or later). Compress extracted regular files with HFS+ compression. 
+Mac OS X specific (v10.6 or later). Compress extracted regular files with HFS+ 
+compression. 
 </dd><dt>--ignore-zeros</dt><dd> 
 An alias of 
 --options '''read_concatenated_archives''' 
@@ -304,7 +318,7 @@ later copies will not overwrite earlier copies.
 Do not overwrite existing files that are newer than the 
 versions appearing in the archive being extracted. 
 </dd><dt>-L, --dereference</dt><dd> 
-(c and r mode only) 
+(c and r modes only) 
 All symbolic links will be followed. 
 Normally, symbolic links are archived as such. 
 With this option, the target of the link will be archived instead. 
@@ -339,6 +353,16 @@ In extract or list modes, this option is ignored.
 (x mode only) 
 Do not extract modification time. 
 By default, the modification time is set to the time stored in the archive. 
+</dd><dt>--mac-metadata</dt><dd> 
+(c, r, u and x mode only) 
+Mac OS X specific. Archive or extract extended ACLs and extended attributes 
+using 
+[[copyfile(3)|http://www.freebsd.org/cgi/man.cgi?query=copyfile&sektion=3]] 
+in AppleDouble format. This is the reverse of 
+--no-mac-metadata. 
+and the default behavior in c, r, and u modes or if 
+'''tar''' 
+is run in x mode as root. 
 </dd><dt>-n, --norecurse, --no-recursion</dt><dd> 
 (c, r, u modes only) 
 Do not recursively archive the contents of directories. 
@@ -379,6 +403,30 @@ This is often used to read filenames output by the
 -print0 
 option to 
 [[find(1)|http://www.freebsd.org/cgi/man.cgi?query=find&sektion=1]]. 
+</dd><dt>--no-acls</dt><dd> 
+(c, r, u, x modes only) 
+Do not archive or extract POSIX.1e or NFSv4 ACLs. This is the reverse of 
+--acls 
+and the default behavior if 
+'''tar''' 
+is run as non-root in x mode (on Mac OS X also in c, r and u modes). 
+</dd><dt>--no-fflags</dt><dd> 
+(c, r, u, x modes only) 
+Do not archive or extract file flags. This is the reverse of 
+--fflags 
+and the default behavior if 
+'''tar''' 
+is run as non-root in x mode. 
+</dd><dt>--no-mac-metadata</dt><dd> 
+(x mode only) 
+Mac OS X specific. Do not archive or extract ACLs and extended attributes using 
+[[copyfile(3)|http://www.freebsd.org/cgi/man.cgi?query=copyfile&sektion=3]] 
+in AppleDouble format. This is the reverse of 
+--mac-metadata. 
+and the default behavior if 
+'''tar''' 
+is run as non-root in x mode. 
+</dd><dt>-n, --norecurse, --no-recursion</dt><dd> 
 </dd><dt>--no-same-owner</dt><dd> 
 (x mode only) 
 Do not extract owner and group IDs. 
@@ -395,7 +443,21 @@ This is the reverse of
 -p 
 and the default behavior if 
 '''tar''' 
-is run as non-root. 
+is run as non-root and can be overridden by also specifying 
+--acls, 
+--fflags, 
+--mac-metadata, 
+--same-owner, 
+--same-permissions 
+and 
+--xattrs. 
+</dd><dt>--no-xattrs</dt><dd> 
+(c, r, u, x modes only) 
+Do not archive or extract extended attributes. This is the reverse of 
+--xattrs 
+and the default behavior if 
+'''tar''' 
+is run as non-root in x mode. 
 </dd><dt>--numeric-owner</dt><dd> 
 This is equivalent to 
 --uname 
@@ -577,14 +639,18 @@ This option suppresses these behaviors.
 </dd><dt>-p, --insecure, --preserve-permissions</dt><dd> 
 (x mode only) 
 Preserve file permissions. 
-Attempt to restore the full permissions, including owner, file modes, file 
-flags and ACLs, if available, for each item extracted from the archive. 
-This is the default, if 
+Attempt to restore the full permissions, including owner, file modes, ACLs, 
+extended atributes and extended file flags, if available, for each item 
+extracted from the archive. This is the default, if 
 '''tar''' 
 is being run by root and can be overridden by also specifying 
---no-same-owner 
+--no-acls, 
+--no-fflags, 
+--no-mac-metadata, 
+--no-same-owner, 
+--no-same-permissions 
 and 
---no-same-permissions. 
+--no-xattrs. 
 </dd><dt>--passphrase ''passphrase''</dt><dd> 
 The 
 ''passphrase'' 
@@ -686,7 +752,7 @@ you probably want to use
 -n 
 as well. 
 </dd><dt>--totals</dt><dd> 
-(c, r, u mode only) 
+(c, r, u modes only) 
 After archiving all files, print a summary to stderr. 
 </dd><dt>-U, --unlink, --unlink-first</dt><dd> 
 (x mode only) 
@@ -748,6 +814,13 @@ Read a list of exclusion patterns from the specified file.
 See 
 --exclude 
 for more information about the handling of exclusions. 
+</dd><dt>--xattrs</dt><dd> 
+(c, r, u, x modes only) 
+Archive or extract extended attributes. This is the reverse of 
+--no-xattrs 
+and the default behavior in c, r, and u modes or if 
+'''tar''' 
+is run in x mode as root. 
 </dd><dt>-y</dt><dd> 
 (c mode only) 
 Compress the resulting archive with 
@@ -920,9 +993,9 @@ For more details, see the explanation of the
 and 
 '''archive_write_set_options'''() 
 API calls that are described in 
-[[ManPagerchiveead3]] 
+[[ManPageArchiveRead3]] 
 and 
-[[ManPagerchiverite3]]. 
+[[ManPageArchiveWrite3]]. 
 == COMPATIBILITY == 
 The bundled-arguments format is supported for compatibility 
 with historic implementations. 
@@ -1065,8 +1138,8 @@ components, or symlinks to other directories.
 [[pax(1)|http://www.freebsd.org/cgi/man.cgi?query=pax&sektion=1]], 
 [[shar(1)|http://www.freebsd.org/cgi/man.cgi?query=shar&sektion=1]], 
 [[xz(1)|http://www.freebsd.org/cgi/man.cgi?query=xz&sektion=1]], 
-[[ManPageibarchive3]], 
-[[ManPageibarchiveormats5]], 
+[[ManPageLibarchive3]], 
+[[ManPageLibarchiveFormats5]], 
 [[ManPageTar5]] 
 == STANDARDS == 
 There is no current POSIX standard for the tar command; it appeared 
@@ -1098,7 +1171,7 @@ beginning with
 FreeBSD 1.0. 
 
 This is a complete re-implementation based on the 
-[[ManPageibarchive3]] 
+[[ManPageLibarchive3]] 
 library. 
 It was first released with 
 FreeBSD 5.4 
index 2d7ae34..3cb828b 100644 (file)
@@ -117,19 +117,19 @@ More detailed information can be found in the individual manual
 pages for each API or utility function. 
 == READING AN ARCHIVE == 
 See 
-[[ManPagerchiveead3]]. 
+[[ManPageArchiveRead3]]. 
 == WRITING AN ARCHIVE == 
 See 
-[[ManPagerchiverite3]]. 
+[[ManPageArchiveWrite3]]. 
 == WRITING ENTRIES TO DISK == 
 The 
-[[ManPagerchiveriteisk3]] 
+[[ManPageArchiveWriteDisk3]] 
 API allows you to write 
-[[ManPagerchiventry3]] 
+[[ManPageArchiveEntry3]] 
 objects to disk using the same API used by 
-[[ManPagerchiverite3]]. 
+[[ManPageArchiveWrite3]]. 
 The 
-[[ManPagerchiveriteisk3]] 
+[[ManPageArchiveWriteDisk3]] 
 API is used internally by 
 '''archive_read_extract'''('';'') 
 using it directly can provide greater control over how entries 
@@ -139,21 +139,21 @@ archive-to-archive copy and archive-to-disk extraction
 operations. 
 == READING ENTRIES FROM DISK == 
 The 
-[[ManPagerchiveeadisk3]] 
+[[ManPageArchiveReadDisk3]] 
 supports for populating 
-[[ManPagerchiventry3]] 
+[[ManPageArchiveEntry3]] 
 objects from information in the filesystem. 
 This includes the information accessible from the 
 [[stat(2)|http://www.freebsd.org/cgi/man.cgi?query=stat&sektion=2]] 
 system call as well as ACLs, extended attributes, 
 and other metadata. 
 The 
-[[ManPagerchiveeadisk3]] 
+[[ManPageArchiveReadDisk3]] 
 API also supports iterating over directory trees, 
 which allows directories of files to be read using 
 an API compatible with 
 the 
-[[ManPagerchiveead3]] 
+[[ManPageArchiveRead3]] 
 API. 
 == DESCRIPTION == 
 Detailed descriptions of each function are provided by the 
@@ -168,7 +168,7 @@ The
 structure contains a complete description of a single archive 
 entry. 
 It uses an opaque interface that is fully documented in 
-[[ManPagerchiventry3]]. 
+[[ManPageArchiveEntry3]]. 
 
 Users familiar with historic formats should be aware that the newer 
 variants have eliminated most restrictions on the length of textual fields. 
@@ -216,14 +216,14 @@ and
 functions can be used to obtain more information. 
 == ENVIRONMENT == 
 There are character set conversions within the 
-[[ManPagerchiventry3]] 
+[[ManPageArchiveEntry3]] 
 functions that are impacted by the currently-selected locale. 
 == SEE ALSO == 
 [[ManPageBsdtar1]], 
-[[ManPagerchiventry3]], 
-[[ManPagerchiveead3]], 
-[[ManPagerchivetil3]], 
-[[ManPagerchiverite3]], 
+[[ManPageArchiveEntry3]], 
+[[ManPageArchiveRead3]], 
+[[ManPageArchiveUtil3]], 
+[[ManPageArchiveWrite3]], 
 [[ManPageTar5]] 
 == HISTORY == 
 The 
index 40e411d..8893b8b 100644 (file)
@@ -291,13 +291,13 @@ ARCHIVE_DEFAULT_BYTES_PER_BLOCK
 ```
 </dd></dl> 
 == SEE ALSO == 
-[[ManPageibarchive3]], 
-[[ManPagerchiveead3]], 
-[[ManPagerchiveeadilter3]], 
-[[ManPagerchiveeadormat3]], 
-[[ManPagerchiveeadetptions3]], 
-[[ManPagerchiverite3]], 
-[[ManPagerchiveriteilter3]], 
-[[ManPagerchiveriteormat3]], 
-[[ManPagerchiveriteetptions3]], 
-[[ManPagerchivetil3]] 
+[[ManPageLibarchive3]], 
+[[ManPageArchiveRead3]], 
+[[ManPageArchiveReadFilter3]], 
+[[ManPageArchiveReadFormat3]], 
+[[ManPageArchiveReadSetOptions3]], 
+[[ManPageArchiveWrite3]], 
+[[ManPageArchiveWriteFilter3]], 
+[[ManPageArchiveWriteFormat3]], 
+[[ManPageArchiveWriteSetOptions3]], 
+[[ManPageArchiveUtil3]] 
index 7623d91..54663b2 100644 (file)
@@ -4,7 +4,7 @@ LIBARCHIVE-FORMATS(5) manual page
 - archive formats supported by the libarchive library 
 == DESCRIPTION == 
 The 
-[[ManPageibarchive3]] 
+[[ManPageLibarchive3]] 
 library reads and writes a variety of streaming archive formats. 
 Generally speaking, all of these archive formats consist of a series of 
 "entries". 
@@ -21,7 +21,7 @@ to support, though many programs do use libarchive convenience
 functions to enable all supported formats. 
 === Tar Formats=== 
 The 
-[[ManPageibarchive3]] 
+[[ManPageLibarchive3]] 
 library can read most tar archives. 
 It can write POSIX-standard 
 "ustar" 
@@ -40,7 +40,7 @@ subsequent entries.
 <dl> 
 <dt>'''gnutar'''</dt><dd> 
 The 
-[[ManPageibarchive3]] 
+[[ManPageLibarchive3]] 
 library can read most GNU-format tar archives. 
 It currently supports the most popular GNU extensions, including 
 modern long filename and linkname support, as well as atime and ctime data. 
@@ -50,12 +50,12 @@ It can read GNU sparse file entries, including the new POSIX-based
 formats. 
 
 The 
-[[ManPageibarchive3]] 
+[[ManPageLibarchive3]] 
 library can write GNU tar format, including long filename 
 and linkname support, as well as atime and ctime data. 
 </dd><dt>'''pax'''</dt><dd> 
 The 
-[[ManPageibarchive3]] 
+[[ManPageLibarchive3]] 
 library can read and write POSIX-compliant pax interchange format 
 archives. 
 Pax interchange format archives are an extension of the older ustar 
@@ -379,7 +379,7 @@ although many of the keywords cannot currently be stored in an
 '''archive_entry''' 
 object. 
 When writing, libarchive supports use of the 
-[[ManPagerchiveriteetptions3]] 
+[[ManPageArchiveWriteSetOptions3]] 
 interface to specify which keywords should be included in the 
 output. 
 If libarchive was compiled with access to suitable 
index a980ba4..c784168 100644 (file)
@@ -13,15 +13,15 @@ make it easy to add new archive and compression formats.
 Externally, libarchive exposes most operations through an 
 opaque, object-style interface. 
 The 
-[[ManPagerchiventry3]] 
+[[ManPageArchiveEntry3]] 
 objects store information about a single filesystem object. 
 The rest of the library provides facilities to write 
-[[ManPagerchiventry3]] 
+[[ManPageArchiveEntry3]] 
 objects to archive files, 
 read them from archive files, 
 and write them to disk. 
 (There are plans to add a facility to read 
-[[ManPagerchiventry3]] 
+[[ManPageArchiveEntry3]] 
 objects from disk as well.) 
 
 The read and write APIs each have four layers: a public API 
@@ -37,7 +37,7 @@ an archive or disk writer, and then use a single set of
 code to select and write entries, regardless of the target. 
 == READ ARCHITECTURE == 
 From the outside, clients use the 
-[[ManPagerchiveead3]] 
+[[ManPageArchiveRead3]] 
 API to manipulate an 
 '''archive''' 
 object to read entries and bodies from an archive stream. 
@@ -50,9 +50,9 @@ The API has four layers:
 The lowest layer is the I/O layer. 
 This layer can be overridden by clients, but most clients use 
 the packaged I/O callbacks provided, for example, by 
-[[ManPagerchiveeadpenemory3]], 
+[[ManPageArchiveReadOpenMemory3]], 
 and 
-[[ManPagerchiveeadpend3]]. 
+[[ManPageArchiveReadOpenFd3]]. 
 The compression layer calls the I/O layer to 
 read bytes and decompresses them for the format layer. 
 The format layer unpacks a stream of uncompressed bytes and 
@@ -319,11 +319,11 @@ Fortunately, such archives are very rare, and libarchive can read
 most ZIP archives, though it cannot always extract as much information 
 as a dedicated ZIP program. 
 == SEE ALSO == 
-[[ManPagerchiventry3]], 
-[[ManPagerchiveead3]], 
-[[ManPagerchiverite3]], 
-[[ManPagerchiveriteisk3]] 
-[[ManPageibarchive3]], 
+[[ManPageArchiveEntry3]], 
+[[ManPageArchiveRead3]], 
+[[ManPageArchiveWrite3]], 
+[[ManPageArchiveWriteDisk3]] 
+[[ManPageLibarchive3]], 
 == HISTORY == 
 The 
 '''libarchive''' 
index cd27c90..d400735 100644 (file)
@@ -36,7 +36,7 @@
  * assert that ARCHIVE_VERSION_NUMBER >= 2012108.
  */
 /* Note: Compiler will complain if this does not match archive_entry.h! */
-#define        ARCHIVE_VERSION_NUMBER 3003000
+#define        ARCHIVE_VERSION_NUMBER 3003001
 
 #include <sys/stat.h>
 #include <stddef.h>  /* for wchar_t */
@@ -155,7 +155,7 @@ __LA_DECL int               archive_version_number(void);
 /*
  * Textual name/version of the library, useful for version displays.
  */
-#define        ARCHIVE_VERSION_ONLY_STRING "3.3.0"
+#define        ARCHIVE_VERSION_ONLY_STRING "3.3.1"
 #define        ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING
 __LA_DECL const char * archive_version_string(void);
 
@@ -1001,6 +1001,10 @@ __LA_DECL int  archive_read_disk_set_atime_restored(struct archive *);
 #define        ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS     (0x0008)
 /* Default: Xattrs are read from disk. */
 #define        ARCHIVE_READDISK_NO_XATTR               (0x0010)
+/* Default: ACLs are read from disk. */
+#define        ARCHIVE_READDISK_NO_ACL                 (0x0020)
+/* Default: File flags are read from disk. */
+#define        ARCHIVE_READDISK_NO_FFLAGS              (0x0040)
 
 __LA_DECL int  archive_read_disk_set_behavior(struct archive *,
                    int flags);
index b58ffb3..b4fd6ca 100644 (file)
   defined(ARCHIVE_CRYPTO_SHA256_WIN) ||\
   defined(ARCHIVE_CRYPTO_SHA384_WIN) ||\
   defined(ARCHIVE_CRYPTO_SHA512_WIN)
+#include <windows.h>
 #include <wincrypt.h>
 typedef struct {
   int   valid;
index d4f061b..10eff11 100644 (file)
@@ -1649,7 +1649,10 @@ static struct flag {
        { "nosappnd",   L"nosappnd",            SF_APPEND,      0 },
        { "nosappend",  L"nosappend",           SF_APPEND,      0 },
 #endif
-#ifdef  EXT2_APPEND_FL                         /* 'a' */
+#if defined(FS_APPEND_FL)                      /* 'a' */
+       { "nosappnd",   L"nosappnd",            FS_APPEND_FL,   0 },
+       { "nosappend",  L"nosappend",           FS_APPEND_FL,   0 },
+#elif defined(EXT2_APPEND_FL)                  /* 'a' */
        { "nosappnd",   L"nosappnd",            EXT2_APPEND_FL, 0 },
        { "nosappend",  L"nosappend",           EXT2_APPEND_FL, 0 },
 #endif
@@ -1662,7 +1665,11 @@ static struct flag {
        { "noschange",  L"noschange",           SF_IMMUTABLE,   0 },
        { "nosimmutable",       L"nosimmutable",        SF_IMMUTABLE,   0 },
 #endif
-#ifdef EXT2_IMMUTABLE_FL                       /* 'i' */
+#if defined(FS_IMMUTABLE_FL)                   /* 'i' */
+       { "noschg",     L"noschg",              FS_IMMUTABLE_FL,        0 },
+       { "noschange",  L"noschange",           FS_IMMUTABLE_FL,        0 },
+       { "nosimmutable",       L"nosimmutable",        FS_IMMUTABLE_FL,        0 },
+#elif defined(EXT2_IMMUTABLE_FL)               /* 'i' */
        { "noschg",     L"noschg",              EXT2_IMMUTABLE_FL,      0 },
        { "noschange",  L"noschange",           EXT2_IMMUTABLE_FL,      0 },
        { "nosimmutable",       L"nosimmutable",        EXT2_IMMUTABLE_FL,      0 },
@@ -1686,7 +1693,9 @@ static struct flag {
 #ifdef UF_NODUMP
        { "nodump",     L"nodump",              0,              UF_NODUMP},
 #endif
-#ifdef EXT2_NODUMP_FL                          /* 'd' */
+#if defined(FS_NODUMP_FL)      /* 'd' */
+       { "nodump",     L"nodump",              0,              FS_NODUMP_FL},
+#elif defined(EXT2_NODUMP_FL)  /* 'd' */
        { "nodump",     L"nodump",              0,              EXT2_NODUMP_FL},
 #endif
 #ifdef UF_OPAQUE
@@ -1699,65 +1708,124 @@ static struct flag {
 #ifdef UF_COMPRESSED
        { "nocompressed",L"nocompressed",       UF_COMPRESSED,  0 },
 #endif
-#ifdef EXT2_UNRM_FL
+#if defined(FS_UNRM_FL)
+        { "nouunlink", L"nouunlink",           FS_UNRM_FL,     0},
+#elif defined(EXT2_UNRM_FL)
         { "nouunlink", L"nouunlink",           EXT2_UNRM_FL,   0},
 #endif
 
-#ifdef EXT2_BTREE_FL
+#if defined(FS_BTREE_FL)
+        { "nobtree",   L"nobtree",             FS_BTREE_FL,    0 },
+#elif defined(EXT2_BTREE_FL)
         { "nobtree",   L"nobtree",             EXT2_BTREE_FL,  0 },
 #endif
 
-#ifdef EXT2_ECOMPR_FL
+#if defined(FS_ECOMPR_FL)
+        { "nocomperr", L"nocomperr",           FS_ECOMPR_FL,   0 },
+#elif defined(EXT2_ECOMPR_FL)
         { "nocomperr", L"nocomperr",           EXT2_ECOMPR_FL, 0 },
 #endif
 
-#ifdef EXT2_COMPR_FL                           /* 'c' */
+#if defined(FS_COMPR_FL)                       /* 'c' */
+        { "nocompress",        L"nocompress",          FS_COMPR_FL,    0 },
+#elif defined(EXT2_COMPR_FL)                   /* 'c' */
         { "nocompress",        L"nocompress",          EXT2_COMPR_FL,  0 },
 #endif
 
-#ifdef EXT2_NOATIME_FL                         /* 'A' */
+#if defined(FS_NOATIME_FL)                     /* 'A' */
+        { "noatime",   L"noatime",             0,              FS_NOATIME_FL},
+#elif defined(EXT2_NOATIME_FL)                 /* 'A' */
         { "noatime",   L"noatime",             0,              EXT2_NOATIME_FL},
 #endif
 
-#ifdef EXT2_DIRTY_FL
+#if defined(FS_DIRTY_FL)
+        { "nocompdirty",L"nocompdirty",                FS_DIRTY_FL,            0},
+#elif defined(EXT2_DIRTY_FL)
         { "nocompdirty",L"nocompdirty",                EXT2_DIRTY_FL,          0},
 #endif
 
-#ifdef EXT2_COMPRBLK_FL
-#ifdef EXT2_NOCOMPR_FL
+#if defined(FS_COMPRBLK_FL)
+#if defined(FS_NOCOMPR_FL)
+        { "nocomprblk",        L"nocomprblk",          FS_COMPRBLK_FL, FS_NOCOMPR_FL},
+#else
+        { "nocomprblk",        L"nocomprblk",          FS_COMPRBLK_FL, 0},
+#endif
+#elif defined(EXT2_COMPRBLK_FL)
+#if defined(EXT2_NOCOMPR_FL)
         { "nocomprblk",        L"nocomprblk",          EXT2_COMPRBLK_FL, EXT2_NOCOMPR_FL},
 #else
         { "nocomprblk",        L"nocomprblk",          EXT2_COMPRBLK_FL,       0},
 #endif
 #endif
-#ifdef EXT2_DIRSYNC_FL
+#if defined(FS_DIRSYNC_FL)
+        { "nodirsync", L"nodirsync",           FS_DIRSYNC_FL,  0},
+#elif defined(EXT2_DIRSYNC_FL)
         { "nodirsync", L"nodirsync",           EXT2_DIRSYNC_FL,        0},
 #endif
-#ifdef EXT2_INDEX_FL
+#if defined(FS_INDEX_FL)
+        { "nohashidx", L"nohashidx",           FS_INDEX_FL,            0},
+#elif defined(EXT2_INDEX_FL)
         { "nohashidx", L"nohashidx",           EXT2_INDEX_FL,          0},
 #endif
-#ifdef EXT2_IMAGIC_FL
+#if defined(FS_IMAGIC_FL)
+        { "noimagic",  L"noimagic",            FS_IMAGIC_FL,           0},
+#elif defined(EXT2_IMAGIC_FL)
         { "noimagic",  L"noimagic",            EXT2_IMAGIC_FL,         0},
 #endif
-#ifdef EXT3_JOURNAL_DATA_FL
+#if defined(FS_JOURNAL_DATA_FL)
+        { "nojournal", L"nojournal",           FS_JOURNAL_DATA_FL,     0},
+#elif defined(EXT3_JOURNAL_DATA_FL)
         { "nojournal", L"nojournal",           EXT3_JOURNAL_DATA_FL,   0},
 #endif
-#ifdef EXT2_SECRM_FL
+#if defined(FS_SECRM_FL)
+        { "nosecuredeletion",L"nosecuredeletion",FS_SECRM_FL,          0},
+#elif defined(EXT2_SECRM_FL)
         { "nosecuredeletion",L"nosecuredeletion",EXT2_SECRM_FL,                0},
 #endif
-#ifdef EXT2_SYNC_FL
+#if defined(FS_SYNC_FL)
+        { "nosync",    L"nosync",              FS_SYNC_FL,             0},
+#elif defined(EXT2_SYNC_FL)
         { "nosync",    L"nosync",              EXT2_SYNC_FL,           0},
 #endif
-#ifdef EXT2_NOTAIL_FL
+#if defined(FS_NOTAIL_FL)
+        { "notail",    L"notail",              0,              FS_NOTAIL_FL},
+#elif defined(EXT2_NOTAIL_FL)
         { "notail",    L"notail",              0,              EXT2_NOTAIL_FL},
 #endif
-#ifdef EXT2_TOPDIR_FL
+#if defined(FS_TOPDIR_FL)
+        { "notopdir",  L"notopdir",            FS_TOPDIR_FL,           0},
+#elif defined(EXT2_TOPDIR_FL)
         { "notopdir",  L"notopdir",            EXT2_TOPDIR_FL,         0},
 #endif
-#ifdef EXT2_RESERVED_FL
+#ifdef FS_ENCRYPT_FL
+        { "noencrypt", L"noencrypt",           FS_ENCRYPT_FL,  0},
+#endif
+#ifdef FS_HUGE_FILE_FL
+        { "nohugefile",        L"nohugefile",          FS_HUGE_FILE_FL,        0},
+#endif
+#ifdef FS_EXTENT_FL
+        { "noextent",  L"noextent",            FS_EXTENT_FL,   0},
+#endif
+#ifdef FS_EA_INODE_FL
+        { "noeainode", L"noeainode",           FS_EA_INODE_FL, 0},
+#endif
+#ifdef FS_EOFBLOCKS_FL
+        { "noeofblocks",L"noeofblocks",                FS_EOFBLOCKS_FL,        0},
+#endif
+#ifdef FS_NOCOW_FL
+        { "nocow",     L"nocow",               FS_NOCOW_FL,    0},
+#endif
+#ifdef FS_INLINE_DATA_FL
+        { "noinlinedata",L"noinlinedata",      FS_INLINE_DATA_FL,      0},
+#endif
+#ifdef FS_PROJINHERIT_FL
+        { "noprojinherit",L"noprojinherit",    FS_PROJINHERIT_FL,      0},
+#endif
+#if defined(FS_RESERVED_FL)
+        { "noreserved",        L"noreserved",          FS_RESERVED_FL, 0},
+#elif defined(EXT2_RESERVED_FL)
         { "noreserved",        L"noreserved",          EXT2_RESERVED_FL,       0},
 #endif
-
        { NULL,         NULL,                   0,              0 }
 };
 
index 2dd557a..7645f0c 100644 (file)
@@ -30,7 +30,7 @@
 #define        ARCHIVE_ENTRY_H_INCLUDED
 
 /* Note: Compiler will complain if this does not match archive.h! */
-#define        ARCHIVE_VERSION_NUMBER 3003000
+#define        ARCHIVE_VERSION_NUMBER 3003001
 
 /*
  * Note: archive_entry.h is for use outside of libarchive; the
@@ -66,6 +66,27 @@ typedef int64_t la_int64_t;
 # endif
 #endif
 
+/* The la_ssize_t should match the type used in 'struct stat' */
+#if !defined(__LA_SSIZE_T_DEFINED)
+/* Older code relied on the __LA_SSIZE_T macro; after 4.0 we'll switch to the typedef exclusively. */
+# if ARCHIVE_VERSION_NUMBER < 4000000
+#define __LA_SSIZE_T la_ssize_t
+# endif
+#define __LA_SSIZE_T_DEFINED
+# if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
+#  if defined(_SSIZE_T_DEFINED) || defined(_SSIZE_T_)
+typedef ssize_t la_ssize_t;
+#  elif defined(_WIN64)
+typedef __int64 la_ssize_t;
+#  else
+typedef long la_ssize_t;
+#  endif
+# else
+# include <unistd.h>  /* ssize_t */
+typedef ssize_t la_ssize_t;
+# endif
+#endif
+
 /* Get a suitable definition for mode_t */
 #if ARCHIVE_VERSION_NUMBER >= 3999000
 /* Switch to plain 'int' for libarchive 4.0.  It's less broken than 'mode_t' */
@@ -526,9 +547,9 @@ __LA_DECL int        archive_entry_acl_next_w(struct archive_entry *, int /* want_type
 #define        ARCHIVE_ENTRY_ACL_STYLE_COMPACT         0x00000010
 
 __LA_DECL wchar_t *archive_entry_acl_to_text_w(struct archive_entry *,
-           ssize_t * /* len */, int /* flags */);
+           la_ssize_t * /* len */, int /* flags */);
 __LA_DECL char *archive_entry_acl_to_text(struct archive_entry *,
-           ssize_t * /* len */, int /* flags */);
+           la_ssize_t * /* len */, int /* flags */);
 __LA_DECL int archive_entry_acl_from_text_w(struct archive_entry *,
            const wchar_t * /* wtext */, int /* type */);
 __LA_DECL int archive_entry_acl_from_text(struct archive_entry *,
index 1e0ae28..f299655 100644 (file)
@@ -76,6 +76,10 @@ __hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx)
 
 #elif defined(_WIN32) && !defined(__CYGWIN__) && defined(HAVE_BCRYPT_H)
 
+#ifndef BCRYPT_HASH_REUSABLE_FLAG
+# define BCRYPT_HASH_REUSABLE_FLAG 0x00000020
+#endif
+
 static int
 __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len)
 {
index 591a212..b2f1d17 100644 (file)
@@ -203,15 +203,17 @@ archive_read_disk_entry_from_file(struct archive *_a,
 #ifdef HAVE_STRUCT_STAT_ST_FLAGS
        /* On FreeBSD, we get flags for free with the stat. */
        /* TODO: Does this belong in copy_stat()? */
-       if (st->st_flags != 0)
+       if ((a->flags & ARCHIVE_READDISK_NO_FFLAGS) == 0 && st->st_flags != 0)
                archive_entry_set_fflags(entry, st->st_flags, 0);
 #endif
 
-#if defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS)
+#if (defined(FS_IOC_GETFLAGS) && defined(HAVE_WORKING_FS_IOC_GETFLAGS)) || \
+    (defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS))
        /* Linux requires an extra ioctl to pull the flags.  Although
         * this is an extra step, it has a nice side-effect: We get an
         * open file descriptor which we can use in the subsequent lookups. */
-       if ((S_ISREG(st->st_mode) || S_ISDIR(st->st_mode))) {
+       if ((a->flags & ARCHIVE_READDISK_NO_FFLAGS) == 0 &&
+           (S_ISREG(st->st_mode) || S_ISDIR(st->st_mode))) {
                if (fd < 0) {
                        if (a->tree != NULL)
                                fd = a->open_on_current_dir(a->tree, path,
@@ -223,7 +225,13 @@ archive_read_disk_entry_from_file(struct archive *_a,
                }
                if (fd >= 0) {
                        int stflags;
-                       r = ioctl(fd, EXT2_IOC_GETFLAGS, &stflags);
+                       r = ioctl(fd,
+#if defined(FS_IOC_GETFLAGS)
+                           FS_IOC_GETFLAGS,
+#else
+                           EXT2_IOC_GETFLAGS,
+#endif
+                           &stflags);
                        if (r == 0 && stflags != 0)
                                archive_entry_set_fflags(entry, stflags, 0);
                }
@@ -269,13 +277,15 @@ archive_read_disk_entry_from_file(struct archive *_a,
        }
 #endif /* HAVE_READLINK || HAVE_READLINKAT */
 
-       r = setup_acls(a, entry, &fd);
-       if (!a->suppress_xattr) {
+       r = 0;
+       if ((a->flags & ARCHIVE_READDISK_NO_ACL) == 0)
+               r = setup_acls(a, entry, &fd);
+       if ((a->flags & ARCHIVE_READDISK_NO_XATTR) == 0) {
                r1 = setup_xattrs(a, entry, &fd);
                if (r1 < r)
                        r = r1;
        }
-       if (a->enable_copyfile) {
+       if (a->flags & ARCHIVE_READDISK_MAC_COPYFILE) {
                r1 = setup_mac_metadata(a, entry, &fd);
                if (r1 < r)
                        r = r1;
index b893704..6961ae6 100644 (file)
@@ -465,8 +465,7 @@ archive_read_disk_new(void)
        a->entry = archive_entry_new2(&a->archive);
        a->lookup_uname = trivial_lookup_uname;
        a->lookup_gname = trivial_lookup_gname;
-       a->enable_copyfile = 1;
-       a->traverse_mount_points = 1;
+       a->flags = ARCHIVE_READDISK_MAC_COPYFILE;
        a->open_on_current_dir = open_on_current_dir;
        a->tree_current_dir_fd = tree_current_dir_fd;
        a->tree_enter_working_dir = tree_enter_working_dir;
@@ -563,25 +562,19 @@ archive_read_disk_set_symlink_hybrid(struct archive *_a)
 int
 archive_read_disk_set_atime_restored(struct archive *_a)
 {
-#ifndef HAVE_UTIMES
-       static int warning_done = 0;
-#endif
        struct archive_read_disk *a = (struct archive_read_disk *)_a;
        archive_check_magic(_a, ARCHIVE_READ_DISK_MAGIC,
            ARCHIVE_STATE_ANY, "archive_read_disk_restore_atime");
 #ifdef HAVE_UTIMES
-       a->restore_time = 1;
+       a->flags |= ARCHIVE_READDISK_RESTORE_ATIME;
        if (a->tree != NULL)
                a->tree->flags |= needsRestoreTimes;
        return (ARCHIVE_OK);
 #else
-       if (warning_done)
-               /* Warning was already emitted; suppress further warnings. */
-               return (ARCHIVE_OK);
-
+       /* Display warning and unset flag */
        archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
            "Cannot restore access time on this system");
-       warning_done = 1;
+       a->flags &= ~ARCHIVE_READDISK_RESTORE_ATIME;
        return (ARCHIVE_WARN);
 #endif
 }
@@ -595,29 +588,14 @@ archive_read_disk_set_behavior(struct archive *_a, int flags)
        archive_check_magic(_a, ARCHIVE_READ_DISK_MAGIC,
            ARCHIVE_STATE_ANY, "archive_read_disk_honor_nodump");
 
+       a->flags = flags;
+
        if (flags & ARCHIVE_READDISK_RESTORE_ATIME)
                r = archive_read_disk_set_atime_restored(_a);
        else {
-               a->restore_time = 0;
                if (a->tree != NULL)
                        a->tree->flags &= ~needsRestoreTimes;
        }
-       if (flags & ARCHIVE_READDISK_HONOR_NODUMP)
-               a->honor_nodump = 1;
-       else
-               a->honor_nodump = 0;
-       if (flags & ARCHIVE_READDISK_MAC_COPYFILE)
-               a->enable_copyfile = 1;
-       else
-               a->enable_copyfile = 0;
-       if (flags & ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS)
-               a->traverse_mount_points = 0;
-       else
-               a->traverse_mount_points = 1;
-       if (flags & ARCHIVE_READDISK_NO_XATTR)
-               a->suppress_xattr = 1;
-       else
-               a->suppress_xattr = 0;
        return (r);
 }
 
@@ -918,7 +896,7 @@ next_entry(struct archive_read_disk *a, struct tree *t,
        } while (lst == NULL);
 
 #ifdef __APPLE__
-       if (a->enable_copyfile) {
+       if (a->flags & ARCHIVE_READDISK_MAC_COPYFILE) {
                /* If we're using copyfile(), ignore "._XXX" files. */
                const char *bname = strrchr(tree_current_path(t), '/');
                if (bname == NULL)
@@ -989,7 +967,7 @@ next_entry(struct archive_read_disk *a, struct tree *t,
        }
        if (t->initial_filesystem_id == -1)
                t->initial_filesystem_id = t->current_filesystem_id;
-       if (!a->traverse_mount_points) {
+       if (a->flags & ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS) {
                if (t->initial_filesystem_id != t->current_filesystem_id)
                        descend = 0;
        }
@@ -999,12 +977,14 @@ next_entry(struct archive_read_disk *a, struct tree *t,
         * Honor nodump flag.
         * If the file is marked with nodump flag, do not return this entry.
         */
-       if (a->honor_nodump) {
+       if (a->flags & ARCHIVE_READDISK_HONOR_NODUMP) {
 #if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP)
                if (st->st_flags & UF_NODUMP)
                        return (ARCHIVE_RETRY);
-#elif defined(EXT2_IOC_GETFLAGS) && defined(EXT2_NODUMP_FL) &&\
-      defined(HAVE_WORKING_EXT2_IOC_GETFLAGS)
+#elif (defined(FS_IOC_GETFLAGS) && defined(FS_NODUMP_FL) && \
+       defined(HAVE_WORKING_FS_IOC_GETFLAGS)) || \
+      (defined(EXT2_IOC_GETFLAGS) && defined(EXT2_NODUMP_FL) && \
+       defined(HAVE_WORKING_EXT2_IOC_GETFLAGS))
                if (S_ISREG(st->st_mode) || S_ISDIR(st->st_mode)) {
                        int stflags;
 
@@ -1013,9 +993,18 @@ next_entry(struct archive_read_disk *a, struct tree *t,
                            O_RDONLY | O_NONBLOCK | O_CLOEXEC);
                        __archive_ensure_cloexec_flag(t->entry_fd);
                        if (t->entry_fd >= 0) {
-                               r = ioctl(t->entry_fd, EXT2_IOC_GETFLAGS,
+                               r = ioctl(t->entry_fd,
+#ifdef FS_IOC_GETFLAGS
+                               FS_IOC_GETFLAGS,
+#else
+                               EXT2_IOC_GETFLAGS,
+#endif
                                        &stflags);
+#ifdef FS_NODUMP_FL
+                               if (r == 0 && (stflags & FS_NODUMP_FL) != 0)
+#else
                                if (r == 0 && (stflags & EXT2_NODUMP_FL) != 0)
+#endif
                                        return (ARCHIVE_RETRY);
                        }
                }
@@ -1340,10 +1329,11 @@ _archive_read_disk_open(struct archive *_a, const char *pathname)
        struct archive_read_disk *a = (struct archive_read_disk *)_a;
 
        if (a->tree != NULL)
-               a->tree = tree_reopen(a->tree, pathname, a->restore_time);
+               a->tree = tree_reopen(a->tree, pathname,
+                   a->flags & ARCHIVE_READDISK_RESTORE_ATIME);
        else
                a->tree = tree_open(pathname, a->symlink_mode,
-                   a->restore_time);
+                   a->flags & ARCHIVE_READDISK_RESTORE_ATIME);
        if (a->tree == NULL) {
                archive_set_error(&a->archive, ENOMEM,
                    "Can't allocate tar data");
@@ -2132,7 +2122,7 @@ tree_open(const char *path, int symlink_mode, int restore_time)
 static struct tree *
 tree_reopen(struct tree *t, const char *path, int restore_time)
 {
-       t->flags = (restore_time)?needsRestoreTimes:0;
+       t->flags = (restore_time != 0)?needsRestoreTimes:0;
        t->flags |= onInitialDir;
        t->visit_type = 0;
        t->tree_errno = 0;
index 2569321..b5a8328 100644 (file)
@@ -63,16 +63,8 @@ struct archive_read_disk {
        int     (*tree_current_dir_fd)(struct tree*);
        int     (*tree_enter_working_dir)(struct tree*);
 
-       /* Set 1 if users request to restore atime . */
-       int              restore_time;
-       /* Set 1 if users request to honor nodump flag . */
-       int              honor_nodump;
-       /* Set 1 if users request to enable mac copyfile. */
-       int              enable_copyfile;
-       /* Set 1 if users request to traverse mount points. */
-       int              traverse_mount_points;
-       /* Set 1 if users want to suppress xattr information. */
-       int              suppress_xattr;
+       /* Bitfield with ARCHIVE_READDISK_* tunables */
+       int     flags;
 
        const char * (*lookup_gname)(void *private, int64_t gid);
        void    (*cleanup_gname)(void *private);
index 27b75e3..3b90330 100644 (file)
@@ -398,8 +398,7 @@ archive_read_disk_new(void)
        a->entry = archive_entry_new2(&a->archive);
        a->lookup_uname = trivial_lookup_uname;
        a->lookup_gname = trivial_lookup_gname;
-       a->enable_copyfile = 1;
-       a->traverse_mount_points = 1;
+       a->flags = ARCHIVE_READDISK_MAC_COPYFILE;
        return (&a->archive);
 }
 
@@ -495,7 +494,7 @@ archive_read_disk_set_atime_restored(struct archive *_a)
        struct archive_read_disk *a = (struct archive_read_disk *)_a;
        archive_check_magic(_a, ARCHIVE_READ_DISK_MAGIC,
            ARCHIVE_STATE_ANY, "archive_read_disk_restore_atime");
-       a->restore_time = 1;
+       a->flags |= ARCHIVE_READDISK_RESTORE_ATIME;
        if (a->tree != NULL)
                a->tree->flags |= needsRestoreTimes;
        return (ARCHIVE_OK);
@@ -510,25 +509,14 @@ archive_read_disk_set_behavior(struct archive *_a, int flags)
        archive_check_magic(_a, ARCHIVE_READ_DISK_MAGIC,
            ARCHIVE_STATE_ANY, "archive_read_disk_honor_nodump");
 
+       a->flags = flags;
+
        if (flags & ARCHIVE_READDISK_RESTORE_ATIME)
                r = archive_read_disk_set_atime_restored(_a);
        else {
-               a->restore_time = 0;
                if (a->tree != NULL)
                        a->tree->flags &= ~needsRestoreTimes;
        }
-       if (flags & ARCHIVE_READDISK_HONOR_NODUMP)
-               a->honor_nodump = 1;
-       else
-               a->honor_nodump = 0;
-       if (flags & ARCHIVE_READDISK_MAC_COPYFILE)
-               a->enable_copyfile = 1;
-       else
-               a->enable_copyfile = 0;
-       if (flags & ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS)
-               a->traverse_mount_points = 0;
-       else
-               a->traverse_mount_points = 1;
        return (r);
 }
 
@@ -852,7 +840,7 @@ next_entry(struct archive_read_disk *a, struct tree *t,
        }
        if (t->initial_filesystem_id == -1)
                t->initial_filesystem_id = t->current_filesystem_id;
-       if (!a->traverse_mount_points) {
+       if (a->flags & ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS) {
                if (t->initial_filesystem_id != t->current_filesystem_id)
                        return (ARCHIVE_RETRY);
        }
@@ -1219,9 +1207,11 @@ _archive_read_disk_open_w(struct archive *_a, const wchar_t *pathname)
        struct archive_read_disk *a = (struct archive_read_disk *)_a;
 
        if (a->tree != NULL)
-               a->tree = tree_reopen(a->tree, pathname, a->restore_time);
+               a->tree = tree_reopen(a->tree, pathname,
+                   a->flags & ARCHIVE_READDISK_RESTORE_ATIME);
        else
-               a->tree = tree_open(pathname, a->symlink_mode, a->restore_time);
+               a->tree = tree_open(pathname, a->symlink_mode,
+                   a->flags & ARCHIVE_READDISK_RESTORE_ATIME);
        if (a->tree == NULL) {
                archive_set_error(&a->archive, ENOMEM,
                    "Can't allocate directory traversal data");
@@ -1519,7 +1509,7 @@ tree_reopen(struct tree *t, const wchar_t *path, int restore_time)
        struct archive_wstring ws;
        wchar_t *pathname, *p, *base;
 
-       t->flags = (restore_time)?needsRestoreTimes:0;
+       t->flags = (restore_time != 0)?needsRestoreTimes:0;
        t->visit_type = 0;
        t->tree_errno = 0;
        t->full_path_dir_length = 0;
index 5e22438..b162465 100644 (file)
@@ -543,7 +543,7 @@ xstrpisotime(const char *s, char **endptr)
 
        /* as a courtesy to our callers, and since this is a non-standard
         * routine, we skip leading whitespace */
-       while (isblank((unsigned char)*s))
+       while (*s == ' ' || *s == '\t')
                ++s;
 
        /* read year */
@@ -589,6 +589,7 @@ static unsigned int
 _warc_rdver(const char *buf, size_t bsz)
 {
        static const char magic[] = "WARC/";
+       const char *c;
        unsigned int ver = 0U;
        unsigned int end = 0U;
 
@@ -615,11 +616,12 @@ _warc_rdver(const char *buf, size_t bsz)
                 * WARC below version 0.12 has a space-separated header
                 * WARC 0.12 and above terminates the version with a CRLF
                 */
+               c = buf + 3U + end;
                if (ver >= 1200U) {
-                       if (memcmp(buf + 3U + end, "\r\n", 2U) != 0)
+                       if (memcmp(c, "\r\n", 2U) != 0)
                                ver = 0U;
                } else if (ver < 1200U) {
-                       if (!isblank(*(buf + 3U + end)))
+                       if (*c != ' ' && *c != '\t')
                                ver = 0U;
                }
        }
@@ -643,7 +645,7 @@ _warc_rdtyp(const char *buf, size_t bsz)
        }
 
        /* overread whitespace */
-       while (val < eol && isblank((unsigned char)*val))
+       while (val < eol && (*val == ' ' || *val == '\t'))
                ++val;
 
        if (val + 8U == eol) {
@@ -673,7 +675,7 @@ _warc_rduri(const char *buf, size_t bsz)
                return res;
        }
 
-       while (val < eol && isblank((unsigned char)*val))
+       while (val < eol && (*val == ' ' || *val == '\t'))
                ++val;
 
        /* overread URL designators */
@@ -731,7 +733,7 @@ _warc_rdlen(const char *buf, size_t bsz)
        }
 
        /* skip leading whitespace */
-       while (val < eol && isblank(*val))
+       while (val < eol && (*val == ' ' || *val == '\t'))
                val++;
        /* there must be at least one digit */
        if (!isdigit(*val))
index 20450ba..5a01e84 100644 (file)
@@ -1712,7 +1712,8 @@ _archive_write_disk_finish_entry(struct archive *_a)
                const void *metadata;
                size_t metadata_size;
                metadata = archive_entry_mac_metadata(a->entry, &metadata_size);
-               if (metadata == NULL || metadata_size == 0) {
+               if ((a->todo & TODO_MAC_METADATA) == 0 ||
+                   metadata == NULL || metadata_size == 0) {
 #endif
                r2 = archive_write_disk_set_acls(&a->archive, a->fd,
                    archive_entry_pathname(a->entry),
@@ -2293,7 +2294,8 @@ _archive_write_disk_close(struct archive *_a)
                        chmod(p->name, p->mode);
                if (p->fixup & TODO_ACLS)
 #ifdef HAVE_DARWIN_ACL
-                       if (p->mac_metadata == NULL ||
+                       if ((p->fixup & TODO_MAC_METADATA) == 0 ||
+                           p->mac_metadata == NULL ||
                            p->mac_metadata_size == 0)
 #endif
                                archive_write_disk_set_acls(&a->archive,
@@ -3465,12 +3467,19 @@ set_fflags(struct archive_write_disk *a)
 #ifdef UF_APPEND
        critical_flags |= UF_APPEND;
 #endif
-#ifdef EXT2_APPEND_FL
+#if defined(FS_APPEND_FL)
+       critical_flags |= FS_APPEND_FL;
+#elif defined(EXT2_APPEND_FL)
        critical_flags |= EXT2_APPEND_FL;
 #endif
-#ifdef EXT2_IMMUTABLE_FL
+#if defined(FS_IMMUTABLE_FL)
+       critical_flags |= FS_IMMUTABLE_FL;
+#elif defined(EXT2_IMMUTABLE_FL)
        critical_flags |= EXT2_IMMUTABLE_FL;
 #endif
+#ifdef FS_JOURNAL_DATA_FL
+       critical_flags |= FS_JOURNAL_DATA_FL;
+#endif
 
        if (a->todo & TODO_FFLAGS) {
                archive_entry_fflags(a->entry, &set, &clear);
@@ -3582,7 +3591,10 @@ set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
        return (ARCHIVE_WARN);
 }
 
-#elif defined(EXT2_IOC_GETFLAGS) && defined(EXT2_IOC_SETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS)
+#elif (defined(FS_IOC_GETFLAGS) && defined(FS_IOC_SETFLAGS) && \
+       defined(HAVE_WORKING_FS_IOC_GETFLAGS)) || \
+      (defined(EXT2_IOC_GETFLAGS) && defined(EXT2_IOC_SETFLAGS) && \
+       defined(HAVE_WORKING_EXT2_IOC_GETFLAGS))
 /*
  * Linux uses ioctl() to read and write file flags.
  */
@@ -3595,7 +3607,7 @@ set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
        int newflags, oldflags;
        int sf_mask = 0;
 
-       if (set == 0  && clear == 0)
+       if (set == 0 && clear == 0)
                return (ARCHIVE_OK);
        /* Only regular files and dirs can have flags. */
        if (!S_ISREG(mode) && !S_ISDIR(mode))
@@ -3616,12 +3628,19 @@ set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
         * defines. (?)  The code below degrades reasonably gracefully
         * if sf_mask is incomplete.
         */
-#ifdef EXT2_IMMUTABLE_FL
+#if defined(FS_IMMUTABLE_FL)
+       sf_mask |= FS_IMMUTABLE_FL;
+#elif defined(EXT2_IMMUTABLE_FL)
        sf_mask |= EXT2_IMMUTABLE_FL;
 #endif
-#ifdef EXT2_APPEND_FL
+#if defined(FS_APPEND_FL)
+       sf_mask |= FS_APPEND_FL;
+#elif defined(EXT2_APPEND_FL)
        sf_mask |= EXT2_APPEND_FL;
 #endif
+#if defined(FS_JOURNAL_DATA_FL)
+       sf_mask |= FS_JOURNAL_DATA_FL;
+#endif
        /*
         * XXX As above, this would be way simpler if we didn't have
         * to read the current flags from disk. XXX
@@ -3629,12 +3648,24 @@ set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
        ret = ARCHIVE_OK;
 
        /* Read the current file flags. */
-       if (ioctl(myfd, EXT2_IOC_GETFLAGS, &oldflags) < 0)
+       if (ioctl(myfd,
+#ifdef FS_IOC_GETFLAGS
+           FS_IOC_GETFLAGS,
+#else
+           EXT2_IOC_GETFLAGS,
+#endif
+           &oldflags) < 0)
                goto fail;
 
        /* Try setting the flags as given. */
        newflags = (oldflags & ~clear) | set;
-       if (ioctl(myfd, EXT2_IOC_SETFLAGS, &newflags) >= 0)
+       if (ioctl(myfd,
+#ifdef FS_IOC_SETFLAGS
+           FS_IOC_SETFLAGS,
+#else
+           EXT2_IOC_SETFLAGS,
+#endif
+           &newflags) >= 0)
                goto cleanup;
        if (errno != EPERM)
                goto fail;
@@ -3643,7 +3674,13 @@ set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
        newflags &= ~sf_mask;
        oldflags &= sf_mask;
        newflags |= oldflags;
-       if (ioctl(myfd, EXT2_IOC_SETFLAGS, &newflags) >= 0)
+       if (ioctl(myfd,
+#ifdef FS_IOC_SETFLAGS
+           FS_IOC_SETFLAGS,
+#else
+           EXT2_IOC_SETFLAGS,
+#endif
+           &newflags) >= 0)
                goto cleanup;
 
        /* We couldn't set the flags, so report the failure. */
index 4e91097..c0ca435 100644 (file)
@@ -4074,8 +4074,10 @@ write_information_block(struct archive_write *a)
        memset(info.s, 0, info_size);
        opt = 0;
 #if defined(HAVE__CTIME64_S)
-       __time64_t iso9660_birth_time_tmp = (__time64_t) iso9660->birth_time; //time_t may be shorter than 64 bits
-       _ctime64_s(buf, sizeof(buf), &(iso9660_birth_time_tmp));
+       {
+               __time64_t iso9660_birth_time_tmp = (__time64_t) iso9660->birth_time; //time_t may be shorter than 64 bits
+               _ctime64_s(buf, sizeof(buf), &(iso9660_birth_time_tmp));
+       }
 #elif defined(HAVE_CTIME_R)
        ctime_r(&(iso9660->birth_time), buf);
 #else
index 6c4ac23..5016eed 100644 (file)
@@ -6,7 +6,7 @@
 IF(ENABLE_TEST)
   SET(libarchive_test_SOURCES
     ../../test_utils/test_utils.c
-    main.c
+    ../../test_utils/test_main.c
     read_open_memory.c
     test.h
     test_acl_nfs4.c
@@ -303,6 +303,7 @@ IF(ENABLE_TEST)
   INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
   INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/test_utils)
+  INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/libarchive/test)
 
   # Experimental new test handling
   ADD_CUSTOM_TARGET(run_libarchive_test
index 58df1cb..fd679f5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003-2006 Tim Kientzle
+ * Copyright (c) 2003-2017 Tim Kientzle
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: head/lib/libarchive/test/test.h 201247 2009-12-30 05:59:21Z kientzle $
  */
 
 /* Every test program should #include "test.h" as the first thing. */
 
-/*
- * The goal of this file (and the matching test.c) is to
- * simplify the very repetitive test-*.c test programs.
- */
-#if defined(HAVE_CONFIG_H)
-/* Most POSIX platforms use the 'configure' script to build config.h */
-#include "config.h"
-#elif defined(__FreeBSD__)
-/* Building as part of FreeBSD system requires a pre-built config.h. */
-#include "config_freebsd.h"
-#elif defined(_WIN32) && !defined(__CYGWIN__)
-/* Win32 can't run the 'configure' script. */
-#include "config_windows.h"
-#else
-/* Warn if the library hasn't been (automatically or manually) configured. */
-#error Oops: No config.h and no pre-built configuration in test.h.
-#endif
-
-#include <sys/types.h>  /* Windows requires this before sys/stat.h */
-#include <sys/stat.h>
-
-#if HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-#ifdef HAVE_DIRECT_H
-#include <direct.h>
-#define dirent direct
-#endif
-#include <errno.h>
-#include <fcntl.h>
-#ifdef HAVE_IO_H
-#include <io.h>
-#endif
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <wchar.h>
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
-/*
- * System-specific tweaks.  We really want to minimize these
- * as much as possible, since they make it harder to understand
- * the mainline code.
- */
-
-/* Windows (including Visual Studio and MinGW but not Cygwin) */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#if !defined(__BORLANDC__)
-#undef chdir
-#define chdir _chdir
-#define strdup _strdup
-#endif
-#endif
-
-/* Visual Studio */
-#if defined(_MSC_VER) && _MSC_VER < 1900
-#define snprintf       sprintf_s
-#endif
-
-#if defined(__BORLANDC__)
-#pragma warn -8068     /* Constant out of range in comparison. */
-#endif
-
-/* Haiku OS and QNX */
-#if defined(__HAIKU__) || defined(__QNXNTO__)
-/* Haiku and QNX have typedefs in stdint.h (needed for int64_t) */
-#include <stdint.h>
-#endif
-
-/* Get a real definition for __FBSDID if we can */
-#if HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-
-/* If not, define it so as to avoid dangling semicolons. */
-#ifndef __FBSDID
-#define        __FBSDID(a)     struct _undefined_hack
-#endif
-
-#ifndef O_BINARY
-#define        O_BINARY 0
-#endif
-
-/*
- * If this platform has <sys/acl.h>, acl_create(), acl_init(),
- * acl_set_file(), and ACL_USER, we assume it has the rest of the
- * POSIX.1e draft functions used in archive_read_extract.c.
- */
-#if HAVE_SYS_ACL_H && HAVE_ACL_CREATE_ENTRY && HAVE_ACL_INIT && HAVE_ACL_SET_FILE
-#if HAVE_ACL_USER
-#define        HAVE_POSIX_ACL  1
-#elif HAVE_ACL_TYPE_EXTENDED
-#define        HAVE_DARWIN_ACL 1
-#endif
-#endif
-
-/*
- * If this platform has <sys/acl.h>, acl_get(), facl_get(), acl_set(),
- * facl_set() and types aclent_t and ace_t it uses Solaris-style ACL functions
- */
-#if HAVE_SYS_ACL_H && HAVE_ACL_GET && HAVE_FACL_GET && HAVE_ACL_SET && HAVE_FACL_SET && HAVE_ACLENT_T && HAVE_ACE_T
-#define        HAVE_SUN_ACL    1
-#endif
-
-/* Define if platform supports NFSv4 ACLs */
-#if (HAVE_POSIX_ACL && HAVE_ACL_TYPE_NFS4) || HAVE_SUN_ACL || HAVE_DARWIN_ACL
-#define        HAVE_NFS4_ACL   1
-#endif
-
-/*
- * Redefine DEFINE_TEST for use in defining the test functions.
- */
-#undef DEFINE_TEST
-#define DEFINE_TEST(name) void name(void); void name(void)
-
-/* An implementation of the standard assert() macro */
-#define assert(e)   assertion_assert(__FILE__, __LINE__, (e), #e, NULL)
-/* chdir() and error if it fails */
-#define assertChdir(path)  \
-  assertion_chdir(__FILE__, __LINE__, path)
-/* Assert two integers are the same.  Reports value of each one if not. */
-#define assertEqualInt(v1,v2) \
-  assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-/* Assert two strings are the same.  Reports value of each one if not. */
-#define assertEqualString(v1,v2)   \
-  assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 0)
-#define assertEqualUTF8String(v1,v2)   \
-  assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 1)
-/* As above, but v1 and v2 are wchar_t * */
-#define assertEqualWString(v1,v2)   \
-  assertion_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-/* As above, but raw blocks of bytes. */
-#define assertEqualMem(v1, v2, l)      \
-  assertion_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
-/* Assert that memory is full of a specified byte */
-#define assertMemoryFilledWith(v1, l, b)                                       \
-  assertion_memory_filled_with(__FILE__, __LINE__, (v1), #v1, (l), #l, (b), #b, NULL)
-/* Assert two files are the same. */
-#define assertEqualFile(f1, f2)        \
-  assertion_equal_file(__FILE__, __LINE__, (f1), (f2))
-/* Assert that a file is empty. */
-#define assertEmptyFile(pathname)      \
-  assertion_empty_file(__FILE__, __LINE__, (pathname))
-/* Assert that a file is not empty. */
-#define assertNonEmptyFile(pathname)           \
-  assertion_non_empty_file(__FILE__, __LINE__, (pathname))
-#define assertFileAtime(pathname, sec, nsec)   \
-  assertion_file_atime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileAtimeRecent(pathname)        \
-  assertion_file_atime_recent(__FILE__, __LINE__, pathname)
-#define assertFileBirthtime(pathname, sec, nsec)       \
-  assertion_file_birthtime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileBirthtimeRecent(pathname) \
-  assertion_file_birthtime_recent(__FILE__, __LINE__, pathname)
-/* Assert that a file exists; supports printf-style arguments. */
-#define assertFileExists(pathname) \
-  assertion_file_exists(__FILE__, __LINE__, pathname)
-/* Assert that a file exists. */
-#define assertFileNotExists(pathname) \
-  assertion_file_not_exists(__FILE__, __LINE__, pathname)
-/* Assert that file contents match a string. */
-#define assertFileContents(data, data_size, pathname) \
-  assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname)
-/* Verify that a file does not contain invalid strings */
-#define assertFileContainsNoInvalidStrings(pathname, strings) \
-  assertion_file_contains_no_invalid_strings(__FILE__, __LINE__, pathname, strings)
-#define assertFileMtime(pathname, sec, nsec)   \
-  assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileMtimeRecent(pathname) \
-  assertion_file_mtime_recent(__FILE__, __LINE__, pathname)
-#define assertFileNLinks(pathname, nlinks)  \
-  assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
-#define assertFileSize(pathname, size)  \
-  assertion_file_size(__FILE__, __LINE__, pathname, size)
-#define assertFileMode(pathname, mode)  \
-  assertion_file_mode(__FILE__, __LINE__, pathname, mode)
-#define assertTextFileContents(text, pathname) \
-  assertion_text_file_contents(__FILE__, __LINE__, text, pathname)
-#define assertFileContainsLinesAnyOrder(pathname, lines)       \
-  assertion_file_contains_lines_any_order(__FILE__, __LINE__, pathname, lines)
-#define assertIsDir(pathname, mode)            \
-  assertion_is_dir(__FILE__, __LINE__, pathname, mode)
-#define assertIsHardlink(path1, path2) \
-  assertion_is_hardlink(__FILE__, __LINE__, path1, path2)
-#define assertIsNotHardlink(path1, path2)      \
-  assertion_is_not_hardlink(__FILE__, __LINE__, path1, path2)
-#define assertIsReg(pathname, mode)            \
-  assertion_is_reg(__FILE__, __LINE__, pathname, mode)
-#define assertIsSymlink(pathname, contents)    \
-  assertion_is_symlink(__FILE__, __LINE__, pathname, contents)
-/* Create a directory, report error if it fails. */
-#define assertMakeDir(dirname, mode)   \
-  assertion_make_dir(__FILE__, __LINE__, dirname, mode)
-#define assertMakeFile(path, mode, contents) \
-  assertion_make_file(__FILE__, __LINE__, path, mode, -1, contents)
-#define assertMakeBinFile(path, mode, csize, contents) \
-  assertion_make_file(__FILE__, __LINE__, path, mode, csize, contents)
-#define assertMakeHardlink(newfile, oldfile)   \
-  assertion_make_hardlink(__FILE__, __LINE__, newfile, oldfile)
-#define assertMakeSymlink(newfile, linkto)     \
-  assertion_make_symlink(__FILE__, __LINE__, newfile, linkto)
-#define assertNodump(path)      \
-  assertion_nodump(__FILE__, __LINE__, path)
-#define assertUmask(mask)      \
-  assertion_umask(__FILE__, __LINE__, mask)
-#define assertUtimes(pathname, atime, atime_nsec, mtime, mtime_nsec)   \
-  assertion_utimes(__FILE__, __LINE__, pathname, atime, atime_nsec, mtime, mtime_nsec)
-
-/*
- * This would be simple with C99 variadic macros, but I don't want to
- * require that.  Instead, I insert a function call before each
- * skipping() call to pass the file and line information down.  Crude,
- * but effective.
- */
-#define skipping       \
-  skipping_setup(__FILE__, __LINE__);test_skipping
-
-/* Function declarations.  These are defined in test_utility.c. */
-void failure(const char *fmt, ...);
-int assertion_assert(const char *, int, int, const char *, void *);
-int assertion_chdir(const char *, int, const char *);
-int assertion_empty_file(const char *, int, const char *);
-int assertion_equal_file(const char *, int, const char *, const char *);
-int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *);
-int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *);
-int assertion_memory_filled_with(const char *, int, const void *, const char *, size_t, const char *, char, const char *, void *);
-int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *, int);
-int assertion_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
-int assertion_file_atime(const char *, int, const char *, long, long);
-int assertion_file_atime_recent(const char *, int, const char *);
-int assertion_file_birthtime(const char *, int, const char *, long, long);
-int assertion_file_birthtime_recent(const char *, int, const char *);
-int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
-int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **);
-int assertion_file_contents(const char *, int, const void *, int, const char *);
-int assertion_file_exists(const char *, int, const char *);
-int assertion_file_mode(const char *, int, const char *, int);
-int assertion_file_mtime(const char *, int, const char *, long, long);
-int assertion_file_mtime_recent(const char *, int, const char *);
-int assertion_file_nlinks(const char *, int, const char *, int);
-int assertion_file_not_exists(const char *, int, const char *);
-int assertion_file_size(const char *, int, const char *, long);
-int assertion_is_dir(const char *, int, const char *, int);
-int assertion_is_hardlink(const char *, int, const char *, const char *);
-int assertion_is_not_hardlink(const char *, int, const char *, const char *);
-int assertion_is_reg(const char *, int, const char *, int);
-int assertion_is_symlink(const char *, int, const char *, const char *);
-int assertion_make_dir(const char *, int, const char *, int);
-int assertion_make_file(const char *, int, const char *, int, int, const void *);
-int assertion_make_hardlink(const char *, int, const char *newpath, const char *);
-int assertion_make_symlink(const char *, int, const char *newpath, const char *);
-int assertion_nodump(const char *, int, const char *);
-int assertion_non_empty_file(const char *, int, const char *);
-int assertion_text_file_contents(const char *, int, const char *buff, const char *f);
-int assertion_umask(const char *, int, int);
-int assertion_utimes(const char *, int, const char *, long, long, long, long );
-
-void skipping_setup(const char *, int);
-void test_skipping(const char *fmt, ...);
-
-/* Like sprintf, then system() */
-int systemf(const char * fmt, ...);
-
-/* Delay until time() returns a value after this. */
-void sleepUntilAfter(time_t);
-
-/* Return true if this platform can create symlinks. */
-int canSymlink(void);
-
-/* Return true if this platform can run the "bzip2" program. */
-int canBzip2(void);
-
-/* Return true if this platform can run the "grzip" program. */
-int canGrzip(void);
-
-/* Return true if this platform can run the "gzip" program. */
-int canGzip(void);
-
-/* Return true if this platform can run the specified command. */
-int canRunCommand(const char *);
-
-/* Return true if this platform can run the "lrzip" program. */
-int canLrzip(void);
-
-/* Return true if this platform can run the "lz4" program. */
-int canLz4(void);
-
-/* Return true if this platform can run the "lzip" program. */
-int canLzip(void);
-
-/* Return true if this platform can run the "lzma" program. */
-int canLzma(void);
-
-/* Return true if this platform can run the "lzop" program. */
-int canLzop(void);
-
-/* Return true if this platform can run the "xz" program. */
-int canXz(void);
-
-/* Return true if this filesystem can handle nodump flags. */
-int canNodump(void);
-
-/* Return true if the file has large i-node number(>0xffffffff). */
-int is_LargeInode(const char *);
-
-/* Suck file into string allocated via malloc(). Call free() when done. */
-/* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
-char *slurpfile(size_t *, const char *fmt, ...);
-
-/* Dump block of bytes to a file. */
-void dumpfile(const char *filename, void *, size_t);
-
-/* Extracts named reference file to the current directory. */
-void extract_reference_file(const char *);
-/* Copies named reference file to the current directory. */
-void copy_reference_file(const char *);
-
-/* Extracts a list of files to the current directory.
- * List must be NULL terminated.
- */
-void extract_reference_files(const char **);
-
-/* Subtract umask from mode */
-mode_t umasked(mode_t expected_mode);
-
-/* Path to working directory for current test */
-extern const char *testworkdir;
-
-/*
- * Special interfaces for libarchive test harness.
- */
-
-#include "archive.h"
-#include "archive_entry.h"
-
-/* ACL structure */
-struct archive_test_acl_t {
-       int type;  /* Type of ACL */
-       int permset; /* Permissions for this class of users. */
-       int tag; /* Owner, User, Owning group, group, other, etc. */
-       int qual; /* GID or UID of user/group, depending on tag. */
-       const char *name; /* Name of user/group, depending on tag. */
-};
-
-/* Set ACLs */
-void archive_test_set_acls(struct archive_entry *, struct archive_test_acl_t *,
-    int);
-
-/* Compare ACLs */
-void archive_test_compare_acls(struct archive_entry *,
-    struct archive_test_acl_t *, int, int, int);
-
-/* Special customized read-from-memory interface. */
-int read_open_memory(struct archive *, const void *, size_t, size_t);
-/* _minimal version exercises a slightly different set of libarchive APIs. */
-int read_open_memory_minimal(struct archive *, const void *, size_t, size_t);
-/* _seek version produces a seekable file. */
-int read_open_memory_seek(struct archive *, const void *, size_t, size_t);
-
-/* Versions of above that accept an archive argument for additional info. */
-#define assertA(e)   assertion_assert(__FILE__, __LINE__, (e), #e, (a))
-#define assertEqualIntA(a,v1,v2)   \
-  assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (a))
-#define assertEqualStringA(a,v1,v2)   \
-  assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (a), 0)
+#define KNOWNREF       "test_compat_gtar_1.tar.uu"
+#define        ENVBASE "LIBARCHIVE" /* Prefix for environment variables. */
+#undef PROGRAM              /* Testing a library, not a program. */
+#define        LIBRARY "libarchive"
+#define        EXTRA_DUMP(x)   archive_error_string((struct archive *)(x))
+#define        EXTRA_ERRNO(x)  archive_errno((struct archive *)(x))
+#define        EXTRA_VERSION   archive_version_details()
 
-#ifdef USE_DMALLOC
-#include <dmalloc.h>
-#endif
+#include "test_common.h"
index f4e66f5..fdc0191 100644 (file)
@@ -159,7 +159,7 @@ DEFINE_TEST(test_acl_nfs4)
         archive_entry_set_mode(ae, S_IFREG | 0777);
 
        /* Store and read back some basic ACL entries. */
-       archive_test_set_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
+       assertEntrySetAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
 
        /* Check that entry contains only NFSv4 types */
        assert((archive_entry_acl_types(ae) &
@@ -169,21 +169,21 @@ DEFINE_TEST(test_acl_nfs4)
 
        assertEqualInt(4,
            archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_NFS4));
-       archive_test_compare_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
+       assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
            ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
 
        /* A more extensive set of ACLs. */
-       archive_test_set_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
+       assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
        assertEqualInt(32,
            archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_NFS4));
-       archive_test_compare_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
+       assertEntryCompareAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
            ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
 
        /*
         * Check that clearing ACLs gets rid of them all by repeating
         * the first test.
         */
-       archive_test_set_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
+       assertEntrySetAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
        failure("Basic ACLs shouldn't be stored as extended ACLs");
        assertEqualInt(4,
            archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_NFS4));
@@ -192,7 +192,7 @@ DEFINE_TEST(test_acl_nfs4)
         * Different types of malformed ACL entries that should
         * fail when added to existing NFS4 ACLs.
         */
-       archive_test_set_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
+       assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
        for (i = 0; i < (int)(sizeof(acls_bad)/sizeof(acls_bad[0])); ++i) {
                struct archive_test_acl_t *p = &acls_bad[i];
                failure("Malformed ACL test #%d", i);
index 8dfa0e0..8566f55 100644 (file)
@@ -238,23 +238,22 @@ DEFINE_TEST(test_acl_pax_posix1e)
         archive_entry_set_mode(ae, S_IFREG | 0777);
 
        /* Basic owner/owning group should just update mode bits. */
-       archive_test_set_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
+       assertEntrySetAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
        assertA(0 == archive_write_header(a, ae));
 
        /* With any extended ACL entry, we should read back a full set. */
-       archive_test_set_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
+       assertEntrySetAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
        assertA(0 == archive_write_header(a, ae));
 
-
        /* A more extensive set of ACLs. */
-       archive_test_set_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
+       assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
        assertA(0 == archive_write_header(a, ae));
 
        /*
         * Check that clearing ACLs gets rid of them all by repeating
         * the first test.
         */
-       archive_test_set_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
+       assertEntrySetAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
        assertA(0 == archive_write_header(a, ae));
        archive_entry_free(ae);
 
@@ -296,7 +295,7 @@ DEFINE_TEST(test_acl_pax_posix1e)
        assertA(0 == archive_read_next_header(a, &ae));
        failure("One extended ACL should flag all ACLs to be returned.");
        assert(4 == archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
-       archive_test_compare_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
+       assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0142);
        failure("Basic ACLs should set mode to 0142, not %04o",
            archive_entry_mode(ae)&0777);
@@ -306,7 +305,7 @@ DEFINE_TEST(test_acl_pax_posix1e)
        assertA(0 == archive_read_next_header(a, &ae));
        assertEqualInt(6, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
-       archive_test_compare_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
+       assertEntryCompareAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0543);
        failure("Basic ACLs should set mode to 0543, not %04o",
            archive_entry_mode(ae)&0777);
@@ -350,15 +349,15 @@ DEFINE_TEST(test_acl_pax_nfs4)
         archive_entry_set_mode(ae, S_IFREG | 0777);
 
        /* NFS4 ACLs mirroring 0754 file mode */
-       archive_test_set_acls(ae, acls3, sizeof(acls3)/sizeof(acls3[0]));
+       assertEntrySetAcls(ae, acls3, sizeof(acls3)/sizeof(acls3[0]));
        assertA(0 == archive_write_header(a, ae));
 
        /* A more extensive set of NFS4 ACLs. */
-       archive_test_set_acls(ae, acls4, sizeof(acls4)/sizeof(acls4[0]));
+       assertEntrySetAcls(ae, acls4, sizeof(acls4)/sizeof(acls4[0]));
        assertA(0 == archive_write_header(a, ae));
 
        /* Set with special (audit, alarm) NFS4 ACLs. */
-       archive_test_set_acls(ae, acls5, sizeof(acls5)/sizeof(acls5[0]));
+       assertEntrySetAcls(ae, acls5, sizeof(acls5)/sizeof(acls5[0]));
        assertA(0 == archive_write_header(a, ae));
 
        archive_entry_free(ae);
@@ -393,21 +392,21 @@ DEFINE_TEST(test_acl_pax_nfs4)
        assertA(0 == archive_read_next_header(a, &ae));
        assertEqualInt(3, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_ALLOW));
-       archive_test_compare_acls(ae, acls3, sizeof(acls3)/sizeof(acls3[0]),
+       assertEntryCompareAcls(ae, acls3, sizeof(acls3)/sizeof(acls3[0]),
            ARCHIVE_ENTRY_ACL_TYPE_ALLOW, 0);
 
        /* Second item has has more fine-grained NFS4 ACLs */
        assertA(0 == archive_read_next_header(a, &ae));
        assertEqualInt(6, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_NFS4));
-       archive_test_compare_acls(ae, acls4, sizeof(acls4)/sizeof(acls4[0]),
+       assertEntryCompareAcls(ae, acls4, sizeof(acls4)/sizeof(acls4[0]),
            ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
 
        /* Third item has has audit and alarm NFS4 ACLs */
        assertA(0 == archive_read_next_header(a, &ae));
        assertEqualInt(6, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_NFS4));
-       archive_test_compare_acls(ae, acls5, sizeof(acls5)/sizeof(acls5[0]),
+       assertEntryCompareAcls(ae, acls5, sizeof(acls5)/sizeof(acls5[0]),
            ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
 
        /* Close the archive. */
index 5d1732a..b46f658 100644 (file)
@@ -393,7 +393,7 @@ DEFINE_TEST(test_acl_platform_posix1e_restore)
        archive_entry_set_pathname(ae, "test0");
        archive_entry_set_mtime(ae, 123456, 7890);
        archive_entry_set_size(ae, 0);
-       archive_test_set_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
+       assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
        assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
        archive_entry_free(ae);
 
index 01167da..fa2628d 100644 (file)
@@ -116,16 +116,15 @@ DEFINE_TEST(test_acl_posix1e)
         * triggering unnecessary extensions.  It's better to identify
         * trivial ACLs at the point they are being read from disk.
         */
-       archive_test_set_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
+       assertEntrySetAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
        failure("Basic ACLs shouldn't be stored as extended ACLs");
        assert(0 == archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
        failure("Basic ACLs should set mode to 0142, not %04o",
            archive_entry_mode(ae)&0777);
        assert((archive_entry_mode(ae) & 0777) == 0142);
 
-
        /* With any extended ACL entry, we should read back a full set. */
-       archive_test_set_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
+       assertEntrySetAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
        failure("One extended ACL should flag all ACLs to be returned.");
 
        /* Check that entry contains only POSIX.1e types */
@@ -135,7 +134,7 @@ DEFINE_TEST(test_acl_posix1e)
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0);
 
        assert(4 == archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
-       archive_test_compare_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
+       assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0142);
        failure("Basic ACLs should set mode to 0142, not %04o",
            archive_entry_mode(ae)&0777);
@@ -143,9 +142,9 @@ DEFINE_TEST(test_acl_posix1e)
 
 
        /* A more extensive set of ACLs. */
-       archive_test_set_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
+       assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
        assertEqualInt(6, archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
-       archive_test_compare_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
+       assertEntryCompareAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0543);
        failure("Basic ACLs should set mode to 0543, not %04o",
            archive_entry_mode(ae)&0777);
@@ -155,7 +154,7 @@ DEFINE_TEST(test_acl_posix1e)
         * Check that clearing ACLs gets rid of them all by repeating
         * the first test.
         */
-       archive_test_set_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
+       assertEntrySetAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
        failure("Basic ACLs shouldn't be stored as extended ACLs");
        assert(0 == archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
        failure("Basic ACLs should set mode to 0142, not %04o",
@@ -166,7 +165,7 @@ DEFINE_TEST(test_acl_posix1e)
         * Different types of malformed ACL entries that should
         * fail when added to existing POSIX.1e ACLs.
         */
-       archive_test_set_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
+       assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
        for (i = 0; i < (int)(sizeof(acls_nfs4)/sizeof(acls_nfs4[0])); ++i) {
                struct archive_test_acl_t *p = &acls_nfs4[i];
                failure("Malformed ACL test #%d", i);
index f3d2b10..8072893 100644 (file)
@@ -282,7 +282,7 @@ DEFINE_TEST(test_acl_from_text)
        assertEqualInt(ARCHIVE_OK,
            archive_entry_acl_from_text(ae, acltext[5],
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
-       archive_test_compare_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+       assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0755);
        assertEqualInt(6, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
@@ -291,7 +291,7 @@ DEFINE_TEST(test_acl_from_text)
        assertEqualInt(ARCHIVE_OK,
            archive_entry_acl_from_text(ae, acltext[7],
            ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
-       archive_test_compare_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+       assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
        assertEqualInt(11, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
@@ -303,7 +303,7 @@ DEFINE_TEST(test_acl_from_text)
        assertEqualInt(ARCHIVE_OK,
            archive_entry_acl_from_text_w(ae, ws,
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
-       archive_test_compare_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+       assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0755);
        assertEqualInt(6, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
@@ -314,7 +314,7 @@ DEFINE_TEST(test_acl_from_text)
        assertEqualInt(ARCHIVE_OK,
            archive_entry_acl_from_text_w(ae, ws,
            ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
-       archive_test_compare_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+       assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
        assertEqualInt(11, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
@@ -324,7 +324,7 @@ DEFINE_TEST(test_acl_from_text)
        assertEqualInt(ARCHIVE_OK,
            archive_entry_acl_from_text(ae, acltext[7],
            ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
-       archive_test_compare_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+       assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
            ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, 0);
        assertEqualInt(5, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
@@ -334,7 +334,7 @@ DEFINE_TEST(test_acl_from_text)
        assertEqualInt(ARCHIVE_OK,
            archive_entry_acl_from_text_w(ae, ws,
            ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
-       archive_test_compare_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+       assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
            ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, 0);
        assertEqualInt(5, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
@@ -344,7 +344,7 @@ DEFINE_TEST(test_acl_from_text)
        assertEqualInt(ARCHIVE_OK,
            archive_entry_acl_from_text(ae, acltext[1],
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
-       archive_test_compare_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+       assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
        assertEqualInt(11, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
@@ -355,7 +355,7 @@ DEFINE_TEST(test_acl_from_text)
        assertEqualInt(ARCHIVE_OK,
            archive_entry_acl_from_text_w(ae, ws,
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
-       archive_test_compare_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+       assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
        assertEqualInt(11, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
@@ -365,7 +365,7 @@ DEFINE_TEST(test_acl_from_text)
        assertEqualInt(ARCHIVE_OK,
            archive_entry_acl_from_text(ae, acltext[2],
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
-       archive_test_compare_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+       assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
        assertEqualInt(11, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
@@ -376,7 +376,7 @@ DEFINE_TEST(test_acl_from_text)
        assertEqualInt(ARCHIVE_OK,
            archive_entry_acl_from_text_w(ae, ws,
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
-       archive_test_compare_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+       assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
        assertEqualInt(11, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
@@ -386,7 +386,7 @@ DEFINE_TEST(test_acl_from_text)
        assertEqualInt(ARCHIVE_OK,
            archive_entry_acl_from_text(ae, acltext[10],
            ARCHIVE_ENTRY_ACL_TYPE_NFS4));
-       archive_test_compare_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
+       assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
            ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
        assertEqualInt(6, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_NFS4));
@@ -398,7 +398,7 @@ DEFINE_TEST(test_acl_from_text)
        assertEqualInt(ARCHIVE_OK,
            archive_entry_acl_from_text_w(ae, ws,
            ARCHIVE_ENTRY_ACL_TYPE_NFS4));
-       archive_test_compare_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
+       assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
            ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
        assertEqualInt(6, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_NFS4));
@@ -416,7 +416,7 @@ DEFINE_TEST(test_acl_to_text)
        assert((ae = archive_entry_new()) != NULL);
 
        /* Write POSIX.1e ACLs  */
-       archive_test_set_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
+       assertEntrySetAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
 
        /* No flags should give output like getfacl(1) on linux */
        compare_acl_text(ae, 0, acltext[0]);
@@ -457,7 +457,7 @@ DEFINE_TEST(test_acl_to_text)
            ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT, acltext[8]);
 
        /* Write NFSv4 ACLs */
-       archive_test_set_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
+       assertEntrySetAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
 
        /* NFSv4 ACLs like getfacl(1) on FreeBSD */
        compare_acl_text(ae, 0, acltext[9]);
index d551e6a..60773ad 100644 (file)
@@ -42,8 +42,12 @@ DEFINE_TEST(test_archive_api_feature)
        if (strlen(buff) < strlen(archive_version_string())) {
                p = archive_version_string() + strlen(buff);
                failure("Version string is: %s", archive_version_string());
-               assert(*p == 'a' || *p == 'b' || *p == 'c' || *p == 'd');
-               ++p;
+               if (p[0] == 'd'&& p[1] == 'e' && p[2] == 'v')
+                       p += 3;
+               else {
+                       assert(*p == 'a' || *p == 'b' || *p == 'c' || *p == 'd');
+                       ++p;
+               }
                failure("Version string is: %s", archive_version_string());
                assert(*p == '\0');
        }
index 3d063c1..8159772 100644 (file)
@@ -227,7 +227,7 @@ DEFINE_TEST(test_compat_solaris_tar_acl)
        failure("One extended ACL should flag all ACLs to be returned.");
        assertEqualInt(7, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
-       archive_test_compare_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+       assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0644);
        failure("Basic ACLs should set mode to 0644, not %04o",
            archive_entry_mode(ae)&0777);
@@ -237,28 +237,28 @@ DEFINE_TEST(test_compat_solaris_tar_acl)
        assertA(0 == archive_read_next_header(a, &ae));
        assertEqualInt(6, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
-       archive_test_compare_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
+       assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0750);
        failure("Basic ACLs should set mode to 0750, not %04o",
            archive_entry_mode(ae)&0777);
        assert((archive_entry_mode(ae) & 0777) == 0750);
        assertEqualInt(6, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
-       archive_test_compare_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
+       assertEntryCompareAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
            ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, 0750);
 
        /* Third item has NFS4 ACLs */
        assertA(0 == archive_read_next_header(a, &ae));
        assertEqualInt(6, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_NFS4));
-       archive_test_compare_acls(ae, acls3, sizeof(acls3)/sizeof(acls3[0]),
+       assertEntryCompareAcls(ae, acls3, sizeof(acls3)/sizeof(acls3[0]),
            ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
 
        /* Fourth item has NFS4 ACLs and inheritance flags */
        assertA(0 == archive_read_next_header(a, &ae));
        assertEqualInt(5, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_NFS4));
-       archive_test_compare_acls(ae, acls4, sizeof(acls4)/sizeof(acls0[4]),
+       assertEntryCompareAcls(ae, acls4, sizeof(acls4)/sizeof(acls0[4]),
            ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
 
        /* Close the archive. */
index f2a78b2..8247101 100644 (file)
@@ -249,7 +249,7 @@ DEFINE_TEST(test_compat_star_acl_posix1e)
        failure("One extended ACL should flag all ACLs to be returned.");
        assertEqualInt(5, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
-       archive_test_compare_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+       assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0142);
        failure("Basic ACLs should set mode to 0142, not %04o",
            archive_entry_mode(ae)&0777);
@@ -259,7 +259,7 @@ DEFINE_TEST(test_compat_star_acl_posix1e)
        assertA(0 == archive_read_next_header(a, &ae));
        assertEqualInt(7, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
-       archive_test_compare_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
+       assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
            ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0543);
        failure("Basic ACLs should set mode to 0543, not %04o",
            archive_entry_mode(ae)&0777);
@@ -269,7 +269,7 @@ DEFINE_TEST(test_compat_star_acl_posix1e)
        assertA(0 == archive_read_next_header(a, &ae));
        assertEqualInt(6, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
-       archive_test_compare_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
+       assertEntryCompareAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
            ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, 0142);
        failure("Basic ACLs should set mode to 0142, not %04o",
            archive_entry_mode(ae)&0777);
@@ -298,21 +298,21 @@ DEFINE_TEST(test_compat_star_acl_nfs4)
        assertA(0 == archive_read_next_header(a, &ae));
        assertEqualInt(3, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_ALLOW));
-       archive_test_compare_acls(ae, acls3, sizeof(acls3)/sizeof(acls3[0]),
+       assertEntryCompareAcls(ae, acls3, sizeof(acls3)/sizeof(acls3[0]),
            ARCHIVE_ENTRY_ACL_TYPE_ALLOW, 0);
 
        /* Second item has has fine-grained NFS4 ACLs */
        assertA(0 == archive_read_next_header(a, &ae));
        assertEqualInt(6, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_NFS4));
-       archive_test_compare_acls(ae, acls4, sizeof(acls4)/sizeof(acls0[4]),
+       assertEntryCompareAcls(ae, acls4, sizeof(acls4)/sizeof(acls0[4]),
            ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
 
        /* Third item has file and directory inheritance NFS4 ACLs */
        assertA(0 == archive_read_next_header(a, &ae));
        assertEqualInt(5, archive_entry_acl_reset(ae,
            ARCHIVE_ENTRY_ACL_TYPE_NFS4));
-       archive_test_compare_acls(ae, acls5, sizeof(acls5)/sizeof(acls5[0]),
+       assertEntryCompareAcls(ae, acls5, sizeof(acls5)/sizeof(acls5[0]),
            ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
 
        /* Close the archive. */
index 71bf3ff..ce7b866 100644 (file)
@@ -110,8 +110,9 @@ test_fuzz(const struct files *filesets)
                } else {
                        for (i = 0; filesets[n].names[i] != NULL; ++i)
                        {
+                               char *newraw;
                                tmp = slurpfile(&size, filesets[n].names[i]);
-                               char *newraw = realloc(rawimage, oldsize + size);
+                               newraw = realloc(rawimage, oldsize + size);
                                if (!assert(newraw != NULL))
                                {
                                        free(rawimage);
index bd36c39..43d7d86 100644 (file)
@@ -61,6 +61,7 @@ uname_lookup(void *d, int64_t u)
        return ("NOTFOO");
 }
 
+#if !defined(__CYGWIN__) && !defined(__HAIKU__)
 /* We test GID lookup by looking up the name of group number zero and
  * checking it against the following list.  If your system uses a
  * different conventional name for group number zero, please extend
@@ -71,13 +72,16 @@ static const char *zero_groups[] = {
        "root",   /* Linux */
        "wheel"  /* BSD */
 };
+#endif
 
 DEFINE_TEST(test_read_disk)
 {
        struct archive *a;
        int gmagic = 0x13579, umagic = 0x1234;
+#if !defined(__CYGWIN__) && !defined(__HAIKU__)
        const char *p;
        size_t i;
+#endif
 
        assert((a = archive_read_disk_new()) != NULL);
 
@@ -115,8 +119,6 @@ DEFINE_TEST(test_read_disk)
                /* Some platforms don't have predictable names for
                 * uid=0, so we skip this part of the test. */
                skipping("standard uname/gname lookup");
-               i = 0;
-               p = zero_groups[0]; /* avoid unused warnings */
 #else
                /* XXX Someday, we may need to generalize this the
                 * same way we generalized the group name check below.
index c9aca8f..fdbfbec 100644 (file)
@@ -1228,8 +1228,8 @@ test_restore_atime(void)
        assertEqualInt(ARCHIVE_OK, archive_read_close(a));
 
        /*
-        * Test4: Traversals with archive_read_disk_set_atime_restored() and
-        * archive_read_disk_honor_nodump().
+        * Test4: Traversals with ARCHIVE_READDISK_RESTORE_ATIME and
+        * ARCHIVE_READDISK_HONOR_NODUMP
         */
        assertNodump("at/f1");
        assertNodump("at/f2");
@@ -1460,7 +1460,7 @@ test_nodump(void)
        assert((a = archive_read_disk_new()) != NULL);
 
        /*
-        * Test1: Traversals without archive_read_disk_honor_nodump().
+        * Test1: Traversals without ARCHIVE_READDISK_HONOR_NODUMP
         */
        failure("Directory traversals should work as well");
        assertEqualIntA(a, ARCHIVE_OK, archive_read_disk_open(a, "nd"));
@@ -1513,7 +1513,7 @@ test_nodump(void)
        assertEqualInt(ARCHIVE_OK, archive_read_close(a));
 
        /*
-        * Test2: Traversals with archive_read_disk_honor_nodump().
+        * Test2: Traversals with ARCHIVE_READDISK_HONOR_NODUMP
         */
        assertUtimes("nd/f1", 886600, 0, 886600, 0);
        assertUtimes("nd/f2", 886611, 0, 886611, 0);
index 9eadaaf..b60f09c 100644 (file)
@@ -1,4 +1,5 @@
 .\" Copyright (c) 2003-2007 Tim Kientzle
+.\" Copyright (c) 2017 Martin Matuska
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 16, 2014
+.Dd February 24, 2017
 .Dt TAR 1
 .Os
 .Sh NAME
@@ -124,7 +125,7 @@ Unless specifically stated otherwise, options are applicable in
 all operating modes.
 .Bl -tag -width indent
 .It Cm @ Ns Pa archive
-(c and r mode only)
+(c and r modes only)
 The specified archive is opened and the entries
 in it will be appended to the current archive.
 As a simple example,
@@ -164,6 +165,16 @@ and gzip compression,
 .Dl Nm Fl a Fl jcf Pa archive.xxx source.c source.h
 if it is unknown suffix or no suffix, creates a new archive with
 restricted pax format and bzip2 compression.
+.It Fl Fl acls
+(c, r, u, x modes only)
+Archive or extract POSIX.1e or NFSv4 ACLs. This is the reverse of
+.Fl Fl no-acls
+and the default behavior in c, r, and u modes (except Mac OS X) or if
+.Nm
+is run in x mode as root. On Mac OS X this option translates extended ACLs
+to NFSv4 ACLs. To store extended ACLs the
+.Fl Fl mac-metadata
+option is preferred.
 .It Fl B , Fl Fl read-full-blocks
 Ignored for compatibility with other
 .Xr tar 1
@@ -188,15 +199,18 @@ options and before extracting any files.
 (x mode only)
 Before removing file system objects to replace them, clear platform-specific
 file flags that might prevent removal.
-.It Fl Fl disable-copyfile
-Mac OS X specific.
-Disable the use of
-.Xr copyfile 3 .
 .It Fl Fl exclude Ar pattern
 Do not process files or directories that match the
 specified pattern.
 Note that exclusions take precedence over patterns or filenames
 specified on the command line.
+.It Fl Fl fflags
+(c, r, u, x modes only)
+Archive or extract file flags. This is the reverse of
+.Fl Fl no-fflags
+and the default behavior in c, r, and u modes or if
+.Nm
+is run in x mode as root.
 .It Fl Fl format Ar format
 (c, r, u mode only)
 Use the specified format for the created archive.
@@ -245,11 +259,11 @@ On create, this sets the group name that will be stored
 in the archive;
 the name will not be verified against the system group database.
 .It Fl H
-(c and r mode only)
+(c and r modes only)
 Symbolic links named on the command line will be followed; the
 target of the link will be archived, not the link itself.
 .It Fl h
-(c and r mode only)
+(c and r modes only)
 Synonym for
 .Fl L .
 .It Fl I
@@ -259,7 +273,8 @@ Synonym for
 Show usage.
 .It Fl Fl hfsCompression
 (x mode only)
-Mac OS X specific(v10.6 or later). Compress extracted regular files with HFS+ compression.
+Mac OS X specific (v10.6 or later). Compress extracted regular files with HFS+
+compression.
 .It Fl Fl ignore-zeros
 An alias of
 .Fl Fl options Cm read_concatenated_archives
@@ -310,7 +325,7 @@ later copies will not overwrite earlier copies.
 Do not overwrite existing files that are newer than the
 versions appearing in the archive being extracted.
 .It Fl L , Fl Fl dereference
-(c and r mode only)
+(c and r modes only)
 All symbolic links will be followed.
 Normally, symbolic links are archived as such.
 With this option, the target of the link will be archived instead.
@@ -345,6 +360,16 @@ In extract or list modes, this option is ignored.
 (x mode only)
 Do not extract modification time.
 By default, the modification time is set to the time stored in the archive.
+.It Fl Fl mac-metadata
+(c, r, u and x mode only)
+Mac OS X specific. Archive or extract extended ACLs and extended attributes
+using
+.Xr copyfile 3
+in AppleDouble format. This is the reverse of
+.Fl Fl no-mac-metadata .
+and the default behavior in c, r, and u modes or if
+.Nm
+is run in x mode as root.
 .It Fl n , Fl Fl norecurse , Fl Fl no-recursion
 (c, r, u modes only)
 Do not recursively archive the contents of directories.
@@ -385,6 +410,30 @@ This is often used to read filenames output by the
 .Fl print0
 option to
 .Xr find 1 .
+.It Fl Fl no-acls
+(c, r, u, x modes only)
+Do not archive or extract POSIX.1e or NFSv4 ACLs. This is the reverse of
+.Fl Fl acls
+and the default behavior if
+.Nm
+is run as non-root in x mode (on Mac OS X also in c, r and u modes).
+.It Fl Fl no-fflags
+(c, r, u, x modes only)
+Do not archive or extract file flags. This is the reverse of
+.Fl Fl fflags
+and the default behavior if
+.Nm
+is run as non-root in x mode.
+.It Fl Fl no-mac-metadata
+(x mode only)
+Mac OS X specific. Do not archive or extract ACLs and extended attributes using
+.Xr copyfile 3
+in AppleDouble format. This is the reverse of
+.Fl Fl mac-metadata .
+and the default behavior if
+.Nm
+is run as non-root in x mode.
+.It Fl n , Fl Fl norecurse , Fl Fl no-recursion
 .It Fl Fl no-same-owner
 (x mode only)
 Do not extract owner and group IDs.
@@ -401,7 +450,21 @@ This is the reverse of
 .Fl p
 and the default behavior if
 .Nm
-is run as non-root.
+is run as non-root and can be overridden by also specifying
+.Fl Fl acls ,
+.Fl Fl fflags ,
+.Fl Fl mac-metadata,
+.Fl Fl same-owner ,
+.Fl Fl same-permissions
+and
+.Fl Fl xattrs .
+.It Fl Fl no-xattrs
+(c, r, u, x modes only)
+Do not archive or extract extended attributes. This is the reverse of
+.Fl Fl xattrs
+and the default behavior if
+.Nm
+is run as non-root in x mode.
 .It Fl Fl numeric-owner
 This is equivalent to
 .Fl Fl uname
@@ -583,14 +646,18 @@ This option suppresses these behaviors.
 .It Fl p , Fl Fl insecure , Fl Fl preserve-permissions
 (x mode only)
 Preserve file permissions.
-Attempt to restore the full permissions, including owner, file modes, file
-flags and ACLs, if available, for each item extracted from the archive.
-This is the default, if
+Attempt to restore the full permissions, including owner, file modes, ACLs,
+extended atributes and extended file flags, if available, for each item
+extracted from the archive. This is the default, if
 .Nm
 is being run by root and can be overridden by also specifying
-.Fl Fl no-same-owner
+.Fl Fl no-acls ,
+.Fl Fl no-fflags ,
+.Fl Fl no-mac-metadata,
+.Fl Fl no-same-owner ,
+.Fl Fl no-same-permissions
 and
-.Fl Fl no-same-permissions .
+.Fl Fl no-xattrs .
 .It Fl Fl passphrase Ar passphrase
 The
 .Pa passphrase
@@ -692,7 +759,7 @@ you probably want to use
 .Fl n
 as well.
 .It Fl Fl totals
-(c, r, u mode only)
+(c, r, u modes only)
 After archiving all files, print a summary to stderr.
 .It Fl U , Fl Fl unlink , Fl Fl unlink-first
 (x mode only)
@@ -754,6 +821,13 @@ Read a list of exclusion patterns from the specified file.
 See
 .Fl Fl exclude
 for more information about the handling of exclusions.
+.It Fl Fl xattrs
+(c, r, u, x modes only)
+Archive or extract extended attributes. This is the reverse of
+.Fl Fl no-xattrs
+and the default behavior in c, r, and u modes or if
+.Nm
+is run in x mode as root.
 .It Fl y
 (c mode only)
 Compress the resulting archive with
index 93bf60a..a9252a5 100644 (file)
@@ -137,7 +137,6 @@ main(int argc, char **argv)
        char                     compression, compression2;
        const char              *compression_name, *compression2_name;
        const char              *compress_program;
-       char                     option_a, option_o;
        char                     possible_help_request;
        char                     buff[16];
 
@@ -150,7 +149,7 @@ main(int argc, char **argv)
        bsdtar->fd = -1; /* Mark as "unused" */
        bsdtar->gid = -1;
        bsdtar->uid = -1;
-       option_a = option_o = 0;
+       bsdtar->flags = 0;
        compression = compression2 = '\0';
        compression_name = compression2_name = NULL;
        compress_program = NULL;
@@ -233,6 +232,14 @@ main(int argc, char **argv)
        if (getenv(COPYFILE_DISABLE_VAR))
                bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_MAC_COPYFILE;
 #endif
+#if defined(__APPLE__)
+       /*
+        * On Mac OS ACLs are archived with copyfile() (--mac-metadata)
+        * Translation to NFSv4 ACLs has to be requested explicitly with --acls
+        */
+       bsdtar->readdisk_flags |= ARCHIVE_READDISK_NO_ACL;
+#endif
+
        bsdtar->matching = archive_match_new();
        if (bsdtar->matching == NULL)
                lafe_errc(1, errno, "Out of memory");
@@ -252,7 +259,12 @@ main(int argc, char **argv)
        while ((opt = bsdtar_getopt(bsdtar)) != -1) {
                switch (opt) {
                case 'a': /* GNU tar */
-                       option_a = 1; /* Record it and resolve it later. */
+                       bsdtar->flags |= OPTFLAG_AUTO_COMPRESS;
+                       break;
+               case OPTION_ACLS: /* GNU tar */
+                       bsdtar->extract_flags |= ARCHIVE_EXTRACT_ACL;
+                       bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_NO_ACL;
+                       bsdtar->flags |= OPTFLAG_ACLS;
                        break;
                case 'B': /* GNU tar */
                        /* libarchive doesn't need this; just ignore it. */
@@ -285,24 +297,26 @@ main(int argc, char **argv)
                        set_mode(bsdtar, opt);
                        break;
                case OPTION_CHECK_LINKS: /* GNU tar */
-                       bsdtar->option_warn_links = 1;
+                       bsdtar->flags |= OPTFLAG_WARN_LINKS;
                        break;
                case OPTION_CHROOT: /* NetBSD */
-                       bsdtar->option_chroot = 1;
+                       bsdtar->flags |= OPTFLAG_CHROOT;
                        break;
                case OPTION_CLEAR_NOCHANGE_FFLAGS:
                        bsdtar->extract_flags |=
                            ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS;
                        break;
-               case OPTION_DISABLE_COPYFILE: /* Mac OS X */
-                       bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_MAC_COPYFILE;
-                       break;
                case OPTION_EXCLUDE: /* GNU tar */
                        if (archive_match_exclude_pattern(
                            bsdtar->matching, bsdtar->argument) != ARCHIVE_OK)
                                lafe_errc(1, 0,
                                    "Couldn't exclude %s\n", bsdtar->argument);
                        break;
+               case OPTION_FFLAGS:
+                       bsdtar->extract_flags |= ARCHIVE_EXTRACT_FFLAGS;
+                       bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_NO_FFLAGS;
+                       bsdtar->flags |= OPTFLAG_FFLAGS;
+                       break;
                case OPTION_FORMAT: /* GNU tar, others */
                        cset_set_format(bsdtar->cset, bsdtar->argument);
                        break;
@@ -344,7 +358,7 @@ main(int argc, char **argv)
                            ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED;
                        break;
                case OPTION_IGNORE_ZEROS:
-                       bsdtar->option_ignore_zeros = 1;
+                       bsdtar->flags |= OPTFLAG_IGNORE_ZEROS;
                        break;
                case 'I': /* GNU tar */
                        /*
@@ -398,7 +412,7 @@ main(int argc, char **argv)
                        break;
                case 'l': /* SUSv2 and GNU tar beginning with 1.16 */
                        /* GNU tar 1.13  used -l for --one-file-system */
-                       bsdtar->option_warn_links = 1;
+                       bsdtar->flags |= OPTFLAG_WARN_LINKS;
                        break;
                case OPTION_LRZIP:
                case OPTION_LZ4:
@@ -421,8 +435,13 @@ main(int argc, char **argv)
                case 'm': /* SUSv2 */
                        bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_TIME;
                        break;
+               case OPTION_MAC_METADATA: /* Mac OS X */
+                       bsdtar->readdisk_flags |= ARCHIVE_READDISK_MAC_COPYFILE;
+                       bsdtar->extract_flags |= ARCHIVE_EXTRACT_MAC_METADATA;
+                       bsdtar->flags |= OPTFLAG_MAC_METADATA;
+                       break;
                case 'n': /* GNU tar */
-                       bsdtar->option_no_subdirs = 1;
+                       bsdtar->flags |= OPTFLAG_NO_SUBDIRS;
                        break;
                /*
                 * Selecting files by time:
@@ -466,6 +485,21 @@ main(int argc, char **argv)
                        bsdtar->extract_flags |=
                            ARCHIVE_EXTRACT_NO_HFS_COMPRESSION;
                        break;
+               case OPTION_NO_ACLS: /* GNU tar */
+                       bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_ACL;
+                       bsdtar->readdisk_flags |= ARCHIVE_READDISK_NO_ACL;
+                       bsdtar->flags |= OPTFLAG_NO_ACLS;
+                       break;
+               case OPTION_NO_FFLAGS:
+                       bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_FFLAGS;
+                       bsdtar->readdisk_flags |= ARCHIVE_READDISK_NO_FFLAGS;
+                       bsdtar->flags |= OPTFLAG_NO_FFLAGS;
+                       break;
+               case OPTION_NO_MAC_METADATA: /* Mac OS X */
+                       bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_MAC_COPYFILE;
+                       bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_MAC_METADATA;
+                       bsdtar->flags |= OPTFLAG_NO_MAC_METADATA;
+                       break;
                case OPTION_NO_SAME_OWNER: /* GNU tar */
                        bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_OWNER;
                        break;
@@ -476,23 +510,24 @@ main(int argc, char **argv)
                        bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_FFLAGS;
                        bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_MAC_METADATA;
                        break;
-               case OPTION_NO_XATTR: /* Issue #131 */
+               case OPTION_NO_XATTRS: /* GNU tar */
                        bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_XATTR;
                        bsdtar->readdisk_flags |= ARCHIVE_READDISK_NO_XATTR;
+                       bsdtar->flags |= OPTFLAG_NO_XATTRS;
                        break;
                case OPTION_NULL: /* GNU tar */
-                       bsdtar->option_null++;
+                       bsdtar->flags |= OPTFLAG_NULL;
                        break;
                case OPTION_NUMERIC_OWNER: /* GNU tar */
                        bsdtar->uname = "";
                        bsdtar->gname = "";
-                       bsdtar->option_numeric_owner++;
+                       bsdtar->flags |= OPTFLAG_NUMERIC_OWNER;
                        break;
                case 'O': /* GNU tar */
-                       bsdtar->option_stdout = 1;
+                       bsdtar->flags |= OPTFLAG_STDOUT;
                        break;
                case 'o': /* SUSv2 and GNU conflict here, but not fatally */
-                       option_o = 1; /* Record it and resolve it later. */
+                       bsdtar->flags |= OPTFLAG_O;
                        break;
                /*
                 * Selecting files by time:
@@ -548,7 +583,7 @@ main(int argc, char **argv)
 #endif
                case 'P': /* GNU tar */
                        bsdtar->extract_flags &= ~SECURITY;
-                       bsdtar->option_absolute_paths = 1;
+                       bsdtar->flags |= OPTFLAG_ABSOLUTE_PATHS;
                        break;
                case 'p': /* GNU tar, star */
                        bsdtar->extract_flags |= ARCHIVE_EXTRACT_PERM;
@@ -564,7 +599,7 @@ main(int argc, char **argv)
                        cset_set_format(bsdtar->cset, "pax");
                        break;
                case 'q': /* FreeBSD GNU tar --fast-read, NetBSD -q */
-                       bsdtar->option_fast_read = 1;
+                       bsdtar->flags |= OPTFLAG_FAST_READ;
                        break;
                case 'r': /* SUSv2 */
                        set_mode(bsdtar, opt);
@@ -601,11 +636,11 @@ main(int argc, char **argv)
                        bsdtar->verbose++;
                        break;
                case OPTION_TOTALS: /* GNU tar */
-                       bsdtar->option_totals++;
+                       bsdtar->flags |= OPTFLAG_TOTALS;
                        break;
                case 'U': /* GNU tar */
                        bsdtar->extract_flags |= ARCHIVE_EXTRACT_UNLINK;
-                       bsdtar->option_unlink_first = 1;
+                       bsdtar->flags |= OPTFLAG_UNLINK_FIRST;
                        break;
                case 'u': /* SUSv2 */
                        set_mode(bsdtar, opt);
@@ -643,7 +678,7 @@ main(int argc, char **argv)
                        break;
 #endif
                case 'w': /* SUSv2 */
-                       bsdtar->option_interactive = 1;
+                       bsdtar->flags |= OPTFLAG_INTERACTIVE;
                        break;
                case 'X': /* GNU tar */
                        if (archive_match_exclude_pattern_from_file(
@@ -655,6 +690,11 @@ main(int argc, char **argv)
                case 'x': /* SUSv2 */
                        set_mode(bsdtar, opt);
                        break;
+               case OPTION_XATTRS: /* GNU tar */
+                       bsdtar->extract_flags |= ARCHIVE_EXTRACT_XATTR;
+                       bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_NO_XATTR;
+                       bsdtar->flags |= OPTFLAG_XATTRS;
+                       break;
                case 'y': /* FreeBSD version of GNU tar */
                        if (compression != '\0')
                                lafe_errc(1, 0,
@@ -703,11 +743,11 @@ main(int argc, char **argv)
                    "Must specify one of -c, -r, -t, -u, -x");
 
        /* Check boolean options only permitted in certain modes. */
-       if (option_a)
+       if (bsdtar->flags & OPTFLAG_AUTO_COMPRESS)
                only_mode(bsdtar, "-a", "c");
        if (bsdtar->readdisk_flags & ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS)
                only_mode(bsdtar, "--one-file-system", "cru");
-       if (bsdtar->option_fast_read)
+       if (bsdtar->flags & OPTFLAG_FAST_READ)
                only_mode(bsdtar, "--fast-read", "xt");
        if (bsdtar->extract_flags & ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED)
                only_mode(bsdtar, "--hfsCompression", "x");
@@ -715,9 +755,23 @@ main(int argc, char **argv)
                only_mode(bsdtar, "--nopreserveHFSCompression", "x");
        if (bsdtar->readdisk_flags & ARCHIVE_READDISK_HONOR_NODUMP)
                only_mode(bsdtar, "--nodump", "cru");
-       if (bsdtar->readdisk_flags & ARCHIVE_READDISK_NO_XATTR)
-               only_mode(bsdtar, "--no-xattr", "crux");
-       if (option_o > 0) {
+       if (bsdtar->flags & OPTFLAG_ACLS)
+               only_mode(bsdtar, "--acls", "crux");
+       if (bsdtar->flags & OPTFLAG_NO_ACLS)
+               only_mode(bsdtar, "--no-acls", "crux");
+       if (bsdtar->flags & OPTFLAG_XATTRS)
+               only_mode(bsdtar, "--xattrs", "crux");
+       if (bsdtar->flags & OPTFLAG_NO_XATTRS)
+               only_mode(bsdtar, "--no-xattrs", "crux");
+       if (bsdtar->flags & OPTFLAG_FFLAGS)
+               only_mode(bsdtar, "--fflags", "crux");
+       if (bsdtar->flags & OPTFLAG_NO_FFLAGS)
+               only_mode(bsdtar, "--no-fflags", "crux");
+       if (bsdtar->flags & OPTFLAG_MAC_METADATA)
+               only_mode(bsdtar, "--mac-metadata", "crux");
+       if (bsdtar->flags & OPTFLAG_NO_MAC_METADATA)
+               only_mode(bsdtar, "--no-mac-metadata", "crux");
+       if (bsdtar->flags & OPTFLAG_O) {
                switch (bsdtar->mode) {
                case 'c':
                        /*
@@ -730,7 +784,7 @@ main(int argc, char **argv)
                        break;
                case 'x':
                        /* POSIX-compatible behavior. */
-                       bsdtar->option_no_owner = 1;
+                       bsdtar->flags |= OPTFLAG_NO_OWNER;
                        bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_OWNER;
                        break;
                default:
@@ -738,16 +792,17 @@ main(int argc, char **argv)
                        break;
                }
        }
-       if (bsdtar->option_no_subdirs)
+       if (bsdtar->flags & OPTFLAG_NO_SUBDIRS)
                only_mode(bsdtar, "-n", "cru");
-       if (bsdtar->option_stdout)
+       if (bsdtar->flags & OPTFLAG_STDOUT)
                only_mode(bsdtar, "-O", "xt");
-       if (bsdtar->option_unlink_first)
+       if (bsdtar->flags & OPTFLAG_UNLINK_FIRST)
                only_mode(bsdtar, "-U", "x");
-       if (bsdtar->option_warn_links)
+       if (bsdtar->flags & OPTFLAG_WARN_LINKS)
                only_mode(bsdtar, "--check-links", "cr");
 
-       if (option_a && cset_auto_compress(bsdtar->cset, bsdtar->filename)) {
+       if ((bsdtar->flags & OPTFLAG_AUTO_COMPRESS) &&
+           cset_auto_compress(bsdtar->cset, bsdtar->filename)) {
                /* Ignore specified compressions if auto-compress works. */
                compression = '\0';
                compression2 = '\0';
index 4b84ba1..ee9c648 100644 (file)
@@ -50,6 +50,7 @@ struct bsdtar {
        int               bytes_per_block; /* -b block_size */
        int               bytes_in_last_block; /* See -b handling. */
        int               verbose;   /* -v */
+       unsigned int      flags; /* Bitfield of boolean options */
        int               extract_flags; /* Flags for extract operation */
        int               readdisk_flags; /* Flags for read disk operation */
        int               strip_components; /* Remove this many leading dirs */
@@ -60,20 +61,7 @@ struct bsdtar {
        const char       *passphrase; /* --passphrase */
        char              mode; /* Program mode: 'c', 't', 'r', 'u', 'x' */
        char              symlink_mode; /* H or L, per BSD conventions */
-       char              option_absolute_paths; /* -P */
-       char              option_chroot; /* --chroot */
-       char              option_fast_read; /* --fast-read */
        const char       *option_options; /* --options */
-       char              option_ignore_zeros; /* --ignore-zeros */
-       char              option_interactive; /* -w */
-       char              option_no_owner; /* -o */
-       char              option_no_subdirs; /* -n */
-       char              option_numeric_owner; /* --numeric-owner */
-       char              option_null; /* --null */
-       char              option_stdout; /* -O */
-       char              option_totals; /* --totals */
-       char              option_unlink_first; /* -U */
-       char              option_warn_links; /* --check-links */
        char              day_first; /* show day before month in -tv output */
        struct creation_set *cset;
 
@@ -114,14 +102,40 @@ struct bsdtar {
        char                    *ppbuff;        /* for util.c */
 };
 
+/* Options for flags bitfield */
+#define        OPTFLAG_AUTO_COMPRESS   (0x00000001)    /* -a */
+#define        OPTFLAG_ABSOLUTE_PATHS  (0x00000002)    /* -P */
+#define        OPTFLAG_CHROOT          (0x00000004)    /* --chroot */
+#define        OPTFLAG_FAST_READ       (0x00000008)    /* --fast-read */
+#define        OPTFLAG_IGNORE_ZEROS    (0x00000010)    /* --ignore-zeros */
+#define        OPTFLAG_INTERACTIVE     (0x00000020)    /* -w */
+#define        OPTFLAG_NO_OWNER        (0x00000040)    /* -o */
+#define        OPTFLAG_NO_SUBDIRS      (0x00000080)    /* -n */
+#define        OPTFLAG_NULL            (0x00000100)    /* --null */
+#define        OPTFLAG_NUMERIC_OWNER   (0x00000200)    /* --numeric-owner */
+#define        OPTFLAG_O               (0x00000400)    /* -o */
+#define        OPTFLAG_STDOUT          (0x00000800)    /* -O */
+#define        OPTFLAG_TOTALS          (0x00001000)    /* --totals */
+#define        OPTFLAG_UNLINK_FIRST    (0x00002000)    /* -U */
+#define        OPTFLAG_WARN_LINKS      (0x00004000)    /* --check-links */
+#define        OPTFLAG_NO_XATTRS       (0x00008000)    /* --no-xattrs */
+#define        OPTFLAG_XATTRS          (0x00010000)    /* --xattrs */
+#define        OPTFLAG_NO_ACLS         (0x00020000)    /* --no-acls */
+#define        OPTFLAG_ACLS            (0x00040000)    /* --acls */
+#define        OPTFLAG_NO_FFLAGS       (0x00080000)    /* --no-fflags */
+#define        OPTFLAG_FFLAGS          (0x00100000)    /* --fflags */
+#define        OPTFLAG_NO_MAC_METADATA (0x00200000)    /* --no-mac-metadata */
+#define        OPTFLAG_MAC_METADATA    (0x00400000)    /* --mac-metadata */
+
 /* Fake short equivalents for long options that otherwise lack them. */
 enum {
-       OPTION_B64ENCODE = 1,
+       OPTION_ACLS = 1,
+       OPTION_B64ENCODE,
        OPTION_CHECK_LINKS,
        OPTION_CHROOT,
        OPTION_CLEAR_NOCHANGE_FFLAGS,
-       OPTION_DISABLE_COPYFILE,
        OPTION_EXCLUDE,
+       OPTION_FFLAGS,
        OPTION_FORMAT,
        OPTION_GID,
        OPTION_GNAME,
@@ -136,15 +150,19 @@ enum {
        OPTION_LZIP,
        OPTION_LZMA,
        OPTION_LZOP,
+       OPTION_MAC_METADATA,
        OPTION_NEWER_CTIME,
        OPTION_NEWER_CTIME_THAN,
        OPTION_NEWER_MTIME,
        OPTION_NEWER_MTIME_THAN,
        OPTION_NODUMP,
        OPTION_NOPRESERVE_HFS_COMPRESSION,
+       OPTION_NO_ACLS,
+       OPTION_NO_FFLAGS,
+       OPTION_NO_MAC_METADATA,
        OPTION_NO_SAME_OWNER,
        OPTION_NO_SAME_PERMISSIONS,
-       OPTION_NO_XATTR,
+       OPTION_NO_XATTRS,
        OPTION_NULL,
        OPTION_NUMERIC_OWNER,
        OPTION_OLDER_CTIME,
@@ -162,7 +180,8 @@ enum {
        OPTION_UNAME,
        OPTION_USE_COMPRESS_PROGRAM,
        OPTION_UUENCODE,
-       OPTION_VERSION
+       OPTION_VERSION,
+       OPTION_XATTRS
 };
 
 int    bsdtar_getopt(struct bsdtar *);
index c87741c..e36c545 100644 (file)
@@ -65,6 +65,7 @@ static const struct bsdtar_option {
 } tar_longopts[] = {
        { "absolute-paths",       0, 'P' },
        { "append",               0, 'r' },
+       { "acls",                 0, OPTION_ACLS },
        { "auto-compress",        0, 'a' },
        { "b64encode",            0, OPTION_B64ENCODE },
        { "block-size",           1, 'b' },
@@ -81,11 +82,12 @@ static const struct bsdtar_option {
        { "create",               0, 'c' },
        { "dereference",          0, 'L' },
        { "directory",            1, 'C' },
-       { "disable-copyfile",     0, OPTION_DISABLE_COPYFILE },
+       { "disable-copyfile",     0, OPTION_NO_MAC_METADATA },
        { "exclude",              1, OPTION_EXCLUDE },
        { "exclude-from",         1, 'X' },
        { "extract",              0, 'x' },
        { "fast-read",            0, 'q' },
+       { "fflags",               0, OPTION_FFLAGS },
        { "file",                 1, 'f' },
        { "files-from",           1, 'T' },
        { "format",               1, OPTION_FORMAT },
@@ -108,6 +110,7 @@ static const struct bsdtar_option {
        { "lzip",                 0, OPTION_LZIP },
        { "lzma",                 0, OPTION_LZMA },
        { "lzop",                 0, OPTION_LZOP },
+       { "mac-metadata",         0, OPTION_MAC_METADATA },
        { "modification-time",    0, 'm' },
        { "newer",                1, OPTION_NEWER_CTIME },
        { "newer-ctime",          1, OPTION_NEWER_CTIME },
@@ -115,10 +118,14 @@ static const struct bsdtar_option {
        { "newer-mtime",          1, OPTION_NEWER_MTIME },
        { "newer-mtime-than",     1, OPTION_NEWER_MTIME_THAN },
        { "newer-than",           1, OPTION_NEWER_CTIME_THAN },
+       { "no-acls",              0, OPTION_NO_ACLS },
+       { "no-fflags",            0, OPTION_NO_FFLAGS },
+       { "no-mac-metadata",      0, OPTION_NO_MAC_METADATA },
        { "no-recursion",         0, 'n' },
        { "no-same-owner",        0, OPTION_NO_SAME_OWNER },
        { "no-same-permissions",  0, OPTION_NO_SAME_PERMISSIONS },
-       { "no-xattr",             0, OPTION_NO_XATTR },
+       { "no-xattr",             0, OPTION_NO_XATTRS },
+       { "no-xattrs",            0, OPTION_NO_XATTRS },
        { "nodump",               0, OPTION_NODUMP },
        { "nopreserveHFSCompression",0, OPTION_NOPRESERVE_HFS_COMPRESSION },
        { "norecurse",            0, 'n' },
@@ -151,6 +158,7 @@ static const struct bsdtar_option {
        { "uuencode",             0, OPTION_UUENCODE },
        { "verbose",              0, 'v' },
        { "version",              0, OPTION_VERSION },
+       { "xattrs",               0, OPTION_XATTRS },
        { "xz",                   0, 'J' },
        { NULL, 0, 0 }
 };
index 3c6cb0c..658c810 100644 (file)
@@ -105,7 +105,7 @@ tar_mode_x(struct bsdtar *bsdtar)
        writer = archive_write_disk_new();
        if (writer == NULL)
                lafe_errc(1, ENOMEM, "Cannot allocate disk writer object");
-       if (!bsdtar->option_numeric_owner)
+       if ((bsdtar->flags & OPTFLAG_NUMERIC_OWNER) == 0)
                archive_write_disk_set_standard_lookup(writer);
        archive_write_disk_set_options(writer, bsdtar->extract_flags);
 
@@ -177,7 +177,7 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer)
        if (bsdtar->names_from_file != NULL)
                if (archive_match_include_pattern_from_file(
                    bsdtar->matching, bsdtar->names_from_file,
-                   bsdtar->option_null) != ARCHIVE_OK)
+                   (bsdtar->flags & OPTFLAG_NULL)) != ARCHIVE_OK)
                        lafe_errc(1, 0, "Error inclusion pattern: %s",
                            archive_error_string(bsdtar->matching));
 
@@ -208,7 +208,7 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer)
        }
        if (ARCHIVE_OK != archive_read_set_options(a, bsdtar->option_options))
                lafe_errc(1, 0, "%s", archive_error_string(a));
-       if (bsdtar->option_ignore_zeros)
+       if (bsdtar->flags & OPTFLAG_IGNORE_ZEROS)
                if (archive_read_set_options(a,
                    "read_concatenated_archives") != ARCHIVE_OK)
                        lafe_errc(1, 0, "%s", archive_error_string(a));
@@ -234,7 +234,7 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer)
                    &progress_data);
        }
 
-       if (mode == 'x' && bsdtar->option_chroot) {
+       if (mode == 'x' && (bsdtar->flags & OPTFLAG_CHROOT)) {
 #if HAVE_CHROOT
                if (chroot(".") != 0)
                        lafe_errc(1, errno, "Can't chroot to \".\"");
@@ -245,7 +245,7 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer)
        }
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
-       if (mode == 'x' && bsdtar->option_stdout) {
+       if (mode == 'x' && (bsdtar->flags & OPTFLAG_STDOUT)) {
                _setmode(1, _O_BINARY);
        }
 #endif
@@ -253,7 +253,7 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer)
        for (;;) {
                /* Support --fast-read option */
                const char *p;
-               if (bsdtar->option_fast_read &&
+               if ((bsdtar->flags & OPTFLAG_FAST_READ) &&
                    archive_match_path_unmatched_inclusions(bsdtar->matching) == 0)
                        break;
 
@@ -307,7 +307,8 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer)
                if (mode == 't') {
                        /* Perversely, gtar uses -O to mean "send to stderr"
                         * when used with -t. */
-                       out = bsdtar->option_stdout ? stderr : stdout;
+                       out = (bsdtar->flags & OPTFLAG_STDOUT) ?
+                           stderr : stdout;
 
                        /*
                         * TODO: Provide some reasonable way to
@@ -345,7 +346,7 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer)
                        if (edit_pathname(bsdtar, entry))
                                continue; /* Excluded by a rewrite failure. */
 
-                       if (bsdtar->option_interactive &&
+                       if ((bsdtar->flags & OPTFLAG_INTERACTIVE) &&
                            !yes("extract '%s'", archive_entry_pathname(entry)))
                                continue;
 
@@ -364,7 +365,7 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer)
 
                        /* TODO siginfo_printinfo(bsdtar, 0); */
 
-                       if (bsdtar->option_stdout)
+                       if (bsdtar->flags & OPTFLAG_STDOUT)
                                r = archive_read_data_into_fd(a, 1);
                        else
                                r = archive_read_extract2(a, entry, writer);
index 0d2da36..3dd3601 100644 (file)
@@ -6,7 +6,7 @@
 IF(ENABLE_TAR AND ENABLE_TEST)
   SET(bsdtar_test_SOURCES
     ../../test_utils/test_utils.c
-    main.c
+    ../../test_utils/test_main.c
     test.h
     test_0.c
     test_basic.c
@@ -96,6 +96,7 @@ IF(ENABLE_TAR AND ENABLE_TEST)
   INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
   INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/test_utils)
+  INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/tar/test)
 
   # Experimental new test handling
   ADD_CUSTOM_TARGET(run_bsdtar_test
diff --git a/tar/test/main.c b/tar/test/main.c
deleted file mode 100644 (file)
index 8d31706..0000000
+++ /dev/null
@@ -1,3072 +0,0 @@
-/*
- * Copyright (c) 2003-2009 Tim Kientzle
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "test.h"
-#include "test_utils.h"
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <errno.h>
-#ifdef HAVE_ICONV_H
-#include <iconv.h>
-#endif
-/*
- * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.
- * As the include guards don't agree, the order of include is important.
- */
-#ifdef HAVE_LINUX_EXT2_FS_H
-#include <linux/ext2_fs.h>      /* for Linux file flags */
-#endif
-#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__)
-#include <ext2fs/ext2_fs.h>     /* Linux file flags, broken on Cygwin */
-#endif
-#include <limits.h>
-#include <locale.h>
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#include <stdarg.h>
-#include <time.h>
-
-/*
- * This same file is used pretty much verbatim for all test harnesses.
- *
- * The next few lines are the only differences.
- * TODO: Move this into a separate configuration header, have all test
- * suites share one copy of this file.
- */
-__FBSDID("$FreeBSD: src/usr.bin/tar/test/main.c,v 1.6 2008/11/05 06:40:53 kientzle Exp $");
-#define KNOWNREF       "test_patterns_2.tar.uu"
-#define ENVBASE "BSDTAR"  /* Prefix for environment variables. */
-#define        PROGRAM "bsdtar"  /* Name of program being tested. */
-#define PROGRAM_ALIAS "tar" /* Generic alias for program */
-#undef LIBRARY           /* Not testing a library. */
-#undef EXTRA_DUMP        /* How to dump extra data */
-#undef EXTRA_ERRNO       /* How to dump errno */
-/* How to generate extra version info. */
-#define        EXTRA_VERSION    (systemf("%s --version", testprog) ? "" : "")
-
-/*
- *
- * Windows support routines
- *
- * Note: Configuration is a tricky issue.  Using HAVE_* feature macros
- * in the test harness is dangerous because they cover up
- * configuration errors.  The classic example of this is omitting a
- * configure check.  If libarchive and libarchive_test both look for
- * the same feature macro, such errors are hard to detect.  Platform
- * macros (e.g., _WIN32 or __GNUC__) are a little better, but can
- * easily lead to very messy code.  It's best to limit yourself
- * to only the most generic programming techniques in the test harness
- * and thus avoid conditionals altogether.  Where that's not possible,
- * try to minimize conditionals by grouping platform-specific tests in
- * one place (e.g., test_acl_freebsd) or by adding new assert()
- * functions (e.g., assertMakeHardlink()) to cover up platform
- * differences.  Platform-specific coding in libarchive_test is often
- * a symptom that some capability is missing from libarchive itself.
- */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#include <io.h>
-#include <direct.h>
-#include <windows.h>
-#ifndef F_OK
-#define F_OK (0)
-#endif
-#ifndef S_ISDIR
-#define S_ISDIR(m)  ((m) & _S_IFDIR)
-#endif
-#ifndef S_ISREG
-#define S_ISREG(m)  ((m) & _S_IFREG)
-#endif
-#if !defined(__BORLANDC__)
-#define access _access
-#undef chdir
-#define chdir _chdir
-#endif
-#ifndef fileno
-#define fileno _fileno
-#endif
-/*#define fstat _fstat64*/
-#if !defined(__BORLANDC__)
-#define getcwd _getcwd
-#endif
-#define lstat stat
-/*#define lstat _stat64*/
-/*#define stat _stat64*/
-#define rmdir _rmdir
-#if !defined(__BORLANDC__)
-#define strdup _strdup
-#define umask _umask
-#endif
-#define int64_t __int64
-#endif
-
-#if defined(HAVE__CrtSetReportMode)
-# include <crtdbg.h>
-#endif
-
-mode_t umasked(mode_t expected_mode)
-{
-       mode_t mode = umask(0);
-       umask(mode);
-       return expected_mode & ~mode;
-}
-
-/* Path to working directory for current test */
-const char *testworkdir;
-#ifdef PROGRAM
-/* Pathname of exe to be tested. */
-const char *testprogfile;
-/* Name of exe to use in printf-formatted command strings. */
-/* On Windows, this includes leading/trailing quotes. */
-const char *testprog;
-#endif
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-static void    *GetFunctionKernel32(const char *);
-static int      my_CreateSymbolicLinkA(const char *, const char *, int);
-static int      my_CreateHardLinkA(const char *, const char *);
-static int      my_GetFileInformationByName(const char *,
-                    BY_HANDLE_FILE_INFORMATION *);
-
-static void *
-GetFunctionKernel32(const char *name)
-{
-       static HINSTANCE lib;
-       static int set;
-       if (!set) {
-               set = 1;
-               lib = LoadLibrary("kernel32.dll");
-       }
-       if (lib == NULL) {
-               fprintf(stderr, "Can't load kernel32.dll?!\n");
-               exit(1);
-       }
-       return (void *)GetProcAddress(lib, name);
-}
-
-static int
-my_CreateSymbolicLinkA(const char *linkname, const char *target, int flags)
-{
-       static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, DWORD);
-       static int set;
-       if (!set) {
-               set = 1;
-               f = GetFunctionKernel32("CreateSymbolicLinkA");
-       }
-       return f == NULL ? 0 : (*f)(linkname, target, flags);
-}
-
-static int
-my_CreateHardLinkA(const char *linkname, const char *target)
-{
-       static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES);
-       static int set;
-       if (!set) {
-               set = 1;
-               f = GetFunctionKernel32("CreateHardLinkA");
-       }
-       return f == NULL ? 0 : (*f)(linkname, target, NULL);
-}
-
-static int
-my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi)
-{
-       HANDLE h;
-       int r;
-
-       memset(bhfi, 0, sizeof(*bhfi));
-       h = CreateFile(path, FILE_READ_ATTRIBUTES, 0, NULL,
-               OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
-       if (h == INVALID_HANDLE_VALUE)
-               return (0);
-       r = GetFileInformationByHandle(h, bhfi);
-       CloseHandle(h);
-       return (r);
-}
-#endif
-
-#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__)
-static void
-invalid_parameter_handler(const wchar_t * expression,
-    const wchar_t * function, const wchar_t * file,
-    unsigned int line, uintptr_t pReserved)
-{
-       /* nop */
-}
-#endif
-
-/*
- *
- * OPTIONS FLAGS
- *
- */
-
-/* Enable core dump on failure. */
-static int dump_on_failure = 0;
-/* Default is to remove temp dirs and log data for successful tests. */
-static int keep_temp_files = 0;
-/* Default is to run the specified tests once and report errors. */
-static int until_failure = 0;
-/* Default is to just report pass/fail for each test. */
-static int verbosity = 0;
-#define        VERBOSITY_SUMMARY_ONLY -1 /* -q */
-#define VERBOSITY_PASSFAIL 0   /* Default */
-#define VERBOSITY_LIGHT_REPORT 1 /* -v */
-#define VERBOSITY_FULL 2 /* -vv */
-/* A few places generate even more output for verbosity > VERBOSITY_FULL,
- * mostly for debugging the test harness itself. */
-/* Cumulative count of assertion failures. */
-static int failures = 0;
-/* Cumulative count of reported skips. */
-static int skips = 0;
-/* Cumulative count of assertions checked. */
-static int assertions = 0;
-
-/* Directory where uuencoded reference files can be found. */
-static const char *refdir;
-
-/*
- * Report log information selectively to console and/or disk log.
- */
-static int log_console = 0;
-static FILE *logfile;
-static void
-vlogprintf(const char *fmt, va_list ap)
-{
-#ifdef va_copy
-       va_list lfap;
-       va_copy(lfap, ap);
-#endif
-       if (log_console)
-               vfprintf(stdout, fmt, ap);
-       if (logfile != NULL)
-#ifdef va_copy
-               vfprintf(logfile, fmt, lfap);
-       va_end(lfap);
-#else
-               vfprintf(logfile, fmt, ap);
-#endif
-}
-
-static void
-logprintf(const char *fmt, ...)
-{
-       va_list ap;
-       va_start(ap, fmt);
-       vlogprintf(fmt, ap);
-       va_end(ap);
-}
-
-/* Set up a message to display only if next assertion fails. */
-static char msgbuff[4096];
-static const char *msg, *nextmsg;
-void
-failure(const char *fmt, ...)
-{
-       va_list ap;
-       if (fmt == NULL) {
-               nextmsg = NULL;
-       } else {
-               va_start(ap, fmt);
-               vsprintf(msgbuff, fmt, ap);
-               va_end(ap);
-               nextmsg = msgbuff;
-       }
-}
-
-/*
- * Copy arguments into file-local variables.
- * This was added to permit vararg assert() functions without needing
- * variadic wrapper macros.  Turns out that the vararg capability is almost
- * never used, so almost all of the vararg assertions can be simplified
- * by removing the vararg capability and reworking the wrapper macro to
- * pass __FILE__, __LINE__ directly into the function instead of using
- * this hook.  I suspect this machinery is used so rarely that we
- * would be better off just removing it entirely.  That would simplify
- * the code here noticeably.
- */
-static const char *skipping_filename;
-static int skipping_line;
-void skipping_setup(const char *filename, int line)
-{
-       skipping_filename = filename;
-       skipping_line = line;
-}
-
-/* Called at the beginning of each assert() function. */
-static void
-assertion_count(const char *file, int line)
-{
-       (void)file; /* UNUSED */
-       (void)line; /* UNUSED */
-       ++assertions;
-       /* Proper handling of "failure()" message. */
-       msg = nextmsg;
-       nextmsg = NULL;
-       /* Uncomment to print file:line after every assertion.
-        * Verbose, but occasionally useful in tracking down crashes. */
-       /* printf("Checked %s:%d\n", file, line); */
-}
-
-/*
- * For each test source file, we remember how many times each
- * assertion was reported.  Cleared before each new test,
- * used by test_summarize().
- */
-static struct line {
-       int count;
-       int skip;
-}  failed_lines[10000];
-const char *failed_filename;
-
-/* Count this failure, setup up log destination and handle initial report. */
-static void
-failure_start(const char *filename, int line, const char *fmt, ...)
-{
-       va_list ap;
-
-       /* Record another failure for this line. */
-       ++failures;
-       failed_filename = filename;
-       failed_lines[line].count++;
-
-       /* Determine whether to log header to console. */
-       switch (verbosity) {
-       case VERBOSITY_LIGHT_REPORT:
-               log_console = (failed_lines[line].count < 2);
-               break;
-       default:
-               log_console = (verbosity >= VERBOSITY_FULL);
-       }
-
-       /* Log file:line header for this failure */
-       va_start(ap, fmt);
-#if _MSC_VER
-       logprintf("%s(%d): ", filename, line);
-#else
-       logprintf("%s:%d: ", filename, line);
-#endif
-       vlogprintf(fmt, ap);
-       va_end(ap);
-       logprintf("\n");
-
-       if (msg != NULL && msg[0] != '\0') {
-               logprintf("   Description: %s\n", msg);
-               msg = NULL;
-       }
-
-       /* Determine whether to log details to console. */
-       if (verbosity == VERBOSITY_LIGHT_REPORT)
-               log_console = 0;
-}
-
-/* Complete reporting of failed tests. */
-/*
- * The 'extra' hook here is used by libarchive to include libarchive
- * error messages with assertion failures.  It could also be used
- * to add strerror() output, for example.  Just define the EXTRA_DUMP()
- * macro appropriately.
- */
-static void
-failure_finish(void *extra)
-{
-       (void)extra; /* UNUSED (maybe) */
-#ifdef EXTRA_DUMP
-       if (extra != NULL) {
-               logprintf("    errno: %d\n", EXTRA_ERRNO(extra));
-               logprintf("   detail: %s\n", EXTRA_DUMP(extra));
-       }
-#endif
-
-       if (dump_on_failure) {
-               fprintf(stderr,
-                   " *** forcing core dump so failure can be debugged ***\n");
-               abort();
-       }
-}
-
-/* Inform user that we're skipping some checks. */
-void
-test_skipping(const char *fmt, ...)
-{
-       char buff[1024];
-       va_list ap;
-
-       va_start(ap, fmt);
-       vsprintf(buff, fmt, ap);
-       va_end(ap);
-       /* Use failure() message if set. */
-       msg = nextmsg;
-       nextmsg = NULL;
-       /* failure_start() isn't quite right, but is awfully convenient. */
-       failure_start(skipping_filename, skipping_line, "SKIPPING: %s", buff);
-       --failures; /* Undo failures++ in failure_start() */
-       /* Don't failure_finish() here. */
-       /* Mark as skip, so doesn't count as failed test. */
-       failed_lines[skipping_line].skip = 1;
-       ++skips;
-}
-
-/*
- *
- * ASSERTIONS
- *
- */
-
-/* Generic assert() just displays the failed condition. */
-int
-assertion_assert(const char *file, int line, int value,
-    const char *condition, void *extra)
-{
-       assertion_count(file, line);
-       if (!value) {
-               failure_start(file, line, "Assertion failed: %s", condition);
-               failure_finish(extra);
-       }
-       return (value);
-}
-
-/* chdir() and report any errors */
-int
-assertion_chdir(const char *file, int line, const char *pathname)
-{
-       assertion_count(file, line);
-       if (chdir(pathname) == 0)
-               return (1);
-       failure_start(file, line, "chdir(\"%s\")", pathname);
-       failure_finish(NULL);
-       return (0);
-
-}
-
-/* Verify two integers are equal. */
-int
-assertion_equal_int(const char *file, int line,
-    long long v1, const char *e1, long long v2, const char *e2, void *extra)
-{
-       assertion_count(file, line);
-       if (v1 == v2)
-               return (1);
-       failure_start(file, line, "%s != %s", e1, e2);
-       logprintf("      %s=%lld (0x%llx, 0%llo)\n", e1, v1, v1, v1);
-       logprintf("      %s=%lld (0x%llx, 0%llo)\n", e2, v2, v2, v2);
-       failure_finish(extra);
-       return (0);
-}
-
-/*
- * Utility to convert a single UTF-8 sequence.
- */
-static int
-_utf8_to_unicode(uint32_t *pwc, const char *s, size_t n)
-{
-       static const char utf8_count[256] = {
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 00 - 0F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 10 - 1F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 20 - 2F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 30 - 3F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 40 - 4F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 50 - 5F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 60 - 6F */
-                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 70 - 7F */
-                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 80 - 8F */
-                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 90 - 9F */
-                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* A0 - AF */
-                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* B0 - BF */
-                0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* C0 - CF */
-                2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* D0 - DF */
-                3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,/* E0 - EF */
-                4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */
-       };
-       int ch;
-       int cnt;
-       uint32_t wc;
-
-       *pwc = 0;
-
-       /* Sanity check. */
-       if (n == 0)
-               return (0);
-       /*
-        * Decode 1-4 bytes depending on the value of the first byte.
-        */
-       ch = (unsigned char)*s;
-       if (ch == 0)
-               return (0); /* Standard:  return 0 for end-of-string. */
-       cnt = utf8_count[ch];
-
-       /* Invalid sequence or there are not plenty bytes. */
-       if (n < (size_t)cnt)
-               return (-1);
-
-       /* Make a Unicode code point from a single UTF-8 sequence. */
-       switch (cnt) {
-       case 1: /* 1 byte sequence. */
-               *pwc = ch & 0x7f;
-               return (cnt);
-       case 2: /* 2 bytes sequence. */
-               if ((s[1] & 0xc0) != 0x80) return (-1);
-               *pwc = ((ch & 0x1f) << 6) | (s[1] & 0x3f);
-               return (cnt);
-       case 3: /* 3 bytes sequence. */
-               if ((s[1] & 0xc0) != 0x80) return (-1);
-               if ((s[2] & 0xc0) != 0x80) return (-1);
-               wc = ((ch & 0x0f) << 12)
-                   | ((s[1] & 0x3f) << 6)
-                   | (s[2] & 0x3f);
-               if (wc < 0x800)
-                       return (-1);/* Overlong sequence. */
-               break;
-       case 4: /* 4 bytes sequence. */
-               if (n < 4)
-                       return (-1);
-               if ((s[1] & 0xc0) != 0x80) return (-1);
-               if ((s[2] & 0xc0) != 0x80) return (-1);
-               if ((s[3] & 0xc0) != 0x80) return (-1);
-               wc = ((ch & 0x07) << 18)
-                   | ((s[1] & 0x3f) << 12)
-                   | ((s[2] & 0x3f) << 6)
-                   | (s[3] & 0x3f);
-               if (wc < 0x10000)
-                       return (-1);/* Overlong sequence. */
-               break;
-       default:
-               return (-1);
-       }
-
-       /* The code point larger than 0x10FFFF is not legal
-        * Unicode values. */
-       if (wc > 0x10FFFF)
-               return (-1);
-       /* Correctly gets a Unicode, returns used bytes. */
-       *pwc = wc;
-       return (cnt);
-}
-
-static void strdump(const char *e, const char *p, int ewidth, int utf8)
-{
-       const char *q = p;
-
-       logprintf("      %*s = ", ewidth, e);
-       if (p == NULL) {
-               logprintf("NULL\n");
-               return;
-       }
-       logprintf("\"");
-       while (*p != '\0') {
-               unsigned int c = 0xff & *p++;
-               switch (c) {
-               case '\a': logprintf("\\a"); break;
-               case '\b': logprintf("\\b"); break;
-               case '\n': logprintf("\\n"); break;
-               case '\r': logprintf("\\r"); break;
-               default:
-                       if (c >= 32 && c < 127)
-                               logprintf("%c", c);
-                       else
-                               logprintf("\\x%02X", c);
-               }
-       }
-       logprintf("\"");
-       logprintf(" (length %d)", q == NULL ? -1 : (int)strlen(q));
-
-       /*
-        * If the current string is UTF-8, dump its code points.
-        */
-       if (utf8) {
-               size_t len;
-               uint32_t uc;
-               int n;
-               int cnt = 0;
-
-               p = q;
-               len = strlen(p);
-               logprintf(" [");
-               while ((n = _utf8_to_unicode(&uc, p, len)) > 0) {
-                       if (p != q)
-                               logprintf(" ");
-                       logprintf("%04X", uc);
-                       p += n;
-                       len -= n;
-                       cnt++;
-               }
-               logprintf("]");
-               logprintf(" (count %d", cnt);
-               if (n < 0) {
-                       logprintf(",unknown %d bytes", len);
-               }
-               logprintf(")");
-
-       }
-       logprintf("\n");
-}
-
-/* Verify two strings are equal, dump them if not. */
-int
-assertion_equal_string(const char *file, int line,
-    const char *v1, const char *e1,
-    const char *v2, const char *e2,
-    void *extra, int utf8)
-{
-       int l1, l2;
-
-       assertion_count(file, line);
-       if (v1 == v2 || (v1 != NULL && v2 != NULL && strcmp(v1, v2) == 0))
-               return (1);
-       failure_start(file, line, "%s != %s", e1, e2);
-       l1 = (int)strlen(e1);
-       l2 = (int)strlen(e2);
-       if (l1 < l2)
-               l1 = l2;
-       strdump(e1, v1, l1, utf8);
-       strdump(e2, v2, l1, utf8);
-       failure_finish(extra);
-       return (0);
-}
-
-static void
-wcsdump(const char *e, const wchar_t *w)
-{
-       logprintf("      %s = ", e);
-       if (w == NULL) {
-               logprintf("(null)");
-               return;
-       }
-       logprintf("\"");
-       while (*w != L'\0') {
-               unsigned int c = *w++;
-               if (c >= 32 && c < 127)
-                       logprintf("%c", c);
-               else if (c < 256)
-                       logprintf("\\x%02X", c);
-               else if (c < 0x10000)
-                       logprintf("\\u%04X", c);
-               else
-                       logprintf("\\U%08X", c);
-       }
-       logprintf("\"\n");
-}
-
-#ifndef HAVE_WCSCMP
-static int
-wcscmp(const wchar_t *s1, const wchar_t *s2)
-{
-
-       while (*s1 == *s2++) {
-               if (*s1++ == L'\0')
-                       return 0;
-       }
-       if (*s1 > *--s2)
-               return 1;
-       else
-               return -1;
-}
-#endif
-
-/* Verify that two wide strings are equal, dump them if not. */
-int
-assertion_equal_wstring(const char *file, int line,
-    const wchar_t *v1, const char *e1,
-    const wchar_t *v2, const char *e2,
-    void *extra)
-{
-       assertion_count(file, line);
-       if (v1 == v2)
-               return (1);
-       if (v1 != NULL && v2 != NULL && wcscmp(v1, v2) == 0)
-               return (1);
-       failure_start(file, line, "%s != %s", e1, e2);
-       wcsdump(e1, v1);
-       wcsdump(e2, v2);
-       failure_finish(extra);
-       return (0);
-}
-
-/*
- * Pretty standard hexdump routine.  As a bonus, if ref != NULL, then
- * any bytes in p that differ from ref will be highlighted with '_'
- * before and after the hex value.
- */
-static void
-hexdump(const char *p, const char *ref, size_t l, size_t offset)
-{
-       size_t i, j;
-       char sep;
-
-       if (p == NULL) {
-               logprintf("(null)\n");
-               return;
-       }
-       for(i=0; i < l; i+=16) {
-               logprintf("%04x", (unsigned)(i + offset));
-               sep = ' ';
-               for (j = 0; j < 16 && i + j < l; j++) {
-                       if (ref != NULL && p[i + j] != ref[i + j])
-                               sep = '_';
-                       logprintf("%c%02x", sep, 0xff & (int)p[i+j]);
-                       if (ref != NULL && p[i + j] == ref[i + j])
-                               sep = ' ';
-               }
-               for (; j < 16; j++) {
-                       logprintf("%c  ", sep);
-                       sep = ' ';
-               }
-               logprintf("%c", sep);
-               for (j=0; j < 16 && i + j < l; j++) {
-                       int c = p[i + j];
-                       if (c >= ' ' && c <= 126)
-                               logprintf("%c", c);
-                       else
-                               logprintf(".");
-               }
-               logprintf("\n");
-       }
-}
-
-/* Verify that two blocks of memory are the same, display the first
- * block of differences if they're not. */
-int
-assertion_equal_mem(const char *file, int line,
-    const void *_v1, const char *e1,
-    const void *_v2, const char *e2,
-    size_t l, const char *ld, void *extra)
-{
-       const char *v1 = (const char *)_v1;
-       const char *v2 = (const char *)_v2;
-       size_t offset;
-
-       assertion_count(file, line);
-       if (v1 == v2 || (v1 != NULL && v2 != NULL && memcmp(v1, v2, l) == 0))
-               return (1);
-       if (v1 == NULL || v2 == NULL)
-               return (0);
-
-       failure_start(file, line, "%s != %s", e1, e2);
-       logprintf("      size %s = %d\n", ld, (int)l);
-       /* Dump 48 bytes (3 lines) so that the first difference is
-        * in the second line. */
-       offset = 0;
-       while (l > 64 && memcmp(v1, v2, 32) == 0) {
-               /* Two lines agree, so step forward one line. */
-               v1 += 16;
-               v2 += 16;
-               l -= 16;
-               offset += 16;
-       }
-       logprintf("      Dump of %s\n", e1);
-       hexdump(v1, v2, l < 128 ? l : 128, offset);
-       logprintf("      Dump of %s\n", e2);
-       hexdump(v2, v1, l < 128 ? l : 128, offset);
-       logprintf("\n");
-       failure_finish(extra);
-       return (0);
-}
-
-/* Verify that a block of memory is filled with the specified byte. */
-int
-assertion_memory_filled_with(const char *file, int line,
-    const void *_v1, const char *vd,
-    size_t l, const char *ld,
-    char b, const char *bd, void *extra)
-{
-       const char *v1 = (const char *)_v1;
-       size_t c = 0;
-       size_t i;
-       (void)ld; /* UNUSED */
-
-       assertion_count(file, line);
-
-       for (i = 0; i < l; ++i) {
-               if (v1[i] == b) {
-                       ++c;
-               }
-       }
-       if (c == l)
-               return (1);
-
-       failure_start(file, line, "%s (size %d) not filled with %s", vd, (int)l, bd);
-       logprintf("   Only %d bytes were correct\n", (int)c);
-       failure_finish(extra);
-       return (0);
-}
-
-/* Verify that the named file exists and is empty. */
-int
-assertion_empty_file(const char *filename, int line, const char *f1)
-{
-       char buff[1024];
-       struct stat st;
-       ssize_t s;
-       FILE *f;
-
-       assertion_count(filename, line);
-
-       if (stat(f1, &st) != 0) {
-               failure_start(filename, line, "Stat failed: %s", f1);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (st.st_size == 0)
-               return (1);
-
-       failure_start(filename, line, "File should be empty: %s", f1);
-       logprintf("    File size: %d\n", (int)st.st_size);
-       logprintf("    Contents:\n");
-       f = fopen(f1, "rb");
-       if (f == NULL) {
-               logprintf("    Unable to open %s\n", f1);
-       } else {
-               s = ((off_t)sizeof(buff) < st.st_size) ?
-                   (ssize_t)sizeof(buff) : (ssize_t)st.st_size;
-               s = fread(buff, 1, s, f);
-               hexdump(buff, NULL, s, 0);
-               fclose(f);
-       }
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Verify that the named file exists and is not empty. */
-int
-assertion_non_empty_file(const char *filename, int line, const char *f1)
-{
-       struct stat st;
-
-       assertion_count(filename, line);
-
-       if (stat(f1, &st) != 0) {
-               failure_start(filename, line, "Stat failed: %s", f1);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (st.st_size == 0) {
-               failure_start(filename, line, "File empty: %s", f1);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (1);
-}
-
-/* Verify that two files have the same contents. */
-/* TODO: hexdump the first bytes that actually differ. */
-int
-assertion_equal_file(const char *filename, int line, const char *fn1, const char *fn2)
-{
-       char buff1[1024];
-       char buff2[1024];
-       FILE *f1, *f2;
-       int n1, n2;
-
-       assertion_count(filename, line);
-
-       f1 = fopen(fn1, "rb");
-       f2 = fopen(fn2, "rb");
-       if (f1 == NULL || f2 == NULL) {
-               if (f1) fclose(f1);
-               if (f2) fclose(f2);
-               return (0);
-       }
-       for (;;) {
-               n1 = (int)fread(buff1, 1, sizeof(buff1), f1);
-               n2 = (int)fread(buff2, 1, sizeof(buff2), f2);
-               if (n1 != n2)
-                       break;
-               if (n1 == 0 && n2 == 0) {
-                       fclose(f1);
-                       fclose(f2);
-                       return (1);
-               }
-               if (memcmp(buff1, buff2, n1) != 0)
-                       break;
-       }
-       fclose(f1);
-       fclose(f2);
-       failure_start(filename, line, "Files not identical");
-       logprintf("  file1=\"%s\"\n", fn1);
-       logprintf("  file2=\"%s\"\n", fn2);
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Verify that the named file does exist. */
-int
-assertion_file_exists(const char *filename, int line, const char *f)
-{
-       assertion_count(filename, line);
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       if (!_access(f, 0))
-               return (1);
-#else
-       if (!access(f, F_OK))
-               return (1);
-#endif
-       failure_start(filename, line, "File should exist: %s", f);
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Verify that the named file doesn't exist. */
-int
-assertion_file_not_exists(const char *filename, int line, const char *f)
-{
-       assertion_count(filename, line);
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       if (_access(f, 0))
-               return (1);
-#else
-       if (access(f, F_OK))
-               return (1);
-#endif
-       failure_start(filename, line, "File should not exist: %s", f);
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Compare the contents of a file to a block of memory. */
-int
-assertion_file_contents(const char *filename, int line, const void *buff, int s, const char *fn)
-{
-       char *contents;
-       FILE *f;
-       int n;
-
-       assertion_count(filename, line);
-
-       f = fopen(fn, "rb");
-       if (f == NULL) {
-               failure_start(filename, line,
-                   "File should exist: %s", fn);
-               failure_finish(NULL);
-               return (0);
-       }
-       contents = malloc(s * 2);
-       n = (int)fread(contents, 1, s * 2, f);
-       fclose(f);
-       if (n == s && memcmp(buff, contents, s) == 0) {
-               free(contents);
-               return (1);
-       }
-       failure_start(filename, line, "File contents don't match");
-       logprintf("  file=\"%s\"\n", fn);
-       if (n > 0)
-               hexdump(contents, buff, n > 512 ? 512 : n, 0);
-       else {
-               logprintf("  File empty, contents should be:\n");
-               hexdump(buff, NULL, s > 512 ? 512 : s, 0);
-       }
-       failure_finish(NULL);
-       free(contents);
-       return (0);
-}
-
-/* Check the contents of a text file, being tolerant of line endings. */
-int
-assertion_text_file_contents(const char *filename, int line, const char *buff, const char *fn)
-{
-       char *contents;
-       const char *btxt, *ftxt;
-       FILE *f;
-       int n, s;
-
-       assertion_count(filename, line);
-       f = fopen(fn, "r");
-       if (f == NULL) {
-               failure_start(filename, line,
-                   "File doesn't exist: %s", fn);
-               failure_finish(NULL);
-               return (0);
-       }
-       s = (int)strlen(buff);
-       contents = malloc(s * 2 + 128);
-       n = (int)fread(contents, 1, s * 2 + 128 - 1, f);
-       if (n >= 0)
-               contents[n] = '\0';
-       fclose(f);
-       /* Compare texts. */
-       btxt = buff;
-       ftxt = (const char *)contents;
-       while (*btxt != '\0' && *ftxt != '\0') {
-               if (*btxt == *ftxt) {
-                       ++btxt;
-                       ++ftxt;
-                       continue;
-               }
-               if (btxt[0] == '\n' && ftxt[0] == '\r' && ftxt[1] == '\n') {
-                       /* Pass over different new line characters. */
-                       ++btxt;
-                       ftxt += 2;
-                       continue;
-               }
-               break;
-       }
-       if (*btxt == '\0' && *ftxt == '\0') {
-               free(contents);
-               return (1);
-       }
-       failure_start(filename, line, "Contents don't match");
-       logprintf("  file=\"%s\"\n", fn);
-       if (n > 0) {
-               hexdump(contents, buff, n, 0);
-               logprintf("  expected\n", fn);
-               hexdump(buff, contents, s, 0);
-       } else {
-               logprintf("  File empty, contents should be:\n");
-               hexdump(buff, NULL, s, 0);
-       }
-       failure_finish(NULL);
-       free(contents);
-       return (0);
-}
-
-/* Verify that a text file contains the specified lines, regardless of order */
-/* This could be more efficient if we sorted both sets of lines, etc, but
- * since this is used only for testing and only ever deals with a dozen or so
- * lines at a time, this relatively crude approach is just fine. */
-int
-assertion_file_contains_lines_any_order(const char *file, int line,
-    const char *pathname, const char *lines[])
-{
-       char *buff;
-       size_t buff_size;
-       size_t expected_count, actual_count, i, j;
-       char **expected = NULL;
-       char *p, **actual = NULL;
-       char c;
-       int expected_failure = 0, actual_failure = 0, retval = 0;
-
-       assertion_count(file, line);
-
-       buff = slurpfile(&buff_size, "%s", pathname);
-       if (buff == NULL) {
-               failure_start(pathname, line, "Can't read file: %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-
-       /* Make a copy of the provided lines and count up the expected
-        * file size. */
-       for (i = 0; lines[i] != NULL; ++i) {
-       }
-       expected_count = i;
-       if (expected_count) {
-               expected = malloc(sizeof(char *) * expected_count);
-               if (expected == NULL) {
-                       failure_start(pathname, line, "Can't allocate memory");
-                       failure_finish(NULL);
-                       goto done;
-               }
-               for (i = 0; lines[i] != NULL; ++i) {
-                       expected[i] = strdup(lines[i]);
-               }
-       }
-
-       /* Break the file into lines */
-       actual_count = 0;
-       for (c = '\0', p = buff; p < buff + buff_size; ++p) {
-               if (*p == '\x0d' || *p == '\x0a')
-                       *p = '\0';
-               if (c == '\0' && *p != '\0')
-                       ++actual_count;
-               c = *p;
-       }
-       if (actual_count) {
-               actual = calloc(sizeof(char *), actual_count);
-               if (actual == NULL) {
-                       failure_start(pathname, line, "Can't allocate memory");
-                       failure_finish(NULL);
-                       goto done;
-               }
-               for (j = 0, p = buff; p < buff + buff_size;
-                   p += 1 + strlen(p)) {
-                       if (*p != '\0') {
-                               actual[j] = p;
-                               ++j;
-                       }
-               }
-       }
-
-       /* Erase matching lines from both lists */
-       for (i = 0; i < expected_count; ++i) {
-               if (expected[i] == NULL)
-                       continue;
-               for (j = 0; j < actual_count; ++j) {
-                       if (actual[j] == NULL)
-                               continue;
-                       if (strcmp(expected[i], actual[j]) == 0) {
-                               free(expected[i]);
-                               expected[i] = NULL;
-                               actual[j] = NULL;
-                               break;
-                       }
-               }
-       }
-
-       /* If there's anything left, it's a failure */
-       for (i = 0; i < expected_count; ++i) {
-               if (expected[i] != NULL)
-                       ++expected_failure;
-       }
-       for (j = 0; j < actual_count; ++j) {
-               if (actual[j] != NULL)
-                       ++actual_failure;
-       }
-       if (expected_failure == 0 && actual_failure == 0) {
-               retval = 1;
-               goto done;
-       }
-       failure_start(file, line, "File doesn't match: %s", pathname);
-       for (i = 0; i < expected_count; ++i) {
-               if (expected[i] != NULL)
-                       logprintf("  Expected but not present: %s\n", expected[i]);
-       }
-       for (j = 0; j < actual_count; ++j) {
-               if (actual[j] != NULL)
-                       logprintf("  Present but not expected: %s\n", actual[j]);
-       }
-       failure_finish(NULL);
-done:
-       free(actual);
-       free(buff);
-       for (i = 0; i < expected_count; ++i)
-               free(expected[i]);
-       free(expected);
-
-       return (retval);
-}
-
-/* Verify that a text file does not contains the specified strings */
-int
-assertion_file_contains_no_invalid_strings(const char *file, int line,
-    const char *pathname, const char *strings[])
-{
-       char *buff;
-       int i;
-
-       buff = slurpfile(NULL, "%s", pathname);
-       if (buff == NULL) {
-               failure_start(file, line, "Can't read file: %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-
-       for (i = 0; strings[i] != NULL; ++i) {
-               if (strstr(buff, strings[i]) != NULL) {
-                       failure_start(file, line, "Invalid string in %s: %s", pathname,
-                           strings[i]);
-                       failure_finish(NULL);
-                       free(buff);
-                       return(0);
-               }
-       }
-
-       free(buff);
-       return (0);
-}
-
-/* Test that two paths point to the same file. */
-/* As a side-effect, asserts that both files exist. */
-static int
-is_hardlink(const char *file, int line,
-    const char *path1, const char *path2)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       BY_HANDLE_FILE_INFORMATION bhfi1, bhfi2;
-       int r;
-
-       assertion_count(file, line);
-       r = my_GetFileInformationByName(path1, &bhfi1);
-       if (r == 0) {
-               failure_start(file, line, "File %s can't be inspected?", path1);
-               failure_finish(NULL);
-               return (0);
-       }
-       r = my_GetFileInformationByName(path2, &bhfi2);
-       if (r == 0) {
-               failure_start(file, line, "File %s can't be inspected?", path2);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (bhfi1.dwVolumeSerialNumber == bhfi2.dwVolumeSerialNumber
-               && bhfi1.nFileIndexHigh == bhfi2.nFileIndexHigh
-               && bhfi1.nFileIndexLow == bhfi2.nFileIndexLow);
-#else
-       struct stat st1, st2;
-       int r;
-
-       assertion_count(file, line);
-       r = lstat(path1, &st1);
-       if (r != 0) {
-               failure_start(file, line, "File should exist: %s", path1);
-               failure_finish(NULL);
-               return (0);
-       }
-       r = lstat(path2, &st2);
-       if (r != 0) {
-               failure_start(file, line, "File should exist: %s", path2);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (st1.st_ino == st2.st_ino && st1.st_dev == st2.st_dev);
-#endif
-}
-
-int
-assertion_is_hardlink(const char *file, int line,
-    const char *path1, const char *path2)
-{
-       if (is_hardlink(file, line, path1, path2))
-               return (1);
-       failure_start(file, line,
-           "Files %s and %s are not hardlinked", path1, path2);
-       failure_finish(NULL);
-       return (0);
-}
-
-int
-assertion_is_not_hardlink(const char *file, int line,
-    const char *path1, const char *path2)
-{
-       if (!is_hardlink(file, line, path1, path2))
-               return (1);
-       failure_start(file, line,
-           "Files %s and %s should not be hardlinked", path1, path2);
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Verify a/b/mtime of 'pathname'. */
-/* If 'recent', verify that it's within last 10 seconds. */
-static int
-assertion_file_time(const char *file, int line,
-    const char *pathname, long t, long nsec, char type, int recent)
-{
-       long long filet, filet_nsec;
-       int r;
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#define EPOC_TIME      (116444736000000000ULL)
-       FILETIME fxtime, fbirthtime, fatime, fmtime;
-       ULARGE_INTEGER wintm;
-       HANDLE h;
-       fxtime.dwLowDateTime = 0;
-       fxtime.dwHighDateTime = 0;
-
-       assertion_count(file, line);
-       /* Note: FILE_FLAG_BACKUP_SEMANTICS applies to open
-        * a directory file. If not, CreateFile() will fail when
-        * the pathname is a directory. */
-       h = CreateFile(pathname, FILE_READ_ATTRIBUTES, 0, NULL,
-           OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
-       if (h == INVALID_HANDLE_VALUE) {
-               failure_start(file, line, "Can't access %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       r = GetFileTime(h, &fbirthtime, &fatime, &fmtime);
-       switch (type) {
-       case 'a': fxtime = fatime; break;
-       case 'b': fxtime = fbirthtime; break;
-       case 'm': fxtime = fmtime; break;
-       }
-       CloseHandle(h);
-       if (r == 0) {
-               failure_start(file, line, "Can't GetFileTime %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       wintm.LowPart = fxtime.dwLowDateTime;
-       wintm.HighPart = fxtime.dwHighDateTime;
-       filet = (wintm.QuadPart - EPOC_TIME) / 10000000;
-       filet_nsec = ((wintm.QuadPart - EPOC_TIME) % 10000000) * 100;
-       nsec = (nsec / 100) * 100; /* Round the request */
-#else
-       struct stat st;
-
-       assertion_count(file, line);
-       r = lstat(pathname, &st);
-       if (r != 0) {
-               failure_start(file, line, "Can't stat %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       switch (type) {
-       case 'a': filet = st.st_atime; break;
-       case 'm': filet = st.st_mtime; break;
-       case 'b': filet = 0; break;
-       default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
-               exit(1);
-       }
-#if defined(__FreeBSD__)
-       switch (type) {
-       case 'a': filet_nsec = st.st_atimespec.tv_nsec; break;
-       case 'b': filet = st.st_birthtime;
-               /* FreeBSD filesystems that don't support birthtime
-                * (e.g., UFS1) always return -1 here. */
-               if (filet == -1) {
-                       return (1);
-               }
-               filet_nsec = st.st_birthtimespec.tv_nsec; break;
-       case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break;
-       default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
-               exit(1);
-       }
-       /* FreeBSD generally only stores to microsecond res, so round. */
-       filet_nsec = (filet_nsec / 1000) * 1000;
-       nsec = (nsec / 1000) * 1000;
-#else
-       filet_nsec = nsec = 0;  /* Generic POSIX only has whole seconds. */
-       if (type == 'b') return (1); /* Generic POSIX doesn't have birthtime */
-#if defined(__HAIKU__)
-       if (type == 'a') return (1); /* Haiku doesn't have atime. */
-#endif
-#endif
-#endif
-       if (recent) {
-               /* Check that requested time is up-to-date. */
-               time_t now = time(NULL);
-               if (filet < now - 10 || filet > now + 1) {
-                       failure_start(file, line,
-                           "File %s has %ctime %lld, %lld seconds ago\n",
-                           pathname, type, filet, now - filet);
-                       failure_finish(NULL);
-                       return (0);
-               }
-       } else if (filet != t || filet_nsec != nsec) {
-               failure_start(file, line,
-                   "File %s has %ctime %lld.%09lld, expected %lld.%09lld",
-                   pathname, type, filet, filet_nsec, t, nsec);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (1);
-}
-
-/* Verify atime of 'pathname'. */
-int
-assertion_file_atime(const char *file, int line,
-    const char *pathname, long t, long nsec)
-{
-       return assertion_file_time(file, line, pathname, t, nsec, 'a', 0);
-}
-
-/* Verify atime of 'pathname' is up-to-date. */
-int
-assertion_file_atime_recent(const char *file, int line, const char *pathname)
-{
-       return assertion_file_time(file, line, pathname, 0, 0, 'a', 1);
-}
-
-/* Verify birthtime of 'pathname'. */
-int
-assertion_file_birthtime(const char *file, int line,
-    const char *pathname, long t, long nsec)
-{
-       return assertion_file_time(file, line, pathname, t, nsec, 'b', 0);
-}
-
-/* Verify birthtime of 'pathname' is up-to-date. */
-int
-assertion_file_birthtime_recent(const char *file, int line,
-    const char *pathname)
-{
-       return assertion_file_time(file, line, pathname, 0, 0, 'b', 1);
-}
-
-/* Verify mode of 'pathname'. */
-int
-assertion_file_mode(const char *file, int line, const char *pathname, int expected_mode)
-{
-       int mode;
-       int r;
-
-       assertion_count(file, line);
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       failure_start(file, line, "assertFileMode not yet implemented for Windows");
-       (void)mode; /* UNUSED */
-       (void)r; /* UNUSED */
-#else
-       {
-               struct stat st;
-               r = lstat(pathname, &st);
-               mode = (int)(st.st_mode & 0777);
-       }
-       if (r == 0 && mode == expected_mode)
-                       return (1);
-       failure_start(file, line, "File %s has mode %o, expected %o",
-           pathname, mode, expected_mode);
-#endif
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Verify mtime of 'pathname'. */
-int
-assertion_file_mtime(const char *file, int line,
-    const char *pathname, long t, long nsec)
-{
-       return assertion_file_time(file, line, pathname, t, nsec, 'm', 0);
-}
-
-/* Verify mtime of 'pathname' is up-to-date. */
-int
-assertion_file_mtime_recent(const char *file, int line, const char *pathname)
-{
-       return assertion_file_time(file, line, pathname, 0, 0, 'm', 1);
-}
-
-/* Verify number of links to 'pathname'. */
-int
-assertion_file_nlinks(const char *file, int line,
-    const char *pathname, int nlinks)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       BY_HANDLE_FILE_INFORMATION bhfi;
-       int r;
-
-       assertion_count(file, line);
-       r = my_GetFileInformationByName(pathname, &bhfi);
-       if (r != 0 && bhfi.nNumberOfLinks == (DWORD)nlinks)
-               return (1);
-       failure_start(file, line, "File %s has %d links, expected %d",
-           pathname, bhfi.nNumberOfLinks, nlinks);
-       failure_finish(NULL);
-       return (0);
-#else
-       struct stat st;
-       int r;
-
-       assertion_count(file, line);
-       r = lstat(pathname, &st);
-       if (r == 0 && (int)st.st_nlink == nlinks)
-               return (1);
-       failure_start(file, line, "File %s has %d links, expected %d",
-           pathname, st.st_nlink, nlinks);
-       failure_finish(NULL);
-       return (0);
-#endif
-}
-
-/* Verify size of 'pathname'. */
-int
-assertion_file_size(const char *file, int line, const char *pathname, long size)
-{
-       int64_t filesize;
-       int r;
-
-       assertion_count(file, line);
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       {
-               BY_HANDLE_FILE_INFORMATION bhfi;
-               r = !my_GetFileInformationByName(pathname, &bhfi);
-               filesize = ((int64_t)bhfi.nFileSizeHigh << 32) + bhfi.nFileSizeLow;
-       }
-#else
-       {
-               struct stat st;
-               r = lstat(pathname, &st);
-               filesize = st.st_size;
-       }
-#endif
-       if (r == 0 && filesize == size)
-                       return (1);
-       failure_start(file, line, "File %s has size %ld, expected %ld",
-           pathname, (long)filesize, (long)size);
-       failure_finish(NULL);
-       return (0);
-}
-
-/* Assert that 'pathname' is a dir.  If mode >= 0, verify that too. */
-int
-assertion_is_dir(const char *file, int line, const char *pathname, int mode)
-{
-       struct stat st;
-       int r;
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       (void)mode; /* UNUSED */
-#endif
-       assertion_count(file, line);
-       r = lstat(pathname, &st);
-       if (r != 0) {
-               failure_start(file, line, "Dir should exist: %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (!S_ISDIR(st.st_mode)) {
-               failure_start(file, line, "%s is not a dir", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-#if !defined(_WIN32) || defined(__CYGWIN__)
-       /* Windows doesn't handle permissions the same way as POSIX,
-        * so just ignore the mode tests. */
-       /* TODO: Can we do better here? */
-       if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) {
-               failure_start(file, line, "Dir %s has wrong mode", pathname);
-               logprintf("  Expected: 0%3o\n", mode);
-               logprintf("  Found: 0%3o\n", st.st_mode & 07777);
-               failure_finish(NULL);
-               return (0);
-       }
-#endif
-       return (1);
-}
-
-/* Verify that 'pathname' is a regular file.  If 'mode' is >= 0,
- * verify that too. */
-int
-assertion_is_reg(const char *file, int line, const char *pathname, int mode)
-{
-       struct stat st;
-       int r;
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       (void)mode; /* UNUSED */
-#endif
-       assertion_count(file, line);
-       r = lstat(pathname, &st);
-       if (r != 0 || !S_ISREG(st.st_mode)) {
-               failure_start(file, line, "File should exist: %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-#if !defined(_WIN32) || defined(__CYGWIN__)
-       /* Windows doesn't handle permissions the same way as POSIX,
-        * so just ignore the mode tests. */
-       /* TODO: Can we do better here? */
-       if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) {
-               failure_start(file, line, "File %s has wrong mode", pathname);
-               logprintf("  Expected: 0%3o\n", mode);
-               logprintf("  Found: 0%3o\n", st.st_mode & 07777);
-               failure_finish(NULL);
-               return (0);
-       }
-#endif
-       return (1);
-}
-
-/* Check whether 'pathname' is a symbolic link.  If 'contents' is
- * non-NULL, verify that the symlink has those contents. */
-static int
-is_symlink(const char *file, int line,
-    const char *pathname, const char *contents)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       (void)pathname; /* UNUSED */
-       (void)contents; /* UNUSED */
-       assertion_count(file, line);
-       /* Windows sort-of has real symlinks, but they're only usable
-        * by privileged users and are crippled even then, so there's
-        * really not much point in bothering with this. */
-       return (0);
-#else
-       char buff[301];
-       struct stat st;
-       ssize_t linklen;
-       int r;
-
-       assertion_count(file, line);
-       r = lstat(pathname, &st);
-       if (r != 0) {
-               failure_start(file, line,
-                   "Symlink should exist: %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (!S_ISLNK(st.st_mode))
-               return (0);
-       if (contents == NULL)
-               return (1);
-       linklen = readlink(pathname, buff, sizeof(buff) - 1);
-       if (linklen < 0) {
-               failure_start(file, line, "Can't read symlink %s", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       buff[linklen] = '\0';
-       if (strcmp(buff, contents) != 0)
-               return (0);
-       return (1);
-#endif
-}
-
-/* Assert that path is a symlink that (optionally) contains contents. */
-int
-assertion_is_symlink(const char *file, int line,
-    const char *path, const char *contents)
-{
-       if (is_symlink(file, line, path, contents))
-               return (1);
-       if (contents)
-               failure_start(file, line, "File %s is not a symlink to %s",
-                   path, contents);
-       else
-               failure_start(file, line, "File %s is not a symlink", path);
-       failure_finish(NULL);
-       return (0);
-}
-
-
-/* Create a directory and report any errors. */
-int
-assertion_make_dir(const char *file, int line, const char *dirname, int mode)
-{
-       assertion_count(file, line);
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       (void)mode; /* UNUSED */
-       if (0 == _mkdir(dirname))
-               return (1);
-#else
-       if (0 == mkdir(dirname, mode)) {
-               if (0 == chmod(dirname, mode)) {
-                       assertion_file_mode(file, line, dirname, mode);
-                       return (1);
-               }
-       }
-#endif
-       failure_start(file, line, "Could not create directory %s", dirname);
-       failure_finish(NULL);
-       return(0);
-}
-
-/* Create a file with the specified contents and report any failures. */
-int
-assertion_make_file(const char *file, int line,
-    const char *path, int mode, int csize, const void *contents)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       /* TODO: Rework this to set file mode as well. */
-       FILE *f;
-       (void)mode; /* UNUSED */
-       assertion_count(file, line);
-       f = fopen(path, "wb");
-       if (f == NULL) {
-               failure_start(file, line, "Could not create file %s", path);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (contents != NULL) {
-               size_t wsize;
-
-               if (csize < 0)
-                       wsize = strlen(contents);
-               else
-                       wsize = (size_t)csize;
-               if (wsize != fwrite(contents, 1, wsize, f)) {
-                       fclose(f);
-                       failure_start(file, line,
-                           "Could not write file %s", path);
-                       failure_finish(NULL);
-                       return (0);
-               }
-       }
-       fclose(f);
-       return (1);
-#else
-       int fd;
-       assertion_count(file, line);
-       fd = open(path, O_CREAT | O_WRONLY, mode >= 0 ? mode : 0644);
-       if (fd < 0) {
-               failure_start(file, line, "Could not create %s", path);
-               failure_finish(NULL);
-               return (0);
-       }
-       if (0 != chmod(path, mode)) {
-               failure_start(file, line, "Could not chmod %s", path);
-               failure_finish(NULL);
-               close(fd);
-               return (0);
-       }
-       if (contents != NULL) {
-               ssize_t wsize;
-
-               if (csize < 0)
-                       wsize = (ssize_t)strlen(contents);
-               else
-                       wsize = (ssize_t)csize;
-               if (wsize != write(fd, contents, wsize)) {
-                       close(fd);
-                       failure_start(file, line,
-                           "Could not write to %s", path);
-                       failure_finish(NULL);
-                       close(fd);
-                       return (0);
-               }
-       }
-       close(fd);
-       assertion_file_mode(file, line, path, mode);
-       return (1);
-#endif
-}
-
-/* Create a hardlink and report any failures. */
-int
-assertion_make_hardlink(const char *file, int line,
-    const char *newpath, const char *linkto)
-{
-       int succeeded;
-
-       assertion_count(file, line);
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       succeeded = my_CreateHardLinkA(newpath, linkto);
-#elif HAVE_LINK
-       succeeded = !link(linkto, newpath);
-#else
-       succeeded = 0;
-#endif
-       if (succeeded)
-               return (1);
-       failure_start(file, line, "Could not create hardlink");
-       logprintf("   New link: %s\n", newpath);
-       logprintf("   Old name: %s\n", linkto);
-       failure_finish(NULL);
-       return(0);
-}
-
-/* Create a symlink and report any failures. */
-int
-assertion_make_symlink(const char *file, int line,
-    const char *newpath, const char *linkto)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       int targetIsDir = 0;  /* TODO: Fix this */
-       assertion_count(file, line);
-       if (my_CreateSymbolicLinkA(newpath, linkto, targetIsDir))
-               return (1);
-#elif HAVE_SYMLINK
-       assertion_count(file, line);
-       if (0 == symlink(linkto, newpath))
-               return (1);
-#endif
-       failure_start(file, line, "Could not create symlink");
-       logprintf("   New link: %s\n", newpath);
-       logprintf("   Old name: %s\n", linkto);
-       failure_finish(NULL);
-       return(0);
-}
-
-/* Set umask, report failures. */
-int
-assertion_umask(const char *file, int line, int mask)
-{
-       assertion_count(file, line);
-       (void)file; /* UNUSED */
-       (void)line; /* UNUSED */
-       umask(mask);
-       return (1);
-}
-
-/* Set times, report failures. */
-int
-assertion_utimes(const char *file, int line,
-    const char *pathname, long at, long at_nsec, long mt, long mt_nsec)
-{
-       int r;
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#define WINTIME(sec, nsec) ((Int32x32To64(sec, 10000000) + EPOC_TIME)\
-        + (((nsec)/1000)*10))
-       HANDLE h;
-       ULARGE_INTEGER wintm;
-       FILETIME fatime, fmtime;
-       FILETIME *pat, *pmt;
-
-       assertion_count(file, line);
-       h = CreateFileA(pathname,GENERIC_READ | GENERIC_WRITE,
-                   FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
-                   FILE_FLAG_BACKUP_SEMANTICS, NULL);
-       if (h == INVALID_HANDLE_VALUE) {
-               failure_start(file, line, "Can't access %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-
-       if (at > 0 || at_nsec > 0) {
-               wintm.QuadPart = WINTIME(at, at_nsec);
-               fatime.dwLowDateTime = wintm.LowPart;
-               fatime.dwHighDateTime = wintm.HighPart;
-               pat = &fatime;
-       } else
-               pat = NULL;
-       if (mt > 0 || mt_nsec > 0) {
-               wintm.QuadPart = WINTIME(mt, mt_nsec);
-               fmtime.dwLowDateTime = wintm.LowPart;
-               fmtime.dwHighDateTime = wintm.HighPart;
-               pmt = &fmtime;
-       } else
-               pmt = NULL;
-       if (pat != NULL || pmt != NULL)
-               r = SetFileTime(h, NULL, pat, pmt);
-       else
-               r = 1;
-       CloseHandle(h);
-       if (r == 0) {
-               failure_start(file, line, "Can't SetFileTime %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (1);
-#else /* defined(_WIN32) && !defined(__CYGWIN__) */
-       struct stat st;
-       struct timeval times[2];
-
-#if !defined(__FreeBSD__)
-       mt_nsec = at_nsec = 0;  /* Generic POSIX only has whole seconds. */
-#endif
-       if (mt == 0 && mt_nsec == 0 && at == 0 && at_nsec == 0)
-               return (1);
-
-       r = lstat(pathname, &st);
-       if (r < 0) {
-               failure_start(file, line, "Can't stat %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-
-       if (mt == 0 && mt_nsec == 0) {
-               mt = st.st_mtime;
-#if defined(__FreeBSD__)
-               mt_nsec = st.st_mtimespec.tv_nsec;
-               /* FreeBSD generally only stores to microsecond res, so round. */
-               mt_nsec = (mt_nsec / 1000) * 1000;
-#endif
-       }
-       if (at == 0 && at_nsec == 0) {
-               at = st.st_atime;
-#if defined(__FreeBSD__)
-               at_nsec = st.st_atimespec.tv_nsec;
-               /* FreeBSD generally only stores to microsecond res, so round. */
-               at_nsec = (at_nsec / 1000) * 1000;
-#endif
-       }
-
-       times[1].tv_sec = mt;
-       times[1].tv_usec = mt_nsec / 1000;
-
-       times[0].tv_sec = at;
-       times[0].tv_usec = at_nsec / 1000;
-
-#ifdef HAVE_LUTIMES
-       r = lutimes(pathname, times);
-#else
-       r = utimes(pathname, times);
-#endif
-       if (r < 0) {
-               failure_start(file, line, "Can't utimes %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       return (1);
-#endif /* defined(_WIN32) && !defined(__CYGWIN__) */
-}
-
-/* Set nodump, report failures. */
-int
-assertion_nodump(const char *file, int line, const char *pathname)
-{
-#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP)
-       int r;
-
-       assertion_count(file, line);
-       r = chflags(pathname, UF_NODUMP);
-       if (r < 0) {
-               failure_start(file, line, "Can't set nodump %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-#elif defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS)\
-        && defined(EXT2_NODUMP_FL)
-       int fd, r, flags;
-
-       assertion_count(file, line);
-       fd = open(pathname, O_RDONLY | O_NONBLOCK);
-       if (fd < 0) {
-               failure_start(file, line, "Can't open %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       r = ioctl(fd, EXT2_IOC_GETFLAGS, &flags);
-       if (r < 0) {
-               failure_start(file, line, "Can't get flags %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       flags |= EXT2_NODUMP_FL;
-       r = ioctl(fd, EXT2_IOC_SETFLAGS, &flags);
-       if (r < 0) {
-               failure_start(file, line, "Can't set nodump %s\n", pathname);
-               failure_finish(NULL);
-               return (0);
-       }
-       close(fd);
-#else
-       (void)pathname; /* UNUSED */
-       assertion_count(file, line);
-#endif
-       return (1);
-}
-
-/*
- *
- *  UTILITIES for use by tests.
- *
- */
-
-/*
- * Check whether platform supports symlinks.  This is intended
- * for tests to use in deciding whether to bother testing symlink
- * support; if the platform doesn't support symlinks, there's no point
- * in checking whether the program being tested can create them.
- *
- * Note that the first time this test is called, we actually go out to
- * disk to create and verify a symlink.  This is necessary because
- * symlink support is actually a property of a particular filesystem
- * and can thus vary between directories on a single system.  After
- * the first call, this returns the cached result from memory, so it's
- * safe to call it as often as you wish.
- */
-int
-canSymlink(void)
-{
-       /* Remember the test result */
-       static int value = 0, tested = 0;
-       if (tested)
-               return (value);
-
-       ++tested;
-       assertion_make_file(__FILE__, __LINE__, "canSymlink.0", 0644, 1, "a");
-       /* Note: Cygwin has its own symlink() emulation that does not
-        * use the Win32 CreateSymbolicLink() function. */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       value = my_CreateSymbolicLinkA("canSymlink.1", "canSymlink.0", 0)
-           && is_symlink(__FILE__, __LINE__, "canSymlink.1", "canSymlink.0");
-#elif HAVE_SYMLINK
-       value = (0 == symlink("canSymlink.0", "canSymlink.1"))
-           && is_symlink(__FILE__, __LINE__, "canSymlink.1","canSymlink.0");
-#endif
-       return (value);
-}
-
-/* Platform-dependent options for hiding the output of a subcommand. */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-static const char *redirectArgs = ">NUL 2>NUL"; /* Win32 cmd.exe */
-#else
-static const char *redirectArgs = ">/dev/null 2>/dev/null"; /* POSIX 'sh' */
-#endif
-/*
- * Can this platform run the bzip2 program?
- */
-int
-canBzip2(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("bzip2 -d -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the grzip program?
- */
-int
-canGrzip(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("grzip -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the gzip program?
- */
-int
-canGzip(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("gzip -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the lrzip program?
- */
-int
-canRunCommand(const char *cmd)
-{
-  static int tested = 0, value = 0;
-  if (!tested) {
-    tested = 1;
-    if (systemf("%s %s", cmd, redirectArgs) == 0)
-      value = 1;
-  }
-  return (value);
-}
-
-int
-canLrzip(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("lrzip -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the lz4 program?
- */
-int
-canLz4(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("lz4 -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the lzip program?
- */
-int
-canLzip(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("lzip -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the lzma program?
- */
-int
-canLzma(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("lzma -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the lzop program?
- */
-int
-canLzop(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("lzop -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this platform run the xz program?
- */
-int
-canXz(void)
-{
-       static int tested = 0, value = 0;
-       if (!tested) {
-               tested = 1;
-               if (systemf("xz -V %s", redirectArgs) == 0)
-                       value = 1;
-       }
-       return (value);
-}
-
-/*
- * Can this filesystem handle nodump flags.
- */
-#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP)
-
-int
-canNodump(void)
-{
-       const char *path = "cannodumptest";
-       struct stat sb;
-
-       assertion_make_file(__FILE__, __LINE__, path, 0644, 0, NULL);
-       if (chflags(path, UF_NODUMP) < 0)
-               return (0);
-       if (stat(path, &sb) < 0)
-               return (0);
-       if (sb.st_flags & UF_NODUMP)
-               return (1);
-       return (0);
-}
-
-#elif defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS)\
-        && defined(EXT2_NODUMP_FL)
-
-int
-canNodump(void)
-{
-       const char *path = "cannodumptest";
-       int fd, r, flags;
-
-       assertion_make_file(__FILE__, __LINE__, path, 0644, 0, NULL);
-       fd = open(path, O_RDONLY | O_NONBLOCK);
-       if (fd < 0)
-               return (0);
-       r = ioctl(fd, EXT2_IOC_GETFLAGS, &flags);
-       if (r < 0)
-               return (0);
-       flags |= EXT2_NODUMP_FL;
-       r = ioctl(fd, EXT2_IOC_SETFLAGS, &flags);
-       if (r < 0)
-               return (0);
-       close(fd);
-       fd = open(path, O_RDONLY | O_NONBLOCK);
-       if (fd < 0)
-               return (0);
-       r = ioctl(fd, EXT2_IOC_GETFLAGS, &flags);
-       if (r < 0)
-               return (0);
-       close(fd);
-       if (flags & EXT2_NODUMP_FL)
-               return (1);
-       return (0);
-}
-
-#else
-
-int
-canNodump()
-{
-       return (0);
-}
-
-#endif
-
-/*
- * Sleep as needed; useful for verifying disk timestamp changes by
- * ensuring that the wall-clock time has actually changed before we
- * go back to re-read something from disk.
- */
-void
-sleepUntilAfter(time_t t)
-{
-       while (t >= time(NULL))
-#if defined(_WIN32) && !defined(__CYGWIN__)
-               Sleep(500);
-#else
-               sleep(1);
-#endif
-}
-
-/*
- * Call standard system() call, but build up the command line using
- * sprintf() conventions.
- */
-int
-systemf(const char *fmt, ...)
-{
-       char buff[8192];
-       va_list ap;
-       int r;
-
-       va_start(ap, fmt);
-       vsprintf(buff, fmt, ap);
-       if (verbosity > VERBOSITY_FULL)
-               logprintf("Cmd: %s\n", buff);
-       r = system(buff);
-       va_end(ap);
-       return (r);
-}
-
-/*
- * Slurp a file into memory for ease of comparison and testing.
- * Returns size of file in 'sizep' if non-NULL, null-terminates
- * data in memory for ease of use.
- */
-char *
-slurpfile(size_t * sizep, const char *fmt, ...)
-{
-       char filename[8192];
-       struct stat st;
-       va_list ap;
-       char *p;
-       ssize_t bytes_read;
-       FILE *f;
-       int r;
-
-       va_start(ap, fmt);
-       vsprintf(filename, fmt, ap);
-       va_end(ap);
-
-       f = fopen(filename, "rb");
-       if (f == NULL) {
-               /* Note: No error; non-existent file is okay here. */
-               return (NULL);
-       }
-       r = fstat(fileno(f), &st);
-       if (r != 0) {
-               logprintf("Can't stat file %s\n", filename);
-               fclose(f);
-               return (NULL);
-       }
-       p = malloc((size_t)st.st_size + 1);
-       if (p == NULL) {
-               logprintf("Can't allocate %ld bytes of memory to read file %s\n",
-                   (long int)st.st_size, filename);
-               fclose(f);
-               return (NULL);
-       }
-       bytes_read = fread(p, 1, (size_t)st.st_size, f);
-       if (bytes_read < st.st_size) {
-               logprintf("Can't read file %s\n", filename);
-               fclose(f);
-               free(p);
-               return (NULL);
-       }
-       p[st.st_size] = '\0';
-       if (sizep != NULL)
-               *sizep = (size_t)st.st_size;
-       fclose(f);
-       return (p);
-}
-
-/*
- * Slurp a file into memory for ease of comparison and testing.
- * Returns size of file in 'sizep' if non-NULL, null-terminates
- * data in memory for ease of use.
- */
-void
-dumpfile(const char *filename, void *data, size_t len)
-{
-       ssize_t bytes_written;
-       FILE *f;
-
-       f = fopen(filename, "wb");
-       if (f == NULL) {
-               logprintf("Can't open file %s for writing\n", filename);
-               return;
-       }
-       bytes_written = fwrite(data, 1, len, f);
-       if (bytes_written < (ssize_t)len)
-               logprintf("Can't write file %s\n", filename);
-       fclose(f);
-}
-
-/* Read a uuencoded file from the reference directory, decode, and
- * write the result into the current directory. */
-#define VALID_UUDECODE(c) (c >= 32 && c <= 96)
-#define        UUDECODE(c) (((c) - 0x20) & 0x3f)
-void
-extract_reference_file(const char *name)
-{
-       char buff[1024];
-       FILE *in, *out;
-
-       sprintf(buff, "%s/%s.uu", refdir, name);
-       in = fopen(buff, "r");
-       failure("Couldn't open reference file %s", buff);
-       assert(in != NULL);
-       if (in == NULL)
-               return;
-       /* Read up to and including the 'begin' line. */
-       for (;;) {
-               if (fgets(buff, sizeof(buff), in) == NULL) {
-                       /* TODO: This is a failure. */
-                       goto done;
-               }
-               if (memcmp(buff, "begin ", 6) == 0)
-                       break;
-       }
-       /* Now, decode the rest and write it. */
-       out = fopen(name, "wb");
-       while (fgets(buff, sizeof(buff), in) != NULL) {
-               char *p = buff;
-               int bytes;
-
-               if (memcmp(buff, "end", 3) == 0)
-                       break;
-
-               bytes = UUDECODE(*p++);
-               while (bytes > 0) {
-                       int n = 0;
-                       /* Write out 1-3 bytes from that. */
-                       if (bytes > 0) {
-                               assert(VALID_UUDECODE(p[0]));
-                               assert(VALID_UUDECODE(p[1]));
-                               n = UUDECODE(*p++) << 18;
-                               n |= UUDECODE(*p++) << 12;
-                               fputc(n >> 16, out);
-                               --bytes;
-                       }
-                       if (bytes > 0) {
-                               assert(VALID_UUDECODE(p[0]));
-                               n |= UUDECODE(*p++) << 6;
-                               fputc((n >> 8) & 0xFF, out);
-                               --bytes;
-                       }
-                       if (bytes > 0) {
-                               assert(VALID_UUDECODE(p[0]));
-                               n |= UUDECODE(*p++);
-                               fputc(n & 0xFF, out);
-                               --bytes;
-                       }
-               }
-       }
-       fclose(out);
-done:
-       fclose(in);
-}
-
-void
-copy_reference_file(const char *name)
-{
-       char buff[1024];
-       FILE *in, *out;
-       size_t rbytes;
-
-       sprintf(buff, "%s/%s", refdir, name);
-       in = fopen(buff, "rb");
-       failure("Couldn't open reference file %s", buff);
-       assert(in != NULL);
-       if (in == NULL)
-               return;
-       /* Now, decode the rest and write it. */
-       /* Not a lot of error checking here; the input better be right. */
-       out = fopen(name, "wb");
-       while ((rbytes = fread(buff, 1, sizeof(buff), in)) > 0) {
-               if (fwrite(buff, 1, rbytes, out) != rbytes) {
-                       logprintf("Error: fwrite\n");
-                       break;
-               }
-       }
-       fclose(out);
-       fclose(in);
-}
-
-int
-is_LargeInode(const char *file)
-{
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       BY_HANDLE_FILE_INFORMATION bhfi;
-       int r;
-
-       r = my_GetFileInformationByName(file, &bhfi);
-       if (r != 0)
-               return (0);
-       return (bhfi.nFileIndexHigh & 0x0000FFFFUL);
-#else
-       struct stat st;
-       int64_t ino;
-
-       if (stat(file, &st) < 0)
-               return (0);
-       ino = (int64_t)st.st_ino;
-       return (ino > 0xffffffff);
-#endif
-}
-
-void
-extract_reference_files(const char **names)
-{
-       while (names && *names)
-               extract_reference_file(*names++);
-}
-
-/*
- *
- * TEST management
- *
- */
-
-/*
- * "list.h" is simply created by "grep DEFINE_TEST test_*.c"; it has
- * a line like
- *      DEFINE_TEST(test_function)
- * for each test.
- */
-
-/* Use "list.h" to declare all of the test functions. */
-#undef DEFINE_TEST
-#define        DEFINE_TEST(name) void name(void);
-#include "list.h"
-
-/* Use "list.h" to create a list of all tests (functions and names). */
-#undef DEFINE_TEST
-#define        DEFINE_TEST(n) { n, #n, 0 },
-struct test_list_t tests[] = {
-       #include "list.h"
-};
-
-/*
- * Summarize repeated failures in the just-completed test.
- */
-static void
-test_summarize(int failed, int skips_num)
-{
-       unsigned int i;
-
-       switch (verbosity) {
-       case VERBOSITY_SUMMARY_ONLY:
-               printf(failed ? "E" : ".");
-               fflush(stdout);
-               break;
-       case VERBOSITY_PASSFAIL:
-               printf(failed ? "FAIL\n" : skips_num ? "ok (S)\n" : "ok\n");
-               break;
-       }
-
-       log_console = (verbosity == VERBOSITY_LIGHT_REPORT);
-
-       for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) {
-               if (failed_lines[i].count > 1 && !failed_lines[i].skip)
-                       logprintf("%s:%d: Summary: Failed %d times\n",
-                           failed_filename, i, failed_lines[i].count);
-       }
-       /* Clear the failure history for the next file. */
-       failed_filename = NULL;
-       memset(failed_lines, 0, sizeof(failed_lines));
-}
-
-/*
- * Actually run a single test, with appropriate setup and cleanup.
- */
-static int
-test_run(int i, const char *tmpdir)
-{
-       char workdir[1024];
-       char logfilename[64];
-       int failures_before = failures;
-       int skips_before = skips;
-       int oldumask;
-
-       switch (verbosity) {
-       case VERBOSITY_SUMMARY_ONLY: /* No per-test reports at all */
-               break;
-       case VERBOSITY_PASSFAIL: /* rest of line will include ok/FAIL marker */
-               printf("%3d: %-64s", i, tests[i].name);
-               fflush(stdout);
-               break;
-       default: /* Title of test, details will follow */
-               printf("%3d: %s\n", i, tests[i].name);
-       }
-
-       /* Chdir to the top-level work directory. */
-       if (!assertChdir(tmpdir)) {
-               fprintf(stderr,
-                   "ERROR: Can't chdir to top work dir %s\n", tmpdir);
-               exit(1);
-       }
-       /* Create a log file for this test. */
-       sprintf(logfilename, "%s.log", tests[i].name);
-       logfile = fopen(logfilename, "w");
-       fprintf(logfile, "%s\n\n", tests[i].name);
-       /* Chdir() to a work dir for this specific test. */
-       snprintf(workdir, sizeof(workdir), "%s/%s", tmpdir, tests[i].name);
-       testworkdir = workdir;
-       if (!assertMakeDir(testworkdir, 0755)
-           || !assertChdir(testworkdir)) {
-               fprintf(stderr,
-                   "ERROR: Can't chdir to work dir %s\n", testworkdir);
-               exit(1);
-       }
-       /* Explicitly reset the locale before each test. */
-       setlocale(LC_ALL, "C");
-       /* Record the umask before we run the test. */
-       umask(oldumask = umask(0));
-       /*
-        * Run the actual test.
-        */
-       (*tests[i].func)();
-       /*
-        * Clean up and report afterwards.
-        */
-       testworkdir = NULL;
-       /* Restore umask */
-       umask(oldumask);
-       /* Reset locale. */
-       setlocale(LC_ALL, "C");
-       /* Reset directory. */
-       if (!assertChdir(tmpdir)) {
-               fprintf(stderr, "ERROR: Couldn't chdir to temp dir %s\n",
-                   tmpdir);
-               exit(1);
-       }
-       /* Report per-test summaries. */
-       tests[i].failures = failures - failures_before;
-       test_summarize(tests[i].failures, skips - skips_before);
-       /* Close the per-test log file. */
-       fclose(logfile);
-       logfile = NULL;
-       /* If there were no failures, we can remove the work dir and logfile. */
-       if (tests[i].failures == 0) {
-               if (!keep_temp_files && assertChdir(tmpdir)) {
-#if defined(_WIN32) && !defined(__CYGWIN__)
-                       /* Make sure not to leave empty directories.
-                        * Sometimes a processing of closing files used by tests
-                        * is not done, then rmdir will be failed and it will
-                        * leave a empty test directory. So we should wait a few
-                        * seconds and retry rmdir. */
-                       int r, t;
-                       for (t = 0; t < 10; t++) {
-                               if (t > 0)
-                                       Sleep(1000);
-                               r = systemf("rmdir /S /Q %s", tests[i].name);
-                               if (r == 0)
-                                       break;
-                       }
-                       systemf("del %s", logfilename);
-#else
-                       systemf("rm -rf %s", tests[i].name);
-                       systemf("rm %s", logfilename);
-#endif
-               }
-       }
-       /* Return appropriate status. */
-       return (tests[i].failures);
-}
-
-/*
- *
- *
- * MAIN and support routines.
- *
- *
- */
-
-static void
-usage(const char *program)
-{
-       static const int limit = sizeof(tests) / sizeof(tests[0]);
-       int i;
-
-       printf("Usage: %s [options] <test> <test> ...\n", program);
-       printf("Default is to run all tests.\n");
-       printf("Otherwise, specify the numbers of the tests you wish to run.\n");
-       printf("Options:\n");
-       printf("  -d  Dump core after any failure, for debugging.\n");
-       printf("  -k  Keep all temp files.\n");
-       printf("      Default: temp files for successful tests deleted.\n");
-#ifdef PROGRAM
-       printf("  -p <path>  Path to executable to be tested.\n");
-       printf("      Default: path taken from " ENVBASE " environment variable.\n");
-#endif
-       printf("  -q  Quiet.\n");
-       printf("  -r <dir>   Path to dir containing reference files.\n");
-       printf("      Default: Current directory.\n");
-       printf("  -u  Keep running specifies tests until one fails.\n");
-       printf("  -v  Verbose.\n");
-       printf("Available tests:\n");
-       for (i = 0; i < limit; i++)
-               printf("  %d: %s\n", i, tests[i].name);
-       exit(1);
-}
-
-static char *
-get_refdir(const char *d)
-{
-       size_t tried_size, buff_size;
-       char *buff, *tried, *pwd = NULL, *p = NULL;
-
-#ifdef PATH_MAX
-       buff_size = PATH_MAX;
-#else
-       buff_size = 8192;
-#endif
-       buff = calloc(buff_size, 1);
-       if (buff == NULL) {
-               fprintf(stderr, "Unable to allocate memory\n");
-               exit(1);
-       }
-
-       /* Allocate a buffer to hold the various directories we checked. */
-       tried_size = buff_size * 2;
-       tried = calloc(tried_size, 1);
-       if (tried == NULL) {
-               fprintf(stderr, "Unable to allocate memory\n");
-               exit(1);
-       }
-
-       /* If a dir was specified, try that */
-       if (d != NULL) {
-               pwd = NULL;
-               snprintf(buff, buff_size, "%s", d);
-               p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-               if (p != NULL) goto success;
-               strncat(tried, buff, tried_size - strlen(tried) - 1);
-               strncat(tried, "\n", tried_size - strlen(tried) - 1);
-               goto failure;
-       }
-
-       /* Get the current dir. */
-#ifdef PATH_MAX
-       pwd = getcwd(NULL, PATH_MAX);/* Solaris getcwd needs the size. */
-#else
-       pwd = getcwd(NULL, 0);
-#endif
-       while (pwd[strlen(pwd) - 1] == '\n')
-               pwd[strlen(pwd) - 1] = '\0';
-
-       /* Look for a known file. */
-       snprintf(buff, buff_size, "%s", pwd);
-       p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-       if (p != NULL) goto success;
-       strncat(tried, buff, tried_size - strlen(tried) - 1);
-       strncat(tried, "\n", tried_size - strlen(tried) - 1);
-
-       snprintf(buff, buff_size, "%s/test", pwd);
-       p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-       if (p != NULL) goto success;
-       strncat(tried, buff, tried_size - strlen(tried) - 1);
-       strncat(tried, "\n", tried_size - strlen(tried) - 1);
-
-#if defined(LIBRARY)
-       snprintf(buff, buff_size, "%s/%s/test", pwd, LIBRARY);
-#else
-       snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM);
-#endif
-       p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-       if (p != NULL) goto success;
-       strncat(tried, buff, tried_size - strlen(tried) - 1);
-       strncat(tried, "\n", tried_size - strlen(tried) - 1);
-
-#if defined(PROGRAM_ALIAS)
-       snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM_ALIAS);
-       p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-       if (p != NULL) goto success;
-       strncat(tried, buff, tried_size - strlen(tried) - 1);
-       strncat(tried, "\n", tried_size - strlen(tried) - 1);
-#endif
-
-       if (memcmp(pwd, "/usr/obj", 8) == 0) {
-               snprintf(buff, buff_size, "%s", pwd + 8);
-               p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-               if (p != NULL) goto success;
-               strncat(tried, buff, tried_size - strlen(tried) - 1);
-               strncat(tried, "\n", tried_size - strlen(tried) - 1);
-
-               snprintf(buff, buff_size, "%s/test", pwd + 8);
-               p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
-               if (p != NULL) goto success;
-               strncat(tried, buff, tried_size - strlen(tried) - 1);
-               strncat(tried, "\n", tried_size - strlen(tried) - 1);
-       }
-
-failure:
-       printf("Unable to locate known reference file %s\n", KNOWNREF);
-       printf("  Checked following directories:\n%s\n", tried);
-       printf("Use -r option to specify full path to reference directory\n");
-#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
-       DebugBreak();
-#endif
-       exit(1);
-
-success:
-       free(p);
-       free(pwd);
-       free(tried);
-
-       /* Copy result into a fresh buffer to reduce memory usage. */
-       p = strdup(buff);
-       free(buff);
-       return p;
-}
-
-int
-main(int argc, char **argv)
-{
-       static const int limit = sizeof(tests) / sizeof(tests[0]);
-       int test_set[sizeof(tests) / sizeof(tests[0])];
-       int i = 0, j = 0, tests_run = 0, tests_failed = 0, option;
-       time_t now;
-       char *refdir_alloc = NULL;
-       const char *progname;
-       char **saved_argv;
-       const char *tmp, *option_arg, *p;
-       char tmpdir[256], *pwd, *testprogdir, *tmp2 = NULL, *vlevel = NULL;
-       char tmpdir_timestamp[256];
-
-       (void)argc; /* UNUSED */
-
-       /* Get the current dir. */
-#ifdef PATH_MAX
-       pwd = getcwd(NULL, PATH_MAX);/* Solaris getcwd needs the size. */
-#else
-       pwd = getcwd(NULL, 0);
-#endif
-       while (pwd[strlen(pwd) - 1] == '\n')
-               pwd[strlen(pwd) - 1] = '\0';
-
-#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__)
-       /* To stop to run the default invalid parameter handler. */
-       _set_invalid_parameter_handler(invalid_parameter_handler);
-       /* Disable annoying assertion message box. */
-       _CrtSetReportMode(_CRT_ASSERT, 0);
-#endif
-
-       /*
-        * Name of this program, used to build root of our temp directory
-        * tree.
-        */
-       progname = p = argv[0];
-       if ((testprogdir = (char *)malloc(strlen(progname) + 1)) == NULL)
-       {
-               fprintf(stderr, "ERROR: Out of memory.");
-               exit(1);
-       }
-       strcpy(testprogdir, progname);
-       while (*p != '\0') {
-               /* Support \ or / dir separators for Windows compat. */
-               if (*p == '/' || *p == '\\')
-               {
-                       progname = p + 1;
-                       i = j;
-               }
-               ++p;
-               j++;
-       }
-       testprogdir[i] = '\0';
-#if defined(_WIN32) && !defined(__CYGWIN__)
-       if (testprogdir[0] != '/' && testprogdir[0] != '\\' &&
-           !(((testprogdir[0] >= 'a' && testprogdir[0] <= 'z') ||
-              (testprogdir[0] >= 'A' && testprogdir[0] <= 'Z')) &&
-               testprogdir[1] == ':' &&
-               (testprogdir[2] == '/' || testprogdir[2] == '\\')))
-#else
-       if (testprogdir[0] != '/')
-#endif
-       {
-               /* Fixup path for relative directories. */
-               if ((testprogdir = (char *)realloc(testprogdir,
-                       strlen(pwd) + 1 + strlen(testprogdir) + 1)) == NULL)
-               {
-                       fprintf(stderr, "ERROR: Out of memory.");
-                       exit(1);
-               }
-               memmove(testprogdir + strlen(pwd) + 1, testprogdir,
-                   strlen(testprogdir) + 1);
-               memcpy(testprogdir, pwd, strlen(pwd));
-               testprogdir[strlen(pwd)] = '/';
-       }
-
-#ifdef PROGRAM
-       /* Get the target program from environment, if available. */
-       testprogfile = getenv(ENVBASE);
-#endif
-
-       if (getenv("TMPDIR") != NULL)
-               tmp = getenv("TMPDIR");
-       else if (getenv("TMP") != NULL)
-               tmp = getenv("TMP");
-       else if (getenv("TEMP") != NULL)
-               tmp = getenv("TEMP");
-       else if (getenv("TEMPDIR") != NULL)
-               tmp = getenv("TEMPDIR");
-       else
-               tmp = "/tmp";
-
-       /* Allow -d to be controlled through the environment. */
-       if (getenv(ENVBASE "_DEBUG") != NULL)
-               dump_on_failure = 1;
-
-       /* Allow -v to be controlled through the environment. */
-       if (getenv("_VERBOSITY_LEVEL") != NULL)
-       {
-               vlevel = getenv("_VERBOSITY_LEVEL");
-               verbosity = atoi(vlevel);
-               if (verbosity < VERBOSITY_SUMMARY_ONLY || verbosity > VERBOSITY_FULL)
-               {
-                       /* Unsupported verbosity levels are silently ignored */
-                       vlevel = NULL;
-                       verbosity = VERBOSITY_PASSFAIL;
-               }
-       }
-
-       /* Get the directory holding test files from environment. */
-       refdir = getenv(ENVBASE "_TEST_FILES");
-
-       /*
-        * Parse options, without using getopt(), which isn't available
-        * on all platforms.
-        */
-       ++argv; /* Skip program name */
-       while (*argv != NULL) {
-               if (**argv != '-')
-                       break;
-               p = *argv++;
-               ++p; /* Skip '-' */
-               while (*p != '\0') {
-                       option = *p++;
-                       option_arg = NULL;
-                       /* If 'opt' takes an argument, parse that. */
-                       if (option == 'p' || option == 'r') {
-                               if (*p != '\0')
-                                       option_arg = p;
-                               else if (*argv == NULL) {
-                                       fprintf(stderr,
-                                           "Option -%c requires argument.\n",
-                                           option);
-                                       usage(progname);
-                               } else
-                                       option_arg = *argv++;
-                               p = ""; /* End of this option word. */
-                       }
-
-                       /* Now, handle the option. */
-                       switch (option) {
-                       case 'd':
-                               dump_on_failure = 1;
-                               break;
-                       case 'k':
-                               keep_temp_files = 1;
-                               break;
-                       case 'p':
-#ifdef PROGRAM
-                               testprogfile = option_arg;
-#else
-                               fprintf(stderr, "-p option not permitted\n");
-                               usage(progname);
-#endif
-                               break;
-                       case 'q':
-                               if (!vlevel)
-                                       verbosity--;
-                               break;
-                       case 'r':
-                               refdir = option_arg;
-                               break;
-                       case 'u':
-                               until_failure++;
-                               break;
-                       case 'v':
-                               if (!vlevel)
-                                       verbosity++;
-                               break;
-                       default:
-                               fprintf(stderr, "Unrecognized option '%c'\n",
-                                   option);
-                               usage(progname);
-                       }
-               }
-       }
-
-       /*
-        * Sanity-check that our options make sense.
-        */
-#ifdef PROGRAM
-       if (testprogfile == NULL)
-       {
-               if ((tmp2 = (char *)malloc(strlen(testprogdir) + 1 +
-                       strlen(PROGRAM) + 1)) == NULL)
-               {
-                       fprintf(stderr, "ERROR: Out of memory.");
-                       exit(1);
-               }
-               strcpy(tmp2, testprogdir);
-               strcat(tmp2, "/");
-               strcat(tmp2, PROGRAM);
-               testprogfile = tmp2;
-       }
-
-       {
-               char *testprg;
-#if defined(_WIN32) && !defined(__CYGWIN__)
-               /* Command.com sometimes rejects '/' separators. */
-               testprg = strdup(testprogfile);
-               for (i = 0; testprg[i] != '\0'; i++) {
-                       if (testprg[i] == '/')
-                               testprg[i] = '\\';
-               }
-               testprogfile = testprg;
-#endif
-               /* Quote the name that gets put into shell command lines. */
-               testprg = malloc(strlen(testprogfile) + 3);
-               strcpy(testprg, "\"");
-               strcat(testprg, testprogfile);
-               strcat(testprg, "\"");
-               testprog = testprg;
-       }
-#endif
-
-#if !defined(_WIN32) && defined(SIGPIPE)
-       {   /* Ignore SIGPIPE signals */
-               struct sigaction sa;
-               sa.sa_handler = SIG_IGN;
-               sigemptyset(&sa.sa_mask);
-               sa.sa_flags = 0;
-               sigaction(SIGPIPE, &sa, NULL);
-       }
-#endif
-
-       /*
-        * Create a temp directory for the following tests.
-        * Include the time the tests started as part of the name,
-        * to make it easier to track the results of multiple tests.
-        */
-       now = time(NULL);
-       for (i = 0; ; i++) {
-               strftime(tmpdir_timestamp, sizeof(tmpdir_timestamp),
-                   "%Y-%m-%dT%H.%M.%S",
-                   localtime(&now));
-               snprintf(tmpdir, sizeof(tmpdir), "%s/%s.%s-%03d", tmp,
-                   progname, tmpdir_timestamp, i);
-               if (assertMakeDir(tmpdir,0755))
-                       break;
-               if (i >= 999) {
-                       fprintf(stderr,
-                           "ERROR: Unable to create temp directory %s\n",
-                           tmpdir);
-                       exit(1);
-               }
-       }
-
-       /*
-        * If the user didn't specify a directory for locating
-        * reference files, try to find the reference files in
-        * the "usual places."
-        */
-       refdir = refdir_alloc = get_refdir(refdir);
-
-       /*
-        * Banner with basic information.
-        */
-       printf("\n");
-       printf("If tests fail or crash, details will be in:\n");
-       printf("   %s\n", tmpdir);
-       printf("\n");
-       if (verbosity > VERBOSITY_SUMMARY_ONLY) {
-               printf("Reference files will be read from: %s\n", refdir);
-#ifdef PROGRAM
-               printf("Running tests on: %s\n", testprog);
-#endif
-               printf("Exercising: ");
-               fflush(stdout);
-               printf("%s\n", EXTRA_VERSION);
-       } else {
-               printf("Running ");
-               fflush(stdout);
-       }
-
-       /*
-        * Run some or all of the individual tests.
-        */
-       saved_argv = argv;
-       do {
-               argv = saved_argv;
-               do {
-                       int test_num;
-
-                       test_num = get_test_set(test_set, limit, *argv, tests);
-                       if (test_num < 0) {
-                               printf("*** INVALID Test %s\n", *argv);
-                               free(refdir_alloc);
-                               free(testprogdir);
-                               usage(progname);
-                               return (1);
-                       }
-                       for (i = 0; i < test_num; i++) {
-                               tests_run++;
-                               if (test_run(test_set[i], tmpdir)) {
-                                       tests_failed++;
-                                       if (until_failure)
-                                               goto finish;
-                               }
-                       }
-                       if (*argv != NULL)
-                               argv++;
-               } while (*argv != NULL);
-       } while (until_failure);
-
-finish:
-       /* Must be freed after all tests run */
-       free(tmp2);
-       free(testprogdir);
-       free(pwd);
-
-       /*
-        * Report summary statistics.
-        */
-       if (verbosity > VERBOSITY_SUMMARY_ONLY) {
-               printf("\n");
-               printf("Totals:\n");
-               printf("  Tests run:         %8d\n", tests_run);
-               printf("  Tests failed:      %8d\n", tests_failed);
-               printf("  Assertions checked:%8d\n", assertions);
-               printf("  Assertions failed: %8d\n", failures);
-               printf("  Skips reported:    %8d\n", skips);
-       }
-       if (failures) {
-               printf("\n");
-               printf("Failing tests:\n");
-               for (i = 0; i < limit; ++i) {
-                       if (tests[i].failures)
-                               printf("  %d: %s (%d failures)\n", i,
-                                   tests[i].name, tests[i].failures);
-               }
-               printf("\n");
-               printf("Details for failing tests: %s\n", tmpdir);
-               printf("\n");
-       } else {
-               if (verbosity == VERBOSITY_SUMMARY_ONLY)
-                       printf("\n");
-               printf("%d tests passed, no failures\n", tests_run);
-       }
-
-       free(refdir_alloc);
-
-       /* If the final tmpdir is empty, we can remove it. */
-       /* This should be the usual case when all tests succeed. */
-       assertChdir("..");
-       rmdir(tmpdir);
-
-       return (tests_failed ? 1 : 0);
-}
index 3a23a05..1e1bee8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003-2006 Tim Kientzle
+ * Copyright (c) 2003-2017 Tim Kientzle
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/usr.bin/tar/test/test.h,v 1.4 2008/08/21 07:04:57 kientzle Exp $
+ * $FreeBSD$
  */
 
 /* Every test program should #include "test.h" as the first thing. */
 
-/*
- * The goal of this file (and the matching test.c) is to
- * simplify the very repetitive test-*.c test programs.
- */
-#if defined(HAVE_CONFIG_H)
-/* Most POSIX platforms use the 'configure' script to build config.h */
-#include "config.h"
-#elif defined(__FreeBSD__)
-/* Building as part of FreeBSD system requires a pre-built config.h. */
-#include "config_freebsd.h"
-#elif defined(_WIN32) && !defined(__CYGWIN__)
-/* Win32 can't run the 'configure' script. */
-#include "config_windows.h"
-#else
-/* Warn if the library hasn't been (automatically or manually) configured. */
-#error Oops: No config.h and no pre-built configuration in test.h.
-#endif
-
-#include <sys/types.h>  /* Windows requires this before sys/stat.h */
-#include <sys/stat.h>
-
-#if HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-#ifdef HAVE_DIRECT_H
-#include <direct.h>
-#define dirent direct
-#endif
-#include <errno.h>
-#include <fcntl.h>
-#ifdef HAVE_IO_H
-#include <io.h>
-#endif
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <wchar.h>
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
-/*
- * System-specific tweaks.  We really want to minimize these
- * as much as possible, since they make it harder to understand
- * the mainline code.
- */
-
-/* Windows (including Visual Studio and MinGW but not Cygwin) */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#if !defined(__BORLANDC__)
-#undef chdir
-#define chdir _chdir
-#define strdup _strdup
-#endif
-#endif
-
-/* Visual Studio */
-#if defined(_MSC_VER) && _MSC_VER < 1900
-#define snprintf       sprintf_s
-#endif
-
-#if defined(__BORLANDC__)
-#pragma warn -8068     /* Constant out of range in comparison. */
-#endif
-
-/* Haiku OS and QNX */
-#if defined(__HAIKU__) || defined(__QNXNTO__)
-/* Haiku and QNX have typedefs in stdint.h (needed for int64_t) */
-#include <stdint.h>
-#endif
-
-/* Get a real definition for __FBSDID if we can */
-#if HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-
-/* If not, define it so as to avoid dangling semicolons. */
-#ifndef __FBSDID
-#define        __FBSDID(a)     struct _undefined_hack
-#endif
-
-#ifndef O_BINARY
-#define        O_BINARY 0
-#endif
-
-/*
- * Redefine DEFINE_TEST for use in defining the test functions.
- */
-#undef DEFINE_TEST
-#define DEFINE_TEST(name) void name(void); void name(void)
-
-/* An implementation of the standard assert() macro */
-#define assert(e)   assertion_assert(__FILE__, __LINE__, (e), #e, NULL)
-/* chdir() and error if it fails */
-#define assertChdir(path)  \
-  assertion_chdir(__FILE__, __LINE__, path)
-/* Assert two integers are the same.  Reports value of each one if not. */
-#define assertEqualInt(v1,v2) \
-  assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-/* Assert two strings are the same.  Reports value of each one if not. */
-#define assertEqualString(v1,v2)   \
-  assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 0)
-#define assertEqualUTF8String(v1,v2)   \
-  assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 1)
-/* As above, but v1 and v2 are wchar_t * */
-#define assertEqualWString(v1,v2)   \
-  assertion_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-/* As above, but raw blocks of bytes. */
-#define assertEqualMem(v1, v2, l)      \
-  assertion_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
-/* Assert that memory is full of a specified byte */
-#define assertMemoryFilledWith(v1, l, b)                                       \
-  assertion_memory_filled_with(__FILE__, __LINE__, (v1), #v1, (l), #l, (b), #b, NULL)
-/* Assert two files are the same. */
-#define assertEqualFile(f1, f2)        \
-  assertion_equal_file(__FILE__, __LINE__, (f1), (f2))
-/* Assert that a file is empty. */
-#define assertEmptyFile(pathname)      \
-  assertion_empty_file(__FILE__, __LINE__, (pathname))
-/* Assert that a file is not empty. */
-#define assertNonEmptyFile(pathname)           \
-  assertion_non_empty_file(__FILE__, __LINE__, (pathname))
-#define assertFileAtime(pathname, sec, nsec)   \
-  assertion_file_atime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileAtimeRecent(pathname)        \
-  assertion_file_atime_recent(__FILE__, __LINE__, pathname)
-#define assertFileBirthtime(pathname, sec, nsec)       \
-  assertion_file_birthtime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileBirthtimeRecent(pathname) \
-  assertion_file_birthtime_recent(__FILE__, __LINE__, pathname)
-/* Assert that a file exists; supports printf-style arguments. */
-#define assertFileExists(pathname) \
-  assertion_file_exists(__FILE__, __LINE__, pathname)
-/* Assert that a file exists. */
-#define assertFileNotExists(pathname) \
-  assertion_file_not_exists(__FILE__, __LINE__, pathname)
-/* Assert that file contents match a string. */
-#define assertFileContents(data, data_size, pathname) \
-  assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname)
-/* Verify that a file does not contain invalid strings */
-#define assertFileContainsNoInvalidStrings(pathname, strings) \
-  assertion_file_contains_no_invalid_strings(__FILE__, __LINE__, pathname, strings)
-#define assertFileMtime(pathname, sec, nsec)   \
-  assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileMtimeRecent(pathname) \
-  assertion_file_mtime_recent(__FILE__, __LINE__, pathname)
-#define assertFileNLinks(pathname, nlinks)  \
-  assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
-#define assertFileSize(pathname, size)  \
-  assertion_file_size(__FILE__, __LINE__, pathname, size)
-#define assertFileMode(pathname, mode)  \
-  assertion_file_mode(__FILE__, __LINE__, pathname, mode)
-#define assertTextFileContents(text, pathname) \
-  assertion_text_file_contents(__FILE__, __LINE__, text, pathname)
-#define assertFileContainsLinesAnyOrder(pathname, lines)       \
-  assertion_file_contains_lines_any_order(__FILE__, __LINE__, pathname, lines)
-#define assertIsDir(pathname, mode)            \
-  assertion_is_dir(__FILE__, __LINE__, pathname, mode)
-#define assertIsHardlink(path1, path2) \
-  assertion_is_hardlink(__FILE__, __LINE__, path1, path2)
-#define assertIsNotHardlink(path1, path2)      \
-  assertion_is_not_hardlink(__FILE__, __LINE__, path1, path2)
-#define assertIsReg(pathname, mode)            \
-  assertion_is_reg(__FILE__, __LINE__, pathname, mode)
-#define assertIsSymlink(pathname, contents)    \
-  assertion_is_symlink(__FILE__, __LINE__, pathname, contents)
-/* Create a directory, report error if it fails. */
-#define assertMakeDir(dirname, mode)   \
-  assertion_make_dir(__FILE__, __LINE__, dirname, mode)
-#define assertMakeFile(path, mode, contents) \
-  assertion_make_file(__FILE__, __LINE__, path, mode, -1, contents)
-#define assertMakeBinFile(path, mode, csize, contents) \
-  assertion_make_file(__FILE__, __LINE__, path, mode, csize, contents)
-#define assertMakeHardlink(newfile, oldfile)   \
-  assertion_make_hardlink(__FILE__, __LINE__, newfile, oldfile)
-#define assertMakeSymlink(newfile, linkto)     \
-  assertion_make_symlink(__FILE__, __LINE__, newfile, linkto)
-#define assertNodump(path)      \
-  assertion_nodump(__FILE__, __LINE__, path)
-#define assertUmask(mask)      \
-  assertion_umask(__FILE__, __LINE__, mask)
-#define assertUtimes(pathname, atime, atime_nsec, mtime, mtime_nsec)   \
-  assertion_utimes(__FILE__, __LINE__, pathname, atime, atime_nsec, mtime, mtime_nsec)
-
-/*
- * This would be simple with C99 variadic macros, but I don't want to
- * require that.  Instead, I insert a function call before each
- * skipping() call to pass the file and line information down.  Crude,
- * but effective.
- */
-#define skipping       \
-  skipping_setup(__FILE__, __LINE__);test_skipping
-
-/* Function declarations.  These are defined in test_utility.c. */
-void failure(const char *fmt, ...);
-int assertion_assert(const char *, int, int, const char *, void *);
-int assertion_chdir(const char *, int, const char *);
-int assertion_empty_file(const char *, int, const char *);
-int assertion_equal_file(const char *, int, const char *, const char *);
-int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *);
-int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *);
-int assertion_memory_filled_with(const char *, int, const void *, const char *, size_t, const char *, char, const char *, void *);
-int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *, int);
-int assertion_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
-int assertion_file_atime(const char *, int, const char *, long, long);
-int assertion_file_atime_recent(const char *, int, const char *);
-int assertion_file_birthtime(const char *, int, const char *, long, long);
-int assertion_file_birthtime_recent(const char *, int, const char *);
-int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
-int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **);
-int assertion_file_contents(const char *, int, const void *, int, const char *);
-int assertion_file_exists(const char *, int, const char *);
-int assertion_file_mode(const char *, int, const char *, int);
-int assertion_file_mtime(const char *, int, const char *, long, long);
-int assertion_file_mtime_recent(const char *, int, const char *);
-int assertion_file_nlinks(const char *, int, const char *, int);
-int assertion_file_not_exists(const char *, int, const char *);
-int assertion_file_size(const char *, int, const char *, long);
-int assertion_is_dir(const char *, int, const char *, int);
-int assertion_is_hardlink(const char *, int, const char *, const char *);
-int assertion_is_not_hardlink(const char *, int, const char *, const char *);
-int assertion_is_reg(const char *, int, const char *, int);
-int assertion_is_symlink(const char *, int, const char *, const char *);
-int assertion_make_dir(const char *, int, const char *, int);
-int assertion_make_file(const char *, int, const char *, int, int, const void *);
-int assertion_make_hardlink(const char *, int, const char *newpath, const char *);
-int assertion_make_symlink(const char *, int, const char *newpath, const char *);
-int assertion_nodump(const char *, int, const char *);
-int assertion_non_empty_file(const char *, int, const char *);
-int assertion_text_file_contents(const char *, int, const char *buff, const char *f);
-int assertion_umask(const char *, int, int);
-int assertion_utimes(const char *, int, const char *, long, long, long, long );
-
-void skipping_setup(const char *, int);
-void test_skipping(const char *fmt, ...);
-
-/* Like sprintf, then system() */
-int systemf(const char * fmt, ...);
-
-/* Delay until time() returns a value after this. */
-void sleepUntilAfter(time_t);
-
-/* Return true if this platform can create symlinks. */
-int canSymlink(void);
-
-/* Return true if this platform can run the "bzip2" program. */
-int canBzip2(void);
-
-/* Return true if this platform can run the "grzip" program. */
-int canGrzip(void);
-
-/* Return true if this platform can run the "gzip" program. */
-int canGzip(void);
-
-/* Return true if this platform can run the specified command. */
-int canRunCommand(const char *);
-
-/* Return true if this platform can run the "lrzip" program. */
-int canLrzip(void);
-
-/* Return true if this platform can run the "lz4" program. */
-int canLz4(void);
-
-/* Return true if this platform can run the "lzip" program. */
-int canLzip(void);
-
-/* Return true if this platform can run the "lzma" program. */
-int canLzma(void);
-
-/* Return true if this platform can run the "lzop" program. */
-int canLzop(void);
-
-/* Return true if this platform can run the "xz" program. */
-int canXz(void);
-
-/* Return true if this filesystem can handle nodump flags. */
-int canNodump(void);
-
-/* Return true if the file has large i-node number(>0xffffffff). */
-int is_LargeInode(const char *);
-
-/* Suck file into string allocated via malloc(). Call free() when done. */
-/* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
-char *slurpfile(size_t *, const char *fmt, ...);
-
-/* Dump block of bytes to a file. */
-void dumpfile(const char *filename, void *, size_t);
-
-/* Extracts named reference file to the current directory. */
-void extract_reference_file(const char *);
-/* Copies named reference file to the current directory. */
-void copy_reference_file(const char *);
-
-/* Extracts a list of files to the current directory.
- * List must be NULL terminated.
- */
-void extract_reference_files(const char **);
-
-/* Subtract umask from mode */
-mode_t umasked(mode_t expected_mode);
-
-/* Path to working directory for current test */
-extern const char *testworkdir;
-
-/*
- * Special interfaces for program test harness.
- */
-
-/* Pathname of exe to be tested. */
-extern const char *testprogfile;
-/* Name of exe to use in printf-formatted command strings. */
-/* On Windows, this includes leading/trailing quotes. */
-extern const char *testprog;
-
-#ifdef USE_DMALLOC
-#include <dmalloc.h>
-#endif
+#define KNOWNREF       "test_patterns_2.tar.uu"
+#define ENVBASE "BSDTAR"  /* Prefix for environment variables. */
+#define        PROGRAM "bsdtar"  /* Name of program being tested. */
+#define PROGRAM_ALIAS "tar" /* Generic alias for program */
+#undef LIBRARY           /* Not testing a library. */
+#undef EXTRA_DUMP        /* How to dump extra data */
+#undef EXTRA_ERRNO       /* How to dump errno */
+/* How to generate extra version info. */
+#define        EXTRA_VERSION    (systemf("%s --version", testprog) ? "" : "")
+
+#include "test_common.h"
index 0c904d7..1b896c0 100644 (file)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2003-2017 Tim Kientzle
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -23,7 +23,6 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_version.c,v 1.2 2008/05/26 17:10:10 kientzle Exp $");
 
 /*
  * Test that --version option works and generates reasonable output.
@@ -31,73 +30,5 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/test/test_version.c,v 1.2 2008/05/26 17:10:1
 
 DEFINE_TEST(test_version)
 {
-       int r;
-       char *p, *q;
-       size_t s;
-
-
-       r = systemf("%s --version >version.stdout 2>version.stderr", testprog);
-       if (r != 0)
-               r = systemf("%s -W version >version.stdout 2>version.stderr",
-                   testprog);
-       failure("Unable to run either %s --version or %s -W version",
-           testprog, testprog);
-       if (!assert(r == 0))
-               return;
-
-       /* --version should generate nothing to stdout. */
-       assertEmptyFile("version.stderr");
-       /* Verify format of version message. */
-       q = p = slurpfile(&s, "version.stdout");
-       /* Version message should start with name of program, then space. */
-       assert(s > 6);
-       failure("Version must start with 'bsdtar': ``%s''", p);
-       if (!assertEqualMem(q, "bsdtar ", 7))
-               goto done;
-       q += 7; s -= 7;
-       /* Version number is a series of digits and periods. */
-       while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
-               ++q;
-               --s;
-       }
-       /* Version number terminated by space. */
-       failure("No space after bsdtar version: ``%s''", p);
-       assert(s > 1);
-       /* Skip a single trailing a,b,c, or d. */
-       if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
-               ++q;
-       failure("No space after bsdtar version: ``%s''", p);
-       assert(*q == ' ');
-       ++q; --s;
-       /* Separator. */
-       failure("No `-' between bsdtar and libarchive versions: ``%s''", p);
-       assertEqualMem(q, "- ", 2);
-       q += 2; s -= 2;
-       /* libarchive name and version number */
-       failure("Not long enough for libarchive version: ``%s''", p);
-       assert(s > 11);
-       failure("Libarchive version must start with `libarchive': ``%s''", p);
-       assertEqualMem(q, "libarchive ", 11);
-       q += 11; s -= 11;
-       /* Version number is a series of digits and periods. */
-       while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
-               ++q;
-               --s;
-       }
-       /* Skip a single trailing a,b,c, or d. */
-       if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
-               ++q;
-       /* Skip arbitrary third-party version numbers. */
-       while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) {
-               ++q;
-               --s;
-       }
-       /* All terminated by end-of-line. */
-       assert(s >= 1);
-       /* Skip an optional CR character (e.g., Windows) */
-       failure("Version output must end with \\n or \\r\\n");
-       if (*q == '\r') { ++q; --s; }
-       assertEqualMem(q, "\n", 1);
-done:
-       free(p);
+       assertVersion(testprog, "bsdtar");
 }
index 8f65b17..662db5b 100644 (file)
@@ -534,7 +534,7 @@ edit_pathname(struct bsdtar *bsdtar, struct archive_entry *entry)
                }
        }
 
-       if (!bsdtar->option_absolute_paths) {
+       if ((bsdtar->flags & OPTFLAG_ABSOLUTE_PATHS) == 0) {
                /* By default, don't write or restore absolute pathnames. */
                name = strip_absolute_path(bsdtar, name);
                if (*name == '\0')
index 532abb2..9c24566 100644 (file)
@@ -583,7 +583,7 @@ cleanup:
        archive_read_free(bsdtar->diskreader);
        bsdtar->diskreader = NULL;
 
-       if (bsdtar->option_totals) {
+       if (bsdtar->flags & OPTFLAG_TOTALS) {
                fprintf(stderr, "Total bytes written: %s\n",
                    tar_i64toa(archive_filter_bytes(a, -1)));
        }
@@ -606,7 +606,8 @@ archive_names_from_file(struct bsdtar *bsdtar, struct archive *a)
 
        bsdtar->next_line_is_dir = 0;
 
-       lr = lafe_line_reader(bsdtar->names_from_file, bsdtar->option_null);
+       lr = lafe_line_reader(bsdtar->names_from_file,
+           (bsdtar->flags & OPTFLAG_NULL));
        while ((line = lafe_line_reader_next(lr)) != NULL) {
                if (bsdtar->next_line_is_dir) {
                        if (*line != '\0')
@@ -617,7 +618,8 @@ archive_names_from_file(struct bsdtar *bsdtar, struct archive *a)
                                bsdtar->return_value = 1;
                        }
                        bsdtar->next_line_is_dir = 0;
-               } else if (!bsdtar->option_null && strcmp(line, "-C") == 0)
+               } else if (((bsdtar->flags & OPTFLAG_NULL) == 0) &&
+                   strcmp(line, "-C") == 0)
                        bsdtar->next_line_is_dir = 1;
                else {
                        if (*line != '/')
@@ -690,7 +692,7 @@ append_archive(struct bsdtar *bsdtar, struct archive *a, struct archive *ina)
        while (ARCHIVE_OK == (e = archive_read_next_header(ina, &in_entry))) {
                if (archive_match_excluded(bsdtar->matching, in_entry))
                        continue;
-               if (bsdtar->option_interactive &&
+               if ((bsdtar->flags & OPTFLAG_INTERACTIVE) &&
                    !yes("copy '%s'", archive_entry_pathname(in_entry)))
                        continue;
                if (bsdtar->verbose > 1) {
@@ -809,11 +811,11 @@ excluded_callback(struct archive *a, void *_data, struct archive_entry *entry)
 {
        struct bsdtar *bsdtar = (struct bsdtar *)_data;
 
-       if (bsdtar->option_no_subdirs)
+       if (bsdtar->flags & OPTFLAG_NO_SUBDIRS)
                return;
        if (!archive_read_disk_can_descend(a))
                return;
-       if (bsdtar->option_interactive &&
+       if ((bsdtar->flags & OPTFLAG_INTERACTIVE) &&
            !yes("add '%s'", archive_entry_pathname(entry)))
                return;
        archive_read_disk_descend(a);
@@ -844,12 +846,13 @@ metadata_filter(struct archive *a, void *_data, struct archive_entry *entry)
         * check would veto this file, we shouldn't bother
         * the user with it.
         */
-       if (bsdtar->option_interactive &&
+       if ((bsdtar->flags & OPTFLAG_INTERACTIVE) &&
            !yes("add '%s'", archive_entry_pathname(entry)))
                return (0);
 
        /* Note: if user vetoes, we won't descend. */
-       if (!bsdtar->option_no_subdirs && archive_read_disk_can_descend(a))
+       if (((bsdtar->flags & OPTFLAG_NO_SUBDIRS) == 0) &&
+           archive_read_disk_can_descend(a))
                archive_read_disk_descend(a);
 
        return (1);
diff --git a/test_utils/test_common.h b/test_utils/test_common.h
new file mode 100644 (file)
index 0000000..82e8483
--- /dev/null
@@ -0,0 +1,434 @@
+/*
+ * Copyright (c) 2003-2017 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef        TEST_COMMON_H
+#define        TEST_COMMON_H
+
+/*
+ * The goal of this file (and the matching test.c) is to
+ * simplify the very repetitive test-*.c test programs.
+ */
+#if defined(HAVE_CONFIG_H)
+/* Most POSIX platforms use the 'configure' script to build config.h */
+#include "config.h"
+#elif defined(__FreeBSD__)
+/* Building as part of FreeBSD system requires a pre-built config.h. */
+#include "config_freebsd.h"
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+/* Win32 can't run the 'configure' script. */
+#include "config_windows.h"
+#else
+/* Warn if the library hasn't been (automatically or manually) configured. */
+#error Oops: No config.h and no pre-built configuration in test.h.
+#endif
+
+#include <sys/types.h>  /* Windows requires this before sys/stat.h */
+#include <sys/stat.h>
+
+#if HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+#ifdef HAVE_DIRECT_H
+#include <direct.h>
+#define dirent direct
+#endif
+#include <errno.h>
+#include <fcntl.h>
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <time.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <wchar.h>
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
+/*
+ * System-specific tweaks.  We really want to minimize these
+ * as much as possible, since they make it harder to understand
+ * the mainline code.
+ */
+
+/* Windows (including Visual Studio and MinGW but not Cygwin) */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#if !defined(__BORLANDC__)
+#undef chdir
+#define chdir _chdir
+#define strdup _strdup
+#endif
+#endif
+
+/* Visual Studio */
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#define snprintf       sprintf_s
+#endif
+
+#if defined(__BORLANDC__)
+#pragma warn -8068     /* Constant out of range in comparison. */
+#endif
+
+/* Haiku OS and QNX */
+#if defined(__HAIKU__) || defined(__QNXNTO__)
+/* Haiku and QNX have typedefs in stdint.h (needed for int64_t) */
+#include <stdint.h>
+#endif
+
+/* Get a real definition for __FBSDID if we can */
+#if HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+
+/* If not, define it so as to avoid dangling semicolons. */
+#ifndef __FBSDID
+#define        __FBSDID(a)     struct _undefined_hack
+#endif
+
+#ifndef O_BINARY
+#define        O_BINARY 0
+#endif
+
+/*
+ * If this platform has <sys/acl.h>, acl_create(), acl_init(),
+ * acl_set_file(), and ACL_USER, we assume it has the rest of the
+ * POSIX.1e draft functions used in archive_read_extract.c.
+ */
+#if HAVE_SYS_ACL_H && HAVE_ACL_CREATE_ENTRY && HAVE_ACL_INIT && HAVE_ACL_SET_FILE
+#if HAVE_ACL_USER
+#define        HAVE_POSIX_ACL  1
+#elif HAVE_ACL_TYPE_EXTENDED
+#define        HAVE_DARWIN_ACL 1
+#endif
+#endif
+
+/*
+ * If this platform has <sys/acl.h>, acl_get(), facl_get(), acl_set(),
+ * facl_set() and types aclent_t and ace_t it uses Solaris-style ACL functions
+ */
+#if HAVE_SYS_ACL_H && HAVE_ACL_GET && HAVE_FACL_GET && HAVE_ACL_SET && HAVE_FACL_SET && HAVE_ACLENT_T && HAVE_ACE_T
+#define        HAVE_SUN_ACL    1
+#endif
+
+/* Define if platform supports NFSv4 ACLs */
+#if (HAVE_POSIX_ACL && HAVE_ACL_TYPE_NFS4) || HAVE_SUN_ACL || HAVE_DARWIN_ACL
+#define        HAVE_NFS4_ACL   1
+#endif
+
+/*
+ * Redefine DEFINE_TEST for use in defining the test functions.
+ */
+#undef DEFINE_TEST
+#define DEFINE_TEST(name) void name(void); void name(void)
+
+/* An implementation of the standard assert() macro */
+#define assert(e)   assertion_assert(__FILE__, __LINE__, (e), #e, NULL)
+/* chdir() and error if it fails */
+#define assertChdir(path)  \
+  assertion_chdir(__FILE__, __LINE__, path)
+/* Assert two integers are the same.  Reports value of each one if not. */
+#define assertEqualInt(v1,v2) \
+  assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
+/* Assert two strings are the same.  Reports value of each one if not. */
+#define assertEqualString(v1,v2)   \
+  assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 0)
+#define assertEqualUTF8String(v1,v2)   \
+  assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 1)
+/* As above, but v1 and v2 are wchar_t * */
+#define assertEqualWString(v1,v2)   \
+  assertion_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
+/* As above, but raw blocks of bytes. */
+#define assertEqualMem(v1, v2, l)      \
+  assertion_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
+/* Assert that memory is full of a specified byte */
+#define assertMemoryFilledWith(v1, l, b)                                       \
+  assertion_memory_filled_with(__FILE__, __LINE__, (v1), #v1, (l), #l, (b), #b, NULL)
+/* Assert two files are the same. */
+#define assertEqualFile(f1, f2)        \
+  assertion_equal_file(__FILE__, __LINE__, (f1), (f2))
+/* Assert that a file is empty. */
+#define assertEmptyFile(pathname)      \
+  assertion_empty_file(__FILE__, __LINE__, (pathname))
+/* Assert that a file is not empty. */
+#define assertNonEmptyFile(pathname)           \
+  assertion_non_empty_file(__FILE__, __LINE__, (pathname))
+#define assertFileAtime(pathname, sec, nsec)   \
+  assertion_file_atime(__FILE__, __LINE__, pathname, sec, nsec)
+#define assertFileAtimeRecent(pathname)        \
+  assertion_file_atime_recent(__FILE__, __LINE__, pathname)
+#define assertFileBirthtime(pathname, sec, nsec)       \
+  assertion_file_birthtime(__FILE__, __LINE__, pathname, sec, nsec)
+#define assertFileBirthtimeRecent(pathname) \
+  assertion_file_birthtime_recent(__FILE__, __LINE__, pathname)
+/* Assert that a file exists; supports printf-style arguments. */
+#define assertFileExists(pathname) \
+  assertion_file_exists(__FILE__, __LINE__, pathname)
+/* Assert that a file exists. */
+#define assertFileNotExists(pathname) \
+  assertion_file_not_exists(__FILE__, __LINE__, pathname)
+/* Assert that file contents match a string. */
+#define assertFileContents(data, data_size, pathname) \
+  assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname)
+/* Verify that a file does not contain invalid strings */
+#define assertFileContainsNoInvalidStrings(pathname, strings) \
+  assertion_file_contains_no_invalid_strings(__FILE__, __LINE__, pathname, strings)
+#define assertFileMtime(pathname, sec, nsec)   \
+  assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
+#define assertFileMtimeRecent(pathname) \
+  assertion_file_mtime_recent(__FILE__, __LINE__, pathname)
+#define assertFileNLinks(pathname, nlinks)  \
+  assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
+#define assertFileSize(pathname, size)  \
+  assertion_file_size(__FILE__, __LINE__, pathname, size)
+#define assertFileMode(pathname, mode)  \
+  assertion_file_mode(__FILE__, __LINE__, pathname, mode)
+#define assertTextFileContents(text, pathname) \
+  assertion_text_file_contents(__FILE__, __LINE__, text, pathname)
+#define assertFileContainsLinesAnyOrder(pathname, lines)       \
+  assertion_file_contains_lines_any_order(__FILE__, __LINE__, pathname, lines)
+#define assertIsDir(pathname, mode)            \
+  assertion_is_dir(__FILE__, __LINE__, pathname, mode)
+#define assertIsHardlink(path1, path2) \
+  assertion_is_hardlink(__FILE__, __LINE__, path1, path2)
+#define assertIsNotHardlink(path1, path2)      \
+  assertion_is_not_hardlink(__FILE__, __LINE__, path1, path2)
+#define assertIsReg(pathname, mode)            \
+  assertion_is_reg(__FILE__, __LINE__, pathname, mode)
+#define assertIsSymlink(pathname, contents)    \
+  assertion_is_symlink(__FILE__, __LINE__, pathname, contents)
+/* Create a directory, report error if it fails. */
+#define assertMakeDir(dirname, mode)   \
+  assertion_make_dir(__FILE__, __LINE__, dirname, mode)
+#define assertMakeFile(path, mode, contents) \
+  assertion_make_file(__FILE__, __LINE__, path, mode, -1, contents)
+#define assertMakeBinFile(path, mode, csize, contents) \
+  assertion_make_file(__FILE__, __LINE__, path, mode, csize, contents)
+#define assertMakeHardlink(newfile, oldfile)   \
+  assertion_make_hardlink(__FILE__, __LINE__, newfile, oldfile)
+#define assertMakeSymlink(newfile, linkto)     \
+  assertion_make_symlink(__FILE__, __LINE__, newfile, linkto)
+#define assertNodump(path)      \
+  assertion_nodump(__FILE__, __LINE__, path)
+#define assertUmask(mask)      \
+  assertion_umask(__FILE__, __LINE__, mask)
+#define assertUtimes(pathname, atime, atime_nsec, mtime, mtime_nsec)   \
+  assertion_utimes(__FILE__, __LINE__, pathname, atime, atime_nsec, mtime, mtime_nsec)
+#ifndef PROGRAM
+#define assertEntrySetAcls(entry, acls, count) \
+  assertion_entry_set_acls(__FILE__, __LINE__, entry, acls, count)
+#define assertEntryCompareAcls(entry, acls, count, type, mode) \
+  assertion_entry_compare_acls(__FILE__, __LINE__, entry, acls, count, type, mode)
+#endif
+
+/*
+ * This would be simple with C99 variadic macros, but I don't want to
+ * require that.  Instead, I insert a function call before each
+ * skipping() call to pass the file and line information down.  Crude,
+ * but effective.
+ */
+#define skipping       \
+  skipping_setup(__FILE__, __LINE__);test_skipping
+
+/* Function declarations.  These are defined in test_utility.c. */
+void failure(const char *fmt, ...);
+int assertion_assert(const char *, int, int, const char *, void *);
+int assertion_chdir(const char *, int, const char *);
+int assertion_empty_file(const char *, int, const char *);
+int assertion_equal_file(const char *, int, const char *, const char *);
+int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *);
+int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *);
+int assertion_memory_filled_with(const char *, int, const void *, const char *, size_t, const char *, char, const char *, void *);
+int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *, int);
+int assertion_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
+int assertion_file_atime(const char *, int, const char *, long, long);
+int assertion_file_atime_recent(const char *, int, const char *);
+int assertion_file_birthtime(const char *, int, const char *, long, long);
+int assertion_file_birthtime_recent(const char *, int, const char *);
+int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
+int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **);
+int assertion_file_contents(const char *, int, const void *, int, const char *);
+int assertion_file_exists(const char *, int, const char *);
+int assertion_file_mode(const char *, int, const char *, int);
+int assertion_file_mtime(const char *, int, const char *, long, long);
+int assertion_file_mtime_recent(const char *, int, const char *);
+int assertion_file_nlinks(const char *, int, const char *, int);
+int assertion_file_not_exists(const char *, int, const char *);
+int assertion_file_size(const char *, int, const char *, long);
+int assertion_is_dir(const char *, int, const char *, int);
+int assertion_is_hardlink(const char *, int, const char *, const char *);
+int assertion_is_not_hardlink(const char *, int, const char *, const char *);
+int assertion_is_reg(const char *, int, const char *, int);
+int assertion_is_symlink(const char *, int, const char *, const char *);
+int assertion_make_dir(const char *, int, const char *, int);
+int assertion_make_file(const char *, int, const char *, int, int, const void *);
+int assertion_make_hardlink(const char *, int, const char *newpath, const char *);
+int assertion_make_symlink(const char *, int, const char *newpath, const char *);
+int assertion_nodump(const char *, int, const char *);
+int assertion_non_empty_file(const char *, int, const char *);
+int assertion_text_file_contents(const char *, int, const char *buff, const char *f);
+int assertion_umask(const char *, int, int);
+int assertion_utimes(const char *, int, const char *, long, long, long, long );
+int assertion_version(const char*, int, const char *, const char *);
+
+void skipping_setup(const char *, int);
+void test_skipping(const char *fmt, ...);
+
+/* Like sprintf, then system() */
+int systemf(const char * fmt, ...);
+
+/* Delay until time() returns a value after this. */
+void sleepUntilAfter(time_t);
+
+/* Return true if this platform can create symlinks. */
+int canSymlink(void);
+
+/* Return true if this platform can run the "bzip2" program. */
+int canBzip2(void);
+
+/* Return true if this platform can run the "grzip" program. */
+int canGrzip(void);
+
+/* Return true if this platform can run the "gzip" program. */
+int canGzip(void);
+
+/* Return true if this platform can run the specified command. */
+int canRunCommand(const char *);
+
+/* Return true if this platform can run the "lrzip" program. */
+int canLrzip(void);
+
+/* Return true if this platform can run the "lz4" program. */
+int canLz4(void);
+
+/* Return true if this platform can run the "lzip" program. */
+int canLzip(void);
+
+/* Return true if this platform can run the "lzma" program. */
+int canLzma(void);
+
+/* Return true if this platform can run the "lzop" program. */
+int canLzop(void);
+
+/* Return true if this platform can run the "xz" program. */
+int canXz(void);
+
+/* Return true if this filesystem can handle nodump flags. */
+int canNodump(void);
+
+/* Return true if the file has large i-node number(>0xffffffff). */
+int is_LargeInode(const char *);
+
+/* Suck file into string allocated via malloc(). Call free() when done. */
+/* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
+char *slurpfile(size_t *, const char *fmt, ...);
+
+/* Dump block of bytes to a file. */
+void dumpfile(const char *filename, void *, size_t);
+
+/* Extracts named reference file to the current directory. */
+void extract_reference_file(const char *);
+/* Copies named reference file to the current directory. */
+void copy_reference_file(const char *);
+
+/* Extracts a list of files to the current directory.
+ * List must be NULL terminated.
+ */
+void extract_reference_files(const char **);
+
+/* Subtract umask from mode */
+mode_t umasked(mode_t expected_mode);
+
+/* Path to working directory for current test */
+extern const char *testworkdir;
+
+#ifndef PROGRAM
+/*
+ * Special interfaces for libarchive test harness.
+ */
+
+#include "archive.h"
+#include "archive_entry.h"
+
+/* ACL structure */
+struct archive_test_acl_t {
+       int type;  /* Type of ACL */
+       int permset; /* Permissions for this class of users. */
+       int tag; /* Owner, User, Owning group, group, other, etc. */
+       int qual; /* GID or UID of user/group, depending on tag. */
+       const char *name; /* Name of user/group, depending on tag. */
+};
+
+/* Set ACLs */
+int assertion_entry_set_acls(const char *, int, struct archive_entry *,
+    struct archive_test_acl_t *, int);
+
+/* Compare ACLs */
+int assertion_entry_compare_acls(const char *, int, struct archive_entry *,
+    struct archive_test_acl_t *, int, int, int);
+
+/* Special customized read-from-memory interface. */
+int read_open_memory(struct archive *, const void *, size_t, size_t);
+/* _minimal version exercises a slightly different set of libarchive APIs. */
+int read_open_memory_minimal(struct archive *, const void *, size_t, size_t);
+/* _seek version produces a seekable file. */
+int read_open_memory_seek(struct archive *, const void *, size_t, size_t);
+
+/* Versions of above that accept an archive argument for additional info. */
+#define assertA(e)   assertion_assert(__FILE__, __LINE__, (e), #e, (a))
+#define assertEqualIntA(a,v1,v2)   \
+  assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (a))
+#define assertEqualStringA(a,v1,v2)   \
+  assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (a), 0)
+
+#else  /* defined(PROGRAM) */
+/*
+ * Special interfaces for program test harness.
+ */
+
+/* Pathname of exe to be tested. */
+extern const char *testprogfile;
+/* Name of exe to use in printf-formatted command strings. */
+/* On Windows, this includes leading/trailing quotes. */
+extern const char *testprog;
+
+void assertVersion(const char *prog, const char *base);
+
+#endif /* defined(PROGRAM) */
+
+#ifdef USE_DMALLOC
+#include <dmalloc.h>
+#endif
+
+#endif /* TEST_COMMON_H */
similarity index 92%
rename from libarchive/test/main.c
rename to test_utils/test_main.c
index 46685f8..2ae6b38 100644 (file)
@@ -45,6 +45,9 @@
 #if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__)
 #include <ext2fs/ext2_fs.h>     /* Linux file flags, broken on Cygwin */
 #endif
+#ifdef HAVE_LINUX_FS_H
+#include <linux/fs.h>
+#endif
 #include <limits.h>
 #include <locale.h>
 #ifdef HAVE_SIGNAL_H
 #include <time.h>
 
 /*
- * This same file is used pretty much verbatim for all test harnesses.
- *
- * The next few lines are the only differences.
- * TODO: Move this into a separate configuration header, have all test
- * suites share one copy of this file.
- */
-__FBSDID("$FreeBSD: head/lib/libarchive/test/main.c 201247 2009-12-30 05:59:21Z kientzle $");
-#define KNOWNREF       "test_compat_gtar_1.tar.uu"
-#define        ENVBASE "LIBARCHIVE" /* Prefix for environment variables. */
-#undef PROGRAM              /* Testing a library, not a program. */
-#define        LIBRARY "libarchive"
-#define        EXTRA_DUMP(x)   archive_error_string((struct archive *)(x))
-#define        EXTRA_ERRNO(x)  archive_errno((struct archive *)(x))
-#define        EXTRA_VERSION   archive_version_details()
-
-/*
  *
  * Windows support routines
  *
@@ -1910,8 +1897,10 @@ assertion_nodump(const char *file, int line, const char *pathname)
                failure_finish(NULL);
                return (0);
        }
-#elif defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS)\
-        && defined(EXT2_NODUMP_FL)
+#elif (defined(FS_IOC_GETFLAGS) && defined(HAVE_WORKING_FS_IOC_GETFLAGS) && \
+       defined(FS_NODUMP_FL)) || \
+      (defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS) \
+        && defined(EXT2_NODUMP_FL))
        int fd, r, flags;
 
        assertion_count(file, line);
@@ -1921,14 +1910,31 @@ assertion_nodump(const char *file, int line, const char *pathname)
                failure_finish(NULL);
                return (0);
        }
-       r = ioctl(fd, EXT2_IOC_GETFLAGS, &flags);
+       r = ioctl(fd,
+#ifdef FS_IOC_GETFLAGS
+           FS_IOC_GETFLAGS,
+#else
+           EXT2_IOC_GETFLAGS,
+#endif
+           &flags);
        if (r < 0) {
                failure_start(file, line, "Can't get flags %s\n", pathname);
                failure_finish(NULL);
                return (0);
        }
+#ifdef FS_NODUMP_FL
+       flags |= FS_NODUMP_FL;
+#else
        flags |= EXT2_NODUMP_FL;
-       r = ioctl(fd, EXT2_IOC_SETFLAGS, &flags);
+#endif
+
+        r = ioctl(fd,
+#ifdef FS_IOC_SETFLAGS
+           FS_IOC_SETFLAGS,
+#else
+           EXT2_IOC_SETFLAGS,
+#endif
+           &flags);
        if (r < 0) {
                failure_start(file, line, "Can't set nodump %s\n", pathname);
                failure_finish(NULL);
@@ -1942,6 +1948,117 @@ assertion_nodump(const char *file, int line, const char *pathname)
        return (1);
 }
 
+#ifdef PROGRAM
+static void assert_version_id(char **qq, size_t *ss)
+{
+       char *q = *qq;
+       size_t s = *ss;
+
+       /* Version number is a series of digits and periods. */
+       while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
+               ++q;
+               --s;
+       }
+
+       if (q[0] == 'd' && q[1] == 'e' && q[2] == 'v') {
+               q += 3;
+               s -= 3;
+       }
+       
+       /* Skip a single trailing a,b,c, or d. */
+       if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
+               ++q;
+
+       /* Version number terminated by space. */
+       failure("No space after version: ``%s''", q);
+       assert(s > 1);
+       failure("No space after version: ``%s''", q);
+       assert(*q == ' ');
+
+       ++q; --s;
+
+       *qq = q;
+       *ss = s;
+}
+
+
+/*
+ * Check program version
+ */
+void assertVersion(const char *prog, const char *base)
+{
+       int r;
+       char *p, *q;
+       size_t s;
+       unsigned int prog_len = strlen(base);
+
+       r = systemf("%s --version >version.stdout 2>version.stderr", prog);
+       if (r != 0)
+               r = systemf("%s -W version >version.stdout 2>version.stderr",
+                   prog);
+
+       failure("Unable to run either %s --version or %s -W version",
+               prog, prog);
+       if (!assert(r == 0))
+               return;
+
+       /* --version should generate nothing to stdout. */
+       assertEmptyFile("version.stderr");
+
+       /* Verify format of version message. */
+       q = p = slurpfile(&s, "version.stdout");
+
+       /* Version message should start with name of program, then space. */
+       assert(s > prog_len + 1);
+       
+       failure("Version must start with '%s': ``%s''", base, p);
+       if (!assertEqualMem(q, base, prog_len)) {
+               free(p);
+               return;
+       }
+
+       q += prog_len; s -= prog_len;
+
+       assert(*q == ' ');
+       q++; s--;
+
+       assert_version_id(&q, &s);
+
+       /* Separator. */
+       failure("No `-' between program name and versions: ``%s''", p);
+       assertEqualMem(q, "- ", 2);
+       q += 2; s -= 2;
+
+       failure("Not long enough for libarchive version: ``%s''", p);
+       assert(s > 11);
+
+       failure("Libarchive version must start with `libarchive': ``%s''", p);
+       assertEqualMem(q, "libarchive ", 11);
+
+       q += 11; s -= 11;
+
+       assert_version_id(&q, &s);
+
+       /* Skip arbitrary third-party version numbers. */
+       while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' ||
+           isalnum(*q))) {
+               ++q;
+               --s;
+       }
+
+       /* All terminated by end-of-line. */
+       assert(s >= 1);
+
+       /* Skip an optional CR character (e.g., Windows) */
+       failure("Version output must end with \\n or \\r\\n");
+
+       if (*q == '\r') { ++q; --s; }
+       assertEqualMem(q, "\n", 1);
+
+       free(p);
+}
+#endif /* PROGRAM */
+
 /*
  *
  *  UTILITIES for use by tests.
@@ -2157,9 +2274,10 @@ canNodump(void)
        return (0);
 }
 
-#elif defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS)\
-        && defined(EXT2_NODUMP_FL)
-
+#elif (defined(FS_IOC_GETFLAGS) && defined(HAVE_WORKING_FS_IOC_GETFLAGS) \
+        && defined(FS_NODUMP_FL)) || \
+      (defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS) \
+        && defined(EXT2_NODUMP_FL))
 int
 canNodump(void)
 {
@@ -2170,22 +2288,48 @@ canNodump(void)
        fd = open(path, O_RDONLY | O_NONBLOCK);
        if (fd < 0)
                return (0);
-       r = ioctl(fd, EXT2_IOC_GETFLAGS, &flags);
+       r = ioctl(fd,
+#ifdef FS_IOC_GETFLAGS
+           FS_IOC_GETFLAGS,
+#else
+           EXT2_IOC_GETFLAGS,
+#endif
+           &flags);
        if (r < 0)
                return (0);
+#ifdef FS_NODUMP_FL
+       flags |= FS_NODUMP_FL;
+#else
        flags |= EXT2_NODUMP_FL;
-       r = ioctl(fd, EXT2_IOC_SETFLAGS, &flags);
+#endif
+       r = ioctl(fd,
+#ifdef FS_IOC_SETFLAGS
+           FS_IOC_SETFLAGS,
+#else
+           EXT2_IOC_SETFLAGS,
+#endif
+          &flags);
        if (r < 0)
                return (0);
        close(fd);
        fd = open(path, O_RDONLY | O_NONBLOCK);
        if (fd < 0)
                return (0);
-       r = ioctl(fd, EXT2_IOC_GETFLAGS, &flags);
+       r = ioctl(fd,
+#ifdef FS_IOC_GETFLAGS
+           FS_IOC_GETFLAGS,
+#else
+           EXT2_IOC_GETFLAGS,
+#endif
+           &flags);
        if (r < 0)
                return (0);
        close(fd);
+#ifdef FS_NODUMP_FL
+       if (flags & FS_NODUMP_FL)
+#else
        if (flags & EXT2_NODUMP_FL)
+#endif
                return (1);
        return (0);
 }
@@ -2429,23 +2573,33 @@ extract_reference_files(const char **names)
                extract_reference_file(*names++);
 }
 
+#ifndef PROGRAM
 /* Set ACLs */
-void
-archive_test_set_acls(struct archive_entry *ae,
+int
+assertion_entry_set_acls(const char *file, int line, struct archive_entry *ae,
     struct archive_test_acl_t *acls, int n)
 {
-       int i;
+       int i, r, ret;
+
+       assertion_count(file, line);
 
+       ret = 0;
        archive_entry_acl_clear(ae);
        for (i = 0; i < n; i++) {
-               failure("type=%#010x, permset=%#010x, tag=%d, qual=%d name=%s",
+               r = archive_entry_acl_add_entry(ae,
                    acls[i].type, acls[i].permset, acls[i].tag,
                    acls[i].qual, acls[i].name);
-               assertEqualInt(ARCHIVE_OK,
-                   archive_entry_acl_add_entry(ae,
-                       acls[i].type, acls[i].permset, acls[i].tag,
-                       acls[i].qual, acls[i].name));
+               if (r != 0) {
+                       ret = 1;
+                       failure_start(file, line, "type=%#010x, ",
+                           "permset=%#010x, tag=%d, qual=%d name=%s",
+                           acls[i].type, acls[i].permset, acls[i].tag,
+                           acls[i].qual, acls[i].name);
+                       failure_finish(NULL);
+               }
        }
+
+       return (ret);
 }
 
 static int
@@ -2482,16 +2636,20 @@ archive_test_acl_match(struct archive_test_acl_t *acl, int type, int permset,
 }
 
 /* Compare ACLs */
-void
-archive_test_compare_acls(struct archive_entry *ae,
-    struct archive_test_acl_t *acls, int cnt, int want_type, int mode)
+int
+assertion_entry_compare_acls(const char *file, int line,
+    struct archive_entry *ae, struct archive_test_acl_t *acls, int cnt,
+    int want_type, int mode)
 {
        int *marker;
-       int i, r, n;
+       int i, r, n, ret;
        int type, permset, tag, qual;
        int matched;
        const char *name;
 
+       assertion_count(file, line);
+
+       ret = 0;
        n = 0;
        marker = malloc(sizeof(marker[0]) * cnt);
 
@@ -2502,10 +2660,11 @@ archive_test_compare_acls(struct archive_entry *ae,
                }
        }
 
-       failure("No ACL's to compare, type mask: %d", want_type);
-       assert(n > 0);
-       if (n == 0)
-               return;
+       if (n == 0) {
+               failure_start(file, line, "No ACL's to compare, type mask: %d",
+                   want_type);
+               return (1);
+       }
 
        while (0 == (r = archive_entry_acl_next(ae, want_type,
                         &type, &permset, &tag, &qual, &name))) {
@@ -2520,40 +2679,83 @@ archive_test_compare_acls(struct archive_entry *ae,
                }
                if (type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS
                    && tag == ARCHIVE_ENTRY_ACL_USER_OBJ) {
-                       if (!matched) printf("No match for user_obj perm\n");
-                       failure("USER_OBJ permset (%02o) != user mode (%02o)",
-                           permset, 07 & (mode >> 6));
-                       assert((permset << 6) == (mode & 0700));
+                       if (!matched) {
+                               failure_start(file, line, "No match for "
+                                   "user_obj perm");
+                               failure_finish(NULL);
+                               ret = 1;
+                       }
+                       if ((permset << 6) != (mode & 0700)) {
+                               failure_start(file, line, "USER_OBJ permset "
+                                   "(%02o) != user mode (%02o)", permset,
+                                   07 & (mode >> 6));
+                               failure_finish(NULL);
+                               ret = 1;
+                       }
                } else if (type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS
                    && tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ) {
-                       if (!matched) printf("No match for group_obj perm\n");
-                       failure("GROUP_OBJ permset %02o != group mode %02o",
-                           permset, 07 & (mode >> 3));
-                       assert((permset << 3) == (mode & 0070));
+                       if (!matched) {
+                               failure_start(file, line, "No match for "
+                                   "group_obj perm");
+                               failure_finish(NULL);
+                               ret = 1;
+                       }
+                       if ((permset << 3) != (mode & 0070)) {
+                               failure_start(file, line, "GROUP_OBJ permset "
+                                   "(%02o) != group mode (%02o)", permset,
+                                   07 & (mode >> 3));
+                               failure_finish(NULL);
+                               ret = 1;
+                       }
                } else if (type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS
                    && tag == ARCHIVE_ENTRY_ACL_OTHER) {
-                       if (!matched) printf("No match for other perm\n");
-                       failure("OTHER permset (%02o) != other mode (%02o)",
-                           permset, mode & 07);
-                       assert((permset << 0) == (mode & 0007));
-               } else {
-                       failure("Could not find match for ACL "
-                           "(type=%#010x,permset=%#010x,tag=%d,qual=%d,"
+                       if (!matched) {
+                               failure_start(file, line, "No match for "
+                                   "other perm");
+                               failure_finish(NULL);
+                               ret = 1;
+                       }
+                       if ((permset << 0) != (mode & 0007)) {
+                               failure_start(file, line, "OTHER permset "
+                                   "(%02o) != other mode (%02o)", permset,
+                                   mode & 07);
+                               failure_finish(NULL);
+                               ret = 1;
+                       }
+               } else if (matched != 1) {
+                       failure_start(file, line, "Could not find match for "
+                           "ACL (type=%#010x,permset=%#010x,tag=%d,qual=%d,"
                            "name=``%s'')", type, permset, tag, qual, name);
-                       assert(matched == 1);
+                       failure_finish(NULL);
+                       ret = 1;
                }
        }
-       assertEqualInt(ARCHIVE_EOF, r);
-       if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)
-               assert((mode_t)(mode & 0777) == (archive_entry_mode(ae)
-                   & 0777));
-       failure("Could not find match for ACL "
-           "(type=%#010x,permset=%#010x,tag=%d,qual=%d,name=``%s'')",
-           acls[marker[0]].type, acls[marker[0]].permset,
-           acls[marker[0]].tag, acls[marker[0]].qual, acls[marker[0]].name);
-       assert(n == 0); /* Number of ACLs not matched should == 0 */
+       if (r != ARCHIVE_EOF) {
+               failure_start(file, line, "Should not exit before EOF");
+               failure_finish(NULL);
+               ret = 1;
+       }
+       if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0 &&
+           (mode_t)(mode & 0777) != (archive_entry_mode(ae) & 0777)) {
+               failure_start(file, line, "Mode (%02o) and entry mode (%02o) "
+                   "mismatch", mode, archive_entry_mode(ae));
+               failure_finish(NULL);
+               ret = 1;
+       }
+       if (n != 0) {
+               failure_start(file, line, "Could not find match for ACL "
+                   "(type=%#010x,permset=%#010x,tag=%d,qual=%d,name=``%s'')",
+                   acls[marker[0]].type, acls[marker[0]].permset,
+                   acls[marker[0]].tag, acls[marker[0]].qual,
+                   acls[marker[0]].name);
+               failure_finish(NULL);
+               ret = 1;
+               /* Number of ACLs not matched should == 0 */
+       }
        free(marker);
+       return (ret);
 }
+#endif /* !defined(PROGRAM) */
 
 /*
  *