.\" zip_register_cancel_callback_with_state.mdoc -- allow cancelling during zip_close
-.\" Copyright (C) 2021 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2021-2022 Dieter Baron and Thomas Klausner
.\"
.\" This file is part of libzip, a library to manipulate ZIP archives.
.\" The authors can be contacted at <libzip@nih.at>
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd April 6, 2021
+.Dd June 18, 2022
.Dt ZIP_REGISTER_CANCEL_CALLBACK_WITH_STATE 3
.Os
.Sh NAME
libzip (-lzip)
.Sh SYNOPSIS
.In zip.h
-.Vt typedef void (*zip_cancel_callback)(zip_t *, double, void *);
+.Vt typedef int (*zip_cancel_callback)(zip_t *, void *);
.Ft void
.Fn zip_register_cancel_callback_with_state "zip_t *archive" "zip_cancel_callback callback" "void (*ud_free)(void *)" "void *ud"
.Sh DESCRIPTION
.Xr zip_close 3
in regular intervals (after every zip archive entry that's completely
written to disk, and while writing data for entries) with zip archive
-.Ar archive ,
-the current progress state (see
-.Xr zip_register_progress_callback_with_state 3 )
-as a
-.Vt double ,
+.Ar archive
and the user-provided user-data
.Ar ud
as arguments.
-The progress state is a
-.Vt double
-in the range from 0.0 to 1.0.
+When the callback function returns a non-zero value, writing is cancelled and
+.Xr zip_close 3
+returns an error.
.Pp
The callback function should be fast, since it will be called often.
.Sh SEE ALSO