Imported Upstream version 1.9.0
[platform/upstream/libzip.git] / man / zip_register_cancel_callback_with_state.html
1 <!DOCTYPE html>
2 <html>
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
6   
7    This file is part of libzip, a library to manipulate ZIP archives.
8    The authors can be contacted at <libzip@nih.at>
9   
10    Redistribution and use in source and binary forms, with or without
11    modification, are permitted provided that the following conditions
12    are met:
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
18       distribution.
19    3. The names of the authors may not be used to endorse or promote
20       products derived from this software without specific prior
21       written permission.
22   
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.
34    -->
35 <head>
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>
39 </head>
40 <body>
41 <table class="head">
42   <tr>
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>
46   </tr>
47 </table>
48 <div class="manual-text">
49 <section class="Sh">
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> &#x2014;
52 <div class="Nd">allow cancelling during zip_close</div>
53 </section>
54 <section class="Sh">
55 <h1 class="Sh" id="LIBRARY"><a class="permalink" href="#LIBRARY">LIBRARY</a></h1>
56 libzip (-lzip)
57 </section>
58 <section class="Sh">
59 <h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
60 <code class="In">#include &lt;<a class="In">zip.h</a>&gt;</code>
61 <p class="Pp"><var class="Vt">typedef int (*zip_cancel_callback)(zip_t *, void
62     *);</var></p>
63 <p class="Pp"><var class="Ft">void</var>
64   <br/>
65   <code class="Fn">zip_register_cancel_callback_with_state</code>(<var class="Fa" style="white-space: nowrap;">zip_t
66     *archive</var>,
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
70     *ud</var>);</p>
71 </section>
72 <section class="Sh">
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>.
76 <p class="Pp">The
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
90     often.</p>
91 </section>
92 <section class="Sh">
93 <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
94   ALSO</a></h1>
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>
98 </section>
99 <section class="Sh">
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
102   libzip 1.6.0.
103 </section>
104 <section class="Sh">
105 <h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
106 <span class="An">Dieter Baron</span>
107   &lt;<a class="Mt" href="mailto:dillo@nih.at">dillo@nih.at</a>&gt; and
108   <span class="An">Thomas Klausner</span>
109   &lt;<a class="Mt" href="mailto:tk@giga.or.at">tk@giga.or.at</a>&gt;
110 </section>
111 </div>
112 <table class="foot">
113   <tr>
114     <td class="foot-date">June 18, 2022</td>
115     <td class="foot-os">NiH</td>
116   </tr>
117 </table>
118 </body>
119 </html>