blob: 6681cf2cf3aa9442421d2148bd6cba0b2724beb2 [file] [log] [blame]
Thomas Klausner37ca2c62018-04-10 12:40:44 +02001<!DOCTYPE html>
2<html>
Thomas Klausner0001d262018-04-14 22:34:06 +02003<!-- This is an automatically generated file. Do not edit.
4 zip_source_buffer.mdoc -- create zip data source from buffer
Thomas Klausner8c8c26f2021-06-18 11:33:49 +02005 Copyright (C) 2004-2021 Dieter Baron and Thomas Klausner
Thomas Klausner0001d262018-04-14 22:34:06 +02006
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 -->
Thomas Klausner37ca2c62018-04-10 12:40:44 +020035<head>
36 <meta charset="utf-8"/>
Thomas Klausner37ca2c62018-04-10 12:40:44 +020037 <link rel="stylesheet" href="../nih-man.css" type="text/css" media="all"/>
38 <title>ZIP_SOURCE_BUFFER(3)</title>
39</head>
40<body>
41<table class="head">
42 <tr>
43 <td class="head-ltitle">ZIP_SOURCE_BUFFER(3)</td>
44 <td class="head-vol">Library Functions Manual</td>
45 <td class="head-rtitle">ZIP_SOURCE_BUFFER(3)</td>
46 </tr>
47</table>
48<div class="manual-text">
Thomas Klausner8fb14f92019-03-12 12:44:02 +010049<section class="Sh">
50<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
51<code class="Nm">zip_source_buffer</code>,
52 <code class="Nm">zip_source_buffer_create</code> &#x2014;
53<div class="Nd">create zip data source from buffer</div>
54</section>
55<section class="Sh">
56<h1 class="Sh" id="LIBRARY"><a class="permalink" href="#LIBRARY">LIBRARY</a></h1>
Thomas Klausner37ca2c62018-04-10 12:40:44 +020057libzip (-lzip)
Thomas Klausner8fb14f92019-03-12 12:44:02 +010058</section>
59<section class="Sh">
60<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
61<code class="In">#include &lt;<a class="In">zip.h</a>&gt;</code>
62<p class="Pp"><var class="Ft">zip_source_t *</var>
63 <br/>
64 <code class="Fn">zip_source_buffer</code>(<var class="Fa" style="white-space: nowrap;">zip_t
65 *archive</var>, <var class="Fa" style="white-space: nowrap;">const void
66 *data</var>, <var class="Fa" style="white-space: nowrap;">zip_uint64_t
67 len</var>, <var class="Fa" style="white-space: nowrap;">int
68 freep</var>);</p>
69<p class="Pp"><var class="Ft">zip_source_t *</var>
70 <br/>
71 <code class="Fn">zip_source_buffer_create</code>(<var class="Fa" style="white-space: nowrap;">const
72 void *data</var>, <var class="Fa" style="white-space: nowrap;">zip_uint64_t
73 len</var>, <var class="Fa" style="white-space: nowrap;">int freep</var>,
74 <var class="Fa" style="white-space: nowrap;">zip_error_t *error</var>);</p>
75</section>
76<section class="Sh">
77<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
78The functions <code class="Fn">zip_source_buffer</code>() and
79 <code class="Fn">zip_source_buffer_create</code>() create a zip source from
80 the buffer <var class="Ar">data</var> of size <var class="Ar">len</var>. If
81 <var class="Ar">freep</var> is non-zero, the buffer will be freed when it is
82 no longer needed. <var class="Ar">data</var> must remain valid for the
83 lifetime of the created source.
84<p class="Pp">The source can be used to open a zip archive from.</p>
85</section>
86<section class="Sh">
87<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN
Thomas Klausner0001d262018-04-14 22:34:06 +020088 VALUES</a></h1>
Thomas Klausner37ca2c62018-04-10 12:40:44 +020089Upon successful completion, the created source is returned. Otherwise,
Thomas Klausner8fb14f92019-03-12 12:44:02 +010090 <code class="Dv">NULL</code> is returned and the error code in
91 <var class="Ar">archive</var> or <var class="Ar">error</var> is set to
92 indicate the error.
93</section>
94<section class="Sh">
95<h1 class="Sh" id="ERRORS"><a class="permalink" href="#ERRORS">ERRORS</a></h1>
96<code class="Fn">zip_source_buffer</code>() and
97 <code class="Fn">zip_source_buffer_create</code>() fail if:
Thomas Klausnerff556822018-12-23 19:58:03 +010098<dl class="Bl-tag">
Thomas Klausner8fb14f92019-03-12 12:44:02 +010099 <dt>[<a class="permalink" href="#ZIP_ER_INVAL"><code class="Er" id="ZIP_ER_INVAL">ZIP_ER_INVAL</code></a>]</dt>
100 <dd><var class="Ar">len</var> is greater than zero and
101 <var class="Ar">data</var> is <code class="Dv">NULL</code>.</dd>
102 <dt>[<a class="permalink" href="#ZIP_ER_MEMORY"><code class="Er" id="ZIP_ER_MEMORY">ZIP_ER_MEMORY</code></a>]</dt>
Thomas Klausnerd4ec9862018-05-19 20:35:35 +0200103 <dd>Required memory could not be allocated.</dd>
Thomas Klausner37ca2c62018-04-10 12:40:44 +0200104</dl>
Thomas Klausner8fb14f92019-03-12 12:44:02 +0100105</section>
106<section class="Sh">
107<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
Thomas Klausner0001d262018-04-14 22:34:06 +0200108 ALSO</a></h1>
Thomas Klausner8fb14f92019-03-12 12:44:02 +0100109<a class="Xr" href="libzip.html">libzip(3)</a>,
110 <a class="Xr" href="zip_file_add.html">zip_file_add(3)</a>,
111 <a class="Xr" href="zip_file_replace.html">zip_file_replace(3)</a>,
112 <a class="Xr" href="zip_open_from_source.html">zip_open_from_source(3)</a>,
113 <a class="Xr" href="zip_source.html">zip_source(3)</a>
114</section>
115<section class="Sh">
116<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
117<code class="Fn">zip_source_buffer</code>() and
118 <code class="Fn">zip_source_buffer_create</code>() were added in libzip 1.0.
119</section>
120<section class="Sh">
121<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
122<span class="An">Dieter Baron</span>
123 &lt;<a class="Mt" href="mailto:dillo@nih.at">dillo@nih.at</a>&gt; and
124 <span class="An">Thomas Klausner</span>
125 &lt;<a class="Mt" href="mailto:tk@giga.or.at">tk@giga.or.at</a>&gt;
126</section>
127</div>
Thomas Klausner37ca2c62018-04-10 12:40:44 +0200128<table class="foot">
129 <tr>
130 <td class="foot-date">December 18, 2017</td>
Thomas Klausner6aecb022020-07-11 10:38:46 +0200131 <td class="foot-os">NiH</td>
Thomas Klausner37ca2c62018-04-10 12:40:44 +0200132 </tr>
133</table>
134</body>
135</html>