-- File: NutDump.mesa -- Implemented by: NutDumpImpl, NutLoadImpl -- 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 -- Last Edited by: Cattell, April 28, 1983 2:28 pm DIRECTORY DB USING [Domain, Entity, Relation, Relship], IO USING [STREAM], Rope USING [ROPE]; NutDump: CEDAR DEFINITIONS = BEGIN OPEN DB, IO, Rope; --************************************************** -- for gross dumping of the data base --************************************************** DumpToFile: PROC[ segment: ROPE, -- segment cannot be defaulted fileName: ROPE _ NIL, dl: LIST OF Domain _ NIL, rl: LIST OF Relation _ NIL, complement: BOOLEAN _ FALSE, entityCentric: BOOLEAN _ FALSE]; -- 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 DumpAll: PROC[segment: ROPE, fileName: ROPE _ NIL] = INLINE {DumpToFile[segment, fileName, NIL, NIL, TRUE]}; LoadFromFile: PROC[dumpFile: ROPE _ NIL, DBFile: ROPE _ NIL]; -- Loads whatever is in the dumpFile into the DBFile; uses same dump format as DumpToFile. -- the segment name is given in the dumpFile; if the DBFile does not exist, it is created --************************************************** -- for selective dumping of the data base --************************************************** OpenFile: PROC[fileName: ROPE] RETURNS[STREAM]; CloseFile: PROC[fileStream: STREAM]; -- you may use a different type of stream if you choose 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 END . . . ʈ˜Jš¯ÏcÏÐci3œÏk œŸœŸœ(ŸœŸœŸœ ŸœŸœŸœŸœŸœŸœŸœ 5œ&œ5œÐbn œŸœŸœœŸœŸœ ŸœŸœ Ÿœ ŸœŸœ ŸœŸœŸ œŸœŸœž{žXœ œŸœ Ÿœ ŸœŸœŸœ ŸœŸœŸœ  œŸœ ŸœŸœ ŸœŸœžÏež6[œ”œÏnœŸœ ŸœŸœŸœ¢ œŸœ Ÿœ8œ¢ œŸœŸœŸœŸœ ŸœŸœ ¢ œŸœŸœ!œ¢ œŸœŸœ¢ œŸœŸœ+œ¢ œŸœŸœœŸœ ˜£—…—& ´