From: <lab...@us...> - 2012-07-23 21:26:23
|
Revision: 1484 http://opengtoolkit.svn.sourceforge.net/opengtoolkit/?rev=1484&view=rev Author: labviewer Date: 2012-07-23 21:26:16 +0000 (Mon, 23 Jul 2012) Log Message: ----------- Modify 64 Bit support Modified Paths: -------------- trunk/lvzip/c_source/Makefile trunk/lvzip/c_source/Makefile.in trunk/lvzip/c_source/Makefile.vxworks trunk/lvzip/c_source/Makefile.x64 trunk/lvzip/c_source/lvutil.c trunk/lvzip/c_source/lvutil.h trunk/lvzip/c_source/zalias.h trunk/lvzip/c_source/zip.h trunk/lvzip/c_source/zlibvc.vcproj Added Paths: ----------- trunk/lvzip/c_source/lvapi.c Modified: trunk/lvzip/c_source/Makefile =================================================================== --- trunk/lvzip/c_source/Makefile 2012-07-23 21:23:01 UTC (rev 1483) +++ trunk/lvzip/c_source/Makefile 2012-07-23 21:26:16 UTC (rev 1484) @@ -25,7 +25,7 @@ # -Wstrict-prototypes -Wmissing-prototypes CINDIR=/usr/local/lv70/cintools -SFLAGS=-O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -L$(CINDIR) +SFLAGS=-O3 -fPIC -fvisibility=hidden -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -L$(CINDIR) LDFLAGS= TEST_LDFLAGS=-L. libz.a LDSHARED=gcc @@ -57,12 +57,12 @@ OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o -OBJL = unzip.o zip.o lvutil.o ioapi.o iomem.o mztools.o +OBJL = lvutil.o ioapi.o iomem.o mztools.o unzip.o zip.o OBJC = $(OBJZ) $(OBJL) $(OBJG) PIC_OBJZ = adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo PIC_OBJG = compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo -PIC_OBJL = unzip.lo zip.lo lvutil.lo ioapi.lo iomem.lo mztools.lo +PIC_OBJL = lvapi.lo lvutil.lo ioapi.lo iomem.lo mztools.lo unzip.lo zip.lo PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJL) $(PIC_OBJG) # to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo Modified: trunk/lvzip/c_source/Makefile.in =================================================================== --- trunk/lvzip/c_source/Makefile.in 2012-07-23 21:23:01 UTC (rev 1483) +++ trunk/lvzip/c_source/Makefile.in 2012-07-23 21:26:16 UTC (rev 1484) @@ -58,13 +58,13 @@ OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o -OBJL = lvutil.o ioapi.o iomem.o mztools.o +OBJL = lvapi.o lvutil.o ioapi.o iomem.o mztools.o OBJC = $(OBJZ) $(OBJL) $(OBJG) PIC_OBJZ = adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo PIC_OBJG = compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG) -PIC_OBJL = lvutil.lo ioapi.lo iomem.lo mztools.lo +PIC_OBJL = lvapi.lo lvutil.lo ioapi.lo iomem.lo mztools.lo PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJL) $(PIC_OBJG) # to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo Modified: trunk/lvzip/c_source/Makefile.vxworks =================================================================== --- trunk/lvzip/c_source/Makefile.vxworks 2012-07-23 21:23:01 UTC (rev 1483) +++ trunk/lvzip/c_source/Makefile.vxworks 2012-07-23 21:26:16 UTC (rev 1484) @@ -18,10 +18,11 @@ # List all the *compiled* object files here, under the OBJ_DIR # directory. Make will automatically locate the source file and # compile it. -OBJECTS := $(OBJ_DIR)/adler32.o $(OBJ_DIR)/compress.o $(OBJ_DIR)/crc32.o $(OBJ_DIR)/uncompr.o $(OBJ_DIR)/deflate.o \ - $(OBJ_DIR)/trees.o $(OBJ_DIR)/zutil.o $(OBJ_DIR)/inflate.o $(OBJ_DIR)/infback.o $(OBJ_DIR)/inftrees.o \ - $(OBJ_DIR)/inffast.o $(OBJ_DIR)/ioapi.o $(OBJ_DIR)/iomem.o $(OBJ_DIR)/lvutil.o $(OBJ_DIR)/mztools.o \ - $(OBJ_DIR)/zip.o $(OBJ_DIR)/unzip.o +OBJECTS := $(OBJ_DIR)/adler32.o $(OBJ_DIR)/compress.o $(OBJ_DIR)/crc32.o $(OBJ_DIR)/deflate.o \ + $(OBJ_DIR)\gzclose.o $(OBJ_DIR)\gzlib.o $(OBJ_DIR)\gzread.o $(OBJ_DIR)\gzwrite.o \ + $(OBJ_DIR)/inffast.o $(OBJ_DIR)/infback.o $(OBJ_DIR)/inflate.o $(OBJ_DIR)/inftrees.o \ + $(OBJ_DIR)/ioapi.o $(OBJ_DIR)/iomem.o $(OBJ_DIR)/lvutil.o $(OBJ_DIR)/lvapi.o $(OBJ_DIR)/mztools.o \ + $(OBJ_DIR)/trees.o $(OBJ_DIR)/uncompr.o $(OBJ_DIR)/unzip.o $(OBJ_DIR)/zip.o $(OBJ_DIR)/zutil.o # This is the name of the output shared library. PROJECT_TARGETS := $(OBJ_DIR)/lvzlib.out Modified: trunk/lvzip/c_source/Makefile.x64 =================================================================== --- trunk/lvzip/c_source/Makefile.x64 2012-07-23 21:23:01 UTC (rev 1483) +++ trunk/lvzip/c_source/Makefile.x64 2012-07-23 21:26:16 UTC (rev 1484) @@ -13,40 +13,50 @@ SOURCES=adler32.c \ compress.c \ crc32.c \ - uncompr.c \ deflate.c \ - trees.c \ - zutil.c \ + gzclose.c \ + gzlib.c \ + gzread.c \ + gzwrite.c \ + infback.c \ + inffast.c \ inflate.c \ - infback.c \ inftrees.c \ - inffast.c \ ioapi.c \ iowin.c \ iomem.c \ + lvapi.c \ lvutil.c \ mztools.c \ + trees.c \ + uncompr.c \ + unzip.c \ zip.c \ - unzip.c - + zutil.c + OBJS=$(OUTDIR)\adler32.obj \ $(OUTDIR)\compress.obj \ $(OUTDIR)\crc32.obj \ - $(OUTDIR)\uncompr.obj \ $(OUTDIR)\deflate.obj \ - $(OUTDIR)\trees.obj \ - $(OUTDIR)\zutil.obj \ + $(OUTDIR)\gzclose.obj \ + $(OUTDIR)\gzlib.obj \ + $(OUTDIR)\gzread.obj \ + $(OUTDIR)\gzwrite.obj \ + $(OUTDIR)\infback.obj \ + $(OUTDIR)\inffast.obj \ $(OUTDIR)\inflate.obj \ - $(OUTDIR)\infback.obj \ $(OUTDIR)\inftrees.obj \ - $(OUTDIR)\inffast.obj \ $(OUTDIR)\ioapi.obj \ $(OUTDIR)\iowin.obj \ $(OUTDIR)\iomem.obj \ + $(OUTDIR)\lvapi.obj \ $(OUTDIR)\lvutil.obj \ $(OUTDIR)\mztools.obj \ + $(OUTDIR)\trees.obj \ + $(OUTDIR)\uncompr.obj \ + $(OUTDIR)\unzip.obj \ $(OUTDIR)\zip.obj \ - $(OUTDIR)\unzip.obj + $(OUTDIR)\zutil.obj ELIBS=user32.lib kernel32.lib labview.lib Added: trunk/lvzip/c_source/lvapi.c =================================================================== --- trunk/lvzip/c_source/lvapi.c (rev 0) +++ trunk/lvzip/c_source/lvapi.c 2012-07-23 21:26:16 UTC (rev 1484) @@ -0,0 +1,200 @@ +#define ZLIB_INTERNAL +#include "zlib.h" +#include "lvutil.h" +#include "zip.h" +#include "unzip.h" + +#ifndef VERSIONMADEBY +# define VERSIONMADEBY (0x0) /* platform depedent */ +#endif + +LibAPI(const char *) lvzlib_zlibVersion(void) +{ + return zlibVersion(); +} + +LibAPI(int) lvzlib_compress(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, int level) +{ + return compress2(dest, destLen, source, sourceLen, level); +} + +LibAPI(int) lvzlib_uncompress(Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen) +{ + return uncompress(dest, destLen, source, sourceLen); +} + +LibAPI(uInt32) lvzlib_crc32(uInt32 crc, const Bytef *buf, uInt32 len) +{ + return crc32(crc, buf, len); +} + +LibAPI(int) lvzlib__openDummy(LStrHandle *name, UPtr *node) +{ + Unused(name); + *node = NULL; + return mgNotSupported; +} + +LibAPI(int) lvzlib_noProp(UPtr node, uInt32 attr, UPtr data) +{ + Unused(node); + Unused(attr); + Unused(data); + return mgNotSupported; +} + +LibAPI(int) lvzlib_zipCleanup(zipFile node) +{ + return zipClose2(node, NULL, NULL); +} + +LibAPI(int) lvzlib_unzipCleanup(unzFile node) +{ + return unzClose(node); +} + +LibAPI(int) lvzlib_zipOpen(const void *pathname, int append, LStrHandle *globalcomment, + zlib_filefunc64_def* pzlib_filefunc_def, zipFile *file) +{ + zipcharpc comment; + *file = zipOpen2_64(pathname, append, &comment, pzlib_filefunc_def); + if (*file) + { + if (comment) + { + size_t len = strlen(comment); + MgErr err = NumericArrayResize(uB, 1, (UHandle*)globalcomment, len); + if (!err) + { + MoveBlock(comment, LStrBuf(**globalcomment), len); + LStrLen(**globalcomment) = (int32)len; + } + } + return Z_OK; + } + return Z_ERRNO; +} + +LibAPI(int) lvzlib_zipOpenNewFileInZip(zipFile *file, const char* filename, + const zip_fileinfo* zipfi, const void* extrafield_local, + uInt size_extrafield_local, const void* extrafield_global, + uInt size_extrafield_global, const char* comment, int method, + int level, int raw, int windowBits, int memLevel, int strategy, + const char* password, uLong crcForCrypting, int zip64) +{ + return zipOpenNewFileInZip4_64(*file, filename, zipfi, extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, comment, method, level, + raw, windowBits, memLevel, strategy, password[0] ? password : NULL, + crcForCrypting, VERSIONMADEBY, 0, zip64); +} + +LibAPI(int) lvzlib_zipWriteInFileInZip(zipFile *file, const voidp buf, uInt32 len) +{ + return zipWriteInFileInZip(*file, buf, len); +} + +LibAPI(int) lvzlib_zipCloseFileInZipRaw(zipFile *file, uInt32 uncompressedSize, uInt32 crc32) +{ + return zipCloseFileInZipRaw64(*file, uncompressedSize, crc32); +} + +LibAPI(int) lvzlib_zipCloseFileInZipRaw64(zipFile *file, uInt64 uncompressedSize, uInt32 crc32) +{ + return zipCloseFileInZipRaw64(*file, uncompressedSize, crc32); +} + +LibAPI(int) lvzlib_zipClose(zipFile *file, const char *globalComment, LStrHandle *stream) +{ + return zipClose2(*file, globalComment, stream); +} + +LibAPI(int) lvzlib_unzOpen(const void *pathname, zlib_filefunc64_def* pzlib_filefunc_def, unzFile *file) +{ + *file = unzOpen2_64(pathname, pzlib_filefunc_def); + if (*file) + return Z_OK; + return Z_ERRNO; +} + +LibAPI(int) lvzlib_unzClose(unzFile *file) +{ + return unzClose(*file); +} + +LibAPI(int) lvzlib_unzGetGlobalInfo(unzFile *file, unz_global_info* pglobal_info) +{ + return unzGetGlobalInfo(*file, pglobal_info); +} + +LibAPI(int) lvzlib_unzGetGlobalInfo64(unzFile *file, unz_global_info64* pglobal_info) +{ + return unzGetGlobalInfo64(*file, pglobal_info); +} + +LibAPI(int) lvzlib_unzGetGlobalComment(unzFile *file, char *szComment, uInt32 len) +{ + return unzGetGlobalComment(*file, szComment, len); +} + +LibAPI(int) lvzlib_unzLocateFile(unzFile *file, const char *szFileName, int iCaseSensitivity) +{ + return unzLocateFile(*file, szFileName, iCaseSensitivity); +} + +LibAPI(int) lvzlib_unzGetCurrentFileInfoLen(unzFile *file, unz_file_info * pfile_info) +{ + return unzGetCurrentFileInfo(*file, pfile_info, NULL, 0, NULL, 0, NULL, 0); +} + +LibAPI(int) lvzlib_unzGetCurrentFileInfo(unzFile *file, unz_file_info * pfile_info, + char * szFileName, uInt32 fileNameBufferSize, + void *extraField, uInt32 extraFieldBufferSize, + char* szComment, uInt32 commentBufferSize) +{ + return unzGetCurrentFileInfo(*file, pfile_info, szFileName, fileNameBufferSize, + extraField, extraFieldBufferSize, szComment, commentBufferSize); +} + +LibAPI(int) lvzlib_unzOpenCurrentFile(unzFile *file, int32* method, int32* level, int16 raw, const char* password) +{ + return unzOpenCurrentFile3(*file, method, level, raw, password[0] ? password : NULL); +} + +LibAPI(int) lvzlib_unzGetLocalExtrafield(unzFile *file, LStrHandle *extra) +{ + int len = unzGetLocalExtrafield(*file, NULL, 0); + if (len > 0) + { + MgErr err = NumericArrayResize(uB, 1, (UHandle*)extra, len); + if (!err) + { + LStrLen(**extra) = len; + return unzGetLocalExtrafield(*file, LStrBuf(**extra), len); + } + else + len = Z_MEM_ERROR; + } + return len; +} + +LibAPI(int) lvzlib_unzReadCurrentFile(unzFile *file, voidp buffer, uInt32 size) +{ + return unzReadCurrentFile(*file, buffer, size); +} + +LibAPI(int) lvzlib_unzCloseCurrentFile(unzFile *file) +{ + return unzCloseCurrentFile(*file); +} + +LibAPI(int) lvzlib_unzGoToFirstFile(unzFile *file) +{ + return unzGoToFirstFile(*file); +} + +LibAPI(int) lvzlib_unzGoToNextFile(unzFile *file) +{ + return unzGoToNextFile(*file); +} Modified: trunk/lvzip/c_source/lvutil.c =================================================================== --- trunk/lvzip/c_source/lvutil.c 2012-07-23 21:23:01 UTC (rev 1483) +++ trunk/lvzip/c_source/lvutil.c 2012-07-23 21:26:16 UTC (rev 1484) @@ -525,12 +525,12 @@ #endif #endif -extern void ZEXPORT DLLVersion(uChar* version) +LibAPI(void) DLLVersion(uChar* version) { - sprintf((char*)version, "lvzlib date: %s, time: %s",__DATE__,__TIME__); + sprintf((char*)version, "lvzlib V 2.1, date: %s, time: %s",__DATE__,__TIME__); } -extern MgErr ZEXPORT LVPath_HasResourceFork(Path path, int32 *hasResFork) +LibAPI(MgErr) LVPath_HasResourceFork(Path path, int32 *hasResFork) { MgErr err = noErr; #if MacOS @@ -566,7 +566,7 @@ return err; } -extern MgErr ZEXPORT LVPath_EncodeMacbinary(Path srcPath, Path dstPath) +LibAPI(MgErr) LVPath_EncodeMacbinary(Path srcPath, Path dstPath) { #if MacOS FSSpec srcFSSpec; @@ -586,7 +586,7 @@ #endif } -extern MgErr ZEXPORT LVPath_DecodeMacbinary(Path srcPath, Path dstPath) +LibAPI(MgErr) LVPath_DecodeMacbinary(Path srcPath, Path dstPath) { #if MacOS FSSpec srcFSSpec; @@ -606,7 +606,7 @@ #endif } -extern MgErr ZEXPORT LVPath_OpenFile(LVRefNum *refnum, Path path, uInt8 rsrc, uInt32 openMode, uInt32 denyMode) +LibAPI(MgErr) LVPath_OpenFile(LVRefNum *refnum, Path path, uInt8 rsrc, uInt32 openMode, uInt32 denyMode) { MgErr err; int32 type; @@ -852,7 +852,7 @@ return err; } -extern MgErr ZEXPORT LVPath_UtilFileInfo(Path path, +LibAPI(MgErr) LVPath_UtilFileInfo(Path path, uInt8 write, uInt8 *isDirectory, LVFileInfo *fileInfo, @@ -1157,31 +1157,36 @@ return err; } -extern long ZEXPORT InitializeFileFuncs (zlib_filefunc64_def* pzlib_filefunc_def, LStrHandle *memory) +LibAPI(MgErr) InitializeFileFuncs(LStrHandle filefunc_def) { - DoDebugger(); - - if (pzlib_filefunc_def) - { - if (memory) - { - fill_mem_filefunc(pzlib_filefunc_def, memory); - } - else - { + MgErr err = NumericArrayResize(uB, 1, (UHandle*)&filefunc_def, sizeof(zlib_filefunc64_def)); + if (!err) + { + zlib_filefunc64_def* pzlib_filefunc_def = (zlib_filefunc64_def*)LStrBuf(*filefunc_def); + LStrLen(*filefunc_def) = sizeof(zlib_filefunc64_def); #if Win32 fill_win32_filefunc64A(pzlib_filefunc_def); #else fill_fopen64_filefunc(pzlib_filefunc_def); #endif - } - return mgNoErr; + } + return err; +} + +LibAPI(MgErr) InitializeStreamFuncs(LStrHandle filefunc_def, LStrHandle *memory) +{ + MgErr err = NumericArrayResize(uB, 1, (UHandle*)&filefunc_def, sizeof(zlib_filefunc64_def)); + if (!err) + { + zlib_filefunc64_def* pzlib_filefunc_def = (zlib_filefunc64_def*)LStrBuf(*filefunc_def); + LStrLen(*filefunc_def) = sizeof(zlib_filefunc64_def); + + fill_mem_filefunc(pzlib_filefunc_def, memory); } - else - return sizeof(zlib_filefunc64_def); + return err; } -extern MgErr ZEXPORT LVPath_ToText(Path path, CStr str, int32 *len) +LibAPI(MgErr) LVPath_ToText(Path path, CStr str, int32 *len) { MgErr err; LStrPtr lstr; Modified: trunk/lvzip/c_source/lvutil.h =================================================================== --- trunk/lvzip/c_source/lvutil.h 2012-07-23 21:23:01 UTC (rev 1483) +++ trunk/lvzip/c_source/lvutil.h 2012-07-23 21:26:16 UTC (rev 1484) @@ -44,6 +44,12 @@ #error No target defined #endif +#if Win32 + #define LibAPI(retval) extern __declspec(dllexport) retval +#else + #define LibAPI(retval) __attribute__((visibility ("default"))) extern retval +#endif + #if defined(DEBUG) #if Win32 #if defined(_CVI_DEBUG_) @@ -70,16 +76,38 @@ */ #endif -typedef char int8; -typedef unsigned char uInt8; -typedef uInt8 uChar; -typedef short int16; -typedef unsigned short uInt16; -typedef long int32; -typedef unsigned long uInt32; -typedef float float32; -typedef double float64; +#ifndef Unused +/* The macro Unused can be used to avoid compiler warnings for +unused parameters or locals. */ +# ifdef __cplusplus +/* This implementation of Unused is safe for const parameters. */ +# define Unused(var_or_param) _Unused((const void *)&var_or_param) + inline void _Unused(const void *) {} +# elif MSWin +/* This implementation of Unused is not safe for const parameters. */ +# define Unused(var_or_param) var_or_param=var_or_param +# else +# define Unused(var_or_param) +# endif +#endif /* Unused */ +typedef signed char int8; +typedef unsigned char uInt8; +typedef uInt8 uChar; +typedef signed short int16; +typedef unsigned short uInt16; +typedef signed int int32; +typedef unsigned int uInt32; +#if Win32 +typedef signed __int64 int64; +typedef unsigned __int64 uInt64; +#else +typedef signed long long int64; +typedef unsigned long long uInt64; +#endif +typedef float float32; +typedef double float64; + #define Private(T) typedef struct T##_t { void *p; } *T #define PrivateH(T) struct T##_t; typedef struct T##_t **T @@ -199,7 +227,7 @@ } LVPoint; typedef uChar Str255[256], *PStr, *CStr, *UPtr, **UHandle; -typedef const uChar *ConstCStr, *ConstPStr, ConstStr255[256]; +typedef const uChar *ConstCStr, *ConstPStr, *ConstUPtr, ConstStr255[256]; #define PStrBuf(b) (&((PStr)(b))[1]) #define PStrLen(b) (((PStr)(b))[0]) /* # of chars in string */ @@ -258,39 +286,42 @@ MgErr FNewRefNum(Path path, File fd, LVRefNum* refnum); int32 DbgPrintf(CStr fmt, ...); -UPtr DSNewPClr(int32); +UPtr DSNewPClr(size_t size); MgErr DSDisposePtr(UPtr); -UHandle DSNewHClr(int32 size); -MgErr DSSetHandleSize(UHandle, int32); +UHandle DSNewHClr(size_t size); +MgErr DSSetHandleSize(UHandle, size_t); int32 DSGetHandleSize(UHandle); MgErr DSDisposeHandle(UHandle); -MgErr NumericArrayResize(int32, int32, UHandle*, int32); +void MoveBlock(ConstUPtr ps, UPtr pd, size_t size); +MgErr NumericArrayResize(int32, int32, UHandle*, size_t); + #define Min(a, b) ((a) < (b)) ? (a) : (b) #define Max(a, b) ((a) > (b)) ? (a) : (b) /* Our exported functions */ -ZEXTERN void ZEXPORT DLLVersion OF((uChar* Version)); +LibAPI(void) DLLVersion OF((uChar* Version)); -ZEXTERN MgErr ZEXPORT LVPath_ToText OF((Path path, CStr str, int32 *len)); -ZEXTERN MgErr ZEXPORT LVPath_HasResourceFork OF((Path path, int32 *hasResFork)); -ZEXTERN MgErr ZEXPORT LVPath_EncodeMacbinary OF((Path srcFileName, Path dstFileName)); -ZEXTERN MgErr ZEXPORT LVPath_DecodeMacbinary OF((Path srcFileName, Path dstFileName)); +LibAPI(MgErr) LVPath_ToText OF((Path path, CStr str, int32 *len)); +LibAPI(MgErr) LVPath_HasResourceFork OF((Path path, int32 *hasResFork)); +LibAPI(MgErr) LVPath_EncodeMacbinary OF((Path srcFileName, Path dstFileName)); +LibAPI(MgErr) LVPath_DecodeMacbinary OF((Path srcFileName, Path dstFileName)); -ZEXTERN MgErr ZEXPORT LVPath_UtilFileInfo OF((Path path, +LibAPI(MgErr) LVPath_UtilFileInfo OF((Path path, uInt8 write, uInt8 *isDirectory, LVFileInfo *finderInfo, LStrHandle comment)); -ZEXTERN MgErr ZEXPORT LVPath_OpenFile OF((LVRefNum *refnum, +LibAPI(MgErr) LVPath_OpenFile OF((LVRefNum *refnum, Path path, uInt8 rsrc, uInt32 openMode, uInt32 denyMode)); -ZEXTERN long ZEXPORT InitializeFileFuncs OF((zlib_filefunc64_def* pzlib_filefunc_def, LStrHandle *memory)); +LibAPI(MgErr) InitializeFileFuncs OF((LStrHandle filefunc_def)); +LibAPI(MgErr) InitializeStreamFuncs OF((LStrHandle filefunc_def, LStrHandle *memory)); #ifdef __cplusplus } Modified: trunk/lvzip/c_source/zalias.h =================================================================== --- trunk/lvzip/c_source/zalias.h 2012-07-23 21:23:01 UTC (rev 1483) +++ trunk/lvzip/c_source/zalias.h 2012-07-23 21:26:16 UTC (rev 1484) @@ -1,144 +1,86 @@ -#define _dist_code lvzip__dist_code -#define _length_code lvzip__length_code -#define _tr_align lvzip__tr_align -#define _tr_flush_block lvzip__tr_flush_block -#define _tr_init lvzip__tr_init -#define _tr_stored_block lvzip__tr_stored_block -#define _tr_tally lvzip__tr_tally -#define adler32 lvzip_adler32 -#define adler32_combine lvzip_adler32_combine -#define adler32_combine64 lvzip_adler32_combine64 -#define compress lvzip_compress -#define compress2 lvzip_compress2 -#define compressBound lvzip_compressBound -#define crc32 lvzip_crc32 -#define crc32_combine lvzip_crc32_combine -#define crc32_combine64 lvzip_crc32_combine64 -#define deflate lvzip_deflate -#define deflate_copyright lvzip_deflate_copyright -#define deflateBound lvzip_deflateBound -#define deflateCopy lvzip_deflateCopy -#define deflateEnd lvzip_deflateEnd -#define deflateInit_ lvzip_deflateInit_ -#define deflateInit2_ lvzip_deflateInit2_ -#define deflateParams lvzip_deflateParams -#define deflatePending lvzip_deflatePending -#define deflatePrime lvzip_deflatePrime -#define deflateReset lvzip_deflateReset -#define deflateResetKeep lvzip_deflateResetKeep -#define deflateSetDictionary lvzip_deflateSetDictionary -#define deflateSetHeader lvzip_deflateSetHeader -#define deflateTune lvzip_deflateTune -#define get_crc_table lvzip_get_crc_table -#define inflate lvzip_inflate -#define inflate_copyright lvzip_inflate_copyright -#define inflate_table lvzip_inflate_table -#define inflateBack lvzip_inflateBack -#define inflateBackEnd lvzip_inflateBackEnd -#define inflateBackInit_ lvzip_inflateBackInit_ -#define inflateCopy lvzip_inflateCopy -#define inflateEnd lvzip_inflateEnd -#define inflateGetHeader lvzip_inflateGetHeader -#define inflate_fast lvzip_inflate_fast -#define inflateInit_ lvzip_inflateInit_ -#define inflateInit2_ lvzip_inflateInit2_ -#define inflateMark lvzip_inflateMark -#define inflatePrime lvzip_inflatePrime -#define inflateReset lvzip_inflateReset -#define inflateReset2 lvzip_inflateReset2 -#define inflateResetKeep lvzip_inflateResetKeep -#define inflateSetDictionary lvzip_inflateSetDictionary -#define inflateSync lvzip_inflateSync -#define inflateSyncPoint lvzip_inflateSyncPoint -#define inflateUndermine lvzip_inflateUndermine -#define uncompress lvzip_uncompress -#define z_errmsg lvzip_z_errmsg -#define zcalloc lvzip_zcalloc -#define zcfree lvzip_zcfree -#define zError lvzip_zError -#define zlibCompileFlags lvzip_zlibCompileFlags -#define zlibVersion lvzip_zlibVersion -#define unzClose lvzip_unzClose -#define unzCloseCurrentFile lvzip_unzCloseCurrentFile -#define unzGetCurrentFileInfo lvzip_unzGetCurrentFileInfo -#define unzGetCurrentFileInfo64 lvzip_unzGetCurrentFileInfo64 -#define unzGetCurrentFileZStreamPos64 lvzip_unzGetCurrentFileZStreamPos64 -#define unzGetFilePos lvzip_unzGetFilePos -#define unzGetFilePos64 lvzip_unzGetFilePos64 -#define unzGetGlobalComment lvzip_unzGetGlobalComment -#define unzGetGlobalInfo lvzip_unzGetGlobalInfo -#define unzGetGlobalInfo64 lvzip_unzGetGlobalInfo64 -#define unzGetLocalExtrafield lvzip_unzGetLocalExtrafield -#define unzGetOffset lvzip_unzGetOffset -#define unzGetOffset64 lvzip_unzGetOffset64 -#define unzGoToFilePos lvzip_unzGoToFilePos -#define unzGoToFilePos64 lvzip_unzGoToFilePos64 -#define unzGoToFirstFile lvzip_unzGoToFirstFile -#define unzGoToNextFile lvzip_unzGoToNextFile -#define unzLocateFile lvzip_unzLocateFile -#define unzOpen lvzip_unzOpen -#define unzOpen64 lvzip_unzOpen64 -#define unzOpen2 lvzip_unzOpen2 -#define unzOpen2_64 lvzip_unzOpen2_64 -#define unzOpenCurrentFile lvzip_unzOpenCurrentFile -#define unzOpenCurrentFile2 lvzip_unzOpenCurrentFile2 -#define unzOpenCurrentFile3 lvzip_unzOpenCurrentFile3 -#define unzOpenCurrentFilePassword lvzip_unzOpenCurrentFilePassword -#define unzReadCurrentFile lvzip_unzReadCurrentFile -#define unzRepair lvzip_unzRepair -#define unzSetOffset lvzip_unzSetOffset -#define unzSetOffset64 lvzip_unzSetOffset64 -#define unzStringFileNameCompare lvzip_unzStringFileNameCompare -#define unztell lvzip_unztell -#define unztell64 lvzip_unztell64 -#define unzeof lvzip_unzeof -#define zipClose lvzip_zipClose -#define zipClose2 lvzip_zipClose2 -#define zipCloseFileInZip lvzip_zipCloseFileInZip -#define zipCloseFileInZipRaw lvzip_zipCloseFileInZipRaw -#define zipCloseFileInZipRaw64 lvzip_zipCloseFileInZipRaw64 -#define zipOpen lvzip_zipOpen -#define zipOpen64 lvzip_zipOpen64 -#define zipOpen2 lvzip_zipOpen2 -#define zipOpen2_64 lvzip_zipOpen2_64 -#define zipOpen3 lvzip_zipOpen3 -#define zipOpenNewFileInZip lvzip_zipOpenNewFileInZip -#define zipOpenNewFileInZip64 lvzip_zipOpenNewFileInZip64 -#define zipOpenNewFileInZip2 lvzip_zipOpenNewFileInZip2 -#define zipOpenNewFileInZip2_64 lvzip_zipOpenNewFileInZip2_64 -#define zipOpenNewFileInZip3 lvzip_zipOpenNewFileInZip3 -#define zipOpenNewFileInZip3_64 lvzip_zipOpenNewFileInZip3_64 -#define zipOpenNewFileInZip4 lvzip_zipOpenNewFileInZip4 -#define zipOpenNewFileInZip4_64 lvzip_zipOpenNewFileInZip4_64 -#define zipRemoveExtraInfoBlock lvzip_zipRemoveExtraInfoBlock -#define zipWriteInFileInZip lvzip_zipWriteInFileInZip -#define gzopen lvzlib_gzopen -#define gzopen64 lvzlib_gzopen64 -#define gzdopen lvzlib_gzdopen -#define gzbuffer lvzlib_gzbuffer -#define gzseek lvzlib_gzseek -#define gzseek64 lvzlib_gzseek64 -#define gzsetparams lvzlib_gzsetparams -#define gzread lvzlib_gzread -#define gzwrite lvzlib_gzwrite -#define gzprintf lvzlib_gzprintf -#define gzputc lvzlib_gzputc -#define gzputs lvzlib_gzputs -#define gzgetc lvzlib_gzgetc -#define gzgets lvzlib_gzgets -#define gzungetc lvzlib_gzungetc -#define gzrewind lvzlib_gzrewind -#define gzeof lvzlib_gzeof -#define gzclearerr lvzlib_gzclearerr -#define gzflush lvzlib_gzflush -#define gzdirect lvzlib_gzdirect -#define gzerror lvzlib_gzerror -#define gzclose lvzlib_gzclose -#define gzclose_r lvzlib_gzclose_r -#define gzclose_w lvzlib_gzclose_w -#define gztell lvzlib_gztell -#define gztell64 lvzlib_gztell64 -#define gzoffset lvzlib_gzoffset -#define gzoffset64 lvzlib_gzoffset64 -#define gcrc32_combine lvzlib_crc32_combine -#define gcrc32_combine64 lvzlib_crc32_combine64 +#define z_errmsg z_z_errmsg + +#define unzClose z_unzClose +#define unzCloseCurrentFile z_unzCloseCurrentFile +#define unzGetCurrentFileInfo z_unzGetCurrentFileInfo +#define unzGetCurrentFileInfo64 z_unzGetCurrentFileInfo64 +#define unzGetCurrentFileZStreamPos64 z_unzGetCurrentFileZStreamPos64 +#define unzGetFilePos z_unzGetFilePos +#define unzGetFilePos64 z_unzGetFilePos64 +#define unzGetGlobalComment z_unzGetGlobalComment +#define unzGetGlobalInfo z_unzGetGlobalInfo +#define unzGetGlobalInfo64 z_unzGetGlobalInfo64 +#define unzGetLocalExtrafield z_unzGetLocalExtrafield +#define unzGetOffset z_unzGetOffset +#define unzGetOffset64 z_unzGetOffset64 +#define unzGoToFilePos z_unzGoToFilePos +#define unzGoToFilePos64 z_unzGoToFilePos64 +#define unzGoToFirstFile z_unzGoToFirstFile +#define unzGoToNextFile z_unzGoToNextFile +#define unzLocateFile z_unzLocateFile +#define unzOpen z_unzOpen +#define unzOpen64 z_unzOpen64 +#define unzOpen2 z_unzOpen2 +#define unzOpen2_64 z_unzOpen2_64 +#define unzOpenCurrentFile z_unzOpenCurrentFile +#define unzOpenCurrentFile2 z_unzOpenCurrentFile2 +#define unzOpenCurrentFile3 z_unzOpenCurrentFile3 +#define unzOpenCurrentFilePassword z_unzOpenCurrentFilePassword +#define unzReadCurrentFile z_unzReadCurrentFile +#define unzRepair z_unzRepair +#define unzSetOffset z_unzSetOffset +#define unzSetOffset64 z_unzSetOffset64 +#define unzStringFileNameCompare z_unzStringFileNameCompare +#define unztell z_unztell +#define unztell64 z_unztell64 +#define unzeof z_unzeof +#define zipClose z_zipClose +#define zipClose2 z_zipClose2 +#define zipCloseFileInZip z_zipCloseFileInZip +#define zipCloseFileInZipRaw z_zipCloseFileInZipRaw +#define zipCloseFileInZipRaw64 z_zipCloseFileInZipRaw64 +#define zipOpen z_zipOpen +#define zipOpen64 z_zipOpen64 +#define zipOpen2 z_zipOpen2 +#define zipOpen2_64 z_zipOpen2_64 +#define zipOpen3 z_zipOpen3 +#define zipOpenNewFileInZip z_zipOpenNewFileInZip +#define zipOpenNewFileInZip64 z_zipOpenNewFileInZip64 +#define zipOpenNewFileInZip2 z_zipOpenNewFileInZip2 +#define zipOpenNewFileInZip2_64 z_zipOpenNewFileInZip2_64 +#define zipOpenNewFileInZip3 z_zipOpenNewFileInZip3 +#define zipOpenNewFileInZip3_64 z_zipOpenNewFileInZip3_64 +#define zipOpenNewFileInZip4 z_zipOpenNewFileInZip4 +#define zipOpenNewFileInZip4_64 z_zipOpenNewFileInZip4_64 +#define zipRemoveExtraInfoBlock z_zipRemoveExtraInfoBlock +#define zipWriteInFileInZip z_zipWriteInFileInZip +#define gzopen z_gzopen +#define gzopen64 z_gzopen64 +#define gzdopen z_gzdopen +#define gzbuffer z_gzbuffer +#define gzseek z_gzseek +#define gzseek64 z_gzseek64 +#define gzsetparams z_gzsetparams +#define gzread z_gzread +#define gzwrite z_gzwrite +#define gzprintf z_gzprintf +#define gzputc z_gzputc +#define gzputs z_gzputs +#define gzgetc z_gzgetc +#define gzgets z_gzgets +#define gzungetc z_gzungetc +#define gzrewind z_gzrewind +#define gzeof z_gzeof +#define gzclearerr z_gzclearerr +#define gzflush z_gzflush +#define gzdirect z_gzdirect +#define gzerror z_gzerror +#define gzclose z_gzclose +#define gzclose_r z_gzclose_r +#define gzclose_w z_gzclose_w +#define gztell z_gztell +#define gztell64 z_gztell64 +#define gzoffset z_gzoffset +#define gzoffset64 z_gzoffset64 +#define gcrc32_combine z_crc32_combine +#define gcrc32_combine64 z_crc32_combine64 Modified: trunk/lvzip/c_source/zip.h =================================================================== --- trunk/lvzip/c_source/zip.h 2012-07-23 21:23:01 UTC (rev 1483) +++ trunk/lvzip/c_source/zip.h 2012-07-23 21:26:16 UTC (rev 1484) @@ -335,6 +335,9 @@ /* Close the zipfile */ +ZEXTERN int ZEXPORT zipClose2 OF((zipFile file, + const char* global_comment, + voidp output)); ZEXTERN int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader)); Modified: trunk/lvzip/c_source/zlibvc.vcproj =================================================================== --- trunk/lvzip/c_source/zlibvc.vcproj 2012-07-23 21:23:01 UTC (rev 1483) +++ trunk/lvzip/c_source/zlibvc.vcproj 2012-07-23 21:26:16 UTC (rev 1484) @@ -382,7 +382,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;NO_vsnprintf;ZLIB_DLL;_CRT_SECURE_NO_WARNINGS" + PreprocessorDefinitions="WIN32;_DEBUG;Z_PREFIX;NO_vsnprintf;_CRT_SECURE_NO_WARNINGS" RuntimeLibrary="3" PrecompiledHeaderFile="$(IntDir)\zlibvc.pch" AssemblerListingLocation="$(IntDir)\" @@ -481,7 +481,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;NO_vsnprintf;ZLIB_DLL;_CRT_SECURE_NO_WARNINGS" + PreprocessorDefinitions="WIN32;_DEBUG;Z_PREFIX;NO_vsnprintf;_CRT_SECURE_NO_WARNINGS" RuntimeLibrary="3" PrecompiledHeaderFile="$(IntDir)\zlibvc.pch" AssemblerListingLocation="$(IntDir)\" @@ -1110,7 +1110,7 @@ Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" - PreprocessorDefinitions="WIN32;NDEBUG;NO_vsnprintf;ZLIB_DLL;_CRT_SECURE_NO_WARNINGS" + PreprocessorDefinitions="WIN32;NDEBUG;Z_PREFIX;NO_vsnprintf;_CRT_SECURE_NO_WARNINGS" StringPooling="true" RuntimeLibrary="0" EnableFunctionLevelLinking="true" @@ -1207,7 +1207,7 @@ Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" - PreprocessorDefinitions="WIN32;NDEBUG;NO_vsnprintf;ZLIB_DLL;_CRT_SECURE_NO_WARNINGS" + PreprocessorDefinitions="WIN32;NDEBUG;Z_PREFIX;NO_vsnprintf;_CRT_SECURE_NO_WARNINGS" StringPooling="true" RuntimeLibrary="0" EnableFunctionLevelLinking="true" @@ -2571,6 +2571,10 @@ </FileConfiguration> </File> <File + RelativePath=".\lvapi.c" + > + </File> + <File RelativePath="lvutil.c" > <FileConfiguration @@ -2687,18 +2691,6 @@ </FileConfiguration> </File> <File - RelativePath="lvzlib.def" - > - <FileConfiguration - Name="DLL Release|x64" - ExcludedFromBuild="true" - > - <Tool - Name="VCCustomBuildTool" - /> - </FileConfiguration> - </File> - <File RelativePath="MacBinaryIII.c" > <FileConfiguration @@ -3409,6 +3401,122 @@ </FileConfiguration> </File> <File + RelativePath="zlib.rc" + > + <FileConfiguration + Name="DLL ASM Obj Release|Win32" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="DLL ASM Obj Release|x64" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="static Release|Win32" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="static Release|x64" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="DLL Debug|Win32" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="DLL Debug|x64" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="DLL ASM Release|Win32" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="DLL ASM Release|x64" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="static ASM Release|Win32" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="static ASM Release|x64" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="DLL ASM Debug|Win32" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="DLL ASM Debug|x64" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="DLL Release|Win32" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="DLL Release|x64" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File RelativePath="zutil.c" > <FileConfiguration @@ -3542,6 +3650,10 @@ > </File> <File + RelativePath=".\gzguts.h" + > + </File> + <File RelativePath="inffast.h" > </File> @@ -3618,122 +3730,6 @@ RelativePath="lvzlib.ico" > </File> - <File - RelativePath="zlib.rc" - > - <FileConfiguration - Name="DLL ASM Obj Release|Win32" - > - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="DLL ASM Obj Release|x64" - > - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="static Release|Win32" - > - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="static Release|x64" - > - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="DLL Debug|Win32" - > - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="DLL Debug|x64" - > - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="DLL ASM Release|Win32" - > - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="DLL ASM Release|x64" - > - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="static ASM Release|Win32" - > - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="static ASM Release|x64" - > - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="DLL ASM Debug|Win32" - > - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="DLL ASM Debug|x64" - > - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="DLL Release|Win32" - > - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="DLL Release|x64" - > - <Tool - Name="VCResourceCompilerTool" - PreprocessorDefinitions="" - /> - </FileConfiguration> - </File> </Filter> <Filter Name="Assembler Files" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |