tableverbs.c

Go to the documentation of this file.
00001 
00002 /*  $Id: tableverbs.c 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /******************************************************************************
00005 
00006     UserLand Frontier(tm) -- High performance Web content management,
00007     object database, system-level and Internet scripting environment,
00008     including source code editing and debugging.
00009 
00010     Copyright (C) 1992-2004 UserLand Software, Inc.
00011 
00012     This program is free software; you can redistribute it and/or modify
00013     it under the terms of the GNU General Public License as published by
00014     the Free Software Foundation; either version 2 of the License, or
00015     (at your option) any later version.
00016 
00017     This program is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020     GNU General Public License for more details.
00021 
00022     You should have received a copy of the GNU General Public License
00023     along with this program; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 ******************************************************************************/
00027 
00028 #include "frontier.h"
00029 #include "standard.h"
00030 
00031 #include "file.h"
00032 #include "memory.h"
00033 #include "resources.h"
00034 #include "strings.h"
00035 #include "shell.h"
00036 #include "opinternal.h"
00037 #include "oplist.h"
00038 #include "langinternal.h"
00039 #include "langsystem7.h"
00040 #include "tablestructure.h"
00041 #include "tableinternal.h"
00042 #include "tableverbs.h"
00043 #include "kernelverbdefs.h"
00044 
00045 
00046 
00047 
00048 typedef enum tytabletoken { /*verbs that are processed by table.c*/
00049     
00050     movefunc,
00051     
00052     copyfunc,
00053     
00054     renamefunc,
00055     
00056     moveandrenamefunc,
00057     
00058     /*
00059     lockfunc,
00060     
00061     islockedfunc,
00062     */
00063     
00064     assignfunc,
00065     
00066     validatefunc,
00067     
00068     sortbyfunc,
00069     
00070     getcursorfunc,
00071     
00072     getselectionfunc,
00073     
00074     gofunc,
00075     
00076     gotofunc,
00077     
00078     gotonamefunc,
00079     
00080     jettisonfunc,
00081     
00082     packtablefunc,
00083     
00084     emptytablefunc,
00085     
00086     getdisplaysettings,
00087     
00088     setdisplaysettings,
00089 
00090     sortorderfunc,
00091     
00092     cttableverbs
00093     } tytabletoken;
00094 
00095 
00096 
00097 static boolean gettableparam (hdltreenode hfirst, short pnum, hdlhashtable *htable, bigstring bs, hdltablevariable *hv, hdlhashnode *hnode) {
00098     
00099     /*
00100     5.0.2b13 dmb: on failure, generate an error; don't set global tableverberrornum
00101     */
00102     
00103     tyvaluerecord val;
00104     short berrornum = 0;
00105     bigstring bserror;
00106     
00107     *hv = nil; /*default*/
00108     
00109     if (!getvarparam (hfirst, pnum, htable, bs)) /*name of table*/
00110         return (false);
00111     
00112     if (!langsymbolreference (*htable, bs, &val, hnode))
00113         return (false);
00114     
00115     if (!gettablevariable (val, hv, &berrornum)) {
00116         
00117         getstringlist (tableerrorlist, berrornum, bserror);
00118         
00119         langerrormessage (bserror);
00120         
00121         return (false);
00122         }
00123     
00124     return (true);
00125     } /*gettableparam*/
00126 
00127 
00128 boolean gettablevalue (hdltreenode hfirst, short pnum, hdlhashtable *htable) {
00129     
00130     hdltablevariable hv;
00131     bigstring bsname;
00132     hdlhashnode hnode;
00133     
00134     if (!gettableparam (hfirst, pnum, htable, bsname, &hv, &hnode))
00135         return (false);
00136     
00137     if (!tableverbinmemory ((hdlexternalvariable) hv, hnode)) /*couldn't swap it into memory*/
00138         return (false);
00139     
00140     *htable = (hdlhashtable) (**hv).variabledata;
00141     
00142     return (true);
00143     } /*gettablevalue*/
00144 
00145 
00146 static boolean tablevalidateverb (hdltreenode hparam1, tyvaluerecord *v) {
00147     
00148     /*
00149     11/14/90 DW: validating a table is now something you can do from a script.
00150     */
00151     
00152     hdlhashtable htable;
00153     
00154     flnextparamislast = true;
00155     
00156     if (!gettablevalue (hparam1, 1, &htable))
00157         return (false);
00158         
00159     (*v).data.flvalue = tablevalidate (htable, false);
00160     
00161     return (true);
00162     } /*tablevalidateverb*/
00163 
00164 
00165 static boolean tablemoveverb (hdltreenode hparam1, tyvaluerecord *v) {
00166     
00167     /*
00168     table.move (address, tableaddress): boolean; move the indicated table 
00169     entry to the given table
00170     
00171     9/30/91 dmb: use hashassign, not hashinsert, so existing item is overwritten
00172     
00173     10/3/91 dmb: use new fllanghashassignprotect flag to override protection
00174 
00175     5.0a15 dmb: on success, return address of moved value
00176     
00177     5.1.4 dmb: generate errors if item doesn't exist
00178     */
00179     
00180     hdlhashtable ht1, ht2;
00181     bigstring bs;
00182     tyvaluerecord val;
00183     boolean fl;
00184     hdlhashnode hnode;
00185     
00186     if (!getvarparam (hparam1, 1, &ht1, bs))
00187         return (false);
00188     
00189     flnextparamislast = true;
00190     
00191     if (!gettablevalue (hparam1, 2, &ht2))
00192         return (false);
00193     
00194     pushhashtable (ht1);
00195     
00196     fl = hashlookup (bs, &val, &hnode);
00197     
00198     if (fl)
00199         hashdelete (bs, false, false); /*don't toss the value*/
00200     
00201     pophashtable ();
00202     
00203     if (!fl) {
00204     
00205         langparamerror (unknownidentifiererror, bs);
00206         
00207         return (false);
00208         }
00209         
00210     if (!hashtableassign (ht2, bs, val))
00211         return (false);
00212     
00213     return (setaddressvalue (ht2, bs, v));
00214     } /*tablemoveverb*/
00215 
00216 
00217 static boolean tablecopyverb (hdltreenode hparam1, tyvaluerecord *v) {
00218     
00219     /*
00220     table.copy (address, tableaddress): boolean; copy the indicated table 
00221     entry to the given table
00222     
00223     9/30/91 dmb: use hashassign, not hashinsert, so existing item is overwritten
00224     
00225     10/3/91 dmb: use new fllanghashassignprotect flag to override protection
00226 
00227     5.0a15 dmb: on success, return address of moved value
00228     
00229     5.1.4 dmb: generate errors if item doesn't exist
00230     */
00231     
00232     hdlhashtable ht1, ht2;
00233     bigstring bs;
00234     tyvaluerecord val;
00235     boolean fl;
00236     Handle hpacked;
00237     hdlhashnode hnode;
00238     
00239     if (!getvarparam (hparam1, 1, &ht1, bs))
00240         return (false);
00241     
00242     flnextparamislast = true;
00243     
00244     if (!gettablevalue (hparam1, 2, &ht2))
00245         return (false);
00246     
00247     fl = hashtablelookup (ht1, bs, &val, &hnode);
00248     
00249     if (!fl) {
00250         
00251         langparamerror (unknownidentifiererror, bs);
00252         
00253         return (false);
00254         }
00255         //return (true); /*not fatal error; false is returned to caller*/
00256     
00257     if (!langpackvalue (val, &hpacked, hnode)) /*error packing -- probably out of memory*/
00258         return (false);
00259     
00260     fl = langunpackvalue (hpacked, &val);
00261     
00262     disposehandle (hpacked);
00263     
00264     if (fl) {
00265         
00266         /*
00267         fllanghashassignprotect = false;
00268         */
00269         
00270         fl = hashtableassign (ht2, bs, val);
00271         
00272         /*
00273         fllanghashassignprotect = true;
00274         */
00275         
00276         if (!fl)
00277             disposevaluerecord (val, true);
00278         }
00279     
00280     if (fl)
00281         fl = setaddressvalue (ht2, bs, v);
00282     
00283     return (fl);
00284     } /*tablecopyverb*/
00285 
00286 
00287 static boolean tablerenameverb (hdltreenode hparam1, tyvaluerecord *v) {
00288     
00289     /*
00290     table.rename (address, string): boolean; rename the indicated table 
00291     entry to the given name
00292     
00293     12/28/91 dmb: resort the table after changing its name
00294     
00295     8/26/92 dmb: if the table is displayed in a window, use tableresort 
00296     to ensure clean update
00297 
00298     5.0a15 dmb: on success, return address of renamed value
00299     
00300     5.1.4 dmb: disallow rename if new name is already in use; generate 
00301     errors if item doesn't exist
00302     */
00303     
00304     hdlhashtable htable;
00305     bigstring bs, bsname;
00306     hdlhashnode hnode;
00307     
00308     if (!getvarparam (hparam1, 1, &htable, bs))
00309         return (false);
00310     
00311     flnextparamislast = true;
00312     
00313     if (!getstringvalue (hparam1, 2, bsname))
00314         return (false);
00315     
00316     if (!hashtablelookupnode (htable, bs, &hnode)) {
00317         
00318         langparamerror (unknownidentifiererror, bs);
00319         
00320         return (false);
00321         }
00322     
00323     if (!equalidentifiers (bs, bsname)) {
00324         
00325         if (hashtablesymbolexists (htable, bsname)) {
00326         
00327             lang2paramerror (badrenameerror, bs, bsname);
00328             
00329             return (false);
00330             }
00331         
00332         if (!hashsetnodekey (htable, hnode, bsname))
00333             return (false);
00334         }
00335     
00336     hashresort (htable, hnode);
00337     
00338     return (setaddressvalue (htable, bsname, v));
00339     } /*tablerenameverb*/
00340 
00341 
00342 static boolean tablemoveandrenameverb (hdltreenode hparam1, tyvaluerecord *v) {
00343     
00344     /*
00345     5.0a15 dmb: on success, return address of moved value
00346     
00347     5.1.4 dmb: generate errors if item doesn't exist
00348     */
00349     
00350     hdlhashtable ht1, ht2;
00351     bigstring bs1, bs2;
00352     tyvaluerecord val;
00353     boolean fl;
00354     hdlhashnode hnode;
00355     
00356     if (!getvarparam (hparam1, 1, &ht1, bs1))
00357         return (false);
00358     
00359     flnextparamislast = true;
00360     
00361     if (!getvarparam (hparam1, 2, &ht2, bs2))
00362         return (false);
00363     
00364     pushhashtable (ht1);
00365     
00366     fl = hashlookup (bs1, &val, &hnode);
00367     
00368     if (fl)
00369         hashdelete (bs1, false, false); /*don't toss the value*/
00370     
00371     pophashtable ();
00372     
00373     if (!fl) {
00374         
00375         langparamerror (unknownidentifiererror, bs1);
00376         
00377         return (false);
00378         }
00379     
00380     if (!hashtableassign (ht2, bs2, val))
00381         return (false);
00382     
00383     return (setaddressvalue (ht2, bs2, v));
00384     } /*tablemoveandrenameverb*/
00385 
00386 
00387 /*
00388 static boolean tablefindverb (hdltreenode hparam1, tyvaluerecord *v) {
00389     
00390     /%
00391     table.find (adr, bs): boolean; search the (external) value at adr 
00392     for the string bs.  if adr is a table, do *not* search subordinate 
00393     tables
00394     %/
00395     
00396     hdlhashtable htable;
00397     bigstring bsname, bs;
00398     tyvaluerecord val;
00399     boolean flzoom;
00400     boolean flsave;
00401     
00402     if (!getvarparam (hparam1, 1, &htable, bsname))
00403         return (false);
00404     
00405     flnextparamislast = true;
00406     
00407     if (!getstringvalue (hparam1, 2, searchparams.bsfind))
00408         return (false);
00409     
00410     startnewsearch (false, false);
00411     
00412     pushhashtable (htable);
00413     
00414     if (hashlookup (bsname, &val)) {
00415         
00416         flsave = searchparams.flonelevel;
00417         
00418         searchparams.flonelevel = true;
00419         
00420         (*v).data.flvalue = langexternalsearch (val, &flzoom);
00421         
00422         searchparams.flonelevel = flsave;
00423         }
00424     
00425     pophashtable ();
00426     
00427     return (true);
00428     } /%tablefindverb%/
00429 */
00430 
00431 
00432 static boolean tableassignverb (hdltreenode hparam1, tyvaluerecord *v) {
00433     
00434     /*
00435     10/3/91 dmb: use new fllanghashassignprotect flag to override protection
00436     */
00437     
00438     hdlhashtable htable;
00439     bigstring bsname;
00440     tyvaluerecord val;
00441     boolean fl;
00442     
00443     if (!getvarparam (hparam1, 1, &htable, bsname))
00444         return (false);
00445     
00446     flnextparamislast = true;
00447     
00448     if (!getparamvalue (hparam1, 2, &val))
00449         return (false);
00450     
00451     if (!copyvaluerecord (val, &val))
00452         return (false);
00453     
00454     /*
00455     fllanghashassignprotect = false;
00456     */
00457     
00458     fl = hashtableassign (htable, bsname, val);
00459     
00460     /*
00461     fllanghashassignprotect = true;
00462     */
00463     
00464     if (!fl)
00465         return (false);
00466     
00467     exemptfromtmpstack (&val);
00468     
00469     (*v).data.flvalue = true;
00470     
00471     return (true);
00472     } /*tableassignverb*/
00473 
00474 
00475 #ifdef MACVERSION
00476 
00477 static boolean tablepacktableverb (hdltreenode hparam1, tyvaluerecord *v) {
00478     
00479     /*
00480     this is really for internal use only; packes a table and creates a 
00481     named HASH resource that can be loaded in tablestructure
00482     */
00483     
00484     hdlhashtable htable;
00485     bigstring bs;
00486     register boolean fl;
00487     Handle hpacked;
00488     boolean fldummy;
00489     
00490     if (!gettablevalue (hparam1, 1, &htable))
00491         return (false);
00492     
00493     flnextparamislast = true;
00494     
00495     if (!getstringvalue (hparam1, 2, bs))
00496         return (false);
00497     
00498     fl = hashpacktable (htable, true, &hpacked, &fldummy);
00499     
00500     if (fl) {
00501         
00502         lockhandle (hpacked);
00503         
00504         fl = filewriteresource (filegetapplicationrnum (), 'HASH', -1, bs, gethandlesize (hpacked), *hpacked);
00505         
00506         disposehandle (hpacked);
00507         }
00508     
00509     (*v).data.flvalue = fl;
00510     
00511     return (true);
00512     } /*tablepacktableverb*/
00513 
00514 #endif
00515 
00516 static boolean tableemptytableverb (hdltreenode hparam1, tyvaluerecord *v) {
00517     
00518     /*
00519     4/25/96 4.0b7 dmb: kernel implementation for speed
00520     */
00521     
00522     hdlhashtable htable;
00523     
00524     flnextparamislast = true;
00525     
00526     if (!gettablevalue (hparam1, 1, &htable))
00527         return (false);
00528     
00529     return (setintvalue (emptyhashtable (htable, true), v));
00530     } /*tableemptytableverb*/
00531 
00532 
00533 static boolean tablegetselvisit (hdlheadrecord hnode, ptrvoid refcon) {
00534     
00535     hdllistrecord hlist = (hdllistrecord) refcon;
00536     hdlhashtable ht;
00537     bigstring bs;
00538     tyvaluerecord val;
00539     
00540     if (!tablegetiteminfo (hnode, &ht, bs, nil, nil))
00541         return (false);
00542     
00543     if (!setaddressvalue (ht, bs, &val))
00544         return (false);
00545     
00546     if (!langpushlistval (hlist, nil, &val))
00547         return (false);
00548     
00549     disposevaluerecord (val, true); // don't let them accumulate
00550     
00551     return (true);
00552     } /*tablegetselvisit*/
00553 
00554 
00555 static boolean tablegetselectionverb (hdltreenode hp1, tyvaluerecord *v) {
00556     
00557     hdllistrecord hlist;
00558     
00559     if (!langcheckparamcount (hp1, 0)) /*too many parameters were passed*/
00560         return (false);
00561     
00562     if (!opnewlist (&hlist, false))
00563         return (false);
00564     
00565     if (!opvisitmarked (down, &tablegetselvisit, (ptrvoid) hlist)) {
00566         
00567         opdisposelist (hlist);
00568         
00569         return (false);
00570         }
00571     
00572     return (setheapvalue ((Handle) hlist, listvaluetype, v));
00573     } /*tablegetselectionverb*/
00574 
00575 
00576 static boolean tablegetdisplaysettingsverb (hdltreenode hp1, tyvaluerecord *v) {
00577     
00578     hdltableformats hf = tableformatsdata;
00579     hdlhashtable hsettings;
00580     tylinelayout layout;
00581     
00582     flnextparamislast = true;
00583     
00584     if (!gettablevalue (hp1, 1, &hsettings))
00585         return (false);
00586     
00587     layout = (**hf).linelayout;
00588     
00589     if (!layout.flinitted) // no layout assigned, get deault
00590         clayinitlinelayout (&layout);
00591     
00592     if (!claylayouttotable (&layout, hsettings))
00593         return (false);
00594     
00595     return (setbooleanvalue (true, v));
00596     } /*tablegetdisplaysettingsverb*/
00597 
00598 
00599 static boolean tablesetdisplaysettingsverb (hdltreenode hp1, tyvaluerecord *v) {
00600     
00601     hdlhashtable hsettings;
00602     tylinelayout layout;
00603     
00604     flnextparamislast = true;
00605     
00606     if (!gettablevalue (hp1, 1, &hsettings))
00607         return (false);
00608     
00609     if (!claytabletolayout (hsettings, &layout))
00610         return (false);
00611     
00612     claysetlinelayout (tableformatswindowinfo, &layout);
00613     
00614     return (setbooleanvalue (true, v));
00615     } /*tablesetdisplaysettingsverb*/
00616 
00617 
00618 static boolean tablefunctionvalue (short token, hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
00619     
00620     /*
00621     bridges table.c with the language.  the name of the verb is bs, its first parameter
00622     is hparam1, and we return a value in vreturned.
00623     
00624     we use a limited number of support routines from lang.c to get parameters and
00625     to return values. 
00626     
00627     return false only if the error is serious enough to halt the running of the script
00628     that called us, otherwise error values are returned through the valuerecord, which
00629     is available to the script.
00630     
00631     if we return false, we try to provide a descriptive error message in the 
00632     returned string bserror.
00633     
00634     11/14/91 dmb: getcursorfunc returns address, not full path
00635     
00636     10/3/92 dmb: commented out setcolwidthfunc. (this verb still isn't "offical")
00637     
00638     4/2/93 dmb: added jettisonfunc
00639     
00640     6/1/93 dmb: when vreturned is nil, return whether or not verb token must 
00641     be run in the Frontier process
00642     
00643     5.1.5b11 dmb: fixed gotofunc silent failure
00644     */
00645     
00646     register tyvaluerecord *v = vreturned;
00647     register boolean fl = false;
00648     WindowPtr targetwindow;
00649     
00650     if (v == nil) { /*need Frontier process?*/
00651         
00652         switch (token) {
00653             
00654             case sortbyfunc:
00655             case getcursorfunc:
00656             case getselectionfunc:
00657             case gotofunc:
00658             case gotonamefunc:
00659             case gofunc:
00660             case getdisplaysettings:
00661             case setdisplaysettings:
00662                 return (true);
00663             
00664             default:
00665                 return (false);
00666             }
00667         }
00668     
00669     setbooleanvalue (false, v); /*by default, table functions return false*/
00670     
00671     switch (token) { /*these verbs don't require an open table window*/
00672         
00673         /*
00674         case findfunc:
00675             if (!tablefindverb (hparam1, v))
00676                 goto error;
00677             
00678             return (true);
00679         */
00680         
00681         case validatefunc:
00682             return (tablevalidateverb (hparam1, v));
00683         
00684         case movefunc:
00685             return (tablemoveverb (hparam1, v));
00686         
00687         case copyfunc:
00688             return (tablecopyverb (hparam1, v));
00689         
00690         case renamefunc:
00691             return (tablerenameverb (hparam1, v));
00692         
00693         case moveandrenamefunc:
00694             return (tablemoveandrenameverb (hparam1, v));
00695         
00696         /*
00697         case lockfunc:
00698         case islockedfunc:
00699         */
00700         
00701         case assignfunc:
00702             return (tableassignverb (hparam1, v));
00703             
00704         #ifdef MACVERSION
00705         case packtablefunc:
00706             return (tablepacktableverb (hparam1, v));
00707         #endif
00708 
00709         case emptytablefunc:
00710             return (tableemptytableverb (hparam1, v));
00711         
00712         case jettisonfunc: { /*toss an object w/out forcing it into memory. for database recovery.*/
00713             hdlhashtable htable;
00714             bigstring bs;
00715             
00716             if (!getvarparam (hparam1, 1, &htable, bs)) /*name of table*/
00717                 return (false);
00718             
00719             pushhashtable (htable);
00720             
00721             (*v).data.flvalue = hashdelete (bs, true, false);
00722             
00723             pophashtable ();
00724             
00725             return (true);
00726             }
00727         } /*switch*/
00728     
00729     /*all other verbs require a table window in front*/
00730     
00731     if (!langfindtargetwindow (idtableprocessor, &targetwindow)) {
00732         
00733         getstringlist (tableerrorlist, notableerror, bserror);
00734         
00735         return (false);
00736         }
00737     
00738     shellpushglobals (targetwindow); /*following verbs assume that an table is pushed*/
00739     
00740     (*shellglobals.gettargetdataroutine) (idtableprocessor); /*set table globals*/
00741     
00742     switch (token) {
00743         
00744         /*
00745         case setcolwidthfunc: {
00746             short colnum, colwidth;
00747             
00748             if (!getintvalue (hparam1, 1, &colnum))
00749                 break;
00750             
00751             flnextparamislast = true;
00752             
00753             if (!getintvalue (hparam1, 2, &colwidth))
00754                 break;
00755             
00756             (*v).data.flvalue = (*(**tableformatsdata).adjustcolwidthroutine) (colnum - 1, colwidth);
00757             
00758             tablesmashdisplay ();
00759             
00760             fl = true;
00761             
00762             break;
00763             }
00764         */
00765         
00766         case sortbyfunc: {
00767             bigstring bssort, bstitle;
00768             short ixcol;
00769             
00770             flnextparamislast = true;
00771             
00772             if (!getstringvalue (hparam1, 1, bssort))
00773                 break;
00774             
00775             alllower (bssort);
00776             
00777             for (ixcol = namecolumn; ixcol <= kindcolumn; ++ixcol) {
00778                 
00779                 tablegettitlestring (ixcol, bstitle);
00780                 
00781                 alllower (bstitle);
00782                 
00783                 if (equalstrings (bssort, bstitle)) {
00784                     
00785                     hdlhashtable ht;
00786                     bigstring bs;
00787                     
00788                     tablegetcursorinfo (&ht, bs, nil, nil);
00789     
00790                     (*v).data.flvalue = tablesetsortorder (ht, ixcol);
00791                     
00792                     break;
00793                     }
00794                 }
00795             
00796             fl = true;
00797             
00798             break;
00799             }
00800         
00801         /*
00802         case centertablefunc: {
00803             boolean flcenter;
00804             
00805             flnextparamislast = true;
00806             
00807             if (!getbooleanvalue (hparam1, 1, &flcenter))
00808                 break;
00809                 
00810             (*v).data.flvalue = tablesetcenter (flcenter);
00811             
00812             fl = true;
00813             
00814             break;
00815             }
00816         */
00817             
00818         case getcursorfunc: {
00819             hdlhashtable htable;
00820             bigstring bs;
00821             tyvaluerecord val;
00822             hdlhashnode hhashnode;
00823             
00824             if (!langcheckparamcount (hparam1, 0)) /*too many parameters were passed*/
00825                 break;
00826             
00827             /*
00828             tablegetcursorpath (bspath);
00829             
00830             fl = setstringvalue (bspath, v);
00831             */
00832             
00833             if (!tablegetcursorinfo (&htable, bs, &val, &hhashnode))
00834                 fl = setstringvalue (zerostring, v);
00835             else
00836                 fl = setaddressvalue (htable, bs, v);
00837             
00838             break;
00839             }
00840         
00841         case getselectionfunc:
00842             fl = tablegetselectionverb (hparam1, v);
00843             
00844             break;
00845         
00846         case gotofunc: {
00847             short row;
00848             hdlheadrecord hsummit;
00849             
00850             flnextparamislast = true;
00851             
00852             if (!getintvalue (hparam1, 1, &row))
00853                 break;
00854             
00855             if (opnthsummit (row, &hsummit)) {
00856                 
00857                 opclearallmarks ();
00858                 
00859                 opmoveto (hsummit);
00860                 
00861                 (*v).data.flvalue = true;
00862                 }
00863             
00864             fl = true;
00865             
00866             break;
00867             }
00868         
00869         case gotonamefunc: {
00870             hdlhashtable ht;
00871             bigstring bs;
00872             
00873             if (!tablegetcursorinfo (&ht, bs, nil, nil))
00874                 ht = nil;
00875             
00876             flnextparamislast = true;
00877             
00878             if (!getstringvalue (hparam1, 1, bs))
00879                 break;
00880             
00881             (*v).data.flvalue = tablemovetoname (ht, bs);
00882             
00883             fl = true;
00884             
00885             break;
00886             }
00887         
00888         case gofunc: {
00889             tydirection dir;
00890             short count;
00891             
00892             if (!getdirectionvalue (hparam1, 1, &dir))
00893                 break;
00894             
00895             flnextparamislast = true;
00896             
00897             if (!getintvalue (hparam1, 2, &count))
00898                 break;
00899             
00900             opsettextmode (false);
00901             
00902             if (dir == down)
00903                 dir = flatdown;
00904             
00905             if (dir == up)
00906                 dir = flatup;
00907             
00908             (*v).data.flvalue = opmotionkey (dir, count, false);
00909             
00910             fl = true;
00911             
00912             break;
00913             }
00914         
00915         case getdisplaysettings:
00916             fl = tablegetdisplaysettingsverb (hparam1, v);
00917             
00918             break;
00919         
00920         case setdisplaysettings:
00921             fl = tablesetdisplaysettingsverb (hparam1, v);
00922             
00923             break;
00924 
00925         case sortorderfunc: {
00926             hdlhashtable ht;
00927             bigstring bs;
00928             short ixcol;
00929 
00930             tablegetcursorinfo (&ht, bs, nil, nil);
00931 
00932             tablegetsortorder (ht, &ixcol);
00933 
00934             tablegettitlestring (ixcol, bs);
00935 
00936             fl = setstringvalue (bs, v);
00937 
00938             break;
00939             }
00940         } /*switch*/
00941     
00942     shellupdatescrollbars (shellwindowinfo);
00943     
00944     shellpopglobals ();
00945     
00946     return (fl);
00947     } /*tablefunctionvalue*/
00948 
00949 
00950 boolean tableinitverbs (void) {
00951     
00952     return (loadfunctionprocessor (idtableverbs, &tablefunctionvalue));
00953     } /*tableinitverbs*/
00954 
00955 
00956 
00957 
00958 
00959 

Generated on Wed May 31 18:20:03 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6