(FILECREATED "20-Nov-85 18:23:31" {QV}<NOTECARDS>1.3K>FGHPATCH002.;1 12167 changes to: (VARS FGHPATCH002COMS) (FNS NC.PutTextSubstance NC.GetTextSubstance NC.TextCopySubstance NC.GetSketchSubstance NC.PutSketchSubstance NC.SketchCopySubstance NC.GetGraphSubstance NC.PutGraphSubstance NC.GraphCopySubstance NC.ListCardGetFn NC.ListCardPutFn NC.ListCardCopyFn)) (* Copyright (c) 1985 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT FGHPATCH002COMS) (RPAQQ FGHPATCH002COMS ((* * Redefined from NCTEXTCARD to implement the fact that NoteCards now handles the start and end pointers at the beginning of each substance's storage on the disk) (FNS NC.PutTextSubstance NC.GetTextSubstance NC.TextCopySubstance) (* * Redefined from NCSKETCHCARD to implement the fact that NoteCards now handles the start and end pointers at the beginning of each substance's storage on the disk) (FNS NC.GetSketchSubstance NC.PutSketchSubstance NC.SketchCopySubstance) (* * Redefined from NCGRAPHCARD to implement the fact that NoteCards now handles the start and end pointers at the beginning of each substance's storage on the disk) (FNS NC.GetGraphSubstance NC.PutGraphSubstance NC.GraphCopySubstance) (* * Redefined from NCLISTCARD to implement the fact that NoteCards now handles the start and end pointers at the beginning of each substance's storage on the disk) (FNS NC.ListCardGetFn NC.ListCardPutFn NC.ListCardCopyFn))) (* * Redefined from NCTEXTCARD to implement the fact that NoteCards now handles the start and end pointers at the beginning of each substance's storage on the disk) (DEFINEQ (NC.PutTextSubstance (LAMBDA (Card) (* fgh: "20-Nov-85 18:10") (* Put text substance from card ID on the database file) (* * rht 9/13/85: Now doesn't try to write piece table at all if substance has zero length.) (* * fgh 11/13/85 Updated to handle NoteFile, Card objects.) (* * fgh 11/20/85 removed code to handle start and end pointers) (LET ((Substance (NC.FetchSubstance Card)) (Stream (fetch (NoteFile Stream) of (fetch (Card NoteFile) of Card)))) (COND ((NOT (ZEROP (fetch (TEXTOBJ TEXTLEN) of (TEXTOBJ Substance)))) (TEDIT.PUT.PCTB (TEXTOBJ Substance) Stream)))))) (NC.GetTextSubstance (LAMBDA (Card StartPtr EndPtr) (* fgh: "20-Nov-85 18:11") (* Get a text stream from the database file) (* * fgh 11/13/85 Updated to handle Card objects.) (* * fgh 11/20/85 NoteCards now passes down start and end pointer as args.) (LET ((TempStream (OPENSTREAM (QUOTE {NODIRCORE}) (QUOTE BOTH) (QUOTE NEW))) (Stream (fetch (NoteFile Stream) of (fetch (Card NoteFile) of Card))) StartFormatPtr TempFileEof TextStream) (* * Copy text stream to a NODIRCORE file) (COPYBYTES Stream TempStream StartPtr EndPtr) (* * fix up file absolute pinter to the beginning of the formatting nformation) (COND ((IGREATERP (SETQ TempFileEof (GETEOFPTR TempStream)) 2) (SETFILEPTR TempStream (IDIFFERENCE TempFileEof 2)) (COND ((EQUAL (IQUOTIENT (\WIN TempStream) 100) NC.TEditPasswordDividedBy100) (SETFILEPTR TempStream (IDIFFERENCE TempFileEof 8)) (SETQ StartFormatPtr (\DWIN TempStream)) (SETFILEPTR TempStream (IDIFFERENCE TempFileEof 8)) (\DWOUT TempStream (IDIFFERENCE StartFormatPtr StartPtr)))))) (* * return an open textstream on the temp file) (SETQ TextStream (OPENTEXTSTREAM TempStream NIL NIL NIL (NC.MakeTEditPropsList))) (STREAMPROP TextStream (QUOTE NoteCardObject) Card) TextStream))) (NC.TextCopySubstance (LAMBDA (Card FromStream ToStream FromStartPtr FromEndPtr) (* fgh: "20-Nov-85 18:14") (* * Copy a text substance from FromStream to ToStream.) (* * fgh 11/20/85 NoteCards now passes the Start and End pointers of the FromStream as args and properly sets the pointers on the ToStream) (COND ((IGREATERP (IDIFFERENCE FromEndPtr FromStartPtr) 2) (SETFILEPTR FromStream (IDIFFERENCE FromEndPtr 2)) (COND ((EQUAL (IQUOTIENT (\WIN FromStream) 100) NC.TEditPasswordDividedBy100) (COPYBYTES FromStream ToStream FromStartPtr (IDIFFERENCE FromEndPtr 8)) (\DWOUT ToStream (IPLUS (IDIFFERENCE (\DWIN FromStream) FromStartPtr) ToStartPtr)) (RPTQ 2 (\WOUT ToStream (\WIN FromStream)))) (T (COPYBYTES FromStream ToStream FromStartPtr FromEndPtr)))) (T (COPYBYTES FromStream ToStream FromStartPtr FromEndPtr))) T)) ) (* * Redefined from NCSKETCHCARD to implement the fact that NoteCards now handles the start and end pointers at the beginning of each substance's storage on the disk) (DEFINEQ (NC.GetSketchSubstance (LAMBDA (Card StartPtr EndPtr) (* fgh: "20-Nov-85 18:15") (* Get sketch substance from Database stream. Database stream is positioned. READ the global sketch description, the locasl sketch scale and region viewed. Also read in any cached bit maps for the MAPS system.) (* * fgh 11/14/85 Updated to handle Card and NoteFile objects.) (* * fgh 11/20/85 NoteCards now passes start and enptrs down.) (LET ((Stream (fetch (NoteFile Stream) of (fetch (Card NoteFile) of Card))) Sketch Scale RegionViewed) (* * Get the substance) (SETQ Sketch (HREAD Stream)) (SETQ Scale (READ Stream)) (SETQ RegionViewed (READ Stream)) (while (EQ (READ Stream) (QUOTE ###CACHEDMAP###)) do (NC.GetCachedMap Stream)) (LIST Sketch Scale RegionViewed)))) (NC.PutSketchSubstance (LAMBDA (Card) (* fgh: "20-Nov-85 18:16") (* Put the sketch substance for card ID to the database. Store the global sketch descriptor, the scale and region viewed for ID and any cached bit maps.) (* * fgh 11/14/85 Updated to handle Card object.) (* * fgh 11/20/85 NoteCards now takes care of setting the start and end pointers for the substance.) (LET ((Substance (NC.FetchSubstance Card)) (Window (NC.FetchWindow Card)) (Stream (fetch (NoteFile Stream) of (fetch (Card NoteFile) of Card))) SketchSpecs) (HPRINT Substance Stream NIL T) (PRINT (OR (AND Window (SCALE.FROM.SKW Window)) (NC.FetchScale Card)) Stream) (PRINT (OR (AND Window (SK.REGION.VIEWED Window)) (NC.FetchRegionViewed Card)) Stream) (COND ((AND Window (SETQ SketchSpecs (LOCALSPECS.FROM.VIEWER Window))) (MAPSKETCHSPECS SketchSpecs (FUNCTION NC.PutCachedMap) Stream))) (PRINT (QUOTE ###ENDSKETCH###) Stream)))) (NC.SketchCopySubstance (LAMBDA (Card FromStream ToStream FromStartPtr FromEndPtr) (* fgh: "20-Nov-85 18:18") (* * Copy a sketch substance from FromStream to ToStream.) (* * fgh 11/14/85 Updated to handle Card object.) (* * fgh 11/20/85 NoteCards now handles the start and end ptrs -- passing the from ptrs as args and properly setting the to ptrs.) (* * Copy the bytes) (COPYBYTES FromStream ToStream FromStartPtr FromEndPtr) T)) ) (* * Redefined from NCGRAPHCARD to implement the fact that NoteCards now handles the start and end pointers at the beginning of each substance's storage on the disk) (DEFINEQ (NC.GetGraphSubstance (LAMBDA (Card) (* fgh: "20-Nov-85 18:19") (* * fgh 11/14/85 Updated to handle Card object.) (* * fgh 11/20/85 NoteCards now passes start and end ptrs down.) (LET ((Stream (fetch (NoteFile Stream) of (fetch (Card NoteFile) of Card)))) (* * Read the Graph) (HREAD Stream)))) (NC.PutGraphSubstance (LAMBDA (Card) (* fgh: "20-Nov-85 18:20") (* Put Graph in card ID onto DatabaseStream) (* * fgh 11/14/85 Updated to handle Card object.) (* * fgh 11/20/85 NoteCards now takes care of setting the start and end pointers for the substance.) (LET ((Graph (NC.FetchSubstance Card)) (Stream (fetch (NoteFile Stream) of (fetch (Card NoteFile) of Card)))) (* Clean up BITMAPS in Graph data structure) (for GraphNode in (fetch GRAPHNODES of Graph) do (replace (GRAPHNODE NODELABELBITMAP) of GraphNode with NIL)) (* Write data stucture) (HPRINT Graph Stream)))) (NC.GraphCopySubstance (LAMBDA (Card FromStream ToStream FromStartPtr FromEndPtr) (* fgh: "20-Nov-85 18:21") (* * Copy a graph substance from FromStream to ToStream.) (* * fgh 11/14/85 Updated to handle Card object.) (* * fgh 11/20/85 NoteCards now handles the start and end ptrs -- passing the from ptrs as args and properly setting the to ptrs.) (* * Copy the bytes) (COPYBYTES FromStream ToStream FromStartPtr FromEndPtr) T)) ) (* * Redefined from NCLISTCARD to implement the fact that NoteCards now handles the start and end pointers at the beginning of each substance's storage on the disk) (DEFINEQ (NC.ListCardGetFn (LAMBDA (Card StartPtr EndPtr) (* fgh: "20-Nov-85 18:21") (* * Get the list substance from the disk) (* * fgh 11/20/85 NoteCards now passes start and end ptrs down.) (LET ((Stream (fetch (NoteFile Stream) of (fetch (Card NoteFile) of Card)))) (READ Stream)))) (NC.ListCardPutFn (LAMBDA (Card) (* fgh: "20-Nov-85 18:22") (* Put list substance) (* * fgh 11/20/85 NoteCards now takes care of setting the start and end pointers for the substance.) (LET ((Substance (NC.FetchSubstance Card)) (Stream (fetch (NoteFile Stream) of (fetch (Card NoteFile) of Card)))) (PRINT Substance Stream)))) (NC.ListCardCopyFn (LAMBDA (Card FromStream ToStream FromStartPtr FromEndPtr) (* fgh: "20-Nov-85 18:23") (* * Copy a list substance from FromStream to ToStream.) (* * Copy the bytes,) (* * fgh 11/20/85 NoteCards now handles the start and end ptrs -- passing the from ptrs as args and properly setting the to ptrs.) (COPYBYTES FromStream ToStream FromStartPtr FromEndPtr) T)) ) (PUTPROPS FGHPATCH002 COPYRIGHT ("Xerox Corporation" 1985)) (DECLARE: DONTCOPY (FILEMAP (NIL (1737 5341 (NC.PutTextSubstance 1747 . 2597) (NC.GetTextSubstance 2599 . 4247) ( NC.TextCopySubstance 4249 . 5339)) (5516 8323 (NC.GetSketchSubstance 5526 . 6518) ( NC.PutSketchSubstance 6520 . 7730) (NC.SketchCopySubstance 7732 . 8321)) (8497 10497 ( NC.GetGraphSubstance 8507 . 8939) (NC.PutGraphSubstance 8941 . 9906) (NC.GraphCopySubstance 9908 . 10495)) (10670 12085 (NC.ListCardGetFn 10680 . 11062) (NC.ListCardPutFn 11064 . 11565) ( NC.ListCardCopyFn 11567 . 12083))))) STOP