xref: /trunk/main/extensions/source/macosx/spotlight/unzip.h (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir *************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir /* unzip.h -- IO for uncompress .zip files using zlib
29*cdf0e10cSrcweir    Version 1.01e, February 12th, 2005
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir    Copyright (C) 1998-2005 Gilles Vollant
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir    This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
34*cdf0e10cSrcweir      WinZip, InfoZip tools and compatible.
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir    Multi volume ZipFile (span) are not supported.
37*cdf0e10cSrcweir    Encryption compatible with pkzip 2.04g only supported
38*cdf0e10cSrcweir    Old compressions used by old PKZip 1.x are not supported
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir    I WAIT FEEDBACK at mail info@winimage.com
42*cdf0e10cSrcweir    Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir    Condition of use and distribution are the same than zlib :
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir   This software is provided 'as-is', without any express or implied
47*cdf0e10cSrcweir   warranty.  In no event will the authors be held liable for any damages
48*cdf0e10cSrcweir   arising from the use of this software.
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir   Permission is granted to anyone to use this software for any purpose,
51*cdf0e10cSrcweir   including commercial applications, and to alter it and redistribute it
52*cdf0e10cSrcweir   freely, subject to the following restrictions:
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir   1. The origin of this software must not be misrepresented; you must not
55*cdf0e10cSrcweir      claim that you wrote the original software. If you use this software
56*cdf0e10cSrcweir      in a product, an acknowledgment in the product documentation would be
57*cdf0e10cSrcweir      appreciated but is not required.
58*cdf0e10cSrcweir   2. Altered source versions must be plainly marked as such, and must not be
59*cdf0e10cSrcweir      misrepresented as being the original software.
60*cdf0e10cSrcweir   3. This notice may not be removed or altered from any source distribution.
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir */
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir /* for more info about .ZIP format, see
66*cdf0e10cSrcweir       http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip
67*cdf0e10cSrcweir       http://www.info-zip.org/pub/infozip/doc/
68*cdf0e10cSrcweir    PkWare has also a specification at :
69*cdf0e10cSrcweir       ftp://ftp.pkware.com/probdesc.zip
70*cdf0e10cSrcweir */
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir #ifndef _unz_H
73*cdf0e10cSrcweir #define _unz_H
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir #ifdef __cplusplus
76*cdf0e10cSrcweir extern "C" {
77*cdf0e10cSrcweir #endif
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir #include <zlib.h>
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir #include "ioapi.h"
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
84*cdf0e10cSrcweir /* like the STRICT of WIN32, we define a pointer that cannot be converted
85*cdf0e10cSrcweir     from (void*) without cast */
86*cdf0e10cSrcweir typedef struct TagunzFile__ { int unused; } unzFile__;
87*cdf0e10cSrcweir typedef unzFile__ *unzFile;
88*cdf0e10cSrcweir #else
89*cdf0e10cSrcweir typedef voidp unzFile;
90*cdf0e10cSrcweir #endif
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir #define UNZ_OK                          (0)
94*cdf0e10cSrcweir #define UNZ_END_OF_LIST_OF_FILE         (-100)
95*cdf0e10cSrcweir #define UNZ_ERRNO                       (Z_ERRNO)
96*cdf0e10cSrcweir #define UNZ_EOF                         (0)
97*cdf0e10cSrcweir #define UNZ_PARAMERROR                  (-102)
98*cdf0e10cSrcweir #define UNZ_BADZIPFILE                  (-103)
99*cdf0e10cSrcweir #define UNZ_INTERNALERROR               (-104)
100*cdf0e10cSrcweir #define UNZ_CRCERROR                    (-105)
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir /* tm_unz contain date/time info */
103*cdf0e10cSrcweir typedef struct tm_unz_s
104*cdf0e10cSrcweir {
105*cdf0e10cSrcweir     uInt tm_sec;            /* seconds after the minute - [0,59] */
106*cdf0e10cSrcweir     uInt tm_min;            /* minutes after the hour - [0,59] */
107*cdf0e10cSrcweir     uInt tm_hour;           /* hours since midnight - [0,23] */
108*cdf0e10cSrcweir     uInt tm_mday;           /* day of the month - [1,31] */
109*cdf0e10cSrcweir     uInt tm_mon;            /* months since January - [0,11] */
110*cdf0e10cSrcweir     uInt tm_year;           /* years - [1980..2044] */
111*cdf0e10cSrcweir } tm_unz;
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir /* unz_global_info structure contain global data about the ZIPfile
114*cdf0e10cSrcweir    These data comes from the end of central dir */
115*cdf0e10cSrcweir typedef struct unz_global_info_s
116*cdf0e10cSrcweir {
117*cdf0e10cSrcweir     uLong number_entry;         /* total number of entries in
118*cdf0e10cSrcweir                        the central dir on this disk */
119*cdf0e10cSrcweir     uLong size_comment;         /* size of the global comment of the zipfile */
120*cdf0e10cSrcweir } unz_global_info;
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir /* unz_file_info contain information about a file in the zipfile */
124*cdf0e10cSrcweir typedef struct unz_file_info_s
125*cdf0e10cSrcweir {
126*cdf0e10cSrcweir     uLong version;              /* version made by                 2 bytes */
127*cdf0e10cSrcweir     uLong version_needed;       /* version needed to extract       2 bytes */
128*cdf0e10cSrcweir     uLong flag;                 /* general purpose bit flag        2 bytes */
129*cdf0e10cSrcweir     uLong compression_method;   /* compression method              2 bytes */
130*cdf0e10cSrcweir     uLong dosDate;              /* last mod file date in Dos fmt   4 bytes */
131*cdf0e10cSrcweir     uLong crc;                  /* crc-32                          4 bytes */
132*cdf0e10cSrcweir     uLong compressed_size;      /* compressed size                 4 bytes */
133*cdf0e10cSrcweir     uLong uncompressed_size;    /* uncompressed size               4 bytes */
134*cdf0e10cSrcweir     uLong size_filename;        /* filename length                 2 bytes */
135*cdf0e10cSrcweir     uLong size_file_extra;      /* extra field length              2 bytes */
136*cdf0e10cSrcweir     uLong size_file_comment;    /* file comment length             2 bytes */
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir     uLong disk_num_start;       /* disk number start               2 bytes */
139*cdf0e10cSrcweir     uLong internal_fa;          /* internal file attributes        2 bytes */
140*cdf0e10cSrcweir     uLong external_fa;          /* external file attributes        4 bytes */
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir     tm_unz tmu_date;
143*cdf0e10cSrcweir } unz_file_info;
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
146*cdf0e10cSrcweir                                                  const char* fileName2,
147*cdf0e10cSrcweir                                                  int iCaseSensitivity));
148*cdf0e10cSrcweir /*
149*cdf0e10cSrcweir    Compare two filename (fileName1,fileName2).
150*cdf0e10cSrcweir    If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
151*cdf0e10cSrcweir    If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
152*cdf0e10cSrcweir                                 or strcasecmp)
153*cdf0e10cSrcweir    If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
154*cdf0e10cSrcweir     (like 1 on Unix, 2 on Windows)
155*cdf0e10cSrcweir */
156*cdf0e10cSrcweir 
157*cdf0e10cSrcweir 
158*cdf0e10cSrcweir extern unzFile ZEXPORT unzOpen OF((const char *path));
159*cdf0e10cSrcweir /*
160*cdf0e10cSrcweir   Open a Zip file. path contain the full pathname (by example,
161*cdf0e10cSrcweir      on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer
162*cdf0e10cSrcweir      "zlib/zlib113.zip".
163*cdf0e10cSrcweir      If the zipfile cannot be opened (file don't exist or in not valid), the
164*cdf0e10cSrcweir        return value is NULL.
165*cdf0e10cSrcweir      Else, the return value is a unzFile Handle, usable with other function
166*cdf0e10cSrcweir        of this unzip package.
167*cdf0e10cSrcweir */
168*cdf0e10cSrcweir 
169*cdf0e10cSrcweir extern unzFile ZEXPORT unzOpen2 OF((const char *path,
170*cdf0e10cSrcweir                                     zlib_filefunc_def* pzlib_filefunc_def));
171*cdf0e10cSrcweir /*
172*cdf0e10cSrcweir    Open a Zip file, like unzOpen, but provide a set of file low level API
173*cdf0e10cSrcweir       for read/write the zip file (see ioapi.h)
174*cdf0e10cSrcweir */
175*cdf0e10cSrcweir 
176*cdf0e10cSrcweir extern int ZEXPORT unzClose OF((unzFile file));
177*cdf0e10cSrcweir /*
178*cdf0e10cSrcweir   Close a ZipFile opened with unzipOpen.
179*cdf0e10cSrcweir   If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
180*cdf0e10cSrcweir     these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
181*cdf0e10cSrcweir   return UNZ_OK if there is no problem. */
182*cdf0e10cSrcweir 
183*cdf0e10cSrcweir extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
184*cdf0e10cSrcweir                                         unz_global_info *pglobal_info));
185*cdf0e10cSrcweir /*
186*cdf0e10cSrcweir   Write info about the ZipFile in the *pglobal_info structure.
187*cdf0e10cSrcweir   No preparation of the structure is needed
188*cdf0e10cSrcweir   return UNZ_OK if there is no problem. */
189*cdf0e10cSrcweir 
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
192*cdf0e10cSrcweir                                            char *szComment,
193*cdf0e10cSrcweir                                            uLong uSizeBuf));
194*cdf0e10cSrcweir /*
195*cdf0e10cSrcweir   Get the global comment string of the ZipFile, in the szComment buffer.
196*cdf0e10cSrcweir   uSizeBuf is the size of the szComment buffer.
197*cdf0e10cSrcweir   return the number of byte copied or an error code <0
198*cdf0e10cSrcweir */
199*cdf0e10cSrcweir 
200*cdf0e10cSrcweir 
201*cdf0e10cSrcweir /***************************************************************************/
202*cdf0e10cSrcweir /* Unzip package allow you browse the directory of the zipfile */
203*cdf0e10cSrcweir 
204*cdf0e10cSrcweir extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
205*cdf0e10cSrcweir /*
206*cdf0e10cSrcweir   Set the current file of the zipfile to the first file.
207*cdf0e10cSrcweir   return UNZ_OK if there is no problem
208*cdf0e10cSrcweir */
209*cdf0e10cSrcweir 
210*cdf0e10cSrcweir extern int ZEXPORT unzGoToNextFile OF((unzFile file));
211*cdf0e10cSrcweir /*
212*cdf0e10cSrcweir   Set the current file of the zipfile to the next file.
213*cdf0e10cSrcweir   return UNZ_OK if there is no problem
214*cdf0e10cSrcweir   return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
215*cdf0e10cSrcweir */
216*cdf0e10cSrcweir 
217*cdf0e10cSrcweir extern int ZEXPORT unzLocateFile OF((unzFile file,
218*cdf0e10cSrcweir                      const char *szFileName,
219*cdf0e10cSrcweir                      int iCaseSensitivity));
220*cdf0e10cSrcweir /*
221*cdf0e10cSrcweir   Try locate the file szFileName in the zipfile.
222*cdf0e10cSrcweir   For the iCaseSensitivity signification, see unzStringFileNameCompare
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir   return value :
225*cdf0e10cSrcweir   UNZ_OK if the file is found. It becomes the current file.
226*cdf0e10cSrcweir   UNZ_END_OF_LIST_OF_FILE if the file is not found
227*cdf0e10cSrcweir */
228*cdf0e10cSrcweir 
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir /* ****************************************** */
231*cdf0e10cSrcweir /* Ryan supplied functions */
232*cdf0e10cSrcweir /* unz_file_info contain information about a file in the zipfile */
233*cdf0e10cSrcweir typedef struct unz_file_pos_s
234*cdf0e10cSrcweir {
235*cdf0e10cSrcweir     uLong pos_in_zip_directory;   /* offset in zip file directory */
236*cdf0e10cSrcweir     uLong num_of_file;            /* # of file */
237*cdf0e10cSrcweir } unz_file_pos;
238*cdf0e10cSrcweir 
239*cdf0e10cSrcweir extern int ZEXPORT unzGetFilePos(
240*cdf0e10cSrcweir     unzFile file,
241*cdf0e10cSrcweir     unz_file_pos* file_pos);
242*cdf0e10cSrcweir 
243*cdf0e10cSrcweir extern int ZEXPORT unzGoToFilePos(
244*cdf0e10cSrcweir     unzFile file,
245*cdf0e10cSrcweir     unz_file_pos* file_pos);
246*cdf0e10cSrcweir 
247*cdf0e10cSrcweir /* ****************************************** */
248*cdf0e10cSrcweir 
249*cdf0e10cSrcweir extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
250*cdf0e10cSrcweir                          unz_file_info *pfile_info,
251*cdf0e10cSrcweir                          char *szFileName,
252*cdf0e10cSrcweir                          uLong fileNameBufferSize,
253*cdf0e10cSrcweir                          void *extraField,
254*cdf0e10cSrcweir                          uLong extraFieldBufferSize,
255*cdf0e10cSrcweir                          char *szComment,
256*cdf0e10cSrcweir                          uLong commentBufferSize));
257*cdf0e10cSrcweir /*
258*cdf0e10cSrcweir   Get Info about the current file
259*cdf0e10cSrcweir   if pfile_info!=NULL, the *pfile_info structure will contain somes info about
260*cdf0e10cSrcweir         the current file
261*cdf0e10cSrcweir   if szFileName!=NULL, the filemane string will be copied in szFileName
262*cdf0e10cSrcweir             (fileNameBufferSize is the size of the buffer)
263*cdf0e10cSrcweir   if extraField!=NULL, the extra field information will be copied in extraField
264*cdf0e10cSrcweir             (extraFieldBufferSize is the size of the buffer).
265*cdf0e10cSrcweir             This is the Central-header version of the extra field
266*cdf0e10cSrcweir   if szComment!=NULL, the comment string of the file will be copied in szComment
267*cdf0e10cSrcweir             (commentBufferSize is the size of the buffer)
268*cdf0e10cSrcweir */
269*cdf0e10cSrcweir 
270*cdf0e10cSrcweir /***************************************************************************/
271*cdf0e10cSrcweir /* for reading the content of the current zipfile, you can open it, read data
272*cdf0e10cSrcweir    from it, and close it (you can close it before reading all the file)
273*cdf0e10cSrcweir    */
274*cdf0e10cSrcweir 
275*cdf0e10cSrcweir extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
276*cdf0e10cSrcweir /*
277*cdf0e10cSrcweir   Open for reading data the current file in the zipfile.
278*cdf0e10cSrcweir   If there is no error, the return value is UNZ_OK.
279*cdf0e10cSrcweir */
280*cdf0e10cSrcweir 
281*cdf0e10cSrcweir extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file,
282*cdf0e10cSrcweir                                                   const char* password));
283*cdf0e10cSrcweir /*
284*cdf0e10cSrcweir   Open for reading data the current file in the zipfile.
285*cdf0e10cSrcweir   password is a crypting password
286*cdf0e10cSrcweir   If there is no error, the return value is UNZ_OK.
287*cdf0e10cSrcweir */
288*cdf0e10cSrcweir 
289*cdf0e10cSrcweir extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file,
290*cdf0e10cSrcweir                                            int* method,
291*cdf0e10cSrcweir                                            int* level,
292*cdf0e10cSrcweir                                            int raw));
293*cdf0e10cSrcweir /*
294*cdf0e10cSrcweir   Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
295*cdf0e10cSrcweir     if raw==1
296*cdf0e10cSrcweir   *method will receive method of compression, *level will receive level of
297*cdf0e10cSrcweir      compression
298*cdf0e10cSrcweir   note : you can set level parameter as NULL (if you did not want known level,
299*cdf0e10cSrcweir          but you CANNOT set method parameter as NULL
300*cdf0e10cSrcweir */
301*cdf0e10cSrcweir 
302*cdf0e10cSrcweir extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file,
303*cdf0e10cSrcweir                                            int* method,
304*cdf0e10cSrcweir                                            int* level,
305*cdf0e10cSrcweir                                            int raw,
306*cdf0e10cSrcweir                                            const char* password));
307*cdf0e10cSrcweir /*
308*cdf0e10cSrcweir   Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
309*cdf0e10cSrcweir     if raw==1
310*cdf0e10cSrcweir   *method will receive method of compression, *level will receive level of
311*cdf0e10cSrcweir      compression
312*cdf0e10cSrcweir   note : you can set level parameter as NULL (if you did not want known level,
313*cdf0e10cSrcweir          but you CANNOT set method parameter as NULL
314*cdf0e10cSrcweir */
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir 
317*cdf0e10cSrcweir extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
318*cdf0e10cSrcweir /*
319*cdf0e10cSrcweir   Close the file in zip opened with unzOpenCurrentFile
320*cdf0e10cSrcweir   Return UNZ_CRCERROR if all the file was read but the CRC is not good
321*cdf0e10cSrcweir */
322*cdf0e10cSrcweir 
323*cdf0e10cSrcweir extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
324*cdf0e10cSrcweir                       voidp buf,
325*cdf0e10cSrcweir                       unsigned len));
326*cdf0e10cSrcweir /*
327*cdf0e10cSrcweir   Read bytes from the current file (opened by unzOpenCurrentFile)
328*cdf0e10cSrcweir   buf contain buffer where data must be copied
329*cdf0e10cSrcweir   len the size of buf.
330*cdf0e10cSrcweir 
331*cdf0e10cSrcweir   return the number of byte copied if somes bytes are copied
332*cdf0e10cSrcweir   return 0 if the end of file was reached
333*cdf0e10cSrcweir   return <0 with error code if there is an error
334*cdf0e10cSrcweir     (UNZ_ERRNO for IO error, or zLib error for uncompress error)
335*cdf0e10cSrcweir */
336*cdf0e10cSrcweir 
337*cdf0e10cSrcweir extern z_off_t ZEXPORT unztell OF((unzFile file));
338*cdf0e10cSrcweir /*
339*cdf0e10cSrcweir   Give the current position in uncompressed data
340*cdf0e10cSrcweir */
341*cdf0e10cSrcweir 
342*cdf0e10cSrcweir extern int ZEXPORT unzeof OF((unzFile file));
343*cdf0e10cSrcweir /*
344*cdf0e10cSrcweir   return 1 if the end of file was reached, 0 elsewhere
345*cdf0e10cSrcweir */
346*cdf0e10cSrcweir 
347*cdf0e10cSrcweir extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
348*cdf0e10cSrcweir                                              voidp buf,
349*cdf0e10cSrcweir                                              unsigned len));
350*cdf0e10cSrcweir /*
351*cdf0e10cSrcweir   Read extra field from the current file (opened by unzOpenCurrentFile)
352*cdf0e10cSrcweir   This is the local-header version of the extra field (sometimes, there is
353*cdf0e10cSrcweir     more info in the local-header version than in the central-header)
354*cdf0e10cSrcweir 
355*cdf0e10cSrcweir   if buf==NULL, it return the size of the local extra field
356*cdf0e10cSrcweir 
357*cdf0e10cSrcweir   if buf!=NULL, len is the size of the buffer, the extra header is copied in
358*cdf0e10cSrcweir     buf.
359*cdf0e10cSrcweir   the return value is the number of bytes copied in buf, or (if <0)
360*cdf0e10cSrcweir     the error code
361*cdf0e10cSrcweir */
362*cdf0e10cSrcweir 
363*cdf0e10cSrcweir /***************************************************************************/
364*cdf0e10cSrcweir 
365*cdf0e10cSrcweir /* Get the current file offset */
366*cdf0e10cSrcweir extern uLong ZEXPORT unzGetOffset (unzFile file);
367*cdf0e10cSrcweir 
368*cdf0e10cSrcweir /* Set the current file offset */
369*cdf0e10cSrcweir extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
370*cdf0e10cSrcweir 
371*cdf0e10cSrcweir 
372*cdf0e10cSrcweir 
373*cdf0e10cSrcweir #ifdef __cplusplus
374*cdf0e10cSrcweir }
375*cdf0e10cSrcweir #endif
376*cdf0e10cSrcweir 
377*cdf0e10cSrcweir #endif /* _unz_H */
378