From: Rolf K. <lab...@us...> - 2006-01-11 12:14:08
|
Update of /cvsroot/opengtoolkit/lvzip/c_source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28822/c_source Modified Files: macbin.c macbin.h Log Message: Make Mac code compile again Index: macbin.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/macbin.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** macbin.c 10 Jan 2006 22:51:31 -0000 1.18 --- macbin.c 11 Jan 2006 12:13:56 -0000 1.19 *************** *** 34,38 **** delta = loc.u.gmtDelta & 0x00ffffff; /* get sec east of UTC */ if (delta & 0x800000) ! delta |= 0xff000000; /* sign extend */ return -delta; /* secs from UTC */ } --- 34,38 ---- delta = loc.u.gmtDelta & 0x00ffffff; /* get sec east of UTC */ if (delta & 0x800000) ! delta |= 0xff000000; /* sign extend */ return -delta; /* secs from UTC */ } *************** *** 64,68 **** volName[PStrLen(fss->name)] = 0; p = strchr(volName, ':'); ! if (!p) return false; *(++p) = 0; --- 64,68 ---- volName[PStrLen(fss->name)] = 0; p = strchr(volName, ':'); ! if (!p) return false; *(++p) = 0; *************** *** 73,85 **** pb.ioParam.ioReqCount = sizeof(vParms); pb.ioParam.ioBuffer = (Ptr)&vParms; ! if (err = PBHGetVolParmsSync(&pb)) { ! return false; } ! return ((vParms.vMAttrib & attributes) == attributes); } /* Compatibility functions for older LabVIEW libraries */ ! extern OSErr ZEXPORT HasResourceFork(PStr path, int32 *hasResFork) { FSSpec theFSSpec; --- 73,85 ---- pb.ioParam.ioReqCount = sizeof(vParms); pb.ioParam.ioBuffer = (Ptr)&vParms; ! if (PBHGetVolParmsSync(&pb)) { ! return false; } ! return ((vParms.vMAttrib & attr) == attr); } /* Compatibility functions for older LabVIEW libraries */ ! extern McErr ZEXPORT HasResourceFork(PStr path, int32 *hasResFork) { FSSpec theFSSpec; *************** *** 88,92 **** *hasResFork = 0; ! err = MakeFSSpec(0, 0, path, &theFSSpec); if (!err) { --- 88,92 ---- *hasResFork = 0; ! err = MakeFSpec(0, 0, path, &theFSSpec); if (!err) { *************** *** 101,105 **** } ! extern OSErr ZEXPORT LV_EncodeMacbinary(PStr srcPath, PStr dstPath) { FSSpec srcFSSpec; --- 101,105 ---- } ! extern McErr ZEXPORT LV_EncodeMacbinary(PStr srcPath, PStr dstPath) { FSSpec srcFSSpec; *************** *** 107,114 **** OSErr err; ! err = MakeFSSpec(srcPath, &srcFSSpec); if (!err) { ! err = MakeFSSpec(dstPath, &dstFSSpec); if (!err) err = EncodeMacbinaryFiles(&srcFSSpec, &dstFSSpec); --- 107,114 ---- OSErr err; ! err = MakeFSpec(0, 0, srcPath, &srcFSSpec); if (!err) { ! err = MakeFSpec(0, 0, dstPath, &dstFSSpec); if (!err) err = EncodeMacbinaryFiles(&srcFSSpec, &dstFSSpec); *************** *** 117,121 **** } ! extern MgErr ZEXPORT LV_DecodeMacbinary(PStr srcPath, PStr dstPath) { FSSpec srcFSSpec; --- 117,121 ---- } ! extern McErr ZEXPORT LV_DecodeMacbinary(PStr srcPath, PStr dstPath) { FSSpec srcFSSpec; *************** *** 123,134 **** OSErr err; ! err = MakeFSSpec(srcPath, &srcFSSpec); if (!err) { ! err = MakeFSSpec(dstPath, &dstFSSpec); if (err) err = DecodeMacBinaryFiles(&srcFSSpec, &dstFSSpec); } ! return OSErrToLVErr(err); } #elif Win32 --- 123,134 ---- OSErr err; ! err = MakeFSpec(0, 0, srcPath, &srcFSSpec); if (!err) { ! err = MakeFSpec(0, 0, dstPath, &dstFSSpec); if (err) err = DecodeMacBinaryFiles(&srcFSSpec, &dstFSSpec); } ! return err; } #elif Win32 *************** *** 219,225 **** if (ret = MakeMacSpec(path, &fss)) { ! return OSErrToLVErr(err); } ! hasDeny = HasFMExtension(&fss, 1L << bHasOpenDeny); switch (openMode) --- 219,225 ---- if (ret = MakeMacSpec(path, &fss)) { ! return OSErrToLVErr(ret); } ! hasDeny = HasFMExtension(&fss, 1L << bHasOpenDeny); switch (openMode) *************** *** 257,265 **** } ! pb.ioCompletionProc = 0; ! pb.ioNamePtr = fss.name; ! pb.ioVRefNum = fss.vRefNum; ! pb.ioDirID = fss.parID; ! pb.ioDenyModes = perm; if (hasDeny) --- 257,266 ---- } ! pb.fileParam.ioCompletion = 0; ! pb.fileParam.ioNamePtr = fss.name; ! pb.fileParam.ioVRefNum = fss.vRefNum; ! pb.fileParam.ioDirID = fss.parID; ! pb.ioParam.ioMisc = NULL; ! pb.accessParam.ioDenyModes = perm; if (hasDeny) *************** *** 269,273 **** else { ! pbr.ioParam.ioPermssn = perm; ret = PBHOpenSync(&pb); } --- 270,274 ---- else { ! pb.ioParam.ioPermssn = perm; ret = PBHOpenSync(&pb); } *************** *** 276,285 **** { if (openMode == openWriteOnlyTruncate) ! ret = SetEOF(pb.ioRefNum, 0L); } ! if (!ret) ! *refnum = pb.ioRefNum; ! ! return OSErrToLVErr(ret); #endif *refnum = 0; --- 277,286 ---- { if (openMode == openWriteOnlyTruncate) ! ret = SetEOF(pb.ioParam.ioRefNum, 0L); } ! if (ret) ! return OSErrToLVErr(ret); ! ! return FNewRefNum(path, (File)pb.ioParam.ioRefNum, refnum); #endif *refnum = 0; *************** *** 298,303 **** OSErr err; ! if (!comment || !PStrLen(comment) ! return mgArgErr; if (err = MakeMacSpec(path, &fss)) --- 299,304 ---- OSErr err; ! if (!comment || !PStrLen(comment)) ! return mgArgErr; if (err = MakeMacSpec(path, &fss)) *************** *** 323,328 **** dtpb.ioDTBuffer = comment; if (comment) ! dtpb.ioDTReqCount = PStrLen(comment) + 1; ! else if (write) --- 324,330 ---- dtpb.ioDTBuffer = comment; if (comment) ! dtpb.ioDTReqCount = PStrLen(comment) + 1; ! else ! dtpb.ioDTReqCount = 0; if (write) *************** *** 376,382 **** else { ! fileInfo->type = cpb.hFileInfo.ioFlFndrInfo.fdType; fileInfo->creator = cpb.hFileInfo.ioFlFndrInfo.fdCreator; ! fileInfo->flags = cpb.hFileInfo.ioFlFndrInfo.fdFlags; fileInfo->fId = cpb.hFileInfo.ioFlFndrInfo.fdFldr; fileInfo->location.v = cpb.hFileInfo.ioFlFndrInfo.fdLocation.v; --- 378,384 ---- else { ! fileInfo->type = cpb.hFileInfo.ioFlFndrInfo.fdType; fileInfo->creator = cpb.hFileInfo.ioFlFndrInfo.fdCreator; ! fileInfo->flags = cpb.hFileInfo.ioFlFndrInfo.fdFlags; fileInfo->fId = cpb.hFileInfo.ioFlFndrInfo.fdFldr; fileInfo->location.v = cpb.hFileInfo.ioFlFndrInfo.fdLocation.v; *************** *** 388,397 **** ConvertLVTime(&fileInfo->cDate, &cpb.hFileInfo.ioFlCrDat, true); ! ConvertLVTime(&fileInfo->cDate, &cpb.hFileInfo.ioFlMdDat, true); } err = PBDTGetCommentSync(&dtpb); } ! } ! } return OSErrToLVErr(err); #else --- 390,399 ---- ConvertLVTime(&fileInfo->cDate, &cpb.hFileInfo.ioFlCrDat, true); ! ConvertLVTime(&fileInfo->cDate, &cpb.hFileInfo.ioFlMdDat, true); } err = PBDTGetCommentSync(&dtpb); } ! } ! } return OSErrToLVErr(err); #else Index: macbin.h =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/macbin.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** macbin.h 10 Jan 2006 22:51:31 -0000 1.13 --- macbin.h 11 Jan 2006 12:13:57 -0000 1.14 *************** *** 35,39 **** Private(LVRefNum); ! typedef int32 MgErr, OSErr; enum { /* Manager Error Codes */ --- 35,41 ---- Private(LVRefNum); ! typedef int32 MgErr; ! typedef int16 McErr; ! enum { /* Manager Error Codes */ *************** *** 174,180 **** extern void ZEXPORT DLLVersion OF((uChar* Version)); ! extern OSErr ZEXPORT HasResourceFork OF((PStr path, int32 *hasResFork)); ! extern OSErr ZEXPORT LV_EncodeMacbinary OF((PStr srcFileName, PStr dstFileName)); ! extern OSErr ZEXPORT LV_DecodeMacbinary OF((PStr srcFileName, PStr dstFileName)); extern MgErr ZEXPORT LVPath_HasResourceFork OF((Path path, int32 *hasResFork)); --- 176,184 ---- extern void ZEXPORT DLLVersion OF((uChar* Version)); ! #if Mac ! extern McErr ZEXPORT HasResourceFork OF((PStr path, int32 *hasResFork)); ! extern McErr ZEXPORT LV_EncodeMacbinary OF((PStr srcFileName, PStr dstFileName)); ! extern McErr ZEXPORT LV_DecodeMacbinary OF((PStr srcFileName, PStr dstFileName)); ! #endif extern MgErr ZEXPORT LVPath_HasResourceFork OF((Path path, int32 *hasResFork)); |