beta-0.89.2
[luatex.git] / source / libs / zziplib / zziplib-0.13.62 / docs / zziplib.html
blobb053930ec8e7a2550ae6e759d7abc656387e9c80
1 <html><head><title>zziplib Library Functions</title>
2 </head><body>
3 <h2>zziplib Library Functions</h2><p>Version 0.13.62</p><p><big><b><code>#include &lt;zzip/lib.h&gt;</code></b></big></p><table width="100%"><tr><td valign="top"><code><b><code><a href="#zzip_error">zzip_error</a></code></b>(ZZIP_DIR * dir)
4 : int
5 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_seterror">zzip_seterror</a></code></b>(ZZIP_DIR * dir, int errcode) : void
6 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_open">zzip_open</a></code></b>(zzip_char_t * filename, int o_flags)
7 : ZZIP_FILE *
8 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_open_ext_io">zzip_open_ext_io</a></code></b>(zzip_char_t * filename, int o_flags, int o_modes,
9 zzip_strings_t * ext, zzip_plugin_io_t io)
10 : ZZIP_FILE *
11 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_open_shared_io">zzip_open_shared_io</a></code></b>(ZZIP_FILE * stream,
12 zzip_char_t * filename, int o_flags, int o_modes,
13 zzip_strings_t * ext, zzip_plugin_io_t io)
14 : ZZIP_FILE *
15 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_opendir">zzip_opendir</a></code></b>(zzip_char_t * filename)
16 : ZZIP_DIR *
17 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_opendir_ext_io">zzip_opendir_ext_io</a></code></b>(zzip_char_t * filename, int o_modes,
18 zzip_strings_t * ext, zzip_plugin_io_t io)
19 : ZZIP_DIR *
20 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_file_real">zzip_file_real</a></code></b>(ZZIP_FILE * fp)
21 : int
22 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_dir_real">zzip_dir_real</a></code></b>(ZZIP_DIR * dir)
23 : int
24 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_realdir">zzip_realdir</a></code></b>(ZZIP_DIR * dir)
25 : void *
26 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_realfd">zzip_realfd</a></code></b>(ZZIP_FILE * fp)
27 : int
28 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_tell">zzip_tell</a></code></b>(ZZIP_FILE * fp)
29 : zzip_off_t
30 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_tell32">zzip_tell32</a></code></b>(ZZIP_FILE * fp)
31 : long
32 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_dir_stat">zzip_dir_stat</a></code></b>(ZZIP_DIR * dir, zzip_char_t * name, ZZIP_STAT * zs, int flags)
33 : int
34 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_file_stat">zzip_file_stat</a></code></b>(ZZIP_FILE * file, ZZIP_STAT * zs)
35 : int
36 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_fstat">zzip_fstat</a></code></b>(ZZIP_FILE * file, ZZIP_STAT * zs)
37 : int
38 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_strerror">zzip_strerror</a></code></b>(int errcode)
39 : zzip_char_t *
40 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_strerror_of">zzip_strerror_of</a></code></b>(ZZIP_DIR * dir)
41 : zzip_char_t *
42 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_dir_open">zzip_dir_open</a></code></b>(zzip_char_t * filename, zzip_error_t * e)
43 : ZZIP_DIR *
44 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_dir_open_ext_io">zzip_dir_open_ext_io</a></code></b>(zzip_char_t * filename, zzip_error_t * e,
45 zzip_strings_t * ext, zzip_plugin_io_t io)
46 : ZZIP_DIR *
47 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_dir_read">zzip_dir_read</a></code></b>(ZZIP_DIR * dir, ZZIP_DIRENT * d)
48 : int
49 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_init_io">zzip_init_io</a></code></b>(zzip_plugin_io_handlers_t io, int flags)
50 : int
51 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_get_default_io">zzip_get_default_io</a></code></b>(void)
52 : zzip_plugin_io_t
53 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_rewinddir">zzip_rewinddir</a></code></b>(ZZIP_DIR * dir)
54 : void
55 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_telldir">zzip_telldir</a></code></b>(ZZIP_DIR * dir)
56 : zzip_off_t
57 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_seekdir">zzip_seekdir</a></code></b>(ZZIP_DIR * dir, zzip_off_t offset)
58 : void
59 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_telldir32">zzip_telldir32</a></code></b>(ZZIP_DIR * dir)
60 : long
61 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_seekdir32">zzip_seekdir32</a></code></b>(ZZIP_DIR * dir, long offset)
62 : void
63 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_fopen">zzip_fopen</a></code></b>(zzip_char_t * filename, zzip_char_t * mode)
64 : ZZIP_FILE *
65 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_freopen">zzip_freopen</a></code></b>(zzip_char_t * filename, zzip_char_t * mode, ZZIP_FILE * stream)
66 : ZZIP_FILE *
67 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_dirhandle">zzip_dirhandle</a></code></b>(ZZIP_FILE * fp)
68 : ZZIP_DIR *
69 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_dirfd">zzip_dirfd</a></code></b>(ZZIP_DIR * dir)
70 : int
71 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_seek">zzip_seek</a></code></b>(ZZIP_FILE * fp, zzip_off_t offset, int whence)
72 : zzip_off_t
73 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_seek32">zzip_seek32</a></code></b>(ZZIP_FILE * fp, long offset, int whence)
74 : long
75 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_read">zzip_read</a></code></b>(ZZIP_FILE * fp, void *buf, zzip_size_t len)
76 : zzip_ssize_t
77 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_fread">zzip_fread</a></code></b>(void *ptr, zzip_size_t size, zzip_size_t nmemb, ZZIP_FILE * file)
78 : zzip_size_t
79 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_dir_free">zzip_dir_free</a></code></b>(ZZIP_DIR * dir)
80 : int
81 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_dir_close">zzip_dir_close</a></code></b>(ZZIP_DIR * dir)
82 : int
83 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_fclose">zzip_fclose</a></code></b>(ZZIP_FILE * fp)
84 : int
85 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_close">zzip_close</a></code></b>(ZZIP_FILE * fp)
86 : int
87 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_dir_fdopen">zzip_dir_fdopen</a></code></b>(int fd, zzip_error_t * errcode_p)
88 : ZZIP_DIR *
89 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_dir_fdopen_ext_io">zzip_dir_fdopen_ext_io</a></code></b>(int fd, zzip_error_t * errcode_p,
90 zzip_strings_t * ext, const zzip_plugin_io_t io)
91 : ZZIP_DIR *
92 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_dir_alloc_ext_io">zzip_dir_alloc_ext_io</a></code></b>(zzip_strings_t * ext, const zzip_plugin_io_t io)
93 : ZZIP_DIR *
94 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_dir_alloc">zzip_dir_alloc</a></code></b>(zzip_strings_t * fileext)
95 : ZZIP_DIR *
96 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_readdir">zzip_readdir</a></code></b>(ZZIP_DIR * dir)
97 : ZZIP_DIRENT *
98 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_closedir">zzip_closedir</a></code></b>(ZZIP_DIR * dir)
99 : int
100 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_errno">zzip_errno</a></code></b>(int errcode)
101 : int
102 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_file_close">zzip_file_close</a></code></b>(ZZIP_FILE * fp)
103 : int
104 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_file_open">zzip_file_open</a></code></b>(ZZIP_DIR * dir, zzip_char_t * name, int o_mode)
105 : ZZIP_FILE *
106 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_inflate_init">zzip_inflate_init</a></code></b>(ZZIP_FILE * fp, struct zzip_dir_hdr *hdr)
107 : static int
108 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_file_read">zzip_file_read</a></code></b>(ZZIP_FILE * fp, void *buf, zzip_size_t len)
109 : zzip_ssize_t
110 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_rewind">zzip_rewind</a></code></b>(ZZIP_FILE * fp)
111 : int
112 </code></td></tr><tr><td valign="top"><code><b><code><a href="#zzip_compr_str">zzip_compr_str</a></code></b>(int compr)
113 : zzip_char_t *
114 </code></td></tr><tr><td valign="top"><code><b><code><a href="#__zzip_fetch_disk_trailer">__zzip_fetch_disk_trailer</a></code></b>(int fd, zzip_off_t filesize,
115 struct _disk_trailer *_zzip_restrict trailer,
116 zzip_plugin_io_t io)
117 : int
118 </code></td></tr><tr><td valign="top"><code><b><code><a href="#__zzip_parse_root_directory">__zzip_parse_root_directory</a></code></b>(int fd,
119 struct _disk_trailer *trailer,
120 struct zzip_dir_hdr **hdr_return,
121 zzip_plugin_io_t io)
122 : int
123 </code></td></tr><tr><td valign="top"><code><b><code><a href="#__zzip_try_open">__zzip_try_open</a></code></b>(zzip_char_t * filename, int filemode,
124 zzip_strings_t * ext, zzip_plugin_io_t io)
125 : int
126 </code></td></tr></table><h3>Documentation</h3><dl><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_error">zzip_error</a></b>(ZZIP_DIR * dir)
127 : int
128 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_seterror">zzip_seterror</a></b>(ZZIP_DIR * dir, int errcode) : void
129 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/info.c</small></em></td></table>
130 </td></tr><tr><td valign="top"><p> The <code>zzip_seterror</code> function just does dir->errcode = errcode
131 </p>
132 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_open">zzip_open</a></b>(zzip_char_t * filename, int o_flags)
133 : ZZIP_FILE *
134 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_open_ext_io">zzip_open_ext_io</a></b>(zzip_char_t * filename, int o_flags, int o_modes,
135 zzip_strings_t * ext, zzip_plugin_io_t io)
136 : ZZIP_FILE *
137 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_open_shared_io">zzip_open_shared_io</a></b>(ZZIP_FILE * stream,
138 zzip_char_t * filename, int o_flags, int o_modes,
139 zzip_strings_t * ext, zzip_plugin_io_t io)
140 : ZZIP_FILE *
141 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/file.c</small></em></td></table>
142 </td></tr><tr><td valign="top"><p>
143 The <code>zzip_open_ext_io</code> function uses explicit ext and io instead of the internal
144 defaults, setting them to zero is equivalent to <code><a href="#zzip_open">zzip_open</a></code>
145 </p><p>
146 note that the two flag types have been split into an o_flags
147 (for fcntl-like openflags) and o_modes where the latter shall
148 carry the zzip_flags and possibly accessmodes for unix filesystems.
149 Since this version of zziplib can not write zipfiles, it is not
150 yet used for anything else than zzip-specific modeflags.
151 </p><p>
152 The <code>zzip_open_ext_io</code> function returns a new zzip-handle (use <code><a href="#zzip_close">zzip_close</a></code> to return
153 it). On error the <code>zzip_open_ext_io</code> function will return null setting <a href="http://www.opengroup.org/onlinepubs/000095399/functions/errno.html"><code>errno(3)</code></a>.
154 </p><p>
155 If any ext_io handlers were used then the referenced structure
156 should be static as the allocated ZZIP_FILE does not copy them.
157 </p>
158 </td></tr><tr><td valign="top"><p>
159 The <code>zzip_open_shared_io</code> function takes an extra stream argument - if a handle has been
160 then ext/io can be left null and the new stream handle will pick up
161 the ext/io. This should be used only in specific environment however
162 since <code><a href="#zzip_file_real">zzip_file_real</a></code> does not store any ext-sequence.
163 </p><p>
164 The benefit for the <code>zzip_open_shared_io</code> function comes in when the old file handle
165 was openened from a file within a zip archive. When the new file
166 is in the same zip archive then the internal zzip_dir structures
167 will be shared. It is even quicker, as no check needs to be done
168 anymore trying to guess the zip archive place in the filesystem,
169 here we just check whether the zip archive's filepath is a prefix
170 part of the filename to be opened.
171 </p><p>
172 Note that the <code>zzip_open_shared_io</code> function is also used by <code><a href="#zzip_freopen">zzip_freopen</a></code> that
173 will unshare the old handle, thereby possibly closing the handle.
174 </p><p>
175 The <code>zzip_open_shared_io</code> function returns a new zzip-handle (use <code><a href="#zzip_close">zzip_close</a></code> to return
176 it). On error the <code>zzip_open_shared_io</code> function will return null setting <a href="http://www.opengroup.org/onlinepubs/000095399/functions/errno.html"><code>errno(3)</code></a>.
177 </p>
178 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_opendir">zzip_opendir</a></b>(zzip_char_t * filename)
179 : ZZIP_DIR *
180 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_opendir_ext_io">zzip_opendir_ext_io</a></b>(zzip_char_t * filename, int o_modes,
181 zzip_strings_t * ext, zzip_plugin_io_t io)
182 : ZZIP_DIR *
183 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/dir.c</small></em></td></table>
184 </td></tr><tr><td valign="top"><p> The <code>zzip_opendir_ext_io</code> function uses explicit ext and io instead of the internal
185 defaults, setting them to zero is equivalent to <code><a href="#zzip_opendir">zzip_opendir</a></code>
186 </p>
187 </td></tr></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_file_real">zzip_file_real</a></b>(ZZIP_FILE * fp)
188 : int
189 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_dir_real">zzip_dir_real</a></b>(ZZIP_DIR * dir)
190 : int
191 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_realdir">zzip_realdir</a></b>(ZZIP_DIR * dir)
192 : void *
193 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_realfd">zzip_realfd</a></b>(ZZIP_FILE * fp)
194 : int
195 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/info.c</small></em></td></table>
196 </td></tr><tr><td valign="top"><p> The <code>zzip_dir_real</code> function checks if the ZZIP_DIR-handle is wrapping
197 a real directory or a zip-archive.
198 Returns 1 for a stat'able directory, and 0 for a handle to zip-archive.
199 </p>
200 </td></tr><tr><td valign="top"><p> The <code>zzip_realdir</code> function returns the posix DIR* handle (if one exists).
201 Check before with <code><a href="#zzip_dir_real">zzip_dir_real</a></code> if the
202 the ZZIP_DIR points to a real directory.
203 </p>
204 </td></tr><tr><td valign="top"><p> The <code>zzip_realfd</code> function returns the posix file descriptor (if one exists).
205 Check before with <code><a href="#zzip_file_real">zzip_file_real</a></code> if the
206 the ZZIP_FILE points to a real file.
207 </p>
208 </td></tr></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_tell">zzip_tell</a></b>(ZZIP_FILE * fp)
209 : zzip_off_t
210 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_tell32">zzip_tell32</a></b>(ZZIP_FILE * fp)
211 : long
212 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/file.c</small></em></td></table>
213 </td></tr><tr><td valign="top"><p> The <code>zzip_tell32</code> function is provided for users who can not use any largefile-mode.
214 </p>
215 </td></tr></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_dir_stat">zzip_dir_stat</a></b>(ZZIP_DIR * dir, zzip_char_t * name, ZZIP_STAT * zs, int flags)
216 : int
217 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_file_stat">zzip_file_stat</a></b>(ZZIP_FILE * file, ZZIP_STAT * zs)
218 : int
219 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_fstat">zzip_fstat</a></b>(ZZIP_FILE * file, ZZIP_STAT * zs)
220 : int
221 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/stat.c</small></em></td></table>
222 </td></tr><tr><td valign="top"><p> The <code>zzip_file_stat</code> function will obtain information about a opened file _within_ a
223 zip-archive. The file is supposed to be open (otherwise -1 is returned).
224 The st_size stat-member contains the uncompressed size. The optional
225 d_name is never set here.
226 </p>
227 </td></tr><tr><td valign="top"><p> The <code>zzip_fstat</code> function will obtain information about a opened file which may be
228 either real/zipped. The file is supposed to be open (otherwise -1 is
229 returned). The st_size stat-member contains the uncompressed size.
230 The optional d_name is never set here. For a real file, we do set the
231 d_csize := st_size and d_compr := 0 for meaningful defaults.
232 </p>
233 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_strerror">zzip_strerror</a></b>(int errcode)
234 : zzip_char_t *
235 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_strerror_of">zzip_strerror_of</a></b>(ZZIP_DIR * dir)
236 : zzip_char_t *
237 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/err.c</small></em></td></table>
238 </td></tr><tr><td valign="top"><p> The <code>zzip_strerror_of</code> function fetches the errorcode from the <code>DIR-handle</code> and
239 runs it through <code><a href="#zzip_strerror">zzip_strerror</a></code> to obtain the static string
240 describing the error.
241 </p>
242 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_dir_open">zzip_dir_open</a></b>(zzip_char_t * filename, zzip_error_t * e)
243 : ZZIP_DIR *
244 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_dir_open_ext_io">zzip_dir_open_ext_io</a></b>(zzip_char_t * filename, zzip_error_t * e,
245 zzip_strings_t * ext, zzip_plugin_io_t io)
246 : ZZIP_DIR *
247 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_dir_read">zzip_dir_read</a></b>(ZZIP_DIR * dir, ZZIP_DIRENT * d)
248 : int
249 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/zip.c</small></em></td></table>
250 </td></tr><tr><td valign="top"><p> the <code>zzip_dir_open_ext_io</code> function uses explicit ext and io instead of the internal
251 defaults. Setting these to zero is equivalent to <code><a href="#zzip_dir_open">zzip_dir_open</a></code>
252 Note that the referenced ext_io plugin handlers structure must be
253 static as it is not copied to the returned ZZIP_DIR structure.
254 </p>
255 </td></tr><tr><td valign="top"><p> fills the dirent-argument with the values and
256 increments the read-pointer of the dir-argument.
257 </p><p>
258 returns 0 if there no entry (anymore).
259 </p>
260 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_init_io">zzip_init_io</a></b>(zzip_plugin_io_handlers_t io, int flags)
261 : int
262 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_get_default_io">zzip_get_default_io</a></b>(void)
263 : zzip_plugin_io_t
264 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/plugin.c</small></em></td></table>
265 </td></tr><tr><td valign="top"><p> The <code>zzip_get_default_io</code> function returns a zzip_plugin_io_t handle to static defaults
266 wrapping the posix io file functions for actual file access. The
267 returned structure is shared by all threads in the system.
268 </p>
269 </td></tr></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_rewinddir">zzip_rewinddir</a></b>(ZZIP_DIR * dir)
270 : void
271 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_telldir">zzip_telldir</a></b>(ZZIP_DIR * dir)
272 : zzip_off_t
273 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_seekdir">zzip_seekdir</a></b>(ZZIP_DIR * dir, zzip_off_t offset)
274 : void
275 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_telldir32">zzip_telldir32</a></b>(ZZIP_DIR * dir)
276 : long
277 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_seekdir32">zzip_seekdir32</a></b>(ZZIP_DIR * dir, long offset)
278 : void
279 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em> </em> </td><td align="right"> <em><small>zzip/dir.c</small></em></td></table><p> The <code>zzip_rewinddir</code> function is the equivalent of a <a href="http://www.opengroup.org/onlinepubs/000095399/functions/rewinddir.html"><code>rewinddir(2)</code></a> for a realdir or
280 the zipfile in place of a directory. The ZZIP_DIR handle returned from
281 <code><a href="#zzip_opendir">zzip_opendir</a></code> has a flag saying realdir or zipfile. As for a zipfile,
282 the filenames will include the filesubpath, so take care.
283 </p>
284 </td></tr><tr><td valign="top"><p> The <code>zzip_telldir</code> function is the equivalent of <a href="http://www.opengroup.org/onlinepubs/000095399/functions/telldir.html"><code>telldir(2)</code></a> for a realdir or zipfile.
285 </p>
286 </td></tr><tr><td valign="top"><p> The <code>zzip_seekdir</code> function is the equivalent of <a href="http://www.opengroup.org/onlinepubs/000095399/functions/seekdir.html"><code>seekdir(2)</code></a> for a realdir or zipfile.
287 </p>
288 </td></tr><tr><td valign="top"><p> The <code>zzip_telldir32</code> function is provided for users who can not use any largefile-mode.
289 </p>
290 </td></tr><tr><td valign="top"><p> The <code>zzip_seekdir32</code> function is provided for users who can not use any largefile-mode.
291 </p>
292 </td></tr></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_fopen">zzip_fopen</a></b>(zzip_char_t * filename, zzip_char_t * mode)
293 : ZZIP_FILE *
294 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_freopen">zzip_freopen</a></b>(zzip_char_t * filename, zzip_char_t * mode, ZZIP_FILE * stream)
295 : ZZIP_FILE *
296 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em> </em> </td><td align="right"> <em><small>zzip/file.c</small></em></td></table><p> The <code>zzip_fopen</code> function will <a href="http://www.opengroup.org/onlinepubs/000095399/functions/fopen.html"><code>fopen(3)</code></a> a real/zipped file.
297 </p><p>
298 It has some magic functionality builtin - it will first try to open
299 the given <em>filename</em> as a normal file. If it does not
300 exist, the given path to the filename (if any) is split into
301 its directory-part and the file-part. A ".zip" extension is
302 then added to the directory-part to create the name of a
303 zip-archive. That zip-archive (if it exists) is being searched
304 for the file-part, and if found a zzip-handle is returned.
305 </p><p>
306 Note that if the file is found in the normal fs-directory the
307 returned structure is mostly empty and the <code><a href="#zzip_read">zzip_read</a></code> call will
308 use the libc <a href="http://www.opengroup.org/onlinepubs/000095399/functions/read.html"><code>read(2)</code></a> to obtain data. Otherwise a <code><a href="#zzip_file_open">zzip_file_open</a></code>
309 is performed and any error mapped to <a href="http://www.opengroup.org/onlinepubs/000095399/functions/errno.html"><code>errno(3)</code></a>.
310 </p><p>
311 unlike the posix-wrapper <code><a href="#zzip_open">zzip_open</a></code> the mode-argument is
312 a string which allows for more freedom to support the extra
313 zzip modes called ZZIP_CASEINSENSITIVE and ZZIP_IGNOREPATH.
314 Currently, this <code><a href="#zzip_fopen">zzip_fopen</a></code> call will convert the following
315 characters in the mode-string into their corrsponding mode-bits:
316 </p><ul><li><p> <code> "r" : O_RDONLY : </code> read-only </p></li>
317 <li><p> <code> "b" : O_BINARY : </code> binary (win32 specific) </p></li>
318 <li><p> <code> "f" : O_NOCTTY : </code> no char device (unix) </p></li>
319 <li><p> <code> "i" : ZZIP_CASELESS : </code> inside zip file </p></li>
320 <li><p> <code> "*" : ZZIP_NOPATHS : </code> inside zip file only </p></li>
321 </ul><p> all other modes will be ignored for zip-contained entries
322 but they are transferred for compatibility and portability,
323 including these extra sugar bits:
324 </p><ul><li><p> <code> "x" : O_EXCL :</code> fail if file did exist </p></li>
325 <li><p> <code> "s" : O_SYNC :</code> synchronized access </p></li>
326 <li><p> <code> "n" : O_NONBLOCK :</code> nonblocking access </p></li>
327 <li><p> <code> "z#" : compression level :</code> for zlib </p></li>
328 <li><p> <code> "g#" : group access :</code> unix access bits </p></li>
329 <li><p> <code> "u#" : owner access :</code> unix access bits </p></li>
330 <li><p> <code> "o#" : world access :</code> unix access bits </p></li>
331 </ul><p> ... the access bits are in traditional unix bit format
332 with 7 = read/write/execute, 6 = read/write, 4 = read-only.
333 </p><p>
334 The default access mode is 0664, and the compression level
335 is ignored since the lib can not yet write zip files, otherwise
336 it would be the initialisation value for the zlib deflateInit
337 where 0 = no-compression, 1 = best-speed, 9 = best-compression.
338 </p><p>
339 The <code>zzip_fopen</code> function returns a new zzip-handle (use <code><a href="#zzip_close">zzip_close</a></code> to return
340 it). On error the <code>zzip_fopen</code> function will return null setting <a href="http://www.opengroup.org/onlinepubs/000095399/functions/errno.html"><code>errno(3)</code></a>.
341 </p>
342 </td></tr><tr><td valign="top"><p>
343 The <code>zzip_freopen</code> function receives an additional argument pointing to
344 a ZZIP_FILE* being already in use. If this extra argument is
345 null then the <code>zzip_freopen</code> function is identical with calling <code><a href="#zzip_fopen">zzip_fopen</a></code>
346 </p><p>
347 Per default, the old file stream is closed and only the internal
348 structures associated with it are kept. These internal structures
349 may be reused for the return value, and this is a lot quicker when
350 the filename matches a zipped file that is incidently in the very
351 same zip arch as the old filename wrapped in the stream struct.
352 </p><p>
353 That's simply because the zip arch's central directory does not
354 need to be read again. As an extension for the <code>zzip_freopen</code> function, if the
355 mode-string contains a "q" then the old stream is not closed but
356 left untouched, instead it is only given as a hint that a new
357 file handle may share/copy the zip arch structures of the old file
358 handle if that is possible, i.e when they are in the same zip arch.
359 </p><p>
360 The <code>zzip_freopen</code> function returns a new zzip-handle (use <code><a href="#zzip_close">zzip_close</a></code> to return
361 it). On error the <code>zzip_freopen</code> function will return null setting <a href="http://www.opengroup.org/onlinepubs/000095399/functions/errno.html"><code>errno(3)</code></a>.
362 </p>
363 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_dirhandle">zzip_dirhandle</a></b>(ZZIP_FILE * fp)
364 : ZZIP_DIR *
365 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_dirfd">zzip_dirfd</a></b>(ZZIP_DIR * dir)
366 : int
367 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/info.c</small></em></td></table>
368 </td></tr><tr><td valign="top"><p> The <code>zzip_dirfd</code> function will just return dir->fd
369 </p><p>
370 If a ZZIP_DIR does point to a zipfile then the file-descriptor of that
371 zipfile is returned, otherwise a NULL is returned and the ZZIP_DIR wraps
372 a real directory DIR (if you have dirent on your system).
373 </p>
374 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_seek">zzip_seek</a></b>(ZZIP_FILE * fp, zzip_off_t offset, int whence)
375 : zzip_off_t
376 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_seek32">zzip_seek32</a></b>(ZZIP_FILE * fp, long offset, int whence)
377 : long
378 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/file.c</small></em></td></table>
379 </td></tr><tr><td valign="top"><p> The <code>zzip_seek32</code> function is provided for users who can not use any largefile-mode.
380 </p>
381 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_read">zzip_read</a></b>(ZZIP_FILE * fp, void *buf, zzip_size_t len)
382 : zzip_ssize_t
383 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_fread">zzip_fread</a></b>(void *ptr, zzip_size_t size, zzip_size_t nmemb, ZZIP_FILE * file)
384 : zzip_size_t
385 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/file.c</small></em></td></table>
386 </td></tr><tr><td valign="top">
387 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_dir_free">zzip_dir_free</a></b>(ZZIP_DIR * dir)
388 : int
389 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_dir_close">zzip_dir_close</a></b>(ZZIP_DIR * dir)
390 : int
391 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/zip.c</small></em></td></table>
392 </td></tr><tr><td valign="top"><p> It will also <a href="http://www.opengroup.org/onlinepubs/000095399/functions/free.html"><code>free(2)</code></a> the <code>ZZIP_DIR-handle</code> given.
393 the counterpart for <code><a href="#zzip_dir_open">zzip_dir_open</a></code>
394 see also <code><a href="#zzip_dir_free">zzip_dir_free</a></code>
395 </p>
396 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_fclose">zzip_fclose</a></b>(ZZIP_FILE * fp)
397 : int
398 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_close">zzip_close</a></b>(ZZIP_FILE * fp)
399 : int
400 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/file.c</small></em></td></table>
401 </td></tr><tr><td valign="top">
402 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_dir_fdopen">zzip_dir_fdopen</a></b>(int fd, zzip_error_t * errcode_p)
403 : ZZIP_DIR *
404 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_dir_fdopen_ext_io">zzip_dir_fdopen_ext_io</a></b>(int fd, zzip_error_t * errcode_p,
405 zzip_strings_t * ext, const zzip_plugin_io_t io)
406 : ZZIP_DIR *
407 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/zip.c</small></em></td></table>
408 </td></tr><tr><td valign="top"><p> the <code>zzip_dir_fdopen_ext_io</code> function uses explicit ext and io instead of the internal
409 defaults, setting these to zero is equivalent to <code><a href="#zzip_dir_fdopen">zzip_dir_fdopen</a></code>
410 </p>
411 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_dir_alloc_ext_io">zzip_dir_alloc_ext_io</a></b>(zzip_strings_t * ext, const zzip_plugin_io_t io)
412 : ZZIP_DIR *
413 </code></td></tr><tr><td valign="top"><code><b><a name="zzip_dir_alloc">zzip_dir_alloc</a></b>(zzip_strings_t * fileext)
414 : ZZIP_DIR *
415 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/zip.c</small></em></td></table>
416 </td></tr><tr><td valign="top"><p> the <code>zzip_dir_alloc</code> function is obsolete - it was generally used for implementation
417 and exported to let other code build on it. It is now advised to
418 use <code><a href="#zzip_dir_alloc_ext_io">zzip_dir_alloc_ext_io</a></code> now on explicitly, just set that second
419 argument to zero to achieve the same functionality as the old style.
420 </p>
421 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_readdir">zzip_readdir</a></b>(ZZIP_DIR * dir)
422 : ZZIP_DIRENT *
423 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/dir.c</small></em></td></table>
424 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_closedir">zzip_closedir</a></b>(ZZIP_DIR * dir)
425 : int
426 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/dir.c</small></em></td></table>
427 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_errno">zzip_errno</a></b>(int errcode)
428 : int
429 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/err.c</small></em></td></table>
430 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_file_close">zzip_file_close</a></b>(ZZIP_FILE * fp)
431 : int
432 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/file.c</small></em></td></table>
433 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_file_open">zzip_file_open</a></b>(ZZIP_DIR * dir, zzip_char_t * name, int o_mode)
434 : ZZIP_FILE *
435 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/file.c</small></em></td></table>
436 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_inflate_init">zzip_inflate_init</a></b>(ZZIP_FILE * fp, struct zzip_dir_hdr *hdr)
437 : static int
438 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/file.c</small></em></td></table>
439 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_file_read">zzip_file_read</a></b>(ZZIP_FILE * fp, void *buf, zzip_size_t len)
440 : zzip_ssize_t
441 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/file.c</small></em></td></table>
442 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_rewind">zzip_rewind</a></b>(ZZIP_FILE * fp)
443 : int
444 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/file.c</small></em></td></table>
445 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="zzip_compr_str">zzip_compr_str</a></b>(int compr)
446 : zzip_char_t *
447 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/info.c</small></em></td></table>
448 </td></tr></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="__zzip_fetch_disk_trailer">__zzip_fetch_disk_trailer</a></b>(int fd, zzip_off_t filesize,
449 struct _disk_trailer *_zzip_restrict trailer,
450 zzip_plugin_io_t io)
451 : int
452 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/zip.c</small></em></td></table>
453 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="__zzip_parse_root_directory">__zzip_parse_root_directory</a></b>(int fd,
454 struct _disk_trailer *trailer,
455 struct zzip_dir_hdr **hdr_return,
456 zzip_plugin_io_t io)
457 : int
458 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/zip.c</small></em></td></table>
459 </td></tr></table></dd><dt><table width="100%"><tr><td valign="top"><code><b><a name="__zzip_try_open">__zzip_try_open</a></b>(zzip_char_t * filename, int filemode,
460 zzip_strings_t * ext, zzip_plugin_io_t io)
461 : int
462 </code></td></tr></table></dt><dd><table width="100%"><tr><td valign="top"><table border="0" width="100%" cellpadding="0" cellspacing="0"><td> &nbsp;<em>...</em> </td><td align="right"> <em><small>zzip/zip.c</small></em></td></table>
463 </td></tr></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd><dt><table width="100%"></table></dt><dd><table width="100%"></table></dd></dl>
464 </body></html>