xref: /netbsd-src/external/gpl3/binutils.old/dist/zlib/contrib/minizip/unzip.h (revision e992f068c547fd6e84b3f104dc2340adcc955732)
175fd0b74Schristos /* unzip.h -- IO for uncompress .zip files using zlib
275fd0b74Schristos    Version 1.1, February 14h, 2010
375fd0b74Schristos    part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
475fd0b74Schristos 
575fd0b74Schristos          Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
675fd0b74Schristos 
775fd0b74Schristos          Modifications of Unzip for Zip64
875fd0b74Schristos          Copyright (C) 2007-2008 Even Rouault
975fd0b74Schristos 
1075fd0b74Schristos          Modifications for Zip64 support on both zip and unzip
1175fd0b74Schristos          Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
1275fd0b74Schristos 
1375fd0b74Schristos          For more info read MiniZip_info.txt
1475fd0b74Schristos 
1575fd0b74Schristos          ---------------------------------------------------------------------------------
1675fd0b74Schristos 
1775fd0b74Schristos         Condition of use and distribution are the same than zlib :
1875fd0b74Schristos 
1975fd0b74Schristos   This software is provided 'as-is', without any express or implied
2075fd0b74Schristos   warranty.  In no event will the authors be held liable for any damages
2175fd0b74Schristos   arising from the use of this software.
2275fd0b74Schristos 
2375fd0b74Schristos   Permission is granted to anyone to use this software for any purpose,
2475fd0b74Schristos   including commercial applications, and to alter it and redistribute it
2575fd0b74Schristos   freely, subject to the following restrictions:
2675fd0b74Schristos 
2775fd0b74Schristos   1. The origin of this software must not be misrepresented; you must not
2875fd0b74Schristos      claim that you wrote the original software. If you use this software
2975fd0b74Schristos      in a product, an acknowledgment in the product documentation would be
3075fd0b74Schristos      appreciated but is not required.
3175fd0b74Schristos   2. Altered source versions must be plainly marked as such, and must not be
3275fd0b74Schristos      misrepresented as being the original software.
3375fd0b74Schristos   3. This notice may not be removed or altered from any source distribution.
3475fd0b74Schristos 
3575fd0b74Schristos   ---------------------------------------------------------------------------------
3675fd0b74Schristos 
3775fd0b74Schristos         Changes
3875fd0b74Schristos 
3975fd0b74Schristos         See header of unzip64.c
4075fd0b74Schristos 
4175fd0b74Schristos */
4275fd0b74Schristos 
4375fd0b74Schristos #ifndef _unz64_H
4475fd0b74Schristos #define _unz64_H
4575fd0b74Schristos 
4675fd0b74Schristos #ifdef __cplusplus
4775fd0b74Schristos extern "C" {
4875fd0b74Schristos #endif
4975fd0b74Schristos 
5075fd0b74Schristos #ifndef _ZLIB_H
5175fd0b74Schristos #include "zlib.h"
5275fd0b74Schristos #endif
5375fd0b74Schristos 
5475fd0b74Schristos #ifndef  _ZLIBIOAPI_H
5575fd0b74Schristos #include "ioapi.h"
5675fd0b74Schristos #endif
5775fd0b74Schristos 
5875fd0b74Schristos #ifdef HAVE_BZIP2
5975fd0b74Schristos #include "bzlib.h"
6075fd0b74Schristos #endif
6175fd0b74Schristos 
6275fd0b74Schristos #define Z_BZIP2ED 12
6375fd0b74Schristos 
6475fd0b74Schristos #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
6575fd0b74Schristos /* like the STRICT of WIN32, we define a pointer that cannot be converted
6675fd0b74Schristos     from (void*) without cast */
6775fd0b74Schristos typedef struct TagunzFile__ { int unused; } unzFile__;
6875fd0b74Schristos typedef unzFile__ *unzFile;
6975fd0b74Schristos #else
7075fd0b74Schristos typedef voidp unzFile;
7175fd0b74Schristos #endif
7275fd0b74Schristos 
7375fd0b74Schristos 
7475fd0b74Schristos #define UNZ_OK                          (0)
7575fd0b74Schristos #define UNZ_END_OF_LIST_OF_FILE         (-100)
7675fd0b74Schristos #define UNZ_ERRNO                       (Z_ERRNO)
7775fd0b74Schristos #define UNZ_EOF                         (0)
7875fd0b74Schristos #define UNZ_PARAMERROR                  (-102)
7975fd0b74Schristos #define UNZ_BADZIPFILE                  (-103)
8075fd0b74Schristos #define UNZ_INTERNALERROR               (-104)
8175fd0b74Schristos #define UNZ_CRCERROR                    (-105)
8275fd0b74Schristos 
8375fd0b74Schristos /* tm_unz contain date/time info */
8475fd0b74Schristos typedef struct tm_unz_s
8575fd0b74Schristos {
86*e992f068Schristos     int tm_sec;             /* seconds after the minute - [0,59] */
87*e992f068Schristos     int tm_min;             /* minutes after the hour - [0,59] */
88*e992f068Schristos     int tm_hour;            /* hours since midnight - [0,23] */
89*e992f068Schristos     int tm_mday;            /* day of the month - [1,31] */
90*e992f068Schristos     int tm_mon;             /* months since January - [0,11] */
91*e992f068Schristos     int tm_year;            /* years - [1980..2044] */
9275fd0b74Schristos } tm_unz;
9375fd0b74Schristos 
9475fd0b74Schristos /* unz_global_info structure contain global data about the ZIPfile
9575fd0b74Schristos    These data comes from the end of central dir */
9675fd0b74Schristos typedef struct unz_global_info64_s
9775fd0b74Schristos {
9875fd0b74Schristos     ZPOS64_T number_entry;         /* total number of entries in
9975fd0b74Schristos                                      the central dir on this disk */
10075fd0b74Schristos     uLong size_comment;         /* size of the global comment of the zipfile */
10175fd0b74Schristos } unz_global_info64;
10275fd0b74Schristos 
10375fd0b74Schristos typedef struct unz_global_info_s
10475fd0b74Schristos {
10575fd0b74Schristos     uLong number_entry;         /* total number of entries in
10675fd0b74Schristos                                      the central dir on this disk */
10775fd0b74Schristos     uLong size_comment;         /* size of the global comment of the zipfile */
10875fd0b74Schristos } unz_global_info;
10975fd0b74Schristos 
11075fd0b74Schristos /* unz_file_info contain information about a file in the zipfile */
11175fd0b74Schristos typedef struct unz_file_info64_s
11275fd0b74Schristos {
11375fd0b74Schristos     uLong version;              /* version made by                 2 bytes */
11475fd0b74Schristos     uLong version_needed;       /* version needed to extract       2 bytes */
11575fd0b74Schristos     uLong flag;                 /* general purpose bit flag        2 bytes */
11675fd0b74Schristos     uLong compression_method;   /* compression method              2 bytes */
11775fd0b74Schristos     uLong dosDate;              /* last mod file date in Dos fmt   4 bytes */
11875fd0b74Schristos     uLong crc;                  /* crc-32                          4 bytes */
11975fd0b74Schristos     ZPOS64_T compressed_size;   /* compressed size                 8 bytes */
12075fd0b74Schristos     ZPOS64_T uncompressed_size; /* uncompressed size               8 bytes */
12175fd0b74Schristos     uLong size_filename;        /* filename length                 2 bytes */
12275fd0b74Schristos     uLong size_file_extra;      /* extra field length              2 bytes */
12375fd0b74Schristos     uLong size_file_comment;    /* file comment length             2 bytes */
12475fd0b74Schristos 
12575fd0b74Schristos     uLong disk_num_start;       /* disk number start               2 bytes */
12675fd0b74Schristos     uLong internal_fa;          /* internal file attributes        2 bytes */
12775fd0b74Schristos     uLong external_fa;          /* external file attributes        4 bytes */
12875fd0b74Schristos 
12975fd0b74Schristos     tm_unz tmu_date;
13075fd0b74Schristos } unz_file_info64;
13175fd0b74Schristos 
13275fd0b74Schristos typedef struct unz_file_info_s
13375fd0b74Schristos {
13475fd0b74Schristos     uLong version;              /* version made by                 2 bytes */
13575fd0b74Schristos     uLong version_needed;       /* version needed to extract       2 bytes */
13675fd0b74Schristos     uLong flag;                 /* general purpose bit flag        2 bytes */
13775fd0b74Schristos     uLong compression_method;   /* compression method              2 bytes */
13875fd0b74Schristos     uLong dosDate;              /* last mod file date in Dos fmt   4 bytes */
13975fd0b74Schristos     uLong crc;                  /* crc-32                          4 bytes */
14075fd0b74Schristos     uLong compressed_size;      /* compressed size                 4 bytes */
14175fd0b74Schristos     uLong uncompressed_size;    /* uncompressed size               4 bytes */
14275fd0b74Schristos     uLong size_filename;        /* filename length                 2 bytes */
14375fd0b74Schristos     uLong size_file_extra;      /* extra field length              2 bytes */
14475fd0b74Schristos     uLong size_file_comment;    /* file comment length             2 bytes */
14575fd0b74Schristos 
14675fd0b74Schristos     uLong disk_num_start;       /* disk number start               2 bytes */
14775fd0b74Schristos     uLong internal_fa;          /* internal file attributes        2 bytes */
14875fd0b74Schristos     uLong external_fa;          /* external file attributes        4 bytes */
14975fd0b74Schristos 
15075fd0b74Schristos     tm_unz tmu_date;
15175fd0b74Schristos } unz_file_info;
15275fd0b74Schristos 
15375fd0b74Schristos extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
15475fd0b74Schristos                                                  const char* fileName2,
15575fd0b74Schristos                                                  int iCaseSensitivity));
15675fd0b74Schristos /*
15775fd0b74Schristos    Compare two filename (fileName1,fileName2).
15875fd0b74Schristos    If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
15975fd0b74Schristos    If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
16075fd0b74Schristos                                 or strcasecmp)
16175fd0b74Schristos    If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
16275fd0b74Schristos     (like 1 on Unix, 2 on Windows)
16375fd0b74Schristos */
16475fd0b74Schristos 
16575fd0b74Schristos 
16675fd0b74Schristos extern unzFile ZEXPORT unzOpen OF((const char *path));
16775fd0b74Schristos extern unzFile ZEXPORT unzOpen64 OF((const void *path));
16875fd0b74Schristos /*
16975fd0b74Schristos   Open a Zip file. path contain the full pathname (by example,
17075fd0b74Schristos      on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer
17175fd0b74Schristos      "zlib/zlib113.zip".
17275fd0b74Schristos      If the zipfile cannot be opened (file don't exist or in not valid), the
17375fd0b74Schristos        return value is NULL.
17475fd0b74Schristos      Else, the return value is a unzFile Handle, usable with other function
17575fd0b74Schristos        of this unzip package.
17675fd0b74Schristos      the "64" function take a const void* pointer, because the path is just the
17775fd0b74Schristos        value passed to the open64_file_func callback.
17875fd0b74Schristos      Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path
17975fd0b74Schristos        is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char*
18075fd0b74Schristos        does not describe the reality
18175fd0b74Schristos */
18275fd0b74Schristos 
18375fd0b74Schristos 
18475fd0b74Schristos extern unzFile ZEXPORT unzOpen2 OF((const char *path,
18575fd0b74Schristos                                     zlib_filefunc_def* pzlib_filefunc_def));
18675fd0b74Schristos /*
18775fd0b74Schristos    Open a Zip file, like unzOpen, but provide a set of file low level API
18875fd0b74Schristos       for read/write the zip file (see ioapi.h)
18975fd0b74Schristos */
19075fd0b74Schristos 
19175fd0b74Schristos extern unzFile ZEXPORT unzOpen2_64 OF((const void *path,
19275fd0b74Schristos                                     zlib_filefunc64_def* pzlib_filefunc_def));
19375fd0b74Schristos /*
19475fd0b74Schristos    Open a Zip file, like unz64Open, but provide a set of file low level API
19575fd0b74Schristos       for read/write the zip file (see ioapi.h)
19675fd0b74Schristos */
19775fd0b74Schristos 
19875fd0b74Schristos extern int ZEXPORT unzClose OF((unzFile file));
19975fd0b74Schristos /*
20075fd0b74Schristos   Close a ZipFile opened with unzOpen.
20175fd0b74Schristos   If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
20275fd0b74Schristos     these files MUST be closed with unzCloseCurrentFile before call unzClose.
20375fd0b74Schristos   return UNZ_OK if there is no problem. */
20475fd0b74Schristos 
20575fd0b74Schristos extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
20675fd0b74Schristos                                         unz_global_info *pglobal_info));
20775fd0b74Schristos 
20875fd0b74Schristos extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file,
20975fd0b74Schristos                                         unz_global_info64 *pglobal_info));
21075fd0b74Schristos /*
21175fd0b74Schristos   Write info about the ZipFile in the *pglobal_info structure.
21275fd0b74Schristos   No preparation of the structure is needed
21375fd0b74Schristos   return UNZ_OK if there is no problem. */
21475fd0b74Schristos 
21575fd0b74Schristos 
21675fd0b74Schristos extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
21775fd0b74Schristos                                            char *szComment,
21875fd0b74Schristos                                            uLong uSizeBuf));
21975fd0b74Schristos /*
22075fd0b74Schristos   Get the global comment string of the ZipFile, in the szComment buffer.
22175fd0b74Schristos   uSizeBuf is the size of the szComment buffer.
22275fd0b74Schristos   return the number of byte copied or an error code <0
22375fd0b74Schristos */
22475fd0b74Schristos 
22575fd0b74Schristos 
22675fd0b74Schristos /***************************************************************************/
22775fd0b74Schristos /* Unzip package allow you browse the directory of the zipfile */
22875fd0b74Schristos 
22975fd0b74Schristos extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
23075fd0b74Schristos /*
23175fd0b74Schristos   Set the current file of the zipfile to the first file.
23275fd0b74Schristos   return UNZ_OK if there is no problem
23375fd0b74Schristos */
23475fd0b74Schristos 
23575fd0b74Schristos extern int ZEXPORT unzGoToNextFile OF((unzFile file));
23675fd0b74Schristos /*
23775fd0b74Schristos   Set the current file of the zipfile to the next file.
23875fd0b74Schristos   return UNZ_OK if there is no problem
23975fd0b74Schristos   return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
24075fd0b74Schristos */
24175fd0b74Schristos 
24275fd0b74Schristos extern int ZEXPORT unzLocateFile OF((unzFile file,
24375fd0b74Schristos                      const char *szFileName,
24475fd0b74Schristos                      int iCaseSensitivity));
24575fd0b74Schristos /*
24675fd0b74Schristos   Try locate the file szFileName in the zipfile.
24775fd0b74Schristos   For the iCaseSensitivity signification, see unzStringFileNameCompare
24875fd0b74Schristos 
24975fd0b74Schristos   return value :
25075fd0b74Schristos   UNZ_OK if the file is found. It becomes the current file.
25175fd0b74Schristos   UNZ_END_OF_LIST_OF_FILE if the file is not found
25275fd0b74Schristos */
25375fd0b74Schristos 
25475fd0b74Schristos 
25575fd0b74Schristos /* ****************************************** */
25675fd0b74Schristos /* Ryan supplied functions */
25775fd0b74Schristos /* unz_file_info contain information about a file in the zipfile */
25875fd0b74Schristos typedef struct unz_file_pos_s
25975fd0b74Schristos {
26075fd0b74Schristos     uLong pos_in_zip_directory;   /* offset in zip file directory */
26175fd0b74Schristos     uLong num_of_file;            /* # of file */
26275fd0b74Schristos } unz_file_pos;
26375fd0b74Schristos 
26475fd0b74Schristos extern int ZEXPORT unzGetFilePos(
26575fd0b74Schristos     unzFile file,
26675fd0b74Schristos     unz_file_pos* file_pos);
26775fd0b74Schristos 
26875fd0b74Schristos extern int ZEXPORT unzGoToFilePos(
26975fd0b74Schristos     unzFile file,
27075fd0b74Schristos     unz_file_pos* file_pos);
27175fd0b74Schristos 
27275fd0b74Schristos typedef struct unz64_file_pos_s
27375fd0b74Schristos {
27475fd0b74Schristos     ZPOS64_T pos_in_zip_directory;   /* offset in zip file directory */
27575fd0b74Schristos     ZPOS64_T num_of_file;            /* # of file */
27675fd0b74Schristos } unz64_file_pos;
27775fd0b74Schristos 
27875fd0b74Schristos extern int ZEXPORT unzGetFilePos64(
27975fd0b74Schristos     unzFile file,
28075fd0b74Schristos     unz64_file_pos* file_pos);
28175fd0b74Schristos 
28275fd0b74Schristos extern int ZEXPORT unzGoToFilePos64(
28375fd0b74Schristos     unzFile file,
28475fd0b74Schristos     const unz64_file_pos* file_pos);
28575fd0b74Schristos 
28675fd0b74Schristos /* ****************************************** */
28775fd0b74Schristos 
28875fd0b74Schristos extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file,
28975fd0b74Schristos                          unz_file_info64 *pfile_info,
29075fd0b74Schristos                          char *szFileName,
29175fd0b74Schristos                          uLong fileNameBufferSize,
29275fd0b74Schristos                          void *extraField,
29375fd0b74Schristos                          uLong extraFieldBufferSize,
29475fd0b74Schristos                          char *szComment,
29575fd0b74Schristos                          uLong commentBufferSize));
29675fd0b74Schristos 
29775fd0b74Schristos extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
29875fd0b74Schristos                          unz_file_info *pfile_info,
29975fd0b74Schristos                          char *szFileName,
30075fd0b74Schristos                          uLong fileNameBufferSize,
30175fd0b74Schristos                          void *extraField,
30275fd0b74Schristos                          uLong extraFieldBufferSize,
30375fd0b74Schristos                          char *szComment,
30475fd0b74Schristos                          uLong commentBufferSize));
30575fd0b74Schristos /*
30675fd0b74Schristos   Get Info about the current file
30775fd0b74Schristos   if pfile_info!=NULL, the *pfile_info structure will contain somes info about
30875fd0b74Schristos         the current file
30975fd0b74Schristos   if szFileName!=NULL, the filemane string will be copied in szFileName
31075fd0b74Schristos             (fileNameBufferSize is the size of the buffer)
31175fd0b74Schristos   if extraField!=NULL, the extra field information will be copied in extraField
31275fd0b74Schristos             (extraFieldBufferSize is the size of the buffer).
31375fd0b74Schristos             This is the Central-header version of the extra field
31475fd0b74Schristos   if szComment!=NULL, the comment string of the file will be copied in szComment
31575fd0b74Schristos             (commentBufferSize is the size of the buffer)
31675fd0b74Schristos */
31775fd0b74Schristos 
31875fd0b74Schristos 
31975fd0b74Schristos /** Addition for GDAL : START */
32075fd0b74Schristos 
32175fd0b74Schristos extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file));
32275fd0b74Schristos 
32375fd0b74Schristos /** Addition for GDAL : END */
32475fd0b74Schristos 
32575fd0b74Schristos 
32675fd0b74Schristos /***************************************************************************/
32775fd0b74Schristos /* for reading the content of the current zipfile, you can open it, read data
32875fd0b74Schristos    from it, and close it (you can close it before reading all the file)
32975fd0b74Schristos    */
33075fd0b74Schristos 
33175fd0b74Schristos extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
33275fd0b74Schristos /*
33375fd0b74Schristos   Open for reading data the current file in the zipfile.
33475fd0b74Schristos   If there is no error, the return value is UNZ_OK.
33575fd0b74Schristos */
33675fd0b74Schristos 
33775fd0b74Schristos extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file,
33875fd0b74Schristos                                                   const char* password));
33975fd0b74Schristos /*
34075fd0b74Schristos   Open for reading data the current file in the zipfile.
34175fd0b74Schristos   password is a crypting password
34275fd0b74Schristos   If there is no error, the return value is UNZ_OK.
34375fd0b74Schristos */
34475fd0b74Schristos 
34575fd0b74Schristos extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file,
34675fd0b74Schristos                                            int* method,
34775fd0b74Schristos                                            int* level,
34875fd0b74Schristos                                            int raw));
34975fd0b74Schristos /*
35075fd0b74Schristos   Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
35175fd0b74Schristos     if raw==1
35275fd0b74Schristos   *method will receive method of compression, *level will receive level of
35375fd0b74Schristos      compression
35475fd0b74Schristos   note : you can set level parameter as NULL (if you did not want known level,
35575fd0b74Schristos          but you CANNOT set method parameter as NULL
35675fd0b74Schristos */
35775fd0b74Schristos 
35875fd0b74Schristos extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file,
35975fd0b74Schristos                                            int* method,
36075fd0b74Schristos                                            int* level,
36175fd0b74Schristos                                            int raw,
36275fd0b74Schristos                                            const char* password));
36375fd0b74Schristos /*
36475fd0b74Schristos   Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
36575fd0b74Schristos     if raw==1
36675fd0b74Schristos   *method will receive method of compression, *level will receive level of
36775fd0b74Schristos      compression
36875fd0b74Schristos   note : you can set level parameter as NULL (if you did not want known level,
36975fd0b74Schristos          but you CANNOT set method parameter as NULL
37075fd0b74Schristos */
37175fd0b74Schristos 
37275fd0b74Schristos 
37375fd0b74Schristos extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
37475fd0b74Schristos /*
37575fd0b74Schristos   Close the file in zip opened with unzOpenCurrentFile
37675fd0b74Schristos   Return UNZ_CRCERROR if all the file was read but the CRC is not good
37775fd0b74Schristos */
37875fd0b74Schristos 
37975fd0b74Schristos extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
38075fd0b74Schristos                       voidp buf,
38175fd0b74Schristos                       unsigned len));
38275fd0b74Schristos /*
38375fd0b74Schristos   Read bytes from the current file (opened by unzOpenCurrentFile)
38475fd0b74Schristos   buf contain buffer where data must be copied
38575fd0b74Schristos   len the size of buf.
38675fd0b74Schristos 
38775fd0b74Schristos   return the number of byte copied if somes bytes are copied
38875fd0b74Schristos   return 0 if the end of file was reached
38975fd0b74Schristos   return <0 with error code if there is an error
39075fd0b74Schristos     (UNZ_ERRNO for IO error, or zLib error for uncompress error)
39175fd0b74Schristos */
39275fd0b74Schristos 
39375fd0b74Schristos extern z_off_t ZEXPORT unztell OF((unzFile file));
39475fd0b74Schristos 
39575fd0b74Schristos extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file));
39675fd0b74Schristos /*
39775fd0b74Schristos   Give the current position in uncompressed data
39875fd0b74Schristos */
39975fd0b74Schristos 
40075fd0b74Schristos extern int ZEXPORT unzeof OF((unzFile file));
40175fd0b74Schristos /*
40275fd0b74Schristos   return 1 if the end of file was reached, 0 elsewhere
40375fd0b74Schristos */
40475fd0b74Schristos 
40575fd0b74Schristos extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
40675fd0b74Schristos                                              voidp buf,
40775fd0b74Schristos                                              unsigned len));
40875fd0b74Schristos /*
40975fd0b74Schristos   Read extra field from the current file (opened by unzOpenCurrentFile)
41075fd0b74Schristos   This is the local-header version of the extra field (sometimes, there is
41175fd0b74Schristos     more info in the local-header version than in the central-header)
41275fd0b74Schristos 
41375fd0b74Schristos   if buf==NULL, it return the size of the local extra field
41475fd0b74Schristos 
41575fd0b74Schristos   if buf!=NULL, len is the size of the buffer, the extra header is copied in
41675fd0b74Schristos     buf.
41775fd0b74Schristos   the return value is the number of bytes copied in buf, or (if <0)
41875fd0b74Schristos     the error code
41975fd0b74Schristos */
42075fd0b74Schristos 
42175fd0b74Schristos /***************************************************************************/
42275fd0b74Schristos 
42375fd0b74Schristos /* Get the current file offset */
42475fd0b74Schristos extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file);
42575fd0b74Schristos extern uLong ZEXPORT unzGetOffset (unzFile file);
42675fd0b74Schristos 
42775fd0b74Schristos /* Set the current file offset */
42875fd0b74Schristos extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos);
42975fd0b74Schristos extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
43075fd0b74Schristos 
43175fd0b74Schristos 
43275fd0b74Schristos 
43375fd0b74Schristos #ifdef __cplusplus
43475fd0b74Schristos }
43575fd0b74Schristos #endif
43675fd0b74Schristos 
43775fd0b74Schristos #endif /* _unz64_H */
438