From: <lab...@us...> - 2015-05-01 20:27:05
|
Revision: 1511 http://sourceforge.net/p/opengtoolkit/svn/1511 Author: labviewer Date: 2015-05-01 20:27:03 +0000 (Fri, 01 May 2015) Log Message: ----------- Fix some errors Modified Paths: -------------- trunk/lvzip/c_source/lvapi.c trunk/lvzip/c_source/lvutil.c trunk/lvzip/c_source/lvzip.xcodeproj/project.pbxproj trunk/lvzip/c_source/zip.h Added Paths: ----------- trunk/lvzip/c_source/lvapi.h Modified: trunk/lvzip/c_source/lvapi.c =================================================================== --- trunk/lvzip/c_source/lvapi.c 2015-04-25 21:49:03 UTC (rev 1510) +++ trunk/lvzip/c_source/lvapi.c 2015-05-01 20:27:03 UTC (rev 1511) @@ -4,6 +4,7 @@ #include "zip.h" #include "unzip.h" #include <string.h> +#include "lvapi.h" #ifndef VERSIONMADEBY # define VERSIONMADEBY (0x0) /* platform depedent */ @@ -231,12 +232,11 @@ { zipFile node; MgErr err = lvzlibGetRefnum(refnum, &node, ZipMagic); - if(!err) + if (!err) { int retval = zipWriteInFileInZip(node, LStrBuf(*buffer), LStrLen(*buffer)); if (retval < 0) return LibToMgErr(retval); - LStrLen(*buffer) = retval; } return err; } @@ -271,7 +271,10 @@ { int retval; LStrHandle comment = NULL; - if (globalComment && LStrLen(*globalComment) > 0) + + *refnum = kNotARefNum; + + if (globalComment && LStrLen(*globalComment) > 0) { err = ConvertLString(globalComment, CP_ACP, &comment, CP_OEMCP, 0, NULL); if (err) Added: trunk/lvzip/c_source/lvapi.h =================================================================== --- trunk/lvzip/c_source/lvapi.h (rev 0) +++ trunk/lvzip/c_source/lvapi.h 2015-05-01 20:27:03 UTC (rev 1511) @@ -0,0 +1,46 @@ +// +// lvapi.h +// lvzip +// +// Created by imac on 01-05-15. +// +// + +#ifndef lvzip_lvapi_h +#define lvzip_lvapi_h +LibAPI(const char *) lvzlib_zlibVersion(void); +LibAPI(int) lvzlib_compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level); +LibAPI(int) lvzlib_uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen); +LibAPI(uInt32) lvzlib_crc32(uInt32 crc, const Bytef *buf, uInt32 len); +LibAPI(MgErr) lvzlib_zipOpen(const void *pathname, int append, LStrHandle *globalcomment, zlib_filefunc64_def* filefuncs, LVRefNum *refnum); +LibAPI(MgErr) lvzlib_zipOpenNewFileInZip(LVRefNum *refnum, LStrHandle filename, const zip_fileinfo* zipfi, + const LStrHandle extrafield_local, const LStrHandle extrafield_global, + LStrHandle comment, int method, int level, int raw, int windowBits, + int memLevel, int strategy, const char* password, uLong crcForCrypting, uLong flags, int zip64); +LibAPI(MgErr) lvzlib_zipWriteInFileInZip(LVRefNum *refnum, const LStrHandle buffer); +LibAPI(MgErr) lvzlib_zipCloseFileInZipRaw32(LVRefNum *refnum, uInt32 uncompressedSize, uInt32 crc32); +LibAPI(MgErr) lvzlib_zipCloseFileInZipRaw64(LVRefNum *refnum, uInt64 uncompressedSize, uInt32 crc32); +LibAPI(MgErr) lvzlib_zipClose(LVRefNum *refnum, const LStrHandle globalComment, LStrHandle *stream); + +LibAPI(MgErr) lvzlib_unzOpen(const void *pathname, zlib_filefunc64_def* filefuncs, LVRefNum *refnum); +LibAPI(MgErr) lvzlib_unzClose(LVRefNum *refnum); +LibAPI(MgErr) lvzlib_unzGetGlobalInfo32(LVRefNum *refnum, LStrHandle *comment, uInt32 *nEntry); +LibAPI(MgErr) lvzlib_unzGetGlobalInfo64(LVRefNum *refnum, LStrHandle *comment, uInt64 *nEntry); +LibAPI(MgErr) lvzlib_unzLocateFile(LVRefNum *refnum, LStrHandle fileName, int iCaseSensitivity); +LibAPI(MgErr) lvzlib_unzGetCurrentFileInfo32(LVRefNum *refnum, unz_file_info *pfile_info, LStrHandle *fileName, + LStrHandle *extraField, LStrHandle *comment); +LibAPI(MgErr) lvzlib_unzGetCurrentFileInfo64(LVRefNum *refnum, unz_file_info64 *pfile_info, LStrHandle *fileName, + LStrHandle *extraField, LStrHandle *comment); +LibAPI(MgErr) lvzlib_unzOpenCurrentFile(LVRefNum *refnum, int32* method, int32* level, int16 raw, const char* password); +LibAPI(MgErr) lvzlib_unzGetLocalExtrafield(LVRefNum *refnum, LStrHandle *extra); +LibAPI(MgErr) lvzlib_unzReadCurrentFile(LVRefNum *refnum, LStrHandle buffer); +LibAPI(MgErr) lvzlib_unzCloseCurrentFile(LVRefNum *refnum); +LibAPI(MgErr) lvzlib_unzGoToFirstFile(LVRefNum *refnum); +LibAPI(MgErr) lvzlib_unzGoToNextFile(LVRefNum *refnum); +LibAPI(MgErr) lvzlib_unzGoToFilePos32(LVRefNum *refnum, unz_file_pos *pos); +LibAPI(MgErr) lvzlib_unzGoToFilePos64(LVRefNum *refnum, unz64_file_pos *pos); +LibAPI(MgErr) lvzlib_unzGetFilePos32(LVRefNum *refnum, unz_file_pos *pos); +LibAPI(MgErr) lvzlib_unzGetFilePos64(LVRefNum *refnum, unz64_file_pos *pos); + + +#endif Modified: trunk/lvzip/c_source/lvutil.c =================================================================== --- trunk/lvzip/c_source/lvutil.c 2015-04-25 21:49:03 UTC (rev 1510) +++ trunk/lvzip/c_source/lvutil.c 2015-05-01 20:27:03 UTC (rev 1511) @@ -72,10 +72,9 @@ if (!posixPath) return mgArgErr; - if (*posixPath) - LStrLen(**posixPath) = 0; - fileRef = CFStringCreateWithBytes(kCFAllocatorDefault, LStrBuf(*hfsPath), LStrLen(*hfsPath), encoding, false); + if (*posixPath) + LStrLen(**posixPath) = 0; if (!fileRef) { return mFullErr; @@ -759,7 +758,7 @@ { err = FPathToText(path, **str); LStrLen(**str) = pathLen; -#if MacOSX +#if MacOSX && (ProcessorType == kX86) if (!err) err = ConvertToPosixPath(*str, str, false); #endif @@ -1081,7 +1080,7 @@ if (0 == ioRefNum) return mgArgErr; #if MacOSX - err = FSRead(ioRefNum, (int32*)&inCount, buffer); + err = FMRead(ioRefNum, (int32*)&inCount, buffer); if (outCount) { if (err && err != eofErr) @@ -1144,7 +1143,7 @@ if (0 == ioRefNum) return mgArgErr; #if MacOSX - err = FSWrite(ioRefNum, (int32*)&inCount, buffer); + err = FMWrite(ioRefNum, (int32*)&inCount, buffer); if (outCount) { if (err && err != dskFulErr) Modified: trunk/lvzip/c_source/lvzip.xcodeproj/project.pbxproj =================================================================== --- trunk/lvzip/c_source/lvzip.xcodeproj/project.pbxproj 2015-04-25 21:49:03 UTC (rev 1510) +++ trunk/lvzip/c_source/lvzip.xcodeproj/project.pbxproj 2015-05-01 20:27:03 UTC (rev 1511) @@ -86,6 +86,7 @@ 839542BA0894F2490020C3E2 /* adler32.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = adler32.c; sourceTree = "<group>"; }; 83D3E1AF080D116E00DE332C /* lvzlib.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = lvzlib.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 83D3E26C080D117700DE332C /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; }; + 88521A381AF4145000A9CDF7 /* lvapi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = lvapi.h; sourceTree = "<group>"; }; 888E74391ADD96A900C5AEFE /* utf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = utf.c; sourceTree = "<group>"; }; 888E743B1ADD96C200C5AEFE /* utf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utf.h; sourceTree = "<group>"; }; 888E743D1ADD96D700C5AEFE /* lvapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lvapi.c; sourceTree = "<group>"; }; @@ -128,6 +129,7 @@ 83D3E1B5080D116E00DE332C /* zlib Sources */ = { isa = PBXGroup; children = ( + 88521A381AF4145000A9CDF7 /* lvapi.h */, 888E743D1ADD96D700C5AEFE /* lvapi.c */, 888E743B1ADD96C200C5AEFE /* utf.h */, 888E74391ADD96A900C5AEFE /* utf.c */, @@ -294,7 +296,7 @@ C77CC6B50C9C7C6500886AB2 /* Development */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = NO; GCC_ALTIVEC_EXTENSIONS = NO; GCC_CHAR_IS_UNSIGNED_CHAR = NO; @@ -341,7 +343,7 @@ C77CC6B60C9C7C6500886AB2 /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = YES; GCC_ALTIVEC_EXTENSIONS = NO; GCC_CHAR_IS_UNSIGNED_CHAR = NO; @@ -385,7 +387,7 @@ C77CC6B70C9C7C6500886AB2 /* Default */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_ALTIVEC_EXTENSIONS = NO; GCC_CHAR_IS_UNSIGNED_CHAR = NO; GCC_ENABLE_CPP_EXCEPTIONS = NO; @@ -427,7 +429,7 @@ isa = XCBuildConfiguration; buildSettings = { "ADDITIONAL_SDKS[arch=i386]" = ""; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_CHAR_IS_UNSIGNED_CHAR = YES; HEADER_SEARCH_PATHS = ( "$(inherited)", @@ -446,7 +448,7 @@ C77CC6BA0C9C7C6500886AB2 /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_CHAR_IS_UNSIGNED_CHAR = YES; HEADER_SEARCH_PATHS = ( "$(inherited)", @@ -466,7 +468,7 @@ isa = XCBuildConfiguration; buildSettings = { "ADDITIONAL_SDKS[arch=*]" = ""; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_CHAR_IS_UNSIGNED_CHAR = YES; HEADER_SEARCH_PATHS = ( "$(inherited)", Modified: trunk/lvzip/c_source/zip.h =================================================================== --- trunk/lvzip/c_source/zip.h 2015-04-25 21:49:03 UTC (rev 1510) +++ trunk/lvzip/c_source/zip.h 2015-05-01 20:27:03 UTC (rev 1511) @@ -143,6 +143,8 @@ int append, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def)); + +ZEXTERN zipFile ZEXPORT zipOpen3 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_32_def* pzlib_filefunc64_32_def); ZEXTERN int ZEXPORT zipOpenNewFileInZip OF((zipFile file, const char* filename, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |