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