From 01ec47d19c39588f6481adef9364fd810182d884 Mon Sep 17 00:00:00 2001 From: Martin Matuska Date: Thu, 12 Nov 2020 10:52:32 +0100 Subject: [PATCH] Update archive_write_open.3 manpage --- libarchive/archive_write_open.3 | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/libarchive/archive_write_open.3 b/libarchive/archive_write_open.3 index 2f6e6270b..f68538502 100644 --- a/libarchive/archive_write_open.3 +++ b/libarchive/archive_write_open.3 @@ -24,10 +24,11 @@ .\" .\" $FreeBSD$ .\" -.Dd February 2, 2012 +.Dd November 12, 2020 .Dt ARCHIVE_WRITE_OPEN 3 .Os .Sh NAME +.Nm archive_write_open , .Nm archive_write_open2 , .Nm archive_write_open_fd , .Nm archive_write_open_FILE , @@ -39,6 +40,14 @@ Streaming Archive Library (libarchive, -larchive) .Sh SYNOPSIS .In archive.h .Ft int +.Fo archive_write_open +.Fa "struct archive *" +.Fa "void *client_data" +.Fa "archive_open_callback *" +.Fa "archive_write_callback *" +.Fa "archive_close_callback *" +.Fc +.Ft int .Fo archive_write_open2 .Fa "struct archive *" .Fa "void *client_data" @@ -62,12 +71,17 @@ Streaming Archive Library (libarchive, -larchive) .Fc .Sh DESCRIPTION .Bl -tag -width indent -.It Fn archive_write_open2 +.It Fn archive_write_open Freeze the settings, open the archive, and prepare for writing entries. This is the most generic form of this function, which accepts -pointers to four callback functions which will be invoked by +pointers to three callback functions which will be invoked by the compression layer to write the constructed archive. This does not alter the default archive padding. +.It Fn archive_write_open2 +Same as +.Fn archive_write_open +with an additional fourth free callback. This function should be preferred to +.Fn archive_write_open . .It Fn archive_write_open_fd A convenience form of .Fn archive_write_open @@ -163,6 +177,8 @@ If the open fails, it should call .Fn archive_set_error to register an error code and message and return .Cm ARCHIVE_FATAL . +Please not that if open fails, close is not called and resources must be +freed inside the open callback or with the free callback. .Bl -item -offset indent .It .Ft typedef la_ssize_t -- 2.39.2