X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5526e819eca4465ed5520d49bccfebc6a28045e0..673e6120795e4e1f3a49157581925a5ee14bf5a9:/src/common/unzip.h diff --git a/src/common/unzip.h b/src/common/unzip.h index 76692cb703..acb137bc66 100644 --- a/src/common/unzip.h +++ b/src/common/unzip.h @@ -1,4 +1,11 @@ -/* unzip.h -- IO for uncompress .zip files using zlib +/* + +This file was altered for needs of wxWindows. +$Id$ + +*/ + +/* unzip.h -- IO for uncompress .zip files using zlib Version 0.15 beta, Mar 19th, 1998, Copyright (C) 1998 Gilles Vollant @@ -33,7 +40,7 @@ */ -/* 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 */ @@ -45,14 +52,43 @@ 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; @@ -69,7 +105,7 @@ 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] */ @@ -98,8 +134,8 @@ typedef struct unz_file_info_s 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 */ @@ -176,7 +212,7 @@ extern int ZEXPORT unzGoToNextFile OF((unzFile file)); return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. */ -extern int ZEXPORT unzLocateFile OF((unzFile file, +extern int ZEXPORT unzLocateFile OF((unzFile file, const char *szFileName, int iCaseSensitivity)); /* @@ -228,7 +264,7 @@ extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); */ -extern int ZEXPORT unzReadCurrentFile OF((unzFile file, +extern int ZEXPORT unzReadCurrentFile OF((unzFile file, voidp buf, unsigned len)); /* @@ -249,7 +285,7 @@ extern z_off_t ZEXPORT unztell OF((unzFile file)); 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, @@ -264,10 +300,20 @@ extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, 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 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