From: <lab...@us...> - 2015-04-14 19:25:49
|
Revision: 1507 http://sourceforge.net/p/opengtoolkit/svn/1507 Author: labviewer Date: 2015-04-14 19:25:47 +0000 (Tue, 14 Apr 2015) Log Message: ----------- Some Mac specific edits Modified Paths: -------------- trunk/lvzip/c_source/MacBinaryIII.h trunk/lvzip/c_source/lvutil.c trunk/lvzip/c_source/lvutil.h trunk/lvzip/c_source/lvzip.xcodeproj/project.pbxproj trunk/lvzip/c_source/mztools.c trunk/lvzip/c_source/utf.c trunk/lvzip/c_source/zip.c Modified: trunk/lvzip/c_source/MacBinaryIII.h =================================================================== --- trunk/lvzip/c_source/MacBinaryIII.h 2015-04-10 10:11:59 UTC (rev 1506) +++ trunk/lvzip/c_source/MacBinaryIII.h 2015-04-14 19:25:47 UTC (rev 1507) @@ -12,7 +12,7 @@ #include <String.h> #pragma once -#pragma options align=mac68k +//#pragma options align=mac68k /* 000 Byte @@ -169,4 +169,4 @@ } #endif -#pragma options align=reset +//#pragma options align=reset Modified: trunk/lvzip/c_source/lvutil.c =================================================================== --- trunk/lvzip/c_source/lvutil.c 2015-04-10 10:11:59 UTC (rev 1506) +++ trunk/lvzip/c_source/lvutil.c 2015-04-14 19:25:47 UTC (rev 1507) @@ -382,8 +382,10 @@ LStrHandle comment) { MgErr err = mgNoErr; -#if MacOSX +#if MacOS +#if !MacOSX FSRef ref; +#endif #elif Win32 LStrPtr lstr; HANDLE handle = NULL; @@ -400,6 +402,15 @@ return mgArgErr; #if MacOSX + if (write) + { + err = FSetInfo(path, fileInfo); + } + else + { + err = FGetInfo(path, fileInfo); + } +#elif MacOS err = FSMakePathRef(path, &ref); if (!err) { @@ -723,7 +734,7 @@ LStrLen(**str) = pathLen; #if MacOSX if (!err) - err = ConvertToPosixPath(*str, str); + err = ConvertToPosixPath(*str, str, false); #endif } } @@ -742,7 +753,7 @@ { MgErr err = mgNoErr; #if MacOSX - err = OSErrToLVErr(FSCloseFork(ioRefNum); + err = OSErrToLVErr(FSCloseFork(ioRefNum)); #elif Unix if (fclose(ioRefNum)) { @@ -901,7 +912,7 @@ if ((offs->q == 0) && (mode == fCurrent)) return noErr; #if MacOSX - ret = FSSetForkPosition(ioRefNum, mode, offs.q); + ret = FSSetForkPosition(ioRefNum, mode, offs->q); if (ret == posErr) { ret = FSSetForkPosition(ioRefNum, fsFromStart, 0); @@ -1043,7 +1054,7 @@ if (0 == ioRefNum) return mgArgErr; #if MacOSX - err = FSRead(ioRefNum, &inCount, buffer); + err = FSRead(ioRefNum, (int32*)&inCount, buffer); if (outCount) { if (err && err != eofErr) @@ -1105,8 +1116,8 @@ if (0 == ioRefNum) return mgArgErr; -#if Mac - err = FSWrite(ioRefNum, &inCount, buffer); +#if MacOSX + err = FSWrite(ioRefNum, (int32*)&inCount, buffer); if (outCount) { if (err && err != dskFulErr) @@ -1124,7 +1135,7 @@ err = Win32ToLVFileErr(); if (outCount) *outCount = actCount; - return err; + return err; #elif Unix errno = 0; actCount = fwrite((char *)buffer, 1, inCount, ioRefNum); @@ -1135,7 +1146,7 @@ } if (outCount) *outCount = actCount; - return err; + return err; #endif } @@ -1144,18 +1155,18 @@ MgErr err; int32 type; FileRefNum ioRefNum; + LStrPtr lstr; #if MacOSX FSRef ref; HFSUniStr255 forkName; int8 perm; + char theMode[4]; OSErr ret; #elif Win32 - LStrPtr lstr; DWORD shareAcc, openAcc; DWORD createMode = OPEN_EXISTING; int32 attempts; #elif Unix - LStrPtr lstr; uChar theMode[3]; struct stat statbuf; #endif @@ -1312,7 +1323,8 @@ #if MacOSX else { - if (err = FSMakePathRef(path, &ref)) + err = FSMakePathRef(path, &ref); + if (err) { DEBUGPRINTF(("FSMakePathRef: err = %ld", err)); return err; @@ -1362,7 +1374,7 @@ ret = FSOpenFork(&ref, forkName.length, forkName.unicode, perm, &ioRefNum); } err = OSErrToLVErr(ret); - if (!err && if (openMode == openWriteOnlyTruncate) + if (!err && openMode == openWriteOnlyTruncate) { FileOffset size; size.q = 0; @@ -1613,13 +1625,13 @@ { return mFullErr; } - hsfRef = CFURLCopyFileSystemPath(urlRef, kCFURLHFSPathStyle); + hfsRef = CFURLCopyFileSystemPath(urlRef, kCFURLHFSPathStyle); CFRelease(urlRef); - if (hsfRef) + if (hfsRef) { CFIndex len; - CFRange range = CFRangeMake(0, CFStringGetLength(posixRef)); - if (CFStringGetBytes(hsfRef, range, encoding, 0, false, NULL, 0, &len) > 0) + CFRange range = CFRangeMake(0, CFStringGetLength(hfsRef)); + if (CFStringGetBytes(hfsRef, range, encoding, 0, false, NULL, 0, &len) > 0) { if (len > 0) { @@ -1629,7 +1641,7 @@ encoding = ConvertCodepageToEncoding(destcp); if (encoding != kCFStringEncodingInvalidId) { - if (CFStringGetBytes(hsfRef, range, encoding, 0, false, LStrBuf(**dest), len, &len) > 0) + if (CFStringGetBytes(hfsRef, range, encoding, 0, false, LStrBuf(**dest), len, &len) > 0) { LStrBuf(**dest)[len] = 0; LStrLen(**dest) = len; @@ -1643,11 +1655,11 @@ } } } - CFRelease(hsfRef); + CFRelease(hfsRef); } else { - err = mgFullErr; + err = mFullErr; } } #endif @@ -1730,7 +1742,7 @@ { return mFullErr; } - urlRef = CFURLCreateWithFileSystemPath(NULL, fileRef, kCFURLHSFPathStyle, isDir); + urlRef = CFURLCreateWithFileSystemPath(NULL, fileRef, kCFURLHFSPathStyle, isDir); CFRelease(fileRef); if (!urlRef) { @@ -1769,7 +1781,7 @@ } else { - err = mgFullErr; + err = mFullErr; } } #endif @@ -2140,7 +2152,7 @@ { CFMutableStringRef cfpath2 = CFStringCreateMutableCopy(NULL, 0, cfpath); CFRelease(cfpath); - if (cpath2) + if (cfpath2) { CFStringNormalize(cfpath2, kCFStringNormalizationFormD); CFStringEncoding encoding = ConvertCodepageToEncoding(codePage); Modified: trunk/lvzip/c_source/lvutil.h =================================================================== --- trunk/lvzip/c_source/lvutil.h 2015-04-10 10:11:59 UTC (rev 1506) +++ trunk/lvzip/c_source/lvutil.h 2015-04-14 19:25:47 UTC (rev 1507) @@ -325,6 +325,7 @@ #define kUnknownFileType RTToL('?','?','?','?') #define kUnknownCreator RTToL('?','?','?','?') + enum { openReadWrite, openReadOnly, openWriteOnly, openWriteOnlyTruncate }; /* open modes */ enum { denyReadWrite, denyWriteOnly, denyNeither}; /* deny modes */ @@ -364,7 +365,6 @@ MgErr FGetPathType(Path, int32*); int32 FDepth(Path path); MgErr FDisposePath(Path p); - MgErr FNewRefNum(Path path, File fd, LVRefNum* refnum); Bool32 FIsARefNum(LVRefNum); MgErr FDisposeRefNum(LVRefNum); Modified: trunk/lvzip/c_source/lvzip.xcodeproj/project.pbxproj =================================================================== --- trunk/lvzip/c_source/lvzip.xcodeproj/project.pbxproj 2015-04-10 10:11:59 UTC (rev 1506) +++ trunk/lvzip/c_source/lvzip.xcodeproj/project.pbxproj 2015-04-14 19:25:47 UTC (rev 1507) @@ -42,9 +42,10 @@ 839542ED0894F2490020C3E2 /* infback.c in Sources */ = {isa = PBXBuildFile; fileRef = 839542B60894F2490020C3E2 /* infback.c */; }; 839542EF0894F2490020C3E2 /* gvmat32c.c in Sources */ = {isa = PBXBuildFile; fileRef = 839542B80894F2490020C3E2 /* gvmat32c.c */; }; 839542F10894F2490020C3E2 /* adler32.c in Sources */ = {isa = PBXBuildFile; fileRef = 839542BA0894F2490020C3E2 /* adler32.c */; }; - 83D3E21E080D117200DE332C /* MacBinaryIII.c in Sources */ = {isa = PBXBuildFile; fileRef = 83D3E1B3080D116E00DE332C /* MacBinaryIII.c */; }; - 83D3E21F080D117200DE332C /* MacBinaryIII.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D3E1B4080D116E00DE332C /* MacBinaryIII.h */; }; 83D3E26D080D117700DE332C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83D3E26C080D117700DE332C /* Carbon.framework */; }; + 888E743A1ADD96A900C5AEFE /* utf.c in Sources */ = {isa = PBXBuildFile; fileRef = 888E74391ADD96A900C5AEFE /* utf.c */; }; + 888E743C1ADD96C200C5AEFE /* utf.h in Headers */ = {isa = PBXBuildFile; fileRef = 888E743B1ADD96C200C5AEFE /* utf.h */; }; + 888E743E1ADD96D700C5AEFE /* lvapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 888E743D1ADD96D700C5AEFE /* lvapi.c */; }; C77CC6BF0C9C7D3200886AB2 /* liblvexports.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C77CC6BE0C9C7D3200886AB2 /* liblvexports.a */; }; C77CC6C20C9C7D6500886AB2 /* liblabviewcin.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C77CC6C10C9C7D6500886AB2 /* liblabviewcin.a */; }; C79368AC0C9ED687006083BF /* iomem.c in Sources */ = {isa = PBXBuildFile; fileRef = C79368AA0C9ED687006083BF /* iomem.c */; }; @@ -88,9 +89,10 @@ 839542B80894F2490020C3E2 /* gvmat32c.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = gvmat32c.c; sourceTree = "<group>"; }; 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; }; - 83D3E1B3080D116E00DE332C /* MacBinaryIII.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = MacBinaryIII.c; sourceTree = SOURCE_ROOT; }; - 83D3E1B4080D116E00DE332C /* MacBinaryIII.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MacBinaryIII.h; sourceTree = SOURCE_ROOT; }; 83D3E26C080D117700DE332C /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; }; + 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>"; }; C77CC6BE0C9C7D3200886AB2 /* liblvexports.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblvexports.a; path = "/Applications/National Instruments/LabVIEW 8.2/cintools/Mach-O/liblvexports.a"; sourceTree = "<absolute>"; }; C77CC6C10C9C7D6500886AB2 /* liblabviewcin.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblabviewcin.a; path = "/Applications/National Instruments/LabVIEW 8.2/cintools/Mach-O/liblabviewcin.a"; sourceTree = "<absolute>"; }; C79368AA0C9ED687006083BF /* iomem.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = iomem.c; sourceTree = "<group>"; }; @@ -119,7 +121,6 @@ C79368AB0C9ED687006083BF /* iomem.h */, C77CC6C10C9C7D6500886AB2 /* liblabviewcin.a */, C77CC6BE0C9C7D3200886AB2 /* liblvexports.a */, - 83D3E1B0080D116E00DE332C /* mac Specific */, 83D3E1B5080D116E00DE332C /* zlib Sources */, 83D3E26B080D117700DE332C /* Frameworks */, 83D3E19A080D116E00DE332C /* Products */, @@ -134,18 +135,12 @@ name = Products; sourceTree = "<group>"; }; - 83D3E1B0080D116E00DE332C /* mac Specific */ = { - isa = PBXGroup; - children = ( - 83D3E1B4080D116E00DE332C /* MacBinaryIII.h */, - 83D3E1B3080D116E00DE332C /* MacBinaryIII.c */, - ); - name = "mac Specific"; - sourceTree = "<group>"; - }; 83D3E1B5080D116E00DE332C /* zlib Sources */ = { isa = PBXGroup; children = ( + 888E743D1ADD96D700C5AEFE /* lvapi.c */, + 888E743B1ADD96C200C5AEFE /* utf.h */, + 888E74391ADD96A900C5AEFE /* utf.c */, 839542890894F2480020C3E2 /* lvutil.h */, 8395428A0894F2480020C3E2 /* lvutil.c */, 8395428C0894F2480020C3E2 /* mztools.c */, @@ -200,13 +195,13 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 83D3E21F080D117200DE332C /* MacBinaryIII.h in Headers */, 839542C00894F2490020C3E2 /* lvutil.h in Headers */, 839542C60894F2490020C3E2 /* inffast.h in Headers */, 839542C90894F2490020C3E2 /* crc32.h in Headers */, 839542CB0894F2490020C3E2 /* crypt.h in Headers */, 839542CD0894F2490020C3E2 /* inflate.h in Headers */, 839542CE0894F2490020C3E2 /* deflate.h in Headers */, + 888E743C1ADD96C200C5AEFE /* utf.h in Headers */, 839542CF0894F2490020C3E2 /* zutil.h in Headers */, 839542D90894F2490020C3E2 /* ioapi.h in Headers */, 839542DB0894F2490020C3E2 /* inftrees.h in Headers */, @@ -248,6 +243,8 @@ /* Begin PBXProject section */ 83D3E190080D116E00DE332C /* Project object */ = { isa = PBXProject; + attributes = { + }; buildConfigurationList = C77CC6B80C9C7C6500886AB2 /* Build configuration list for PBXProject "lvzip" */; compatibilityVersion = "Xcode 2.4"; developmentRegion = English; @@ -280,7 +277,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 83D3E21E080D117200DE332C /* MacBinaryIII.c in Sources */, 839542C10894F2490020C3E2 /* lvutil.c in Sources */, 839542C30894F2490020C3E2 /* mztools.c in Sources */, 839542C70894F2490020C3E2 /* inffast.c in Sources */, @@ -289,10 +285,12 @@ 839542CC0894F2490020C3E2 /* inftrees.c in Sources */, 839542D00894F2490020C3E2 /* zutil.c in Sources */, 839542D60894F2490020C3E2 /* compress.c in Sources */, + 888E743E1ADD96D700C5AEFE /* lvapi.c in Sources */, 839542DA0894F2490020C3E2 /* ioapi.c in Sources */, 839542E00894F2490020C3E2 /* zip.c in Sources */, 839542E40894F2490020C3E2 /* unzip.c in Sources */, 839542E50894F2490020C3E2 /* uncompr.c in Sources */, + 888E743A1ADD96A900C5AEFE /* utf.c in Sources */, 839542E70894F2490020C3E2 /* trees.c in Sources */, 839542EB0894F2490020C3E2 /* inflate.c in Sources */, 839542ED0894F2490020C3E2 /* infback.c in Sources */, @@ -308,6 +306,7 @@ C77CC6B50C9C7C6500886AB2 /* Development */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = NO; GCC_ALTIVEC_EXTENSIONS = NO; GCC_CHAR_IS_UNSIGNED_CHAR = NO; @@ -334,6 +333,7 @@ LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SYSTEM_APPS_DIR)/National Instruments/LabVIEW 2009/cintools/Mach-O\""; LIBRARY_STYLE = DYNAMIC; MACH_O_TYPE = mh_dylib; + MACOSX_DEPLOYMENT_TARGET = 10.8; OTHER_CFLAGS = "-fno-inline"; OTHER_LDFLAGS = ( "-multiply_defined", @@ -343,6 +343,7 @@ PRODUCT_NAME = lvzlib; REZ_SCRIPT_TYPE = Roman; REZ_SUPPRESS_REDECLARED_RESOURCE_TYPE_WARNINGS = NO; + SDKROOT = macosx10.9; SECTORDER_FLAGS = ""; WARNING_CFLAGS = ( "-Wmost", @@ -356,6 +357,7 @@ C77CC6B60C9C7C6500886AB2 /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; COPY_PHASE_STRIP = YES; GCC_ALTIVEC_EXTENSIONS = NO; GCC_CHAR_IS_UNSIGNED_CHAR = NO; @@ -379,6 +381,7 @@ LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SYSTEM_APPS_DIR)/National Instruments/LabVIEW 2009/cintools/Mach-O\""; LIBRARY_STYLE = DYNAMIC; MACH_O_TYPE = mh_dylib; + MACOSX_DEPLOYMENT_TARGET = 10.8; OTHER_CFLAGS = "-fno-inline"; OTHER_LDFLAGS = ( "-multiply_defined", @@ -388,6 +391,7 @@ PRODUCT_NAME = lvzlib; REZ_SCRIPT_TYPE = Roman; REZ_SUPPRESS_REDECLARED_RESOURCE_TYPE_WARNINGS = NO; + SDKROOT = macosx10.9; SECTORDER_FLAGS = ""; WARNING_CFLAGS = ( "-Wmost", @@ -401,6 +405,7 @@ C77CC6B70C9C7C6500886AB2 /* Default */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_ALTIVEC_EXTENSIONS = NO; GCC_CHAR_IS_UNSIGNED_CHAR = NO; GCC_ENABLE_CPP_EXCEPTIONS = NO; @@ -422,6 +427,7 @@ LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SYSTEM_APPS_DIR)/National Instruments/LabVIEW 2009/cintools/Mach-O\""; LIBRARY_STYLE = DYNAMIC; MACH_O_TYPE = mh_dylib; + MACOSX_DEPLOYMENT_TARGET = 10.8; OTHER_CFLAGS = "-fno-inline"; OTHER_LDFLAGS = ( "-multiply_defined", @@ -431,6 +437,7 @@ PRODUCT_NAME = lvzlib; REZ_SCRIPT_TYPE = Roman; REZ_SUPPRESS_REDECLARED_RESOURCE_TYPE_WARNINGS = NO; + SDKROOT = macosx10.9; SECTORDER_FLAGS = ""; WARNING_CFLAGS = ( "-Wmost", Modified: trunk/lvzip/c_source/mztools.c =================================================================== --- trunk/lvzip/c_source/mztools.c 2015-04-10 10:11:59 UTC (rev 1506) +++ trunk/lvzip/c_source/mztools.c 2015-04-14 19:25:47 UTC (rev 1507) @@ -27,7 +27,7 @@ WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \ } while(0) -extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered) +ZEXTERN int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered) const char* file; const char* fileOut; const char* fileOutTmp; Modified: trunk/lvzip/c_source/utf.c =================================================================== --- trunk/lvzip/c_source/utf.c 2015-04-10 10:11:59 UTC (rev 1506) +++ trunk/lvzip/c_source/utf.c 2015-04-14 19:25:47 UTC (rev 1507) @@ -99,7 +99,7 @@ if (!utf8_is_trail(src[*offset])) return INCOMPLETE_SEQUENCE; - return noErr; + return mgNoErr; } #define UTF8_INCREASE_AND_RETURN_ON_ERROR(src, offset, length) {MgErr ret = utf8_increase_safely(src, offset, length); if (ret) return ret;} @@ -112,7 +112,7 @@ *code_point = utf8_mask(src[*offset]); ++(*offset); - return noErr; + return mgNoErr; } static MgErr utf8_get_sequence_2(const uInt8 *src, int32 *offset, int32 length, uInt32 *code_point) @@ -126,7 +126,7 @@ *code_point = ((*code_point << 6) & 0x7c0) + (src[*offset] & 0x3f); ++(*offset); - return noErr; + return mgNoErr; } static MgErr utf8_get_sequence_3(const uInt8 *src, int32 *offset, int32 length, uInt32 *code_point) @@ -144,7 +144,7 @@ *code_point += src[*offset] & 0x3f; ++(*offset); - return noErr; + return mgNoErr; } static MgErr utf8_get_sequence_4(const uInt8 *src, int32 *offset, int32 length, uInt32 *code_point) @@ -166,7 +166,7 @@ *code_point += src[*offset++] & 0x3f; - return noErr; + return mgNoErr; } static MgErr utf8_append(uInt32 cp, uInt8 *buffer, int32 *offset, int32 length) @@ -226,7 +226,7 @@ } *offset += 4; } - return noErr; + return mgNoErr; } static MgErr utf8_next(const uInt8 *buffer, int32 *offset, int32 length, uInt32 *cp) @@ -256,7 +256,7 @@ break; } *offset = (int32)(ptr - buffer); - return noErr; + return mgNoErr; } return mgArgErr; } @@ -278,7 +278,7 @@ MgErr utf8_advance(const uInt8 *src, int32 *offset, int32 length, int32 distance) { - MgErr err = noErr; + MgErr err = mgNoErr; int32 i = 0; uInt32 cp; for (; !err && i < distance; ++i) @@ -290,7 +290,7 @@ MgErr utf8_distance(const uInt8 *src, int32 *offset, int32 length) { - MgErr err = noErr; + MgErr err = mgNoErr; int32 i = 0; uInt32 cp; for (; !err && src[*offset] && (length < 0 || *offset < length); i++) @@ -302,7 +302,7 @@ MgErr utf8_validate_next(const uInt8 *src, int32 *offset, int32 length, uInt32 *code_point) { - MgErr err = noErr; + MgErr err = mgNoErr; uInt32 cp = 0; // Save the original value of offset so we can go back in case of failure @@ -341,7 +341,7 @@ if (code_point) *code_point = cp; offset++; - return noErr; + return mgNoErr; } else err = OVERLONG_SEQUENCE; @@ -357,14 +357,14 @@ MgErr utf8_replace_invalid(const uInt8 *src, int32 *soff, int32 slen, uInt8 *dest, int32 *doff, int32 dlen, uInt32 replacement) { - MgErr err = noErr; + MgErr err = mgNoErr; while (src[*soff] && (slen < 0 || *soff < slen)) { int32 off = *soff; err = utf8_validate_next(src, soff, slen, NULL); switch (err) { - case noErr: + case mgNoErr: for (; off < *soff && *doff < dlen; off++, (*doff)++) dest[*doff] = src[off]; break; @@ -390,7 +390,7 @@ MgErr utf8_is_valid(const uInt8 *src, int32 *offset, int32 length) { - MgErr err = noErr; + MgErr err = mgNoErr; while (!err && src[*offset] && (length < 0 || *offset < length)) { err = utf8_validate_next(src, offset, length, NULL); @@ -400,7 +400,7 @@ MgErr utf16to8(const uInt16 *src, int32 slen, uInt8 *dest, int32 *offset, int32 length) { - MgErr err = noErr; + MgErr err = mgNoErr; int32 soff = 0, doff = offset ? *offset : 0; uInt32 cp = 0; while (!err && src[soff] && (slen < 0 || soff < slen)) @@ -421,7 +421,7 @@ MgErr utf8to16(const uInt8 *src, int32 slen, uInt16 *dest, int32 *offset, int32 length) { - MgErr err = noErr; + MgErr err = mgNoErr; int32 soff = 0, doff = offset ? *offset : 0; uInt32 cp = 0; while (!err && src[soff] && (slen < 0 || soff < slen)) @@ -461,7 +461,7 @@ MgErr utf32to8(const uInt32 *src, int32 slen, uInt8 *dest, int32 *offset, int32 length) { - MgErr err = noErr; + MgErr err = mgNoErr; int32 soff = 0, doff = offset ? *offset : 0; while (!err && src[soff] && (slen < 0 || soff < slen)) { @@ -474,7 +474,7 @@ MgErr utf8to32(const uInt8 *src, int32 slen, uInt32 *dest, int32 *offset, int32 length) { - MgErr err = noErr; + MgErr err = mgNoErr; int32 soff = 0, doff = offset ? *offset : 0; uInt32 cp = 0; while (!err && src[soff] && (slen < 0 || soff < slen) && (!dest || doff < length)) Modified: trunk/lvzip/c_source/zip.c =================================================================== --- trunk/lvzip/c_source/zip.c 2015-04-10 10:11:59 UTC (rev 1506) +++ trunk/lvzip/c_source/zip.c 2015-04-14 19:25:47 UTC (rev 1507) @@ -181,7 +181,6 @@ } zip64_internal; - #ifndef NOCRYPT #define INCLUDECRYPTINGCODE_IFCRYPTALLOWED #include "crypt.h" @@ -638,7 +637,7 @@ return relativeOffset; } -int LoadCentralDirectoryRecord(zip64_internal* pziinit) +local int LoadCentralDirectoryRecord(zip64_internal* pziinit) { int err=ZIP_OK; ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ @@ -956,7 +955,7 @@ return zipOpen3(pathname,append,NULL,NULL); } -int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local) +local int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local) { /* write the local header */ int err; @@ -1753,7 +1752,7 @@ return zipCloseFileInZipRaw (file,0,0); } -int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip) +local int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip) { int err = ZIP_OK; ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writting_offset; @@ -1775,7 +1774,7 @@ return err; } -int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) +local int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) { int err = ZIP_OK; @@ -1814,7 +1813,8 @@ } return err; } -int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) + +local int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip) { int err = ZIP_OK; @@ -1862,7 +1862,7 @@ return err; } -int Write_GlobalComment(zip64_internal* zi, const char* global_comment) +local int Write_GlobalComment(zip64_internal* zi, const char* global_comment) { int err = ZIP_OK; uInt size_global_comment = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |