--EditedbyTeitelmanonJune10,198211:35am--thisinterfaceisintendedtobeextremelystable,andcontainallthatisnecessaryforvanillauseoftheuserexec.--UserExecUtilitiesisalsoastableinterfacewhichcontainsvariousroutinesusedinandimplementedbytheuserexecpackagewhichmayalsobeofgeneralusetoclients.Thesefacilitiesarecharacterizedingeneralasusingtheexec,butnotbeingthoughtofasfunctionsofanexecutive.--UserExecExtrasisaninterfacewhichcontainsfacilitieswhichmaybeofuseforspecializedapplications.Itexposesalittlemoreofthestructureoftheexecutive,andthereforeislikelytobealittlemorevolatilewithrespecttochanges.--UserExecPrivateisforinternalcommunicationbetweenmodulesofUserExec,and,incertainexceptionalcases,forusebyprivelegedclientsDIRECTORYHistoryUSING[HistoryEvent],IOUSING[STREAM],RopeUSING[ROPE],RTBasicUSING[TV,Type];UserExec:CEDARDEFINITIONS=BEGIN--TypesROPE:TYPE=Rope.ROPE;STREAM:TYPE=IO.STREAM;TV:TYPE=RTBasic.TV;Type:TYPE=RTBasic.Type;ProcTakesAnyReturnsAny:TYPE=PROCANYRETURNSANY;ExecHandle:TYPE=REFExecRecord;ExecRecord:TYPE=RECORD[in,out,error:STREAM,commandLine:ROPE,commandLineStream:STREAM,viewer:REFANY,--NarrowstoViewer.Maybeofinterestifclientwantstoflashtheviewer.butformostapplications,alltheclientwouldusewouldbethehandles.currentEvent:History.HistoryEvent,--usuallyhistorylist.first,butincaseofcompoundevents,thecurrentsubevent.privateStuff:REFExecPrivateRecord];ExecPrivateRecord:TYPE;--opaque.definedinuserexecprivate.Expression:TYPE=REFExpressionRecord;ExpressionRecord:TYPE;CommandProc:TYPE=PROC[exec:ExecHandle,clientData:REFANY_NIL]RETURNS[ok:BOOLEAN_TRUE,msg:Rope.ROPE_NIL];--msgisforinclusioninthehistory,sothatforexampletheusercanseewhetheracompilatonwassuccessful,orwhyanattempttorunaprogramfailed.1pî ìïb&î%îÿî\qîOïb&îêïb&î¡îßî"$î%äpî yï`€î ðîˆîî~îéîŽî^î$�î(¼î+`î00î2+î4ýî6iî<_î>†îBîîENîFòî yï^Úî yï]5î ðîºî&îòî'îÿî%‰î)lî.Áî3iî8�î; î=Fî?ê îGÀî yï[�î ÅîÿîâîÒî Ÿî"nî$î(Óî+3î,Øî1cî5F î: î<ô îE(î yïYéî9qîòïYéî¹ïYépîœïYéî ïYéîèî\î¾î!î"Ãî'¾î)bî+î0êî2Žî4� î yïXCî ð îþîjî]îçî"Êî( î-yî1\î4Lî6î7¿î:îŠîA³îEî yïTøî tîòî—î yïSRî ðî@î«îÓîÛ î(Bî-]î2—î4;î:¾î=ºî?`î yïQ¬ î›îfîŽîîîÈ î"rî yïNaqî ŠïL»rîtïL»îZïL»qî£ïL»îïL» î ŠïKrî¦ïKî‹ïKqîÕïKrî8ïKqîïKîeïKî ŠïIprî?ïIpî$ïIpqînïIprîÑïIpqîâïIpîEïIpî ŠïGÊrîïGÊîóïGÊqî=ïGÊrî ïGÊqî$ïGÊîïGÊî ŠïF$î yïBÙrîïBÙîæïBÙî– qîïBÙrî yï?�qpî yïî@^îDÚîG<î yï%1î ¸ î}îxîÄîsî!`î#Àî'¬î)|î+Èqî Šï#‹ î?pî"²ï#‹î#+ï#‹î$)î(Çî1ðî4Qî5÷î8æî:‰î@ûîE[î yï!æî'qî Šï @ rî�ï @îcï @qî?ï @î'ï @î Šïštî yïOqî×ïOrîÕïOîŽïOqîÂïOpîDïOî½ïOî»î!±î&\î(tî yï qîíïrîëïî¤ïqîBïrî'ïîûïqî×ïî¾ïtî yï¸qî&ï¸rî#ï¸îÜï¸qîï¸tî yïl qî6ïlrî4ïlîíïlqî‹ïlrîpïlîïlqîýïlî`ïlî ô î) rî0ïlî0êïlî2Æî5Àî6ýqî9 ïlrî9ðïlî:Äïlqî?wïlî?ÚïlrîBOïlîCïlqîHYïlrî yïÆqîUïÆî~ïÆî±rî9ïÆî ïÆqî´ïÆrîAïÆî)ïÆqîLïÆî¯ïÆpî yï!î ðî¿î*îRî î¯îûî Æî"î%Qî'xî,Óî/î2î4’î6Ðî;àî= îDî yï { îþî·î…îxî^îî ‡î!¼î' quî)Èïö°TVm$uMethodProc:TYPE=PROC[exec:ExecHandle,clientData:REFANY_NIL]RETURNS[handled:BOOLEAN_FALSE];--creatinganexecutiveCreateUserExecutive:PROCEDURE[name:ROPE_NIL,viewer:REFANY_NIL]RETURNS[exec:ExecHandle];--usedtocreateandstartupaninstanceoftheexecutiveUserExecutive.nameisthecaptionatthetopofthewindow/viewer.name=NILdefaultsto"CedarExecutive".Ifviewerissupplied,itshouldNARROWtoTypescript.TS.GetExecHandle:PROCEDURERETURNS[ExecHandle];--Ifcalledfromprocessrunningdirectlyunderanexechandle,returnsthatexechandle,otherwisereturnsdefaultexechandle--loginandpasswordGetNameAndPassword:PROCRETURNS[name,password:ROPE];SetNameAndPassword:PROC[name,password:ROPE];Login:PROC[in,out:STREAM]RETURNS[name,password:ROPE];--promptsuserfornameandpassword.echoespasswordcharacterswith*.--RegistrationofcommandsandmethodsRegisterCommand:PROC[name:ROPE,proc:CommandProc,briefDoc,doc:ROPE_NIL,clientData:REFANY_NIL];--registersacommandandcorrespondingprocedure.Subsequently,whentheusertypesnameparams{cr},procwillbecalledwiththecorrespondingexecHandle,fromwhichhecanobtaintheinput/outputstreams,aswellasthecommandLine,eitherasaropeorastream.ThecontentsofthecommandLineistherestoftheline(uptoCRor;),i.e.doesnotincludename..--briefDocisabriefdescriptionofthecommandpresentedwhenusertypes?--docismorecompletedescriptionsuppliedwhenusertypesname?.Note:RegisterCommanddoesNOTcalltheproc.--clientDatawillbesuppliedasanargumentwhentheprocedureiscalled.RegisterMethod:PROC[proc:MethodProc,name,doc:ROPE_NIL,clientData:REFANY_NIL];--usedtospecifyhandlingofclassesofinput,e.g.tomaketyping&.mesaopenavieweronthecorrespondingfile.Whenthecorrespondingprocedureiscalled,commandLineistheentireline.Note:itispermissibletoreadfromexec.commandLineStream,asitisreloadedbeforeeachattempttocallamethod.RegisterAlias:PROC[name:ROPE,becomes:ROPE,args:LISTOFROPE_NIL];--registersanalias,asimplemacroexpansionfacilityforcommands.Wheneverbeginsacommandline,itwillbereplacedby,e.g.RegisterAlias["compile","compiler"].Ifargsisnon-NIL,thenthenextntokensonthecommandlinewillbesubstitutedforthenargumentsin,andtheresultingropewillreplacename.--Example:RegisterAlias["rn","copyfoo.mesa_from.mesa';deletefrom.mesa';copyto.mesa_foo.mesa\n",LIST["from","to"]]registersanaliaswhichwillcause"rnuserexecimplUserExecImpl"tobetransformedinto"copyfoo.mesa_userexecimpl.mesa';deleteuserexecimpl.mesa';copy2tî yïb! qîìïb!rîéïb!î¢ïb!qî@ïb!rî&ïb!îÍïb!qî²ïb!îïb!î© î'¹ rî.Ìïb!î/ ïb!î1|î4uî5³qî7¾ïb!rî8¥ïb!î9yïb!qî>-ïb!î>�ïb!rîDWïb!îEïb!qî yï`{rî ï`{î ¿ï`{qî£ï`{îï`{pî yï[Šî ðî!îtî yïX>qîöïX>rîxïX>î ïX>qî ïX>î yïX>rî$²ïX>î%†ïX>qî(-ïX>rî)ºïX>î*£ïX>qî+ÆïX>î,¢ïX>rî1€ïX>î2TïX>î40qî7)ïX>rî8¶ïX>î9ŸïX>qî:ÂïX>rî;©ïX>î<}ïX>qîA1ïX>îA”ïX>î yïV˜ pî �ïTóî ûïTóî øî î®î§îKîiîZîMî$Œî&0î(|î.] î7¦î;Jî<¶î?îCÄîEiîGµî yïSMî îh îæîŠîoî •î%˜î'<î+ï î31î4¿î8ãî:Oî?ÞîA6î yïQ§î~î" tî yïN\ qîæïN\rîäïN\îŒïN\î‚qî"sïN\î"ÖïN\ pî yïL¶î ðî ~î_îœîDîXî##î&òî(å î03î4Ëî7� î>ëîDÕî yïKî÷ î yïFî ðîYîýtî yïBÓqîïBÓrîïBÓî¹ïBÓîžqî"�ïBÓî"óïBÓî' rî-�ïBÓî.UïBÓqî0’ïBÓî0öïBÓtî yï?ˆqîÝï?ˆrîÛï?ˆî‚ï?ˆqîgï?ˆîÊï?ˆî ârî'Yï?ˆî(-ï?ˆqî*jï?ˆî*Íï?ˆtî yï<<qî êï<<rîçï<<î�ï<<qîtï<<î×ï<<îÞrîÌï<<îkï<<qî—ï<<rî~ï<<îRï<<qî#ï<<î#hï<<î'€rî-÷ï<<î.Ëï<<qî1ï<<î1kï<<pî yï:—î ðîîøî îÄîhî"zî&Àî,z î2êî5æî yï5¥î ð î‹î/îÎîqtî yï2ZqîSï2ZrîPï2Zîøï2ZqîÝï2Zî@ï2Zrîyï2ZîMï2Zqî!Šï2Zî"gï2Zî& î/Îî5írî9ï2Zî9Üï2Zqî<ƒï2Zrî>ï2Zî>øï2Zqî@ï2Zî@øï2Z rî yï0´î )î"î_qîkï0´îRï0´pî Šï/î ï/îîPî„îŸîC î%Ü î,_ î4äî8fî:²î=–îAî yï-i îî îžînîOî Jî"— î+0 î2ëî6(î: î;çî>uîB�î yï+à îgî¢î[î'îàî , î)Oî-î.Öî0 î3î4Èî5ýî:³î=wîBÃîDfî yï* îCî¯îûî“î6î‚î &î"‘î$6î&µî(nî*>î,pî/tî1Øî6„qpî Šï(wî ï(wîî…îñî&îK î î!¸î$î*î0 î3�î6rî9Ûqpî Šï&Òî ï&Òîî�îìîVîõ î!¾î&öî*wî-\î0Åî5Qî9îD[î yï%,î î¡îíî Šï#† îî¥îuî¬îeî!Xî'^î*àî-,î3Wî4Ãtî yï• qîï•rîï•î­ï•qî“ï•îöï•î• î$Ñî(èrî,ï•î,×ï•qî/~ï•rî1 ï•î1ôï•qî3Çï•î4bï•rî9Üï•î:§ï•î=Wî@PîA�qîC™ï•îCüï•pî �ïïî ûïïî øî î®îî©îMî!§î#Jî'&î)¦î+Kî.÷î3î7Óî;î îG©î yï Ðî H î¹îîUîçî!Tî,šî-ðî1Éî=î>euî)Èïöÿ >TVm$VUserExecImpl.mesa_foo.mesa--abortingUserAbort:PROC[exec:ExecHandle]RETURNS[abort:BOOLEAN];--returnsTRUEiftheuserhasrequestedanabortoftheoperationrunninginexec.Theclientprogramisresponsibleforeffectingtheabort,whichistypicallyperformedbyraisingthesignalUserAborted.SetUserAbort:PROC[exec:ExecHandle];--setstheuserabort,i.e.providesaprogrammablewaytoabort(theoperationcurrentlyrunningin)anexec.ResetUserAbort:PROC[exec:ExecHandle];--turntheabortbitoff.UserAborted:ERROR[msg:ROPE_NIL];--canbeusedbyimplementortoeffectanabortwhentheimplementorhasdetected,viaUserAbort,thattheuserhasabortedtheoperation.Thissignaliscaughtbytheuserexecutive.END.--UserExec3pî yïb&î*î—î yï[�î ðtî yïXCqî¢ïXCrîŸïXCîGïXCqî,ïXCî�ïXCî# rî!>ïXCî"ïXCqî'/ïXCî'’ïXCrî+«ïXCî,dïXCqî1KïXCî1®ïXCpî ïVžî ïVžî |îî„îÚî&î î€î%lî'_î*éî,Œî.Øî4Ïî9ãî;‰î>ýîAÁîEpî yïTøî ä îÁîéî^îªî Œî$oî%Ûî+?î1˜î3rî7äî:0î> qtî yïQ¬ qî�ïQ¬rîšïQ¬îBïQ¬qî'ïQ¬îŠïQ¬î pî �ïPî ûïPî øî�îÜîÁî£îÕî î!A î*î,Üî.�î2 î4Ðî:Çî@}îE’îG±î yïNaqtî yïK qîóïKrîðïKî˜ïKqî}ïKîàïKît pî �ïIpî ûïIpî øîìî8îÂîÊtî yïF$ qî÷ïF$rîõïF$î®ïF$qîpïF$îÓïF$rî/ïF$îïF$qîªïF$rî 7ïF$î! ïF$qî"CïF$î"¦ïF$pî �ïD~î ûïD~î øî†îVîfî@ îî¥î#Hî%;î(Åî,Gî.“ î6Sî8Éî>Rî@… îGkî yïBÙî Åî©îîôî@ î�î"Ÿî&�î'ùî,bî.=î0‰ qrî yï