.\"
.\" $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 ,
.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"
.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
.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