3 <!-- This is an automatically generated file. Do not edit.
4 zip_register_cancel_callback_with_state.mdoc -- allow cancelling during zip_close
5 Copyright (C) 2021-2022 Dieter Baron and Thomas Klausner
7 This file is part of libzip, a library to manipulate ZIP archives.
8 The authors can be contacted at <libzip@nih.at>
10 Redistribution and use in source and binary forms, with or without
11 modification, are permitted provided that the following conditions
13 1. Redistributions of source code must retain the above copyright
14 notice, this list of conditions and the following disclaimer.
15 2. Redistributions in binary form must reproduce the above copyright
16 notice, this list of conditions and the following disclaimer in
17 the documentation and/or other materials provided with the
19 3. The names of the authors may not be used to endorse or promote
20 products derived from this software without specific prior
23 THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
24 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
27 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
31 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
32 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
33 IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 <meta charset="utf-8"/>
37 <link rel="stylesheet" href="../nih-man.css" type="text/css" media="all"/>
38 <title>ZIP_REGISTER_CANCEL_CALLBACK_WITH_STATE(3)</title>
43 <td class="head-ltitle">ZIP_REGISTER_CANCEL_CALLBACK_WITH_STATE(3)</td>
44 <td class="head-vol">Library Functions Manual</td>
45 <td class="head-rtitle">ZIP_REGISTER_CANCEL_CALLBACK_WITH_STATE(3)</td>
48 <div class="manual-text">
50 <h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
51 <code class="Nm">zip_register_cancel_callback_with_state</code> —
52 <div class="Nd">allow cancelling during zip_close</div>
55 <h1 class="Sh" id="LIBRARY"><a class="permalink" href="#LIBRARY">LIBRARY</a></h1>
59 <h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
60 <code class="In">#include <<a class="In">zip.h</a>></code>
61 <p class="Pp"><var class="Vt">typedef int (*zip_cancel_callback)(zip_t *, void
63 <p class="Pp"><var class="Ft">void</var>
65 <code class="Fn">zip_register_cancel_callback_with_state</code>(<var class="Fa" style="white-space: nowrap;">zip_t
67 <var class="Fa" style="white-space: nowrap;">zip_cancel_callback
68 callback</var>, <var class="Fa" style="white-space: nowrap;">void
69 (*ud_free)(void *)</var>, <var class="Fa" style="white-space: nowrap;">void
73 <h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
74 This function can be used to cancel writing of a zip archive during
75 <a class="Xr" href="zip_close.html">zip_close(3)</a>.
77 <code class="Fn">zip_register_cancel_callback_with_state</code>() function
78 registers a callback function <var class="Ar">callback</var> for the zip
79 archive <var class="Ar">archive</var>. The <var class="Ar">ud_free</var>
80 function is called during cleanup for deleting the userdata supplied in
81 <var class="Ar">ud</var>.</p>
82 <p class="Pp">The callback function is called during
83 <a class="Xr" href="zip_close.html">zip_close(3)</a> in regular intervals
84 (after every zip archive entry that's completely written to disk, and while
85 writing data for entries) with zip archive <var class="Ar">archive</var> and
86 the user-provided user-data <var class="Ar">ud</var> as arguments. When the
87 callback function returns a non-zero value, writing is cancelled and
88 <a class="Xr" href="zip_close.html">zip_close(3)</a> returns an error.</p>
89 <p class="Pp">The callback function should be fast, since it will be called
93 <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
95 <a class="Xr" href="libzip.html">libzip(3)</a>,
96 <a class="Xr" href="zip_close.html">zip_close(3)</a>,
97 <a class="Xr" href="zip_register_progress_callback_with_state.html">zip_register_progress_callback_with_state(3)</a>
100 <h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
101 <code class="Fn">zip_register_cancel_callback_with_state</code>() was added in
105 <h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
106 <span class="An">Dieter Baron</span>
107 <<a class="Mt" href="mailto:dillo@nih.at">dillo@nih.at</a>> and
108 <span class="An">Thomas Klausner</span>
109 <<a class="Mt" href="mailto:tk@giga.or.at">tk@giga.or.at</a>>
114 <td class="foot-date">June 18, 2022</td>
115 <td class="foot-os">NiH</td>