shellverbs.c

Go to the documentation of this file.
00001 
00002 /*  $Id: shellverbs.c 1260 2006-04-13 06:13:10Z sethdill $    */
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 #ifdef WIN95VERSION 
00032 #include "frontierwinmain.h"
00033 #endif
00034 
00035 #include "memory.h"
00036 #include "font.h"
00037 #include "kb.h"
00038 #include "notify.h"
00039 #include "ops.h"
00040 #include "search.h"
00041 #include "strings.h"
00042 #include "frontierwindows.h"
00043 #include "shell.h"
00044 #include "shellmenu.h"
00045 #include "shellprint.h"
00046 #include "shellprivate.h"
00047 #include "lang.h"
00048 #include "langexternal.h"
00049 #include "langinternal.h"
00050 #include "tablestructure.h"
00051 #include "tableverbs.h"
00052 #include "process.h"
00053 #include "kernelverbs.h"
00054 #include "wpengine.h"
00055 #include "kernelverbdefs.h"
00056 #include "cancoon.h"
00057 #include "resources.h"
00058 #include "file.h" /* 2005-10-26 creedon */
00059 
00060 #ifdef WIN95VERSION 
00061 #include "WinLand.h"
00062 #include "dlgs.h"
00063 #endif
00064 
00065 #include "langregexp.h"
00066 
00067 
00068 typedef enum tysearchtoken { /*search verbs*/
00069     
00070     resetfunc,
00071     
00072     findnextfunc,
00073     
00074     replacefunc,
00075     
00076     replaceallfunc,
00077     
00078     findtextdialogfunc,
00079 
00080     replacetextdialogfunc,
00081     
00082     ctsearchverbs
00083     } tysearchtoken;
00084 
00085 
00086 typedef enum tyfilemenutoken { /*fileMenu verbs*/
00087     
00088     newfunc,
00089     
00090     openfunc,
00091     
00092     closefunc,
00093     
00094     closeallfunc,
00095     
00096     savefunc,
00097     
00098     savecopyfunc, /* 2006-02-05 aradke: re-enabled, don't change order of tokens */ 
00099     
00100     revertfunc,
00101     
00102     printfunc,
00103     
00104     quitfunc,
00105     
00106     saveasfunc, /* 2005-10-26 creedon */
00107     
00108     ctfilemenuverbs
00109     } tyfilemenutoken;
00110 
00111 
00112 typedef enum tyeditmenutoken { /*editMenu verbs*/
00113     
00114     undofunc,
00115     
00116     cutfunc,
00117     
00118     copyfunc,
00119     
00120     pastefunc,
00121     
00122     clearfunc,
00123     
00124     selectallfunc,
00125     
00126     getfontfunc,
00127     
00128     getfontsizefunc,
00129     
00130     fontfunc,
00131     
00132     fontsizefunc,
00133     
00134     plainfunc,
00135     
00136     boldfunc,
00137     
00138     italicfunc,
00139     
00140     underlinefunc,
00141     
00142     outlinefunc,
00143     
00144     shadowfunc,
00145     
00146     cteditmenuverbs
00147     } tyeditmenutoken;
00148 
00149 
00150 #define str_hidden (BIGSTRING ("\x06" "hidden"))
00151 
00152 
00153 #ifdef WIN95VERSION
00154 
00155 typedef struct tyfindreplaceinfo {
00156     
00157     int func;
00158     
00159     boolean flwraparound;
00160     
00161     boolean flregexp;
00162     
00163     } tyfindreplaceinfo;
00164     
00165 
00166 UINT_PTR CALLBACK shellfindreplacehook (HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam); /*forward declaration*/
00167 
00168 
00169 static tyfindreplaceinfo frinfo;
00170 static FINDREPLACE frstruct;
00171 static bigstring windialogfind;
00172 static bigstring windialogreplace;
00173 
00174 
00175 static boolean copytodialog (bigstring bssource, bigstring bsdest) {
00176 
00177     /*
00178     5.0.2b20 dmb: copy the pascal search string bssource to bsdest
00179     
00180     escape all crs and tabs, and null terminate the result
00181     */
00182     
00183     short ix;
00184     
00185     copystring (bssource, bsdest);
00186     
00187     while ((ix = patternmatch (BIGSTRING ("\x01" "\r"), bsdest)) > 0)
00188         replacestring (bsdest, ix, 1, BIGSTRING ("\x02" "\\r"));
00189     
00190     while ((ix = patternmatch (BIGSTRING ("\x01" "\t"), bsdest)) > 0)
00191         replacestring (bsdest, ix, 1, BIGSTRING ("\x02" "\\t"));
00192     
00193     nullterminate (bsdest);
00194 
00195     return (true);
00196     } /*copytodialog*/
00197 
00198 
00199 static boolean copyfromdialog (bigstring bssource, bigstring bsdest) {
00200 
00201     /*
00202     5.0.2b20 dmb: copy the null-terminated dialog string to bsdest
00203     
00204     unescape all crs and tabs.
00205     */
00206     
00207     short ix;
00208     
00209     copyctopstring (stringbaseaddress (bssource), bsdest);
00210     
00211     while ((ix = patternmatch (BIGSTRING ("\x02" "\\r"), bsdest)) > 0)
00212         replacestring (bsdest, ix, 2, BIGSTRING ("\x01" "\r"));
00213     
00214     while ((ix = patternmatch (BIGSTRING ("\x02" "\\t"), bsdest)) > 0)
00215         replacestring (bsdest, ix, 2, BIGSTRING ("\x01" "\t"));
00216     
00217     return (true);
00218     } /*copyfromdialog*/
00219 
00220 
00221 #endif
00222 
00223 
00224 static WindowPtr lastwindowsearched = nil;
00225 
00226 
00227 static byte *nameparams [] = {
00228     
00229     BIGSTRING ("\x09" "searchfor"),
00230     
00231     BIGSTRING ("\x0b" "replacewith"),
00232     
00233     BIGSTRING ("\x0d" "casesensitive"),
00234     
00235     BIGSTRING ("\x0a" "wholewords"),
00236     
00237     BIGSTRING ("\x0a" "wraparound"),
00238     
00239     BIGSTRING ("\x0a" "flatsearch"),
00240     
00241     BIGSTRING ("\x0f" "frontwindowonly"),
00242     
00243     BIGSTRING ("\x0c" "closewindows"),
00244     
00245     BIGSTRING ("\x11" "regularexpression")
00246     };
00247 
00248 enum nameindexes {
00249     
00250     ixsearchfor,
00251     
00252     ixreplacewith,
00253     
00254     ixcasesensitive,
00255     
00256     ixwholewords,
00257     
00258     ixwraparound,
00259     
00260     ixflatsearch,
00261     
00262     ixfrontwindowonly,
00263     
00264     ixclosewindows,
00265     
00266     ixregularexpression
00267     };
00268 
00269 static void shellverbsetselectioninfo () {
00270     
00271     /*
00272     2.1b14 dmb: make sure menus update when a verb changes font/size/style
00273     */
00274     
00275     shellsetselectioninfo (); /*make changes effect window*/
00276     
00277     (**shellwindowinfo).selectioninfo.fldirty = true; /*make sure menus update*/
00278     } /*shellverbsetselectioninfo*/
00279 
00280 
00281 static boolean shellstyleverb (hdltreenode hparam1, short style, tyvaluerecord *v) {
00282     
00283     register hdlwindowinfo hw = shellwindowinfo;
00284     boolean flwantstyle;
00285     boolean flhavestyle;
00286     boolean fl = false;
00287     short fontstyle;
00288     
00289     if ((**hw).selectioninfo.fldirty)
00290         shellsetselectioninfo (); /*get latest*/
00291     
00292     fontstyle = (**hw).selectioninfo.fontstyle;
00293     
00294     if (style == normal) {
00295         
00296         if (!langcheckparamcount (hparam1, 0)) /*shouldn't have any parameters*/
00297             return (false);
00298         
00299         flwantstyle = false;
00300         
00301         flhavestyle = fontstyle != 0;
00302         }
00303     else {
00304         
00305         flnextparamislast = true;
00306         
00307         if (!getbooleanvalue (hparam1, 1, &flwantstyle))
00308             return (false);
00309         
00310         flhavestyle = (fontstyle & style) != 0;
00311         }
00312     
00313     if (flwantstyle != flhavestyle) {
00314         
00315         (**hw).selectioninfo.fontstyle = style;
00316         
00317         fl = (*shellglobals.styleroutine) ();
00318         
00319         shellverbsetselectioninfo ();
00320         }
00321     
00322     return (setbooleanvalue (fl, v));
00323     } /*shellstyleverb*/
00324 
00325 
00326 static boolean getstringsearchparam (short ixparam, bigstring bsvalue) {
00327     
00328     /*
00329     4/16/92 dmb: use hashgetvaluestring in case value isn't a string, as expected
00330     
00331     2.1b4 dmb: don't use hashgetvaluestring; do our own coercion to avoid display stuff
00332     */
00333     
00334     tyvaluerecord val;
00335     bigstring bsname;
00336     hdlhashnode hnode;
00337     
00338     copystring (nameparams [ixparam], bsname);
00339     
00340     if (!hashlookup (bsname, &val, &hnode))
00341         return (false);
00342     
00343     if (!copyvaluerecord (val, &val))
00344         return (false);
00345     
00346     if (coercetostring (&val))
00347         pullstringvalue (&val, bsvalue);
00348     
00349     releaseheaptmp ((Handle) val.data.stringvalue);
00350     
00351     return (true);
00352     } /*getstringsearchparam*/
00353 
00354 
00355 static boolean setstringsearchparam (short ixparam, bigstring bsvalue) {
00356     
00357     tyvaluerecord val;
00358     bigstring bsname;
00359     
00360     copystring (nameparams [ixparam], bsname);
00361     
00362     if (!setstringvalue (bsvalue, &val))
00363         return (false);
00364     
00365     if (!hashassign (bsname, val))
00366         return (false);
00367     
00368     exemptfromtmpstack (&val);
00369     
00370     return (true);
00371     } /*setstringsearchparam*/
00372 
00373 
00374 static boolean getbooleansearchparam (short ixparam, boolean *flvalue) {
00375     
00376     tyvaluerecord val;
00377     bigstring bsname;
00378     hdlhashnode hnode;
00379     
00380     copystring (nameparams [ixparam], bsname);
00381     
00382     if (!hashlookup (bsname, &val, &hnode))
00383         return (false);
00384     
00385     *flvalue = val.data.flvalue;
00386     
00387     return (true);
00388     } /*getbooleansearchparam*/
00389 
00390 
00391 static boolean setbooleansearchparam (short ixparam, boolean flvalue) {
00392     
00393     tyvaluerecord val;
00394     bigstring bsname;
00395     
00396     copystring (nameparams [ixparam], bsname);
00397     
00398     setbooleanvalue (flvalue, &val);
00399     
00400     return (hashassign (bsname, val));
00401     } /*setbooleansearchparam*/
00402 
00403 
00404 static boolean pushsearchparamstable (void) {
00405     
00406     bigstring bs;
00407     hdlhashtable hparamstable = nil;
00408     
00409     if (!getsystemtablescript (idsearchparamstable, bs))
00410         return (false);
00411     
00412     disablelangerror ();
00413     
00414     if (langexpandtodotparams (bs, &hparamstable, bs))
00415         ; /*table being non-nil is our flag*/
00416     
00417     enablelangerror ();
00418     
00419     if (hparamstable == nil)
00420         return (false);
00421     
00422     return (pushhashtable (hparamstable));
00423     } /*pushsearchparamstable*/
00424 
00425 
00426 boolean getsearchparams (void) {
00427     
00428     /*
00429     9/20/91 dmb: load up the searchparam record from the database params 
00430     table.  temporarily change the search and replace strings to a special 
00431     value so that they won't be found during the search.
00432     
00433     this call should be paired with a call to setsearchparams so that 
00434     the search and replace strings are restored.
00435     
00436     2003-05-17 AR: extended to handle regular expression find and replace strings
00437     */
00438     
00439     bigstring bs;
00440     boolean fl;
00441     boolean flupdateregexp = false;
00442     boolean flresult = false;
00443         
00444     if (!pushsearchparamstable ())
00445         return (false);
00446     
00447     if (getbooleansearchparam (ixcasesensitive, &fl)) {
00448         flupdateregexp = flupdateregexp || (fl != searchparams.flunicase);
00449         searchparams.flunicase = !fl;
00450         }
00451     
00452     if (getbooleansearchparam (ixwholewords, &fl))
00453         searchparams.flwholewords = fl;
00454     
00455     if (getbooleansearchparam (ixwraparound, &fl))
00456         searchparams.flwraparound = fl;
00457     
00458     if (getbooleansearchparam (ixflatsearch, &fl))
00459         searchparams.floneobject = !fl;
00460     
00461     if (getbooleansearchparam (ixfrontwindowonly, &fl))
00462         searchparams.flonelevel = fl;
00463     
00464     if (getbooleansearchparam (ixclosewindows, &fl))
00465         searchparams.flclosebehind = fl;
00466     
00467     if (getbooleansearchparam (ixregularexpression, &fl)) {
00468         flupdateregexp = flupdateregexp || (fl != searchparams.flregexp);
00469         searchparams.flregexp = fl;
00470         }
00471     
00472     if (getstringsearchparam (ixsearchfor, bs)) {
00473         
00474         if (!equalstrings (bs, searchparams.bsorigfind)) { /*it changed*/
00475             
00476             endcurrentsearch ();
00477 
00478             copystring (bs, searchparams.bsorigfind);
00479 
00480             copystring (bs, searchparams.bsfind);
00481 
00482             if (searchparams.flunicase)
00483                 alllower (searchparams.bsfind);
00484                     
00485             flupdateregexp = true;
00486             }
00487         }
00488     
00489     if (getstringsearchparam (ixreplacewith, bs)) {
00490 
00491         if (!equalstrings (bs, searchparams.bsorigreplace)) { /*it changed*/
00492             
00493             copystring (bs, searchparams.bsorigreplace);
00494             
00495             copystring (bs, searchparams.bsreplace);
00496             
00497             flupdateregexp = true;
00498             }
00499         }
00500     
00501     searchparams.floneobject = searchparams.floneobject || searchparams.flonelevel;
00502 
00503 #ifdef flregexpverbs
00504 
00505     if (flupdateregexp) {
00506         
00507         disposehandle (searchparams.hcompiledpattern);
00508         searchparams.hcompiledpattern = nil;
00509         
00510         disposehandle (searchparams.hovector);
00511         searchparams.hovector = nil;
00512         
00513         if (searchparams.flregexp) {
00514             
00515             bigstring bsmsg;
00516             int options;
00517 
00518             setemptystring (bsmsg);
00519                         
00520             nullterminate (searchparams.bsorigfind);
00521             
00522             options = PCRE_DOTALL | PCRE_MULTILINE | PCRE_NOTEMPTY | (searchparams.flunicase ? PCRE_CASELESS : 0L);
00523 
00524             if (!regexpcompile (stringbaseaddress ((char *) (searchparams.bsorigfind)), options, bsmsg, &searchparams.hcompiledpattern)) {
00525                 if (!isemptystring (bsmsg))
00526                     langerrormessage (bsmsg);
00527                 goto exit;
00528                 }
00529             
00530             if (!regexpcheckreplacement (searchparams.hcompiledpattern,
00531                                             stringbaseaddress ((char *) (searchparams.bsorigreplace)),
00532                                             stringlength (searchparams.bsorigreplace))) {
00533                 goto exit;
00534                 }
00535                 
00536             if (!regexpnewovector (searchparams.hcompiledpattern, &searchparams.hovector)) {
00537                 goto exit;
00538                 }
00539             }
00540         }
00541 
00542 #endif 
00543     
00544     setstringsearchparam (ixsearchfor, zerostring);
00545     
00546     setstringsearchparam (ixreplacewith, zerostring);
00547 
00548     flresult = true;
00549     
00550 exit:
00551     
00552     pophashtable ();
00553     
00554     return (flresult);
00555     } /*getsearchparams*/
00556 
00557 
00558 boolean setsearchparams (void) {
00559     
00560     /*
00561     9/20/91 dmb: load up the database params table from  the searchparam 
00562     record.
00563     
00564     this call should be after paired with any call to setsearchparams so 
00565     that the search and replace strings are restored.
00566     */
00567     
00568     if (!pushsearchparamstable ())
00569         return (false);
00570     
00571     setstringsearchparam (ixsearchfor, searchparams.bsorigfind);
00572     
00573     setstringsearchparam (ixreplacewith, searchparams.bsorigreplace);
00574     
00575     setbooleansearchparam (ixcasesensitive, !searchparams.flunicase);
00576     
00577     setbooleansearchparam (ixwholewords, searchparams.flwholewords);
00578     
00579     setbooleansearchparam (ixwraparound, searchparams.flwraparound);
00580     
00581     setbooleansearchparam (ixflatsearch, !searchparams.floneobject);
00582     
00583     setbooleansearchparam (ixfrontwindowonly, searchparams.flonelevel);
00584     
00585     setbooleansearchparam (ixclosewindows, searchparams.flclosebehind);
00586     
00587     setbooleansearchparam (ixregularexpression, searchparams.flregexp);
00588     
00589     pophashtable ();
00590     
00591     return (true);
00592     } /*resetsearchparams*/
00593 
00594 
00595 boolean shellpushtargetglobals (void) {
00596     
00597     WindowPtr targetwindow;
00598     
00599     if (!langfindtargetwindow (-1, &targetwindow))  { /*should never fail, but...*/
00600         
00601         return (shellpushfrontrootglobals ()); /*was: (false)*/
00602         }
00603     
00604     return (shellpushglobals (targetwindow));
00605     } /*shellpushtargetglobals*/
00606 
00607 
00608 static boolean doreplaceallfunc() {
00609     
00610     if (shellwindow != lastwindowsearched)
00611         endcurrentsearch ();
00612     
00613     if (!getsearchparams ())
00614         return (false);
00615     
00616     startnewsearch (false, true);
00617     
00618     if ((*shellglobals.gettargetdataroutine) (idwordprocessor)) {
00619         /*
00620         this bit of dirtyness is to replace the current text selection, if 
00621         there is one.  we shouldn't know about wp, but it's late in the game!
00622         */
00623         
00624         bigstring bs;
00625         
00626         wpgetseltext (bs);
00627         
00628         if (!isemptystring (bs)) {
00629             
00630             wpinsert (searchparams.bsreplace);
00631             
00632             searchparams.ctreplaced = 1;
00633             }
00634         }
00635     
00636     (*shellglobals.searchroutine) ();
00637     
00638     setsearchparams ();
00639     
00640     return (true);
00641     } /*doreplaceallfunc*/
00642 
00643 
00644 static boolean searchfunctionvalue (short token, hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
00645     
00646     /*
00647     bridges shell.c with the language.  the name of the verb is bs, its first parameter
00648     is hparam1, and we return a value in vreturned.
00649     
00650     we use a limited number of support routines from lang.c to get parameters and
00651     to return values. 
00652     
00653     return false only if the error is serious enough to halt the running of the script
00654     that called us, otherwise error values are returned through the valuerecord, which
00655     is available to the script.
00656     
00657     if we return false, we try to provide a descriptive error message in the 
00658     returned string bserror.
00659     
00660     6/1/93 dmb: when vreturned is nil, return whether or not verb token must 
00661     be run in the Frontier process
00662     
00663     2003-05-18 AR: On Windows, handle custom Find & Replace dialogs with
00664     "Wrap around" and "Regular Expression" options.
00665     
00666     2003-05-24 AR: On Windows, ignore lang errors from getsearchparams
00667     in findtextdialogfunc and replacetextdialogfunc.
00668     */
00669     
00670     register tyvaluerecord *v = vreturned;
00671     register boolean fl = false;
00672     
00673     if (v == nil) /*need Frontier process?*/
00674         return (true);
00675     
00676     setbooleanvalue (false, v); /*assume the worst*/
00677     
00678     if (!shellpushtargetglobals ())
00679         return (false);
00680     
00681     switch (token) { /*these verbs assume that the frontmost window's globals are pushed*/
00682         
00683         case resetfunc:
00684             if (!langcheckparamcount (hparam1, 0))
00685                 break;
00686             
00687             endcurrentsearch ();
00688             
00689             fl = setbooleanvalue (true, v);
00690             
00691             break;
00692         
00693         case findnextfunc: {
00694             if (!langcheckparamcount (hparam1, 0))
00695                 break;
00696             
00697             if (shellwindow != lastwindowsearched)
00698                 endcurrentsearch ();
00699             
00700             if (!getsearchparams ())
00701                 break;
00702             
00703             startnewsearch (true, false);
00704             
00705             (*v).data.flvalue = (*shellglobals.searchroutine) ();
00706             
00707             langfindtargetwindow (-1, &lastwindowsearched); /*remember where we left off*/
00708             
00709             setsearchparams ();
00710             
00711             searchparams.flfirsttime = false;
00712             
00713             if (keyboardescape ()) {
00714                 
00715                 keyboardclearescape (); /*consume it*/
00716                 
00717                 //break; /*we'll return false to halt script execution*/
00718                 }
00719             
00720             fl = true;
00721             
00722             break;
00723             }
00724         
00725         case replacefunc:
00726             if (!langcheckparamcount (hparam1, 0))
00727                 break;
00728             
00729             if (!(*shellglobals.gettargetdataroutine) (idwordprocessor)) {
00730                 
00731                 langerror (badreplacecontexterror);
00732                 
00733                 break;
00734                 }
00735             
00736             if (!getsearchparams ())
00737                 break; 
00738                 
00739             (*v).data.flvalue = wpinsert (searchparams.bsreplace);
00740             
00741             setsearchparams ();
00742             
00743             fl = true;
00744         
00745             break;
00746         
00747         case replaceallfunc: {
00748             if (!langcheckparamcount (hparam1, 0))
00749                 break;
00750             
00751             if (!doreplaceallfunc())
00752                 break;
00753             
00754             if (keyboardescape ()) {
00755                 
00756                 keyboardclearescape (); /*consume it*/
00757                 
00758                 //break; /*we'll return false to halt script execution*/
00759                 }
00760             
00761             fl = setlongvalue (searchparams.ctreplaced, v);
00762             
00763             break;
00764             }
00765 
00766     #ifdef WIN95VERSION
00767         case findtextdialogfunc: /*2003-05-18 AR*/
00768             if (!langcheckparamcount (hparam1, 0))
00769                 break;
00770             
00771             if (shellwindow != lastwindowsearched)
00772                 endcurrentsearch ();
00773             
00774             disablelangerror (); /*2003-05-24 AR*/
00775             
00776             getsearchparams ();
00777         
00778             enablelangerror (); /*2003-05-24 AR*/
00779 
00780             frstruct.lStructSize = sizeof (frstruct);
00781             frstruct.hwndOwner = shellframewindow;
00782             frstruct.Flags = 0;
00783 
00784             if (! searchparams.flunicase)
00785                 frstruct.Flags |= FR_MATCHCASE;
00786 
00787             if (searchparams.flwholewords)
00788                 frstruct.Flags |= FR_WHOLEWORD;
00789 
00790             frinfo.flwraparound = searchparams.flwraparound;
00791             frinfo.flregexp = searchparams.flregexp;
00792             frinfo.func = findtextdialogfunc;
00793             frstruct.lCustData = (LPARAM) &frinfo;
00794 
00795             copytodialog (searchparams.bsorigfind, windialogfind);
00796 
00797             frstruct.lpstrFindWhat = stringbaseaddress (windialogfind);
00798             frstruct.lpstrReplaceWith = NULL;
00799             frstruct.wFindWhatLen = sizeof(bigstring) - 2;
00800             frstruct.wReplaceWithLen = 0;
00801 
00802             frstruct.hInstance = hInst;
00803             frstruct.lpfnHook = &shellfindreplacehook; /*set wrap around and regexp checkbox on init*/
00804             frstruct.lpTemplateName = MAKEINTRESOURCE (IDD_CUSTOMFIND);
00805 
00806             frstruct.Flags |= FR_ENABLETEMPLATE | FR_ENABLEHOOK | FR_HIDEUPDOWN ;
00807             
00808             setsearchparams ();
00809 
00810             releasethreadglobals ();
00811             SendMessage (shellframewindow, wm_startsearch, 0, (LPARAM) &frstruct);
00812             grabthreadglobals ();
00813 
00814             fl = setbooleanvalue ((findreplacewindow != NULL), v);
00815 
00816             break;
00817 
00818         case replacetextdialogfunc: /*2003-05-18 AR*/
00819             if (!langcheckparamcount (hparam1, 0))
00820                 break;
00821             
00822             if (shellwindow != lastwindowsearched)
00823                 endcurrentsearch ();
00824             
00825             disablelangerror (); /*2003-05-24 AR*/
00826             
00827             getsearchparams ();
00828         
00829             enablelangerror (); /*2003-05-24 AR*/
00830             
00831             frstruct.lStructSize = sizeof (frstruct);
00832             frstruct.hwndOwner = shellframewindow;
00833             frstruct.Flags = 0;
00834 
00835             if (! searchparams.flunicase)
00836                 frstruct.Flags |= FR_MATCHCASE;
00837 
00838             if (searchparams.flwholewords)
00839                 frstruct.Flags |= FR_WHOLEWORD;
00840 
00841             frinfo.flwraparound = searchparams.flwraparound;
00842             frinfo.flregexp = searchparams.flregexp;
00843             frinfo.func = replacetextdialogfunc;
00844             frstruct.lCustData = (LPARAM) &frinfo;
00845 
00846             copytodialog (searchparams.bsorigfind, windialogfind);
00847             copytodialog (searchparams.bsorigreplace, windialogreplace);
00848 
00849             frstruct.lpstrFindWhat = stringbaseaddress (windialogfind);
00850             frstruct.lpstrReplaceWith = stringbaseaddress (windialogreplace);
00851             frstruct.wFindWhatLen = sizeof(bigstring) - 2;
00852             frstruct.wReplaceWithLen = sizeof(bigstring) - 2;
00853 
00854             frstruct.hInstance = hInst;
00855             frstruct.lpfnHook = &shellfindreplacehook; /*set wrap around and regexp checkbox on init*/
00856             frstruct.lpTemplateName = MAKEINTRESOURCE (IDD_CUSTOMREPLACE);
00857 
00858             frstruct.Flags |= FR_ENABLETEMPLATE | FR_ENABLEHOOK | FR_HIDEUPDOWN ;
00859             
00860             setsearchparams ();
00861 
00862             releasethreadglobals ();
00863             SendMessage (shellframewindow, wm_startreplace, 0, (LPARAM) &frstruct);
00864             grabthreadglobals ();
00865 
00866             fl = setbooleanvalue ((findreplacewindow != NULL), v);
00867             
00868             break;
00869     #endif
00870 
00871         default:
00872             getstringlist (langerrorlist, unimplementedverberror, bserror);
00873             
00874             break;
00875 
00876         
00877         } /*switch -- funcs with front globals pushed*/
00878     
00879     shellpopglobals ();
00880     
00881     return (fl);
00882     } /*searchfunctionvalue*/
00883 
00884 
00885 #ifdef WIN95VERSION
00886 
00887 
00888 UINT_PTR CALLBACK shellfindreplacehook (HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) {
00889     
00890     /*
00891     2003-05-18 AR: Initialize custom "wrap around" and "regular expression" checkboxes
00892     */
00893     
00894     switch (uiMsg) {
00895         
00896         case WM_INITDIALOG: {
00897 
00898             FINDREPLACE * fr = (FINDREPLACE *) lParam;
00899             tyfindreplaceinfo *fri = (tyfindreplaceinfo*)(fr->lCustData);
00900             
00901             CheckDlgButton (hdlg, chx3, (fri->flwraparound) ? BST_CHECKED : BST_UNCHECKED);
00902 
00903             CheckDlgButton (hdlg, chx4, (fri->flregexp) ? BST_CHECKED : BST_UNCHECKED);
00904             
00905             return (1); /*make sure the default proc makes the dialog appear*/
00906             }
00907         
00908         }/*switch*/
00909         
00910     return (0);
00911     } /*shellfindreplacehook*/
00912     
00913     
00914 boolean shellprocessfindmessage (FINDREPLACE * fr) {
00915     
00916     /*
00917     5.0a21 dmb: push/pop root table for locating search params table
00918 
00919     5.0.2b20 dmb: report number of replacements made
00920 
00921     2003-05-18 AR: Don't save settings if the user hit the Cancel button.
00922     Get flags directly from the checkboxes.
00923     
00924     2003-05-19 AR: Modify user.prefs.search table directly instead of
00925     the searchparams global, just like the search.dialog script does
00926     on the Mac. This is neccessary so that getsearchparams can detect
00927     changes in the find and replace strings and update the internal
00928     regexp variables accordingly.
00929     */
00930 
00931     WindowPtr targetwindow;
00932     bigstring bstemp;
00933     boolean fl = true;
00934 
00935     if (fr->Flags & FR_DIALOGTERM) { /*2003-05-18 AR: exit early, don't even grab globals*/
00936         
00937         findreplacewindow = NULL;
00938         
00939         return (true); /*return early, don't save settings to database*/
00940         }
00941 
00942     grabthreadglobals ();
00943     
00944     pushhashtable (roottable);
00945     
00946     if (!pushsearchparamstable ()) {
00947         
00948         pophashtable (); /*roottable*/
00949         
00950         releasethreadglobals ();
00951 
00952         return (false);
00953         }
00954         
00955     setstringlength (windialogfind, strlen(stringbaseaddress(windialogfind)));
00956     copyfromdialog (windialogfind, bstemp);
00957     setstringsearchparam (ixsearchfor, bstemp);
00958     
00959     setstringlength (windialogreplace, strlen(stringbaseaddress(windialogreplace)));
00960     copyfromdialog (windialogreplace, bstemp);
00961     setstringsearchparam (ixreplacewith, bstemp);
00962     
00963     setbooleansearchparam (ixwholewords, IsDlgButtonChecked (findreplacewindow, chx1) == BST_CHECKED);
00964     
00965     setbooleansearchparam (ixcasesensitive, IsDlgButtonChecked (findreplacewindow, chx2) == BST_CHECKED);
00966     
00967     setbooleansearchparam (ixwraparound, IsDlgButtonChecked (findreplacewindow, chx3) == BST_CHECKED);
00968     
00969     setbooleansearchparam (ixregularexpression, IsDlgButtonChecked (findreplacewindow, chx4) == BST_CHECKED);
00970     
00971     pophashtable (); /*searchparamstable*/
00972     
00973     pophashtable (); /*roottable*/
00974         
00975     if (!shellfindtargetwindow (-1, &targetwindow)) {
00976         
00977         releasethreadglobals ();
00978 
00979         return (false);
00980         }
00981     
00982     shellpushglobals (targetwindow);
00983     
00984     //  if (fr->Flags & FR_DIALOGTERM) {
00985     //      
00986     //      findreplacewindow = NULL;
00987     //      /* rab: should we do an endcurrentsearch here */
00988     //      /* dmb: I don't think so */
00989     //      
00990     //      goto exit;
00991     //      }
00992 
00993     if (fr->Flags & FR_FINDNEXT) {
00994         bigstring bsresult;
00995         
00996         langrunstring (BIGSTRING ("\x11" "search.findnext()"), bsresult);
00997         
00998         if (equalstrings (bsresult, bstrue)) {
00999             
01000             if (((tyfindreplaceinfo*)(fr->lCustData))->func == findtextdialogfunc)
01001                 PostMessage (findreplacewindow, WM_COMMAND, IDABORT, 0);
01002             }
01003         else
01004             sysbeep ();
01005         
01006         goto exit;
01007         }
01008 
01009     if (fr->Flags & FR_REPLACE) {
01010         bigstring bsresult;
01011         
01012         langrunstring (BIGSTRING ("\x3b" "if search.replace() {search.findnext()}else{speaker.beep()}"), bsresult);
01013         
01014         goto exit;
01015         }
01016 
01017     if (fr->Flags & FR_REPLACEALL) {
01018 
01019         if (!doreplaceallfunc())
01020             goto exit; /*** FIXME: make sure the error will actually be reported! ***/
01021         
01022         if (searchparams.ctreplaced == 0)
01023             sysbeep ();
01024         else {
01025             bigstring bs;
01026 
01027             numbertostring (searchparams.ctreplaced, bs);
01028 
01029             pushstring (BIGSTRING ("\x13" " replacements made."), bs);
01030 
01031             notifyuser (bs);
01032             }
01033 
01034         goto exit;
01035         }
01036     
01037     fl = false;
01038     
01039     exit:
01040 
01041     shellpopglobals ();
01042 
01043     releasethreadglobals ();
01044 
01045     return (fl);
01046     } /*shellprocessfindmessage*/
01047 
01048 #endif
01049 
01050 
01051 static boolean filemenufunctionvalue (short token, hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
01052     
01053     /*
01054     2/7/91 dmb: added parameters to new, open & save; added boolean to avoid 
01055     dialog in various shell routines.
01056     
01057     2/7/91 dmb: functions that change the current file (closeall, new, open, revert) have 
01058     to save & restore the language globals.  we don't want the language to have 
01059     to do this on every external call, so we do it selectively here
01060     
01061     10/3/91 dmb: split off fileMenu verbs from shell verbs
01062     
01063     10/23/91 dmb: must try to restore globals after revert, so new globals aren't 
01064     in effect when deferred disposal takes place.
01065     
01066     5/19/93 dmb: closefunc uses getfrontwindow, not shellwindow
01067     
01068     6/1/93 dmb: when vreturned is nil, return whether or not verb token must 
01069     be run in the Frontier process
01070     
01071     3.0b15 dmb: quitfunc should just return false and let everything flow normally, 
01072     instead of yielding here. this could problems calling filemenu.quit from a 
01073     component menusharing (osa) client...  however it doesn't, so this change is 
01074     disabled for the time being.
01075     
01076     5.0d16 dmb: savefunc, newfunc need new (optional) parameters
01077     
01078     5.0d18 dmb: closefunc respects the target
01079     
01080     5.1.4 dmb: closefunc takes optional win parameter; savefunc checks hinfo for nil
01081     */
01082     
01083     register tyvaluerecord *v = vreturned;
01084     register boolean fl;
01085     
01086     if (v == nil) /*need Frontier process?*/
01087         return (true);
01088     
01089     setbooleanvalue (false, v); /*assume the worst*/
01090     
01091     switch (token) { /*these verbs don't need any special globals pushed*/
01092         
01093         case newfunc: {
01094             tyvaluerecord val;
01095             tyfilespec fs;
01096             tyexternalid id;
01097             tyvaluerecord vhidden;
01098             short ctconsumed = 0;
01099             short ctpositional;
01100             WindowPtr w;
01101             
01102             if (!getparamvalue (hparam1, ++ctconsumed, &val))
01103                 return (false);
01104             
01105             flnextparamislast = true;
01106             
01107             ctpositional = ctconsumed;
01108             
01109             setbooleanvalue (false, &vhidden); //default value
01110             
01111             if (!getoptionalparamvalue (hparam1, &ctconsumed, &ctpositional, str_hidden, &vhidden))
01112                 return (false);
01113             
01114             disablelangerror ();
01115             
01116             fl = coercetoostype (&val);
01117             
01118             enablelangerror ();
01119             
01120             if (!fl) { // old style, new database
01121             
01122                 if (!coercetofilespec (&val))
01123                     return (false);
01124                 
01125                 fs = (**val.data.filespecvalue);
01126                 
01127                 langsaveglobals (); /*see comment at function head*/
01128                 
01129                 fl = shellnewfile (&fs, vhidden.data.flvalue, &w);
01130                 
01131                 if (!langrestoreglobals ())
01132                     fl = false;
01133                 
01134                 if (!fl)
01135                     return (false);
01136                 }
01137             else {
01138                 id = (tyexternalid) (langgetvaluetype (val.data.ostypevalue) - outlinevaluetype);
01139                 
01140                 if (!ccnewfilewindow (id, &w, vhidden.data.flvalue))
01141                     return (false);
01142                 }
01143             
01144             return (setwinvalue (w, v));
01145             }
01146         
01147         case openfunc: {
01148             tyfilespec fs;
01149             tyvaluerecord vhidden;
01150             short ctconsumed = 0;
01151             short ctpositional;
01152             WindowPtr w;
01153             
01154             if (!getfilespecvalue (hparam1, ++ctconsumed, &fs))
01155                 return (false);
01156             
01157             flnextparamislast = true;
01158             
01159             ctpositional = ctconsumed;
01160             
01161             setbooleanvalue (false, &vhidden); //default value
01162             
01163             if (!getoptionalparamvalue (hparam1, &ctconsumed, &ctpositional, str_hidden, &vhidden))
01164                 return (false);
01165             
01166             langsaveglobals (); /*see comment at function head*/
01167             
01168             fl = shellopenfile (&fs, vhidden.data.flvalue, &w);
01169             
01170             if (!langrestoreglobals ())
01171                 return (false);
01172             
01173             return (fl && setwinvalue (w, v));
01174             }
01175         
01176         case closefunc: {
01177             /*
01178             close the frontmost window
01179             
01180             2005-09-14 creedon: added fldialog parameter, this might be improved as I only dealt with the situation with one or more parameters are defined
01181             */
01182             
01183             hdlwindowinfo hinfo;
01184             WindowPtr targetwindow = nil;
01185             tyvaluerecord val;
01186             boolean fldialog;
01187 
01188             setbooleanvalue (false, &val); /* defaults to false */
01189 
01190             if (langgetparamcount (hparam1) == 0) { // old style, use the target
01191             
01192                 if (!langfindtargetwindow (-1, &targetwindow))
01193                     targetwindow = getfrontwindow ();
01194                 }
01195             else {
01196                 short ctconsumed = 1;
01197                 short ctpositional = 1;
01198 
01199                 if (!getwinparam (hparam1, 1, &hinfo))
01200                     break;
01201                 
01202                 flnextparamislast = true;
01203                 
01204                 if (!getoptionalparamvalue (hparam1, &ctconsumed, &ctpositional, BIGSTRING ("\x08""fldialog"), &val))
01205                     return (false);
01206     
01207                 if (hinfo != nil)
01208                     targetwindow = (**hinfo).macwindow;
01209                 }
01210             
01211             //langsaveglobals (); /*see comment at function head*/
01212             
01213             fldialog = val.data.flvalue;
01214             
01215             (*v).data.flvalue = (targetwindow != nil) && shellclose (targetwindow, fldialog);
01216             
01217             //return (langrestoreglobals ());
01218             
01219             return (true);
01220             }
01221         
01222         case closeallfunc:
01223             if (!langcheckparamcount (hparam1, 0)) /*shouldn't have any parameters*/
01224                 return (false);
01225             
01226             langsaveglobals (); /*see comment at function head*/
01227             
01228             (*v).data.flvalue = shellcloseall (nil, false);
01229             
01230             return (langrestoreglobals ());
01231         
01232         case quitfunc:
01233             if (!langcheckparamcount (hparam1, 0)) /*shouldn't have any parameters*/
01234                 return (false);
01235             
01236             shellexitmaineventloop (); /*sets flag for next iteration*/
01237             
01238             #if 0  /*maybe try this out after 3.0*/
01239             
01240             return (false); /*kill the script*/
01241             
01242             #else
01243             
01244             processyield (); /*give it a chance to happen*/
01245             
01246             (*v).data.flvalue = false; /*we didn't quit -- we're got here, didn't we?*/
01247             
01248             return (true);
01249             
01250             #endif
01251         } /*switch*/
01252     
01253     if (!shellpushtargetglobals ())
01254         return (false);
01255     
01256     fl = false; /*default return value for this function*/
01257     
01258     switch (token) { /*these verbs assume that the frontmost window's globals are pushed*/
01259     
01260         /*
01261         2005-10-26 creedon: disabled savecopyfunc case, saveasfunc can do it all
01262                          added saveasfunc case, it wasn't possible to do a save as for a file-object
01263         
01264         2006-02-05 aradke: re-enabled savecopyfunc case to avoid breakage.
01265                 verb tokens that have previously been referenced from glue scripts
01266                 should never be disabled again, like fileMenu.saveCopy in this case.
01267                 also kept kernelverbs.r and kernelverbs.rc in sync.
01268         */ 
01269         
01270         case savefunc: { /*save the frontmost window*/
01271             hdlwindowinfo hinfo;
01272             
01273             if (langgetparamcount (hparam1) == 0) { // old style, save the root
01274             
01275                 if (!ccfindrootwindow (&hinfo))
01276                     break;
01277                 }
01278             else {
01279                 flnextparamislast = true;
01280                 
01281                 if (!getwinparam (hparam1, 1, &hinfo))
01282                     break;
01283                 
01284                 if (hinfo == nil) {
01285                     
01286                     getstringlist (langerrorlist, badwindowerror, bserror);
01287                     
01288                     break;
01289                     }
01290                 }
01291             
01292             (*v).data.flvalue = shellsave ((**hinfo).macwindow);
01293             
01294             fl = true;
01295             
01296             break;
01297             }
01298         
01299         case savecopyfunc: {    /* 2006-02-05 aradke: re-enabled */
01300             tyfilespec fs;
01301             
01302             flnextparamislast = true;
01303             
01304             if (!getfilespecvalue (hparam1, 1, &fs))
01305                 break;
01306             
01307             (*v).data.flvalue = shellsaveas (shellwindow, &fs, false);
01308             
01309             fl = true;
01310             
01311             break;
01312             } 
01313         
01314         case revertfunc:
01315             if (!langcheckparamcount (hparam1, 0))
01316                 break;
01317             
01318             langsaveglobals (); /*see comment at function head*/
01319             
01320             (*v).data.flvalue = shellrevert (shellwindow, false);
01321             
01322             fl = langrestoreglobals (); /*should return false; script can't continue after a revert*/
01323             
01324             break;
01325         
01326         case printfunc:
01327             if (!langcheckparamcount (hparam1, 0))
01328                 break;
01329             
01330             (*v).data.flvalue = shellprint (shellwindow, false);
01331         
01332             fl = true;
01333             
01334             break;
01335 
01336         case saveasfunc: {
01337             tyfilespec fs;
01338             short ctconsumed = 0;
01339             short ctpositional = 0;
01340             tyvaluerecord val;
01341             
01342             initvalue (&val, stringvaluetype);
01343 
01344             flnextparamislast = true;
01345             
01346             if (!getoptionalparamvalue (hparam1, &ctconsumed, &ctpositional, BIGSTRING ("\x04""path"), &val))
01347                 return (false);
01348             
01349             if (val.data.stringvalue) {
01350                 bigstring bs;
01351                 
01352                 texthandletostring (val.data.stringvalue, bs);
01353                 pathtofilespec (bs, &fs);
01354                 (*v).data.flvalue = shellsaveas (shellwindow, &fs, false);
01355                 }
01356             else
01357                 (*v).data.flvalue = shellsaveas (shellwindow, nil, false);
01358 
01359             fl = true;
01360             
01361             break;
01362             }
01363         
01364         } /*switch -- funcs with front globals pushed*/
01365     
01366     shellpopglobals ();
01367     
01368     return (fl);
01369     } /*filemenufunctionvalue*/
01370 
01371 
01372 static boolean editmenufunctionvalue (short token, hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
01373 #pragma unused (bserror)
01374 
01375     /*
01376     10/3/91 dmb: split off editMenu verbs from shell verbs
01377     
01378     6/1/93 dmb: when vreturned is nil, return whether or not verb token must 
01379     be run in the Frontier process
01380     */
01381     
01382     register tyvaluerecord *v = vreturned;
01383     register boolean fl = false;
01384     
01385     if (v == nil) /*need Frontier process?*/
01386         return (true);
01387     
01388     setbooleanvalue (false, v); /*assume the worst*/
01389     
01390     if (!shellpushtargetglobals ())
01391         return (false);
01392     
01393     switch (token) { /*these verbs assume that the frontmost window's globals are pushed*/
01394         
01395         case undofunc:
01396             if (!langcheckparamcount (hparam1, 0))
01397                 break;
01398             
01399             (*v).data.flvalue = shelleditcommand (undocommand);
01400             
01401             fl = true;
01402             
01403             break;
01404         
01405         case cutfunc:
01406             if (!langcheckparamcount (hparam1, 0))
01407                 break;
01408             
01409             (*v).data.flvalue = shelleditcommand (cutcommand);
01410         
01411             fl = true;
01412             
01413             break;
01414             
01415         case copyfunc:
01416             if (!langcheckparamcount (hparam1, 0))
01417                 break;
01418             
01419             (*v).data.flvalue = shelleditcommand (copycommand);
01420         
01421             fl = true;
01422             
01423             break;
01424             
01425         case pastefunc:
01426             if (!langcheckparamcount (hparam1, 0))
01427                 break;
01428             
01429             (*v).data.flvalue = shelleditcommand (pastecommand);
01430         
01431             fl = true;
01432             
01433             break;
01434         
01435         case clearfunc:
01436             if (!langcheckparamcount (hparam1, 0))
01437                 break;
01438             
01439             (*v).data.flvalue = shelleditcommand (clearcommand);
01440         
01441             fl = true;
01442             
01443             break;
01444         
01445         case selectallfunc: 
01446             if (!langcheckparamcount (hparam1, 0))
01447                 break;
01448             
01449             (*v).data.flvalue = shelleditcommand (selectallcommand);
01450             
01451             fl = true;
01452             
01453             break;
01454         
01455         case fontfunc: {
01456             bigstring bs;
01457             short fontnumber;
01458             
01459             flnextparamislast = true;
01460             
01461             if (!getstringvalue (hparam1, 1, bs)) /*font name*/
01462                 break;
01463             
01464             fontgetnumber (bs, &fontnumber);
01465             
01466             if (fontnumber > 0) {
01467 
01468                 (**shellwindowinfo).selectioninfo.fontnum = fontnumber;
01469             
01470                 (*v).data.flvalue = (*shellglobals.fontroutine) ();
01471                 
01472                 shellverbsetselectioninfo ();
01473                 }
01474             
01475             fl = true;
01476             
01477             break;
01478             }
01479         
01480         case fontsizefunc: {
01481             short fontsize;
01482             
01483             flnextparamislast = true;
01484             
01485             if (!getintvalue (hparam1, 1, &fontsize))
01486                 break;
01487             
01488             (**shellwindowinfo).selectioninfo.fontsize = fontsize;
01489             
01490             (*v).data.flvalue = (*shellglobals.sizeroutine) ();
01491             
01492             shellverbsetselectioninfo ();
01493             
01494             fl = true;
01495             
01496             break;
01497             }
01498         
01499         case plainfunc:
01500             fl = shellstyleverb (hparam1, normal, v);
01501             
01502             break;
01503         
01504         case boldfunc:
01505             fl = shellstyleverb (hparam1, bold, v);
01506             
01507             break;
01508         
01509         case italicfunc:
01510             fl = shellstyleverb (hparam1, italic, v);
01511             
01512             break;
01513         
01514         case underlinefunc:
01515             fl = shellstyleverb (hparam1, underline, v);
01516             
01517             break;
01518         
01519         case outlinefunc:
01520             fl = shellstyleverb (hparam1, outline, v);
01521             
01522             break;
01523         
01524         case shadowfunc:
01525             fl = shellstyleverb (hparam1, shadow, v);
01526             
01527             break;
01528         
01529         case getfontfunc: {
01530             bigstring bsfont;
01531             
01532             if (!langcheckparamcount (hparam1, 0))
01533                 break;
01534              
01535             shellsetselectioninfo ();
01536             
01537             fontgetname ((**shellwindowinfo).selectioninfo.fontnum, bsfont);
01538             
01539             fl = setstringvalue (bsfont, v);
01540             
01541             break;
01542             }
01543         
01544         case getfontsizefunc:
01545             if (!langcheckparamcount (hparam1, 0))
01546                 break;
01547              
01548             shellsetselectioninfo ();
01549             
01550             fl = setintvalue ((**shellwindowinfo).selectioninfo.fontsize, v);
01551             
01552             break;
01553         
01554         
01555         } /*switch*/
01556     
01557     shellpopglobals ();
01558     
01559     return (fl);
01560     } /*editmenufunctionvalue*/
01561 
01562 
01563 
01564 static boolean shellinitbuiltins (void) {
01565     
01566     if (!loadfunctionprocessor (idsearchverbs, &searchfunctionvalue))
01567         return (false);
01568     
01569     if (!loadfunctionprocessor (idfilemenuverbs, &filemenufunctionvalue))
01570         return (false);
01571     
01572     if (!loadfunctionprocessor (ideditmenuverbs, &editmenufunctionvalue))
01573         return (false);
01574     
01575     return (true);
01576     } /*shellinitbuiltins*/
01577 
01578 
01579 boolean shellinitverbs (void) {
01580     
01581     /*
01582     if you just changed or added some definitions in shellinitbuiltins, call
01583     shellinstallbuiltins here.  rebuild, run the program, come back and change
01584     it to shellloadbuiltins, rebuild and go on...
01585     
01586     12/18/90 dmb: no longer save hash tables in program file, so we just 
01587     initialize the builtins directly.
01588     */
01589     
01590     if (!sysinitverbs ())
01591         return (false);
01592     
01593     return (shellinitbuiltins ());
01594     } /*shellinitverbs*/
01595 
01596 
01597 
01598 

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