UserProfile.mesa;EditedbyTeitelmanonDecember16,198211:59amDIRECTORYRopeUSING[ROPE];UserProfile:CEDARDEFINITIONS=BEGINOverviewUserProfileisapackageforreadinginformationfromthediskfile.profile,orifnoneexists,User.profile.Thepurposeoftheprofileistoallowpersonalizedtailoringofthesystem.ThecurrentcatalogueofwaystheCedarcanbeparameterizedmaybefoundinthefileUserProfile.doc.Entriesintheuser'sprofileareoftheform::RETURN,wherevalueiseither(1)aBOOLEAN,(2)anINT,(3)aTOKEN,or(4)aListOfTokens(formoredetails,seeUserProfile.doc).WhenCedarisbooted,rolledBack,oranyfilewhoseextensionis"profile"isedited,theprofileisparsedandadatastructurewhichdescribestheinformationthatwasfoundintheprofileisconstructed.Comments(indicatedusingthestandard"--"convention)canappearanywhereintheprofileandwillbeignored.Theparsingwillalsoignoreextraspacesorblanklines.AnyerrorsoranomaliesdiscoveredwhenparsingoraccessingtheprofilewillcausediagnosticstobeprintedtothefileUserProfile.log.TheuserwillbeinformedthatproblemshavebeenencounteredviatheMessageWindow.Innocasehoweverwillthesystembreak.Accesstoindividualprofileentriesviatheproceduresbelowisrelativelyefficient,sincethisaccessdoesnotrequireanyfilereadsorparsing.Therefore,manysimpleapplicationscansimplyreadinformationfromtheprofileasneeded.However,someapplicationsderivecomplexdatastructuresfromtheprofile(considertheeffectofthe"UserCategory"profileentryonthestateofTioga),andhencecannotaffordtointerrogatetheprofilewheneversomeinformationderivedfromitisused.SuchanapplicationmustregisteraProfileChangedProcandperformallofitsprofileinterrogationsfromwithinthisprocedure.Thisguaranteesthatthecorrespondingvalueswillbeupdatedwhenevertheprofilechanges.TheProfileChangedProcwillbecalledwhenitisfirstregistered,wheneverthesystemisbootedorrolled-back,orwheneverafilewithextension".profile"issaved.Finepoint:SincetheProfileChangedProcforanapplicationisnotcalledfromthatapplication'sprocess(es),theapplicationmustexplicitlysynchronizeitsreadstovariablesderivedfromtheprofilewiththeProfileChangedProc'swritestothesevariables.Thismayinvolveaddingamonitortoanapplicationthatpreviouslydidnotrequireone.AccessingtheProfileTheproceduresdescribedbelowallreadsimpleresultsfromthevaluefieldgivenakey.Thedefaultvalueispassedinasanargumentsothattheclientcanspecifywhattheprocedurereturnsshouldthevaluebeabsentormalformed,ortheprofilebemissing.Boolean:PROC[key:Rope.ROPE,default:BOOLEAN_FALSE]RETURNS[value:BOOLEAN];Number:PROC[key:Rope.ROPE,default:INT_0]RETURNS[value:INT];Token:PROC[key:Rope.ROPE,default:Rope.ROPE_NIL]RETURNS[value:Rope.ROPE];returnsnexttokenfollowing:,i.e.effectivelydoesanIO.GetRope[IDBreak].Ifthefirstcharacterencounteredis",thenreadseverythingtothenextmatching",andreturnsthisasasinglerope.p a!H#;)+/ 2q ^'r \vq\v\vr\vqD\vrU\v Zs We rWeqWeWe rWeq!xWe"2Wes S7t O  y '@*,/2?%@B#E N5 lM#m%&* 28`:B<AD Lu (+-136u8nL9L tAL J /F $)v-J .iJ t23J 3J 7 :<?AqCJ CJ tHJ Hb &q(HbHbt4Hb#Hb\qHbRHbtHbHb| '*j.25/?CH# F E"_!')b/L05q7vI '),^179;>DsG/ <g :K] s!$ +/(0 6 <:?BPF_ 8 d0?!] (+0M 7:u>B 6 T&!-$ ,Y06 9 ?VBE 5U@ ' $2(,8.?035:><@El 3 p#C */3:469=? F' 2u'22t2X2$&(*/M 8;?B 0_ V vD #( +-E29s<#@Fu .t@.>.{"#K$'T -362:;@^B - x $&E*.& * X`!| (*Q,147 ? G/ ( xZ  #&*,,T27;>CG/ '=- 7 &),1q57 AD e P  E!#&c*2,1w47Q=BG/   !%'|u ]r]q]]re]]q_]3]rp] M]q%o]&(]r+y]q-]-]r0]q1q]r7b]7]q;]<]rA]A]u rq_rDq>rO ,q%N%r')Pq*+r01<q5_5r7j7u rqmrRqM r^:$\q'(r+_q,-r.q/r56:<q=>r@A8pS$&D ,/1?yACS D KD"N% ,T-0E3Z9?:=oBDFX  TVm$eListOfTokens:PROC[key:Rope.ROPE,default:LISTOFRope.ROPE_NIL]RETURNS[value:LISTOFRope.ROPE];Forexample,ifyourprofilecontains:PreRun:Clock.bcd,VersionMapOpsImpl.bcd,HideousKludge.bcd,--justuntil3.4--WalnutSend.bcdthenListOfTOkens["PreRun"]willreturn("Clock.bcd","VersionMapOpsImpl.bcd","HideousKludge.bcd","WalnutSend.bcd).NotethatiftheuserprofilecontainsKey:{cr},thenListOfTokens["key",default]willreturnNIL,notdefault,i.e.theentryfor"key"isneithermalformedorabsent.Line:PROC[key:Rope.ROPE,default:Rope.ROPE_NIL]RETURNS[value:Rope.ROPE];LikeListOfTokensexceptreturnstheresultasasinglerope,e.g.foraboveexample,thevalueofLine["PreRun"]wouldbe"Clock.bcdVersionMapOpsImpl.bcdHideousKludge.bcdWalnutSend.bcd".GetProfileName:PROCRETURNS[Rope.ROPE];returnsnameoffileusedtobuildtheprofile,i.e.either.profile,orUserName.Profile.ReturnsNILifnoprofile.RegisteringproceduresforaccessingtheprofileAsmentionedabove,iftheresultofaccessingtheuserprofileisgoingtobecachedbytheclient,thentheprofileshouldnotbeaccesseddirectly,butviaaProfileChangedProcwhichhasbeenregisteredwithCallWhenProfileChanges.Thisguaranteesthatthecorrespondingvalueswillbeupdatedwhenevertheprofilechanges.Inotherwords,ratherthanwriting:ClientCheckpointFlag:BOOL_UserProfile.Boolean["ClientCheckpoint",TRUE];theimplementorshouldwrite:ClientCheckpointFlag:BOOL;Init:ProfileChangedProc={ClientCheckpointFlag_UserProfile.Boolean["ClientCheckpoint",TRUE];UserProfile.CallWhenProfileChanges[Init];CallWhenProfileChanges:PROC[proc:ProfileChangedProc];prociscalledwhenitisfirstregisteredwithreason=firstTime.ProfileChangedProc:TYPE=PROC[reason:ProfileChangeReason];ProfileChangeReason:TYPE={firstTime,rollBack,edit};ProfileChanged:PROC[reason:ProfileChangeReason];CallsalloftheProfileChangedProcs.Thisprocedureisautomaticallycalledafterarollback,whenevertheUserExec.Loginiscalled,orwhenevertheafilewithextension'profile'issavedbytioga.GetErrorLog:PRIVATEPROCRETURNS[fileName:Rope.ROPE];iftherewereanyerrorsreported,thisclosesthestreamandreturnsthenameofthefile.END.2u b& r8b&q6b&b&rb&&b&5qb& b&r"b&#b&q(b&)b&+r-b&.b&q19b&2 b&r4b&q6Ab&7)b&r8Lb&q9b&r? b&?nb&qCb&DJb&Fvr `qX`,`ri``p^Wt \Hs )'458|;=?+ pXtXXp X!X#\t'oX'X 0WHp(WHSb3$H*g-q:-?AER>EN :$&%*02u NrNqNMNr3NNq-NNr>NN#<q&N'Nr*?Nq+N,Nr-Nq.Nr4N4N9q;=C%nas >  $'t ; B  &(+0b157V9M=?BKFi 9 D v$.&(u)9*9t6i97f9:o<@1 Ftu 8Jt8J8J #&)F 2V69c;m@G/ 6\ 4 Z 1q11t1&1'q6-161t9Y191p .6I  Ot +q++t/+ ), {`)+;'qDC),D),tGo),G), &)u #Dr#Dq#D#Drm#D#D#pp!~_9s %t(!) !,.p41!u /r/q//r?/q$//r!/"/&u rq}r %+u j rjqjjrj jp*tvGp#$'./m 7;>@t# p!!e"m&(`.6014 7= ACbGju  rqXr##*kq-.r11gp Ueo" $(z*/$16_8