|
From: <cre...@us...> - 2006-06-26 18:54:05
|
Revision: 1423 Author: creecode Date: 2006-06-26 11:53:58 -0700 (Mon, 26 Jun 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1423&view=rev Log Message: ----------- FSRef-ization started, problem, see < http://sourceforge.net/pm/task.php?func=detailtask&project_task_id=128533&group_id=120666&group_project_id=48146 >. Modified Paths: -------------- Frontier/branches/FSRef_Migration/Common/source/dbverbs.c Modified: Frontier/branches/FSRef_Migration/Common/source/dbverbs.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/source/dbverbs.c 2006-06-26 18:41:12 UTC (rev 1422) +++ Frontier/branches/FSRef_Migration/Common/source/dbverbs.c 2006-06-26 18:53:58 UTC (rev 1423) @@ -404,6 +404,7 @@ boolean flreadonly; odbref odb; + } tyodbrecord, *ptrodbrecord, **hdlodbrecord; @@ -463,9 +464,13 @@ static boolean getodbparam (hdltreenode hparam1, short pnum, hdlodbrecord *hodbrecord) { + // + // 2006-06-23 creedon: for Mac, FSRef-zed + // + hdlodbrecord hodb; tyfilespec fs; - tyfilespec * ptrfs; + ptrfilespec ptrfs; ptrfs = &fs; @@ -473,23 +478,32 @@ return (false); for (hodb = hodblist; hodb != nil; hodb = (**hodb).hnext) { - - if (equalfilespecs (&(**hodb).fs, ptrfs)) { + + if ( equalfilespecs ( &( **hodb ).fs, ptrfs ) ) { *hodbrecord = hodb; return (true); } } + + bigstring bs; - lang2paramerror (dbnotopenederror, bsfunctionname, fsname(ptrfs)); + getfsfile ( ptrfs, bs ); + lang2paramerror (dbnotopenederror, bsfunctionname, bs ); + return (false); - } /*getodbparam*/ + + } // getodbparam static boolean getodbvalue (hdltreenode hparam1, short pnum, tyodbrecord *odb, boolean flreadonly) { + // + // 2006-06-23 creedon: for Mac, FSRef-ized + // + hdlodbrecord hodb; if (!getodbparam (hparam1, pnum, &hodb)) @@ -498,8 +512,12 @@ *odb = **hodb; if ((*odb).flreadonly && !flreadonly) { + + bigstring bs; + + getfsfile ( &( *odb ).fs, bs ); - lang2paramerror (dbopenedreadonlyerror, bsfunctionname, fsname(&(*odb).fs)); + lang2paramerror (dbopenedreadonlyerror, bsfunctionname, bs ); return (false); } @@ -562,22 +580,24 @@ static boolean dbnewverb (hdltreenode hparam1, tyvaluerecord *vreturned) { - /* - 4.1b5 dmb: new verb - */ + // + // 2006-06-20 creedon: for Mac, extend filespec + // + // 4.1b5 dmb: new verb + // tyodbrecord odbrec; boolean fl; flnextparamislast = true; - if (!getfilespecvalue (hparam1, 1, &odbrec.fs)) + if ( ! getfilespecvalue ( hparam1, 1, &odbrec.fs ) ) return (false); + + shellpushdefaultglobals (); // so that config is correct - shellpushdefaultglobals (); /*so that config is correct*/ + fl = opennewfile ( &odbrec.fs, config.filecreator, config.filetype, &odbrec.fref ); - fl = opennewfile (&odbrec.fs, config.filecreator, config.filetype, &odbrec.fref); - shellpopglobals (); if (!fl) @@ -589,28 +609,30 @@ if (odberror (fl)) { - deletefile (&odbrec.fs); + deletefile ( &odbrec.fs ); return (false); } return (setbooleanvalue (true, vreturned)); - } /*dbnewverb*/ + } // dbnewverb static boolean dbopenverb (hdltreenode hparam1, tyvaluerecord *vreturned) { - /* - 4.1b5 dmb: added ability to access already-open root in Frontier - */ + // + // 2006-06-20 creedon: for Mac, extend filespec + // + // 4.1b5 dmb: added ability to access already-open root in Frontier + // tyodbrecord odbrec; hdlodbrecord hodb; WindowPtr w; - + odbrec.fref = 0; - if (!getfilespecvalue (hparam1, 1, &odbrec.fs)) + if ( ! getfilespecvalue ( hparam1, 1, &odbrec.fs ) ) return (false); flnextparamislast = true; @@ -618,18 +640,20 @@ if (!getbooleanvalue (hparam1, 2, &odbrec.flreadonly)) return (false); - w = shellfindfilewindow (&odbrec.fs); + ( void ) extendfilespec ( &odbrec.fs, &odbrec.fs ); + + w = shellfindfilewindow ( &odbrec.fs ); if (w != nil) { if (odberror (odbaccesswindow (w, &odbrec.odb))) return (false); - /*fref remains zero, so unwanted closefiles aren't a problem*/ + // fref remains zero, so unwanted closefiles aren't a problem } else { - if (!openfile (&odbrec.fs, &odbrec.fref, odbrec.flreadonly)) + if ( ! openfile ( &odbrec.fs, &odbrec.fref, odbrec.flreadonly)) return (false); if (odberror (odbopenfile (odbrec.fref, &odbrec.odb, odbrec.flreadonly))) { @@ -648,11 +672,11 @@ return (false); } - + listlink ((hdllinkedlist) hodblist, (hdllinkedlist) hodb); return (setbooleanvalue (true, vreturned)); - } /*dbopenverb*/ + } // dbopenverb static boolean dbsaveverb (hdltreenode hparam1, tyvaluerecord *vreturned) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |