From: Rolf K. <lab...@us...> - 2006-10-25 08:58:40
|
Update of /cvsroot/opengtoolkit/lvzip/c_source In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8749/c_source Modified Files: macbin.c macbin.h zlibvc.def zlibvc.dsp Log Message: Various modifications for handling of aliases/shortcuts Index: macbin.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/macbin.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** macbin.c 23 May 2006 13:18:44 -0000 1.24 --- macbin.c 25 Oct 2006 08:58:37 -0000 1.25 *************** *** 20,53 **** #define MacIsDir(cpb) ((cpb).dirInfo.ioFlAttrib & ioDirMask) #define MacIsStationery(cpb) ((cpb).hFileInfo.ioFlFndrInfo.fdFlags & kIsStationery) #define kFileChanged (1L<<7) static MgErr MakeMacSpec(Path path, FSSpec *fss); ! static OSErr MakeFSpec(int16 vol, int32 dirID, ConstStr255 path, FSSpec *fss); static MgErr OSErrToLVErr(OSErr err); ! static int32 UTCShift(void) { [...1382 lines suppressed...] - return fDiskFull; - case dupFNErr: - return fDupPath; - case tmfoErr: - return fTMFOpen; - case memFullErr: - return mFullErr; - case afpObjectTypeErr: - case afpContainsSharedErr: - case afpInsideSharedErr: - return fNotEnabled; - } - return fIOErr; /* fIOErr generally signifies some unknown file error */ - } - /* - Calculate difference in seconds between local time zone and daylight - savings time settings and Universal Time Coordinate (also called GMT). - */ - #endif --- 1046,1047 ---- Index: macbin.h =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/macbin.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** macbin.h 23 May 2006 13:18:44 -0000 1.17 --- macbin.h 25 Oct 2006 08:58:37 -0000 1.18 *************** *** 17,24 **** --- 17,30 ---- #define MacOSX 1 #endif + #define BigEndian 1 #elif defined(__GNUC__) || defined(linux) #define Unix 1 + #define BigEndian 0 #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN32_WCE) #define Win32 1 + #ifdef _DEBUG + #define DEBUG 1 + #endif + #define BigEndian 0 #endif *************** *** 31,45 **** #define DoDebugger() #endif #else #define DoDebugger() #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; #define Private(T) typedef struct T##_t { void *p; } *T --- 37,60 ---- #define DoDebugger() #endif + #define DebugPrintf DbgPrintf #else #define DoDebugger() + + long DebugPrintf(char* fmt, ...); + long DebugPrintf(char* fmt, ...) + { + return 0; + } #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; #define Private(T) typedef struct T##_t { void *p; } *T *************** *** 53,56 **** --- 68,83 ---- typedef int16 McErr; + typedef int32 Bool32; + + #define Cat4Chrs(c1,c2,c3,c4) (((int32)(uInt8)(c1)<<24)|((int32)(uInt8)(c2)<<16)|((int32)(uInt8)(c3)<<8)|((int32)(uInt8)(c4))) + #define Cat2Chrs(c1,c2) (((int16)(uInt8)(c1)<<8)|((int16)(uInt8)(c2))) + + #if BigEndian + #define RTToL(c1,c2,c3,c4) Cat4Chrs(c1,c2,c3,c4) + #define RTToW(c1,c2) Cat2Chrs(c1,c2) + #else + #define RTToL(c1,c2,c3,c4) Cat4Chrs(c4,c3,c2,c1) + #define RTToW(c1,c2) Cat2Chrs(c2,c1) + #endif enum { /* Manager Error Codes */ *************** *** 146,150 **** } LVPoint; ! typedef uChar Str255[256], *PStr, *CStr, *UPtr; typedef const uChar *ConstCStr, *ConstPStr, ConstStr255[256]; --- 173,177 ---- } LVPoint; ! typedef uChar Str255[256], *PStr, *CStr, *UPtr, **UHandle; typedef const uChar *ConstCStr, *ConstPStr, ConstStr255[256]; *************** *** 155,158 **** --- 182,187 ---- int32 CToPStr(ConstCStr src, PStr dest); int32 PStrCpy(PStr d, ConstPStr s); + int32 StrCpy(CStr t, const CStr s); + int32 StrNCpy(CStr t, const CStr s, int32 l); typedef struct { *************** *** 177,181 **** uInt32 cDate; uInt32 mDate; ! uInt16 flags; /* Mac only */ LVPoint location; /* Mac only */ uInt16 fId; /* Mac only */ --- 206,210 ---- uInt32 cDate; uInt32 mDate; ! uInt16 flags; LVPoint location; /* Mac only */ uInt16 fId; /* Mac only */ *************** *** 184,192 **** --- 213,232 ---- } LVFileInfo; + #define kUnknownType RTToL('?','?','?','?') + #define kUnknownCreator RTToL('?','?','?','?') + enum { openReadWrite, openReadOnly, openWriteOnly, openWriteOnlyTruncate }; /* open modes */ enum { denyReadWrite, denyWriteOnly, denyNeither}; /* deny modes */ + enum { fAbsPath, fRelPath, fNotAPath, fUNCPath, nPathTypes}; /* path type codes */ + /* LabVIEW exported functions */ MgErr FPathToText(Path path, LStrPtr lstr); + MgErr FPathToPath(Path *p); + MgErr FAppendName(Path path, PStr name); + Bool32 FIsAPathOfType(Path path, int32 ofType); + int32 FDepth(Path path); + MgErr FDisposePath(Path p); + MgErr FNewRefNum(Path path, File fd, LVRefNum* refnum); int32 DbgPrintf(CStr fmt, ...); *************** *** 194,198 **** UPtr DSNewPClr(int32); MgErr DSDisposePtr(UPtr); ! int32 StrNCpy(CStr t, const CStr s, int32 l); #define Min(a, b) ((a) < (b)) ? (a) : (b) --- 234,238 ---- UPtr DSNewPClr(int32); MgErr DSDisposePtr(UPtr); ! MgErr DSSetHandleSize(UHandle, int32); #define Min(a, b) ((a) < (b)) ? (a) : (b) *************** *** 201,217 **** extern void ZEXPORT DLLVersion OF((uChar* Version)); - extern MgErr ZEXPORT LV_HasResourceFork OF((PStr path, int32 *hasResFork)); - extern MgErr ZEXPORT LV_EncodeMacbinary OF((PStr srcFileName, PStr dstFileName)); - extern MgErr ZEXPORT LV_DecodeMacbinary OF((PStr srcFileName, PStr dstFileName)); - extern MgErr ZEXPORT LV_UtilFileInfo OF((PStr path, - uInt8 write, - LVFileInfo *finderInfo, - PStr comment)); - - extern MgErr ZEXPORT LV_OpenResFork OF((File *refnum, - PStr path, - uInt32 openMode, - uInt32 denyMode)); - extern MgErr ZEXPORT LVPath_ToText OF((Path path, CStr str, int32 *len)); extern MgErr ZEXPORT LVPath_HasResourceFork OF((Path path, int32 *hasResFork)); --- 241,244 ---- *************** *** 220,229 **** extern MgErr ZEXPORT LVPath_UtilFileInfo OF((Path path, ! uInt8 write, LVFileInfo *finderInfo, ! PStr comment)); ! extern MgErr ZEXPORT LVPath_OpenResFork OF((LVRefNum *refnum, Path path, uInt32 openMode, uInt32 denyMode)); --- 247,258 ---- extern MgErr ZEXPORT LVPath_UtilFileInfo OF((Path path, ! uInt8 write, ! uInt8 *isDirectory, LVFileInfo *finderInfo, ! LStrHandle comment)); ! extern MgErr ZEXPORT LVPath_OpenFile OF((LVRefNum *refnum, Path path, + uInt8 rsrc, uInt32 openMode, uInt32 denyMode)); Index: zlibvc.def =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/zlibvc.def,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** zlibvc.def 23 May 2006 12:47:29 -0000 1.14 --- zlibvc.def 25 Oct 2006 08:58:37 -0000 1.15 *************** *** 100,110 **** LVPath_ToText @201 LVPath_UtilFileInfo @202 ! LVPath_OpenResFork @203 LVPath_HasResourceFork @204 LVPath_EncodeMacbinary @205 LVPath_DecodeMacbinary @206 - LV_HasResourceFork @210 - LV_OpenResFork @211 - LV_UtilFileInfo @212 - LV_EncodeMacbinary @213 - LV_DecodeMacbinary @214 --- 100,105 ---- LVPath_ToText @201 LVPath_UtilFileInfo @202 ! LVPath_OpenFile @203 LVPath_HasResourceFork @204 LVPath_EncodeMacbinary @205 LVPath_DecodeMacbinary @206 Index: zlibvc.dsp =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/zlibvc.dsp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** zlibvc.dsp 1 Mar 2006 10:17:44 -0000 1.8 --- zlibvc.dsp 25 Oct 2006 08:58:37 -0000 1.9 *************** *** 145,149 **** LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /dll /debug /machine:I386 ! # ADD LINK32 user32.lib /nologo /subsystem:windows /dll /incremental:no /debug /machine:I386 /out:"zlibvc___Win32_DLL_ASM_Debug\lvzlib.dll" !ELSEIF "$(CFG)" == "zlibvc - Win32 DLL ASM Obj Release" --- 145,150 ---- LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /dll /debug /machine:I386 ! # ADD LINK32 user32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"zlibvc___Win32_DLL_ASM_Debug\lvzlib.dll" ! # SUBTRACT LINK32 /incremental:no !ELSEIF "$(CFG)" == "zlibvc - Win32 DLL ASM Obj Release" |