3 <!-- This is an automatically generated file. Do not edit.
4 zip_fread.mdoc -- read from file
5 Copyright (C) 2003-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_FREAD(3)</title>
43 <td class="head-ltitle">ZIP_FREAD(3)</td>
44 <td class="head-vol">Library Functions Manual</td>
45 <td class="head-rtitle">ZIP_FREAD(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_fread</code> —
52 <div class="Nd">read from file</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="Ft">zip_int64_t</var>
63 <code class="Fn">zip_fread</code>(<var class="Fa" style="white-space: nowrap;">zip_file_t
64 *file</var>, <var class="Fa" style="white-space: nowrap;">void *buf</var>,
65 <var class="Fa" style="white-space: nowrap;">zip_uint64_t nbytes</var>);</p>
68 <h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
69 The <code class="Fn">zip_fread</code>() function reads up to
70 <var class="Ar">nbytes</var> bytes from <var class="Ar">file</var> into
71 <var class="Ar">buf</var>.
74 <h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN
76 If successful, the number of bytes actually read is returned. When
77 <code class="Fn">zip_fread</code>() is called after reaching the end of the
78 file, 0 is returned. In case of error, -1 is returned.
81 <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
83 <a class="Xr" href="libzip.html">libzip(3)</a>,
84 <a class="Xr" href="zip_fclose.html">zip_fclose(3)</a>,
85 <a class="Xr" href="zip_fopen.html">zip_fopen(3)</a>,
86 <a class="Xr" href="zip_fseek.html">zip_fseek(3)</a>
89 <h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
90 <code class="Fn">zip_fread</code>() was added in libzip 0.6. In libzip 0.10 the
91 return type was changed from <var class="Vt">ssize_t</var> to
92 <var class="Vt">zip_int64_t</var>. In libzip 0.10 the type of
93 <var class="Ar">nbytes</var> was changed from <var class="Vt">size_t</var> to
94 <var class="Vt">zip_uint64_t</var>.
97 <h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
98 <span class="An">Dieter Baron</span>
99 <<a class="Mt" href="mailto:dillo@nih.at">dillo@nih.at</a>> and
100 <span class="An">Thomas Klausner</span>
101 <<a class="Mt" href="mailto:tk@giga.or.at">tk@giga.or.at</a>>
106 <td class="foot-date">September 28, 2021</td>
107 <td class="foot-os">NiH</td>