Imported Upstream version 1.9.0
[platform/upstream/libzip.git] / man / zip_fread.html
1 <!DOCTYPE html>
2 <html>
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
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_FREAD(3)</title>
39 </head>
40 <body>
41 <table class="head">
42   <tr>
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>
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_fread</code> &#x2014;
52 <div class="Nd">read from file</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="Ft">zip_int64_t</var>
62   <br/>
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>
66 </section>
67 <section class="Sh">
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>.
72 </section>
73 <section class="Sh">
74 <h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN
75   VALUES</a></h1>
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.
79 </section>
80 <section class="Sh">
81 <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
82   ALSO</a></h1>
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>
87 </section>
88 <section class="Sh">
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>.
95 </section>
96 <section class="Sh">
97 <h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
98 <span class="An">Dieter Baron</span>
99   &lt;<a class="Mt" href="mailto:dillo@nih.at">dillo@nih.at</a>&gt; and
100   <span class="An">Thomas Klausner</span>
101   &lt;<a class="Mt" href="mailto:tk@giga.or.at">tk@giga.or.at</a>&gt;
102 </section>
103 </div>
104 <table class="foot">
105   <tr>
106     <td class="foot-date">September 28, 2021</td>
107     <td class="foot-os">NiH</td>
108   </tr>
109 </table>
110 </body>
111 </html>