summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_write.3
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2004-08-07 19:22:50 +0000
committerkientzle <kientzle@FreeBSD.org>2004-08-07 19:22:50 +0000
commitce43965b8b0a3777d17e84b790b1da388f3da574 (patch)
treeace20a04007ad2459488721ad147fc08b64bd24c /lib/libarchive/archive_write.3
parent42609f208c42763fa511ec4e8a440b74bfd3e0d8 (diff)
downloadFreeBSD-src-ce43965b8b0a3777d17e84b790b1da388f3da574.zip
FreeBSD-src-ce43965b8b0a3777d17e84b790b1da388f3da574.tar.gz
Split archive_{read,write}_finish into separate "close" (finish the archive
and close it) and "finish" (destroy the object) functions. For backwards compat and simplicity, have "finish" invoke "close" transparently if needed. This allows clients to close the archive and check end-of-operation statistics before destroying the object.
Diffstat (limited to 'lib/libarchive/archive_write.3')
-rw-r--r--lib/libarchive/archive_write.312
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/libarchive/archive_write.3 b/lib/libarchive/archive_write.3
index ee1bdc9..b7af9d5 100644
--- a/lib/libarchive/archive_write.3
+++ b/lib/libarchive/archive_write.3
@@ -45,6 +45,7 @@
.Nm archive_write_prepare ,
.Nm archive_write_header ,
.Nm archive_write_data ,
+.Nm archive_write_close ,
.Nm archive_write_finish
.Nd functions for creating archives
.Sh SYNOPSIS
@@ -82,6 +83,8 @@
.Ft int
.Fn archive_write_data "struct archive *" "const void *" "size_t"
.Ft int
+.Fn archive_write_close "struct archive *"
+.Ft void
.Fn archive_write_finish "struct archive *"
.Sh DESCRIPTION
These functions provide a complete API for creating streaming
@@ -187,9 +190,12 @@ Build and write a header using the data in the provided
structure.
.It Fn archive_write_data
Write data corresponding to the header just written.
+.It Fn archive_write_close
+Complete the archive and invoke the close callback.
.It Fn archive_write_finish
-Complete the archive, invoke the close callback, and release
-all resources.
+Invokes
+.Fn archive_write_close
+if it wasn't invoked manually, then release all resources.
.El
.Pp
The callback functions are defined as follows:
@@ -321,7 +327,7 @@ may include
.Fn archive_write_header ,
.Fn archive_write_data ,
or
-.Fn archive_write_finish .
+.Fn archive_write_close .
In such a case, the
.Fn archive_errno
or
OpenPOWER on IntegriCloud