DIRECTORY DB USING [Domain, Entity, Relation, Relship, Segment], IO USING [STREAM], Rope USING [ROPE]; SquirrelDump: CEDAR DEFINITIONS = BEGIN OPEN DB, IO, Rope; DumpToFile: PROC[ segment: ROPE, fileName: ROPE _ NIL, dl: LIST OF Domain _ NIL, rl: LIST OF Relation _ NIL, complement: BOOLEAN _ FALSE, entityCentric: BOOLEAN _ FALSE]; DumpAll: PROC[segment: ROPE, fileName: ROPE _ NIL] = INLINE {DumpToFile[segment, fileName, NIL, NIL, TRUE]}; LoadFromFile: PROC[dumpFile: ROPE, segment: DB.Segment, DBFile: ROPE]; OpenFile: PROC[fileName: ROPE] RETURNS[STREAM]; CloseFile: PROC[fileStream: STREAM]; WriteSchema: PROC[s: STREAM, dl: LIST OF Domain, rl: LIST OF Relation]; WriteDomain: PROC[s: STREAM, d: Domain, refs: BOOL_ FALSE]; -- writes entities in domain WriteEntity: PROC[s: STREAM, e: Entity]; -- writes a particular entity WriteRelation: PROC[s: STREAM, r: Relation]; -- writes all the relships of the relation WriteRelship: PROC[s: STREAM, r: Relship]; -- writes a particular relship EraseDomains: PROC[dl: LIST OF Domain]; EraseRelations: PROC[rl: LIST OF Relation]; END . . . ´File: SquirrelDump.mesa Implemented by: SquirrelDumpImpl, SquirrelLoadImpl Last edited by: John Maxwell on: June 3, 1982 9:36 am Willie-Sue on: February 22, 1983 3:46 pm Donahue on: January 20, 1983 9:58 am Cattell, April 28, 1983 2:28 pm Widom, June 8, 1984 9:08:37 am PDT Butler on: June 27, 1984 9:54:56 am PDT ************************************************** for gross dumping of the data base ************************************************** dumps only the domains and relations given. If complement = TRUE, dumps everything but the domains and relations given. If entityCentric = TRUE, dumps entities with relships reffing them in first attribute Loads the contents of the dumpFile into the DBFile; uses same dump format as DumpToFile. ************************************************** for selective dumping of the data base ************************************************** you may use a different type of stream if you choose Êx˜Jšœ™Jšœ2™2Jšœ5™5Jšœ(™(Jšœ$™$Jšœ™Jšœ"™"J™'J˜šÏk ˜ Jšœœ.˜6Jšœœœ˜Jšœœœ˜J˜—šœœ œ˜!Jšœœœœ˜J˜—Jšœ2™2Jšœ"™"šœ2™2J˜šÏn œœ œ œœœœ œœœ œœœœœ˜¬JšœÏ™Ï—J˜š žœœ œ œœ˜4Jšœ œœœ˜7J˜—šž œœ œœ˜FJšœX™X——J˜Jšœ2™2Jšœ&™&Jšœ2™2˜Jš žœœ œœœ˜/šž œœ œ˜$Jšœ4™4J˜—Jšž œœœœœ œœ ˜HJš ž œœœœœÏc˜XJšž œœœŸ˜FJšž œœœŸ*˜WJšž œœœŸ˜IJ˜Jšž œœœœ ˜'J˜Jšžœœœœ ˜+J˜—Jšœ˜ J˜J˜J˜J˜—…—R ~