-/* unzip.h -- IO for uncompress .zip files using zlib
+/*
+
+This file was altered for needs of wxWidgets.
+$Id$
+
+*/
+
+/* unzip.h -- IO for uncompress .zip files using zlib
Version 0.15 beta, Mar 19th, 1998,
Copyright (C) 1998 Gilles Vollant
*/
-/* for more info about .ZIP format, see
+/* for more info about .ZIP format, see
ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip
PkWare has also a specification at :
ftp://ftp.pkware.com/probdesc.zip */
extern "C" {
#endif
+/* include zlib.h if not done yet */
#ifndef _ZLIB_H
-#include "zlib.h"
+ /*
+ normally, the compiler options should contain -I../zlib, but it is
+ apparently not the case for all MSW makefiles and so, unless we use
+ configure (which defines __WX_SETUP_H__) or it is explicitly overridden
+ by the user (who can define wxUSE_ZLIB_H_IN_PATH), we hardcode the path
+ here
+ */
+# if defined(__WXMSW__) && !defined(__WX_SETUP_H__) && !defined(wxUSE_ZLIB_H_IN_PATH)
+# include "../zlib/zlib.h"
+# else
+# include "zlib.h"
+# endif
+#endif /* _ZLIB_H */
+
+/*
+ Some system zlib.h headers are modified to not define the OF() macro but use
+ the (standard) __P() instead (example: NetBSD 1.6), work around this if
+ needed assuming that we deal with an ANSI C compiler (which is a natural
+ assumption in 21st century!)
+ */
+#ifndef OF
+# define OF(args) args
+#endif
+
+/*
+ And on some systems ZEXPORT is not defined neither -- work around this too
+ */
+#ifndef ZEXPORT
+# define ZEXPORT
#endif
#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
/* like the STRICT of WIN32, we define a pointer that cannot be converted
from (void*) without cast */
-typedef struct TagunzFile__ { int unused; } unzFile__;
+typedef struct TagunzFile__ { int unused; } unzFile__;
typedef unzFile__ *unzFile;
#else
typedef voidp unzFile;
#define UNZ_CRCERROR (-105)
/* tm_unz contain date/time info */
-typedef struct tm_unz_s
+typedef struct tm_unz_s
{
- uInt tm_sec; /* seconds after the minute - [0,59] */
- uInt tm_min; /* minutes after the hour - [0,59] */
- uInt tm_hour; /* hours since midnight - [0,23] */
- uInt tm_mday; /* day of the month - [1,31] */
- uInt tm_mon; /* months since January - [0,11] */
- uInt tm_year; /* years - [1980..2044] */
+ uInt tm_sec; /* seconds after the minute - [0,59] */
+ uInt tm_min; /* minutes after the hour - [0,59] */
+ uInt tm_hour; /* hours since midnight - [0,23] */
+ uInt tm_mday; /* day of the month - [1,31] */
+ uInt tm_mon; /* months since January - [0,11] */
+ uInt tm_year; /* years - [1980..2044] */
} tm_unz;
/* unz_global_info structure contain global data about the ZIPfile
These data comes from the end of central dir */
typedef struct unz_global_info_s
{
- uLong number_entry; /* total number of entries in
- the central dir on this disk */
- uLong size_comment; /* size of the global comment of the zipfile */
+ uLong number_entry; /* total number of entries in
+ the central dir on this disk */
+ uLong size_comment; /* size of the global comment of the zipfile */
} unz_global_info;
uLong compression_method; /* compression method 2 bytes */
uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
uLong crc; /* crc-32 4 bytes */
- uLong compressed_size; /* compressed size 4 bytes */
- uLong uncompressed_size; /* uncompressed size 4 bytes */
+ uLong compressed_size; /* compressed size 4 bytes */
+ uLong uncompressed_size; /* uncompressed size 4 bytes */
uLong size_filename; /* filename length 2 bytes */
uLong size_file_extra; /* extra field length 2 bytes */
uLong size_file_comment; /* file comment length 2 bytes */
} unz_file_info;
extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
- const char* fileName2,
- int iCaseSensitivity));
+ const char* fileName2,
+ int iCaseSensitivity));
/*
Compare two filename (fileName1,fileName2).
- If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
- If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
- or strcasecmp)
+ If iCaseSenisivity = 1, comparision is case sensitivity
+ (like strcmp)
+ If iCaseSenisivity = 2, comparision is not case sensitivity
+ (like strcmpi or strcasecmp)
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
- (like 1 on Unix, 2 on Windows)
+ (like 1 on Unix, 2 on Windows)
*/
/*
Open a Zip file. path contain the full pathname (by example,
on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer
- "zlib/zlib111.zip".
- If the zipfile cannot be opened (file don't exist or in not valid), the
- return value is NULL.
+ "zlib/zlib111.zip".
+ If the zipfile cannot be opened (file don't exist or in not valid), the
+ return value is NULL.
Else, the return value is a unzFile Handle, usable with other function
- of this unzip package.
+ of this unzip package.
*/
extern int ZEXPORT unzClose OF((unzFile file));
return UNZ_OK if there is no problem. */
extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
- unz_global_info *pglobal_info));
+ unz_global_info *pglobal_info));
/*
Write info about the ZipFile in the *pglobal_info structure.
No preparation of the structure is needed
extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
- char *szComment,
- uLong uSizeBuf));
+ char *szComment,
+ uLong uSizeBuf));
/*
Get the global comment string of the ZipFile, in the szComment buffer.
uSizeBuf is the size of the szComment buffer.
return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
*/
-extern int ZEXPORT unzLocateFile OF((unzFile file,
- const char *szFileName,
- int iCaseSensitivity));
+extern int ZEXPORT unzLocateFile OF((unzFile file,
+ const char *szFileName,
+ int iCaseSensitivity));
/*
Try locate the file szFileName in the zipfile.
For the iCaseSensitivity signification, see unzStringFileNameCompare
extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
- unz_file_info *pfile_info,
- char *szFileName,
- uLong fileNameBufferSize,
- void *extraField,
- uLong extraFieldBufferSize,
- char *szComment,
- uLong commentBufferSize));
+ unz_file_info *pfile_info,
+ char *szFileName,
+ uLong fileNameBufferSize,
+ void *extraField,
+ uLong extraFieldBufferSize,
+ char *szComment,
+ uLong commentBufferSize));
/*
Get Info about the current file
if pfile_info!=NULL, the *pfile_info structure will contain somes info about
- the current file
+ the current file
if szFileName!=NULL, the filemane string will be copied in szFileName
- (fileNameBufferSize is the size of the buffer)
+ (fileNameBufferSize is the size of the buffer)
if extraField!=NULL, the extra field information will be copied in extraField
- (extraFieldBufferSize is the size of the buffer).
- This is the Central-header version of the extra field
+ (extraFieldBufferSize is the size of the buffer).
+ This is the Central-header version of the extra field
if szComment!=NULL, the comment string of the file will be copied in szComment
- (commentBufferSize is the size of the buffer)
+ (commentBufferSize is the size of the buffer)
*/
/***************************************************************************/
Return UNZ_CRCERROR if all the file was read but the CRC is not good
*/
-
-extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
- voidp buf,
- unsigned len));
+
+extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
+ voidp buf,
+ unsigned len));
/*
Read bytes from the current file (opened by unzOpenCurrentFile)
buf contain buffer where data must be copied
extern int ZEXPORT unzeof OF((unzFile file));
/*
- return 1 if the end of file was reached, 0 elsewhere
+ return 1 if the end of file was reached, 0 elsewhere
*/
extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
- voidp buf,
- unsigned len));
+ voidp buf,
+ unsigned len));
/*
Read extra field from the current file (opened by unzOpenCurrentFile)
This is the local-header version of the extra field (sometimes, there is
if buf==NULL, it return the size of the local extra field
if buf!=NULL, len is the size of the buffer, the extra header is copied in
- buf.
- the return value is the number of bytes copied in buf, or (if <0)
- the error code
+ buf.
+ the return value is the number of bytes copied in buf, or (if <0)
+ the error code
*/
+#if defined(__VISAGECPP__) || defined(__BORLANDC__)
+/*Visualage complains of no prototypes*/
+int unzlocal_getByte(FILE* , int*);
+int strcmpcasenosensitive_internal (const char*, const char*);
+int unzlocal_getShort (FILE*, uLong*);
+int unzlocal_getLong (FILE*, uLong*);
+uLong unzlocal_SearchCentralDir(FILE*);
+void unzlocal_DosDateToTmuDate (uLong, tm_unz*);
+#endif
+
#ifdef __cplusplus
}
#endif