From: <lab...@us...> - 2018-12-11 12:18:12
|
Revision: 1560 http://sourceforge.net/p/opengtoolkit/svn/1560 Author: labviewer Date: 2018-12-11 12:18:11 +0000 (Tue, 11 Dec 2018) Log Message: ----------- Some more updates to the C code to improve file information Modified Paths: -------------- trunk/lvzip/c_source/iomem.c trunk/lvzip/c_source/iomem.h trunk/lvzip/c_source/iowin.c trunk/lvzip/c_source/lvapi.c trunk/lvzip/c_source/lvapi.h trunk/lvzip/c_source/lvutil.c trunk/lvzip/c_source/lvutil.h trunk/lvzip/c_source/utf.c trunk/lvzip/c_source/zalias.h Modified: trunk/lvzip/c_source/iomem.c =================================================================== --- trunk/lvzip/c_source/iomem.c 2018-12-09 22:18:17 UTC (rev 1559) +++ trunk/lvzip/c_source/iomem.c 2018-12-11 12:18:11 UTC (rev 1560) @@ -1,7 +1,28 @@ -/* iomem.c -- Memory base function header for compress/uncompress .zip - files using zlib + zip or unzip API +/* + iomem.c -- Memory base function header for compress/uncompress .zip files + using zlib + zip or unzip API - Copyright (C) 2007 Rolf Kalbermatter + Copyright (C) 2007-2018 Rolf Kalbermatter + + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the + following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of SciWare, James Kring, Inc., nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "zutil.h" Modified: trunk/lvzip/c_source/iomem.h =================================================================== --- trunk/lvzip/c_source/iomem.h 2018-12-09 22:18:17 UTC (rev 1559) +++ trunk/lvzip/c_source/iomem.h 2018-12-11 12:18:11 UTC (rev 1560) @@ -1,5 +1,7 @@ /* iomem.h -- IO base function header for compress/uncompress .zip files using zlib + zip or unzip API + + Copyright (C) 2009-2018 Rolf Kalbermatter */ #include <stdlib.h> Modified: trunk/lvzip/c_source/iowin.c =================================================================== --- trunk/lvzip/c_source/iowin.c 2018-12-09 22:18:17 UTC (rev 1559) +++ trunk/lvzip/c_source/iowin.c 2018-12-11 12:18:11 UTC (rev 1560) @@ -1,14 +1,16 @@ -/* iowin32.c -- IO base function header for compress/uncompress .zip - Version 1.1, February 14h, 2010 - part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) +/* + iowin32.c -- IO base function header for compress/uncompress .zip + + Version 1.1, February 14h, 2010 - Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) - Modifications for Zip64 support - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - For more info read MiniZip_info.txt + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + For more info read MiniZip_info.txt */ #include <stdlib.h> Modified: trunk/lvzip/c_source/lvapi.c =================================================================== --- trunk/lvzip/c_source/lvapi.c 2018-12-09 22:18:17 UTC (rev 1559) +++ trunk/lvzip/c_source/lvapi.c 2018-12-11 12:18:11 UTC (rev 1560) @@ -1,6 +1,27 @@ -/* lvapi.c -- LabVIEW interface for LabVIEW ZIP library +/* + lvapi.c -- LabVIEW interface for LabVIEW ZIP library - Copyright (C) 2009-2015 Rolf Kalbermatter + Copyright (C) 2009-2018 Rolf Kalbermatter + + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the + following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of SciWare, James Kring, Inc., nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <string.h> #include <mbstring.h> @@ -153,11 +174,16 @@ return err; } -static char version[250]; +static char version[250] = {0}; LibAPI(const char *) lvzlib_zlibVersion(void) { - snprintf(version, sizeof(version), "LabVIEW ZIP library, version: 4.1\nzlib version: %s", zlibVersion()); + if (!version[0]) + snprintf(version, sizeof(version), "LabVIEW ZIP library, version: 4.2, Dec 2018\n" + "zlib version: %s, build flags: 0x%lX\n" + "minizip version: 1.2.0, September 16th, 2017" + "aes version: 2013\n" + "bzip2 version: %s", lvzip_zlibVersion(), lvzip_zlibCompileFlags(), BZ2_bzlibVersion()); return version; } @@ -633,7 +659,7 @@ return err; } -LibAPI(MgErr) lvzlib_unzGoToFirstFile2(LVRefNum *refnum, unz_file_info64 *pfile_info, LStrHandle *fileName, LStrHandle *extraField, LStrHandle *comment) +LibAPI(MgErr) lvzlib_unzGoToFirstFile2_64(LVRefNum *refnum, unz_file_info64 *pfile_info, LStrHandle *fileName, LStrHandle *extraField, LStrHandle *comment) { unzFile node; MgErr err = lvzlibGetRefnum(refnum, &node, UnzMagic); @@ -667,7 +693,7 @@ return err; } -LibAPI(MgErr) lvzlib_unzGoToNextFile2(LVRefNum *refnum, unz_file_info64 *pfile_info, LStrHandle *fileName, LStrHandle *extraField, LStrHandle *comment) +LibAPI(MgErr) lvzlib_unzGoToNextFile2_64(LVRefNum *refnum, unz_file_info64 *pfile_info, LStrHandle *fileName, LStrHandle *extraField, LStrHandle *comment) { unzFile node; MgErr err = lvzlibGetRefnum(refnum, &node, UnzMagic); Modified: trunk/lvzip/c_source/lvapi.h =================================================================== --- trunk/lvzip/c_source/lvapi.h 2018-12-09 22:18:17 UTC (rev 1559) +++ trunk/lvzip/c_source/lvapi.h 2018-12-11 12:18:11 UTC (rev 1560) @@ -1,6 +1,27 @@ -/* lvapi.c -- LabVIEW interface for LabVIEW ZIP library +/* + lvapi.c -- LabVIEW interface for LabVIEW ZIP library - Copyright (C) 2009-2015 Rolf Kalbermatter + Copyright (C) 2009-2018 Rolf Kalbermatter + + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the + following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of SciWare, James Kring, Inc., nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "lvutil.h" #include "zlib.h" @@ -34,9 +55,9 @@ LibAPI(MgErr) lvzlib_unzReadCurrentFile(LVRefNum *refnum, LStrHandle buffer); LibAPI(MgErr) lvzlib_unzCloseCurrentFile(LVRefNum *refnum); LibAPI(MgErr) lvzlib_unzGoToFirstFile(LVRefNum *refnum); -LibAPI(MgErr) lvzlib_unzGoToFirstFile64(LVRefNum *refnum, unz_file_info64 *pfile_info, LStrHandle *fileName, LStrHandle *extraField, LStrHandle *comment); +LibAPI(MgErr) lvzlib_unzGoToFirstFile2_64(LVRefNum *refnum, unz_file_info64 *pfile_info, LStrHandle *fileName, LStrHandle *extraField, LStrHandle *comment); LibAPI(MgErr) lvzlib_unzGoToNextFile(LVRefNum *refnum); -LibAPI(MgErr) lvzlib_unzGoToNextFile64(LVRefNum *refnum, unz_file_info64 *pfile_info, LStrHandle *fileName, LStrHandle *extraField, LStrHandle *comment); +LibAPI(MgErr) lvzlib_unzGoToNextFile2_64(LVRefNum *refnum, unz_file_info64 *pfile_info, LStrHandle *fileName, LStrHandle *extraField, LStrHandle *comment); 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); Modified: trunk/lvzip/c_source/lvutil.c =================================================================== --- trunk/lvzip/c_source/lvutil.c 2018-12-09 22:18:17 UTC (rev 1559) +++ trunk/lvzip/c_source/lvutil.c 2018-12-11 12:18:11 UTC (rev 1560) @@ -1,9 +1,29 @@ -/* lvutil.c -- support functions for LabVIEW ZIP library +/* + lvutil.c -- support functions for LabVIEW ZIP library - Version 1.13, March 15, 2013 Version 1.25, Dec 07, 2018 Copyright (C) 2002-2018 Rolf Kalbermatter + + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the + following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of SciWare, James Kring, Inc., nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define ZLIB_INTERNAL @@ -106,9 +126,9 @@ #endif #endif -#define usesHFSPath MacOS && ProcessorType!=kX64 -#define usesPosixPath Unix || (MacOSX && ProcessorType==kX64) -#define usesWinPath Win32 +#define usesHFSPath MacOS && ProcessorType != kX64 +#define usesPosixPath Unix || (MacOSX && ProcessorType == kX64) +#define usesWinPath Win32 #if usesHFSPath #define kPathSeperator ':' @@ -1246,7 +1266,7 @@ FInfoRec infoRec; #endif - if (!path || !comment) + if (!FIsAbsPath(path) || !comment) return mgArgErr; #if Win32 && !defined(EMBEDDED) @@ -1254,7 +1274,8 @@ if (err) return err; - if (FDepth(path) == 1) + /* Find First file fails with empty path (desktop) or volume letter alone */ + if (FDepth(path) <= 1) { *isDirectory = TRUE; fi.ftCreationTime.dwLowDateTime = fi.ftCreationTime.dwHighDateTime = 0; @@ -1278,18 +1299,29 @@ { if (write) { - Win32ConvertFromLVTime(fileInfo->cDate, &fi.ftCreationTime); + Win32ConvertFromLVTime(fileInfo->cDate, &fi.ftCreationTime); Win32ConvertFromLVTime(fileInfo->mDate, &fi.ftLastWriteTime); - if (!SetFileTime(handle, &fi.ftCreationTime, &fi.ftLastAccessTime, &fi.ftLastWriteTime)) + handle = CreateFileW(UStrBuf(lstr), GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); + if (handle != INVALID_HANDLE_VALUE) + { + if (!SetFileTime(handle, &fi.ftCreationTime, &fi.ftLastAccessTime, &fi.ftLastWriteTime)) + err = Win32GetLVFileErr(); + CloseHandle(handle); + } + else err = Win32GetLVFileErr(); - fi.dwFileAttributes = GetFileAttributesA((LPCSTR)lstr->str); - if (fi.dwFileAttributes != INVALID_FILE_ATTRIBUTES) + + if (!err) { - if (fileInfo->flags & 0x4000) - fi.dwFileAttributes |= FILE_ATTRIBUTE_HIDDEN; - else - fi.dwFileAttributes &= ~FILE_ATTRIBUTE_HIDDEN; - SetFileAttributesW(UStrBuf(lstr), fi.dwFileAttributes); + fi.dwFileAttributes = GetFileAttributesW(UStrBuf(lstr)); + if (fi.dwFileAttributes != INVALID_FILE_ATTRIBUTES) + { + if (fileInfo->flags & 0x4000) + fi.dwFileAttributes |= FILE_ATTRIBUTE_HIDDEN; + else + fi.dwFileAttributes &= ~FILE_ATTRIBUTE_HIDDEN; + SetFileAttributesW(UStrBuf(lstr), fi.dwFileAttributes); + } } } else @@ -1302,27 +1334,55 @@ fileInfo->flags = (fi.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) ? 0x4000 : 0; if (*isDirectory) { - count = 1; + if (!FDepth(path)) + { + DWORD drives = GetLogicalDrives(); + int drive; - wcscpy(UStrBuf(lstr) + UStrLen(lstr), L"\\*.*"); - if (!err) + count = 0; + for (drive = 1; drive <= 26; drive++) + { + if (drives & 01) + { + count++; + } + drives /= 2; + } + } + else { - handle = FindFirstFileW(UStrBuf(lstr), &fi); - if (handle == INVALID_HANDLE_VALUE) - count = 0; - else - while (FindNextFileW(handle, &fi)) - count++; - FindClose(handle); + count = 1; - if (FDepth(path) == 1) - fileInfo->size = count; - else - fileInfo->size = count - 2; + wcscpy(UStrBuf(lstr) + UStrLen(lstr), L"\\*.*"); + if (!err) + { + handle = FindFirstFileW(UStrBuf(lstr), &fi); + if (handle == INVALID_HANDLE_VALUE) + count = 0; + else + while (FindNextFileW(handle, &fi)) + count++; + FindClose(handle); + } } + if (FDepth(path) <= 1) + fileInfo->size = count; + else + fileInfo->size = count - 2; } else { + uInt32 type = HasRezExt(path); + if (type) + { + fileInfo->type = type; + fileInfo->creator = kLVCreatorType; + } + else + { + fileInfo->type = kUnknownFileType; + fileInfo->creator = kUnknownCreator; + } fileInfo->size = Quad(fi.nFileSizeHigh, fi.nFileSizeLow); } } @@ -1484,8 +1544,17 @@ } else { - fileInfo->type = kUnknownFileType; - fileInfo->creator = kUnknownCreator; + int32 type = HasRezExt(path); + if (type) + { + fileInfo->type = type; + fileInfo->creator = kLVCreatorType; + } + else + { + fileInfo->type = kUnknownFileType; + fileInfo->creator = kUnknownCreator; + } UnixConvertToLVTime(statbuf.st_ctime, &fileInfo->cDate); UnixConvertToLVTime(statbuf.st_mtime, &fileInfo->mDate); fileInfo->rfSize = 0; @@ -1493,11 +1562,13 @@ { DIR *dirp; struct dirent *dp; + struct direntpath dppath; + struct dirent *dpp = (struct dirent *)&dppath; if (!(dirp = opendir((const char*)lstr->str))) return UnixToLVFileErr(); - for (dp = readdir(dirp); dp; dp = readdir(dirp)) + for (dp = readdir_r(dirp, dpp); dp; dp = readdir_r(dirp, dpp)) count++; closedir(dirp); fileInfo->size = count - 2; @@ -1504,6 +1575,9 @@ } else { + /* Try to determine LabVIEW file types based on file ending? */ + // fileInfo->type = kUnknownFileType; + // fileInfo->creator = kLVCreatorType; fileInfo->size = statbuf.st_size; } } Modified: trunk/lvzip/c_source/lvutil.h =================================================================== --- trunk/lvzip/c_source/lvutil.h 2018-12-09 22:18:17 UTC (rev 1559) +++ trunk/lvzip/c_source/lvutil.h 2018-12-11 12:18:11 UTC (rev 1560) @@ -1,8 +1,29 @@ -/* lvutil.h -- support functions for macbinary +/* + lvutil.h -- support functions for LabVIEW integration - Version 1.9, Sept 17th, 2007 + Version 1.17, Dec 8th, 2018 - Copyright (C) 2002-2007 Rolf Kalbermatter + Copyright (C) 2002-2018 Rolf Kalbermatter + + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the + following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of SciWare, James Kring, Inc., nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define test #ifndef _lvUtil_H @@ -394,8 +415,8 @@ typedef struct { uInt32 type; /* handled by LabVIEW Type & Creator */ uInt32 creator; /* handled by LabVIEW Type & Creator */ - uInt64 size; /* not modified, use EOF */ - uInt64 rfSize; /* Mac only, not modified, use EOF */ + uInt64 size; + uInt64 rfSize; uInt32 cDate; uInt32 mDate; uInt16 flags; @@ -407,10 +428,10 @@ typedef enum _FMFileType { - kInvalidType =0, - kUnknownFileType=RTToL('?','?','?','?'), - kTextFileType =RTToL('T','E','X','T'), - kLinkFileType =RTToL('s','l','n','k'), + kInvalidType = 0, + kUnknownFileType= RTToL('?','?','?','?'), + kTextFileType = RTToL('T','E','X','T'), + kLinkFileType = RTToL('s','l','n','k'), /** Typical directory types */ kHardDiskDirType= RTToL('h','d','s','k'), kFloppyDirType = RTToL('f','l','p','y'), @@ -549,6 +570,7 @@ Path FNotAPath(Path); Bool32 FIsAPath(Path path); Bool32 FIsAbsPath(Path path); +Bool32 FIsEmptyPath(Path path); MgErr FTextToPath(UPtr str, int32 len, Path* path); MgErr FPathToText(Path path, LStrPtr lstr); MgErr FPathToPath(Path *p); @@ -572,7 +594,8 @@ MgErr FMRead(File fd, int32 inCount, int32* outCount, UPtr buffer); MgErr FMWrite(File fd, int32 inCount, int32* outCount, UPtr buffer); MgErr FListDir(ConstPath path, FDirEntHandle list, FMListDetails **); -int32 PStrHasRezExt(PStr str); +uInt32 PStrHasRezExt(PStr str); +uInt32 HasRezExt(Path path); int32 DbgPrintf(CStr fmt, ...); Modified: trunk/lvzip/c_source/utf.c =================================================================== --- trunk/lvzip/c_source/utf.c 2018-12-09 22:18:17 UTC (rev 1559) +++ trunk/lvzip/c_source/utf.c 2018-12-11 12:18:11 UTC (rev 1560) @@ -1,3 +1,28 @@ +/* + utf.c - Support routines for Unicode text format conversions between the different sizes + + Copyright (C) 2015-2018 Rolf Kalbermatter + + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the + following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of SciWare, James Kring, Inc., nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ #include "zlib.h" #include "lvutil.h" #include "utf.h" Modified: trunk/lvzip/c_source/zalias.h =================================================================== --- trunk/lvzip/c_source/zalias.h 2018-12-09 22:18:17 UTC (rev 1559) +++ trunk/lvzip/c_source/zalias.h 2018-12-11 12:18:11 UTC (rev 1560) @@ -1,3 +1,33 @@ +/* + zalias.h -- name aliasing for all the zlib and minizip library functions to avoid name clashes in the VxWorks + implementation. VxWorks seems to only use a single gloabal symbol table where all the exported functions of the + process and any loaded shared library are placed into. Since the LabVIEW runtime contains a subset of the zlib + and minizip library for its own ZIP functionality, loading of this shared library silently fails if it uses the + same exported symbols. This was found and reported by some NI developer after I asked about why the cRIO shared + library would not work at all, so the solution is to rename all the symbols here to avoid any name clashes. + + Copyright (C) 2007-2018 Rolf Kalbermatter + + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the + following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of SciWare, James Kring, Inc., nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ #define Z_PREFIX_SET #define _dist_code lvzip__dist_code #define _length_code lvzip__length_code @@ -60,6 +90,7 @@ #define unzClose lvzip_unzClose #define unzClose2 lvzip_unzClose2 #define unzCloseCurrentFile lvzip_unzCloseCurrentFile +#define unzEndOfFile lvzip_unzEndOfFile #define unzGetCurrentFileInfo lvzip_unzGetCurrentFileInfo #define unzGetCurrentFileInfo64 lvzip_unzGetCurrentFileInfo64 #define unzGetCurrentFileZStreamPos64 lvzip_unzGetCurrentFileZStreamPos64 @@ -91,9 +122,10 @@ #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 unzSeek lvzip_unzSeek +#define unzSeek64 lvzip_unzSeek64 +#define unzTell lvzip_unzTell +#define unzTell64 lvzip_unzTell64 #define zipClose lvzip_zipClose #define zipClose2 lvzip_zipClose2 #define zipCloseFileInZip lvzip_zipCloseFileInZip @@ -104,6 +136,7 @@ #define zipOpen2 lvzip_zipOpen2 #define zipOpen2_64 lvzip_zipOpen2_64 #define zipOpen3 lvzip_zipOpen3 +#define zipOpen3_64 lvzip_zipOpen3_64 #define zipOpenNewFileInZip lvzip_zipOpenNewFileInZip #define zipOpenNewFileInZip64 lvzip_zipOpenNewFileInZip64 #define zipOpenNewFileInZip2 lvzip_zipOpenNewFileInZip2 @@ -112,6 +145,7 @@ #define zipOpenNewFileInZip3_64 lvzip_zipOpenNewFileInZip3_64 #define zipOpenNewFileInZip4 lvzip_zipOpenNewFileInZip4 #define zipOpenNewFileInZip4_64 lvzip_zipOpenNewFileInZip4_64 +#define zipOpenNewFileInZip5 lvzip_zipOpenNewFileInZip5 #define zipRemoveExtraInfoBlock lvzip_zipRemoveExtraInfoBlock #define zipWriteInFileInZip lvzip_zipWriteInFileInZip #define gzopen lvzip_gzopen @@ -142,5 +176,5 @@ #define gztell64 lvzip_gztell64 #define gzoffset lvzip_gzoffset #define gzoffset64 lvzip_gzoffset64 -#define gcrc32_combine lvzip_crc32_combine -#define gcrc32_combine64 lvzip_crc32_combine64 +#define gcrc32_combine lvzip_gcrc32_combine +#define gcrc32_combine64 lvzip_gcrc32_combine64 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |