DIRECTORY AMBridge, AMModel, AMModelBridge, AMTypes, BcdDefs, GetMe, LoadState, PrincOps, PrincOpsUtils, RefText, Rope, TimeStamp; GetMeImpl: CEDAR PROGRAM IMPORTS AMBridge, AMModel, AMModelBridge, AMTypes, LoadState, PrincOpsUtils, RefText, Rope EXPORTS GetMe = { ROPE: TYPE = Rope.ROPE; TV: TYPE = AMTypes.TV; GetVersion: PUBLIC PROC RETURNS [ts: TimeStamp.Stamp] = TRUSTED { myLocalFrame: PrincOps.FrameHandle _ PrincOpsUtils.MyLocalFrame[]; myLF: TV _ AMBridge.TVForFrame[myLocalFrame]; callersLF: TV _ AMTypes.DynamicParent[myLF]; callersGF: TV _ AMTypes.GlobalParent[callersLF]; context: AMModel.Context _ AMModelBridge.ContextForFrame[callersGF]; section: AMModel.Section _ AMModel.ContextSection[context]; ts _ AMModel.SectionVersion[section]; }; GetAncestorVersion: PUBLIC PROC [moduleName: ROPE] RETURNS [ts: TimeStamp.Stamp] = TRUSTED { myLocalFrame: PrincOps.FrameHandle _ PrincOpsUtils.MyLocalFrame[]; myLF: TV _ AMBridge.TVForFrame[myLocalFrame]; callersLF: TV _ AMTypes.DynamicParent[myLF]; callersGF: TV _ AMTypes.GlobalParent[callersLF]; context: AMModel.Context _ AMModelBridge.ContextForFrame[callersGF]; section: AMModel.Section _ AMModel.ContextSection[context]; WHILE NOT AMModel.SectionName[section].Equal[moduleName] DO context _ AMModel.ParentContext[context]; IF context = NIL OR AMModel.ContextClass[context] = world THEN ERROR --no such containing module--; section _ AMModel.ContextSection[context]; ENDLOOP; ts _ AMModel.SectionVersion[section]; }; StandardScrewyEncoding: PUBLIC PROC [ts: TimeStamp.Stamp] RETURNS [Rope.ROPE] = { fooey: PACKED ARRAY [0 .. 12) OF [0 .. 16) _ LOOPHOLE[ts]; rt: REF TEXT _ RefText.New[12]; FOR i: NAT IN [0 .. 12) DO rt _ RefText.AppendChar[rt, IF fooey[i] IN [0 .. 9] THEN '0 + fooey[i] ELSE 'a + fooey[i] - 10]; ENDLOOP; RETURN [Rope.FromRefText[rt]]; }; GetBCD: PUBLIC PROC RETURNS [bb: BcdDefs.BcdBase] = TRUSTED { myLocalFrame: PrincOps.FrameHandle _ PrincOpsUtils.MyLocalFrame[]; myLF: TV _ AMBridge.TVForFrame[myLocalFrame]; callersLF: TV _ AMTypes.DynamicParent[myLF]; callersGF: TV _ AMTypes.GlobalParent[callersLF]; callersGlobalFrame: PrincOps.GlobalFrameHandle _ AMBridge.GFHFromTV[callersGF]; cid: LoadState.ConfigID; mi: LoadState.ModuleIndex; LoadState.Acquire[LoadState.local, shared]; [cid, mi] _ LoadState.GlobalFrameToModule[LoadState.local, callersGlobalFrame]; bb _ LoadState.ConfigInfo[LoadState.local, cid].bcd; LoadState.Release[LoadState.local]; }; }. PGetMeImpl.Mesa Last Edited by: Spreitzer, August 17, 1985 8:26:07 pm PDT Κt– "cedar" style˜Icode™K™9K˜KšΟk œy˜‚K˜šΠbx œœ˜KšœS˜ZKšœ˜K˜Kšœ˜K˜Kšœœœ˜Kšœœ œ˜K˜š Οn œœœœœ˜AK˜BKšœœ%˜-Kšœ œ˜,Kšœ œ#˜0K˜DK˜;K˜%K˜—K˜š Ÿœœœœœœ˜\K˜BKšœœ%˜-Kšœ œ˜,Kšœ œ#˜0K˜DK˜;šœœ0˜;Kšœ)˜)Kš œ œœ'œœΟcœ˜cKšœ*˜*Kšœ˜—K˜%K˜—K˜š Ÿœœœœœ˜QKš œœœ œ œ˜:Kšœœœ˜šœœœ ˜šœ˜Kšœ œ œœ˜D—Kšœ˜—Kšœ˜K˜—K˜š Ÿœœœœœ˜=K˜BKšœœ%˜-Kšœ œ˜,Kšœ œ#˜0KšœO˜OK˜Kšœ˜K˜+KšœO˜OKšœ4˜4K˜#K˜—K˜K˜——…— ’ V