DIRECTORY DB, ViewerClasses USING[ Viewer ], Rope USING [ROPE]; NutOps: CEDAR DEFINITIONS = BEGIN OPEN DB, Rope; IsSystemDomain:PROC[d: Domain] RETURNS[BOOLEAN]; IsSystemRelation: PROC[r: Relation] RETURNS[BOOLEAN]; AttributesOf: PROC[r: Relation] RETURNS[AttributeList]; FirstAttributeOf: PROC[r: Relation] RETURNS[Attribute]; EntityValued: PROC [a: Attribute] RETURNS[BOOL]; GetUniquenessString: PROC[a: Attribute] RETURNS[ROPE]; RSetSize: PROC[rs: RelshipSet] RETURNS[INT]; GetTuples: PROC[e: Entity, a: Attribute] RETURNS [tl: LIST OF Relship]; GetRelation: PROC[a: Attribute] RETURNS[r: Relation]; GetRefAttributes: PROC[d: Domain] RETURNS[al: LIST OF Attribute]; RemoveAttribute: PROC[a: Attribute, al: AttributeList] RETURNS[AttributeList]; AppendAttributes: PROC [al1, al2: AttributeList] RETURNS [al: AttributeList]; SetUpSegment: PROC[segmentFile: ROPE, seg: DB.Segment, number: NAT_ 0, makeReadOnly: BOOL_ FALSE] RETURNS [success: BOOL, readOnly: BOOL]; Do: PROC[proc: PROC[ REF ANY ], clientData: REF ANY _ NIL, reTry: BOOL _ FALSE, msgViewer: ViewerClasses.Viewer _ NIL ] RETURNS [succeeded: BOOL]; TryRestart: PROC[trans: DB.Transaction]; AtomFromSegment: PROC[ segR: ROPE ] RETURNS[ ATOM ]; IsLocalName: PROC[ segR: ROPE ] RETURNS[ BOOL ]; END. ðNutOps.mesa useful database utilities Implemented by: NutOpsImpl Created by: Donahue on: January 20, 1983 3:48 pm last edited by: Donahue, July 12, 1983 9:21 am Last Edited by: Willie-sue, February 22, 1983 3:44 pm Last Edited by: Cattell, July 22, 1983 2:59 pm ********************************************** Handy DB routines, implemented by NutOpsImpl.mesa ********************************************** Returns list of r's attributes returns AttributesOf[r].first returns TRUE iff the value stored in attribute a should be an entity returns the uniqueness of a: Key, OptionalKey, etc., as a printable string returns the length of rs, and does a ReleaseRelshipSet returns all the tuples that reference e via attribute a finds a's relation returns all the attributes that can reference an entity from domain d destructively removes a from al destructively appends al1 and al2 and returns the result *********************************************** Opening segments and transactions for them *********************************************** Evaluates the procedure supplied in an environment where the Aborted and Failed signals that may be raised from DB will be caught; the procedure will be retried after a restart if reTry is TRUE (otherwise a restart will be performed on failure without retrying the proc. Any messages produced will be printed in the msgViewer if one is supplied. We return succeeded=TRUE iff no errors occured in executing proc. Attempts to re-open an aborted transaction if user confirms. Ê8˜J˜Jšœ ™ Jšœ™Jšœ™Jšœ0™0Jšœ.™.Jšœ5™5Jšœ.™.J˜šÏk ˜ Jšœ˜Jšœœ ˜Jšœœœ˜J˜—Jšœœ œ˜Jš˜J˜Jšœœ˜J˜Jšœ.™.Jšœ1™1Jšœ.™.J˜JšÏnœœ œœ˜0J˜Jšžœœœœ˜5J˜šž œœœ˜7Jšœ™J˜—šžœœœ ˜7Jšœ™J˜—šž œœœœ˜0JšœD™DJ˜—šžœœœœ˜6JšœJ™JJ˜—šžœœœœ˜,Jšœ6™6J˜—š ž œœœœœ ˜GJšœ7™7J˜—šž œœœ˜5Jšœ™J˜—š žœœ œœœ ˜AJšœE™EJ˜—šžœœ"œ˜NJšœ™J˜—šžœœœ˜MJšœ8™8J˜—Jšœ/™/Jšœ+™+Jšœ/™/J˜šž œœœœœœœœ œ œ˜ŠJ˜—Jšžœœœœœœœœ œœ$œœ œ˜’JšœW™WJšœX™XJšœ]™]JšœJ™JJšœA™AJ˜šž œœœ˜(Jšœ<™