(FILECREATED " 8-May-87 12:43:07" {QV}<NOTECARDS>1.3K>NEXT>RGPATCH038.;1 2478   

      changes to:  (VARS RGPATCH038COMS)
		   (FNS NC.DelFromLink))


(* Copyright (c) 1987 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT RGPATCH038COMS)

(RPAQQ RGPATCH038COMS ((* * rg 5/8/87 check for active card should have been check for links cached 
			    ; fixed)
			 (* * changes to NCLINKS)
			 (FNS NC.DelFromLink)))
(* * rg 5/8/87 check for active card should have been check for links cached ; fixed)

(* * changes to NCLINKS)

(DEFINEQ

(NC.DelFromLink
  [LAMBDA (Link NoOrphanHookFlg)                             (* Randy.Gobbel " 8-May-87 12:42")

          (* * Delete a FromLink from its destination card Hook card to orphan if this is the last link.)



          (* * rht 11/15/84: Changed decision as to when to orphanize a card. Now must have deleted its last link 
	  (not just last subbox or filedcard link). Also checks that link doesn't point from card to itself.)



          (* * rht 12/1/84: Now doesn't do any work unless ID is valid, i.e. not DELETED or FREE.)



          (* * kirk: 13Nov85: deleted of use of DatabaseStream and changed to call CachedDelFromLink.)



          (* * kirk 29Jan86 Changed to a direct recursive call eliminating CachedDelFromLink. Added NC.FileInOrphanBox.)



          (* * rht 2/14/86: Now calls NC.UncacheLinks instead of two calls to NC.SetToLinks and NC.SetFromLinks.)



          (* * kef 7/30/86: Modified so that it only puts the FROMLINKS in the case of an inactiveP card.)



          (* * rg 5/8/87 check for active card should have been check for links cached ; fixed)


    (LET ((DestinationCard (fetch (Link DestinationCard) of Link)))
         (COND
	   ((NC.ValidCardP DestinationCard)
	     (COND
	       ((NC.LinksCachedP DestinationCard)
		 (NC.CachedDelFromLink Link DestinationCard)
		 (OR NoOrphanHookFlg (NC.FileInOrphanBox Link DestinationCard)))
	       (T (WITH.MONITOR (NC.FetchMonitor (fetch (Card NoteFile) of DestinationCard))
				(NC.GetLinks DestinationCard)
				(NC.CachedDelFromLink Link DestinationCard)
				(NC.PutFromLinks DestinationCard)
				(OR NoOrphanHookFlg (NC.FileInOrphanBox Link DestinationCard))
				(NC.UncacheLinks DestinationCard))
		  Link])
)
(PUTPROPS RGPATCH038 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (558 2397 (NC.DelFromLink 568 . 2395)))))
STOP