X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/076bae67da7d0d6909f4a4f364b8fe04fdf59b9d..3b01b1fe4cb656f39290bf7f3891667855abe601:/src/common/unzip.h diff --git a/src/common/unzip.h b/src/common/unzip.h index cb37bef325..c11322431b 100644 --- a/src/common/unzip.h +++ b/src/common/unzip.h @@ -1,6 +1,6 @@ /* -This file was altered for needs of wxWindows. +This file was altered for needs of wxWidgets. $Id$ */ @@ -52,8 +52,37 @@ $Id$ 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) @@ -78,21 +107,21 @@ typedef voidp unzFile; /* tm_unz contain date/time info */ 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; @@ -119,15 +148,16 @@ typedef struct unz_file_info_s } 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) */ @@ -135,11 +165,11 @@ extern unzFile ZEXPORT unzOpen OF((const char *path)); /* 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)); @@ -150,7 +180,7 @@ 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 @@ -158,8 +188,8 @@ extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, 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. @@ -184,8 +214,8 @@ extern int ZEXPORT unzGoToNextFile OF((unzFile file)); */ extern int ZEXPORT unzLocateFile OF((unzFile file, - const char *szFileName, - int iCaseSensitivity)); + const char *szFileName, + int iCaseSensitivity)); /* Try locate the file szFileName in the zipfile. For the iCaseSensitivity signification, see unzStringFileNameCompare @@ -197,24 +227,24 @@ extern int ZEXPORT unzLocateFile OF((unzFile file, 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) */ /***************************************************************************/ @@ -234,10 +264,10 @@ extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); 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)); + voidp buf, + unsigned len)); /* Read bytes from the current file (opened by unzOpenCurrentFile) buf contain buffer where data must be copied @@ -260,8 +290,8 @@ extern int ZEXPORT unzeof OF((unzFile file)); */ 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 @@ -270,12 +300,12 @@ extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, 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. + buf. the return value is the number of bytes copied in buf, or (if <0) - the error code + the error code */ -#if defined(__VISAGECPP__) +#if defined(__VISAGECPP__) || defined(__BORLANDC__) /*Visualage complains of no prototypes*/ int unzlocal_getByte(FILE* , int*); int strcmpcasenosensitive_internal (const char*, const char*);