(FILECREATED "15-May-87 16:33:24" {QV}<NOTECARDS>1.3K>NEXT>RGPATCH040.;1 4887   

      changes to:  (VARS RGPATCH040COMS)
		   (FNS NC.SetUpNOTECARDSDIRECTORIES NC.FindFile))


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

(PRETTYCOMPRINT RGPATCH040COMS)

(RPAQQ RGPATCH040COMS ((* * rg 5/15/87 set up NOTECARDSNEXTDIRECTORIES automatically)
			 (* * changes to NOTECARDS)
			 (FNS NC.FindFile NC.SetUpNOTECARDSDIRECTORIES)
			 (* * remove INITVARS of NOTECARDSNEXTDIRECTORIES from coms)))
(* * rg 5/15/87 set up NOTECARDSNEXTDIRECTORIES automatically)

(* * changes to NOTECARDS)

(DEFINEQ

(NC.FindFile
  [LAMBDA (FileName TypeName CheckConnectedDirFlg SourceFlg)
                                                             (* Randy.Gobbel "15-May-87 16:06")

          (* * kirk 6/12/86 find code file to implement a card type)



          (* * kirk 9/21/86 added optional FileName parameter)



          (* * rht&rg&pmi 10/21/86: Removed lots of useless kruft and replaced with other FINDFILE kruft.
	  Added CheckConnectedDirFlg arg.)



          (* * kirk 12/23/86 replaced use of DCOM with COMPILE.EXT)



          (* * RG 5/15/87 now return NIL if final FINDFILE fails)


    (DECLARE (GLOBALVARS NOTECARDSDIRECTORIES))
    (LET ((FilesLoadDirs (if CheckConnectedDirFlg
			     then (CONS (DIRECTORYNAME T T)
					    NOTECARDSDIRECTORIES)
			   else NOTECARDSDIRECTORIES)))
         [OR FileName (SETQ FileName (PACK* (QUOTE NC)
						  (U-CASE TypeName)
						  (QUOTE CARD]
         (if (AND (NULL (FILENAMEFIELD FileName (QUOTE EXTENSION)))
		      (FINDFILE (PACKFILENAME (QUOTE BODY)
						  FileName
						  (QUOTE EXTENSION)
						  (if SourceFlg
						      then ""
						    else COMPILE.EXT))
				  T FilesLoadDirs))
	   else (FINDFILE FileName T FilesLoadDirs])

(NC.SetUpNOTECARDSDIRECTORIES
  [LAMBDA (BaseDirectory ReleaseIdentifier)                  (* Randy.Gobbel "14-May-87 12:39")

          (* * Set up the NoteCards directories globalvars)



          (* * fgh 8/5/86 Now adds NC.ThisDirectory onto the beginning of the directory list retruned.)



          (* * rg 4/24/87 adds next>lib> into dir list if notecards was loaded from >next)



          (* * rg 5/14/87 now sets NOTECARDSNEXTDIRECTORIES)


    (LET (NoteCardsBaseDirectory StrPtr LibNextDirectory)

          (* * Get the directory for the file now being loaded)


         [COND
	   ((SETQ NoteCardsBaseDirectory BaseDirectory))
	   (T (SETQ NC.ThisDirectory (PACK* (QUOTE {)
						(FILENAMEFIELD (FULLNAME (INPUT))
								 (QUOTE HOST))
						(QUOTE })
						(QUOTE <)
						(FILENAMEFIELD (FULLNAME (INPUT))
								 (QUOTE DIRECTORY))
						(QUOTE >)))

          (* * Find the directory path up to the first subdirectory called NoteCards)


	      (COND
		((SETQ StrPtr (STRPOS "NOTECARDS>" (U-CASE NC.ThisDirectory)
					  NIL NIL NIL T))
		  (SETQ NoteCardsBaseDirectory (SUBATOM NC.ThisDirectory 1 (SUB1 StrPtr]
         (SETQ NOTECARDSNEXTDIRECTORIES (PACK* NoteCardsBaseDirectory (OR ReleaseIdentifier 
									     NC.ReleaseIdentifier)
						   ">NEXT>"))
         (SETQ LibNextDirectory (COND
	     ((STRPOS ">NEXT>" NC.ThisDirectory)
	       (PACK* NoteCardsBaseDirectory (OR ReleaseIdentifier NC.ReleaseIdentifier)
			">NEXT>LIBRARY>"))
	     (T NIL)))

          (* * Create the directory search list based on the NoteCardsBaseDirectory)


         (COND
	   [NoteCardsBaseDirectory (COND
				     [LibNextDirectory (UNION (LIST NC.ThisDirectory)
								(LIST (PACK* 
									   NoteCardsBaseDirectory
										 (OR 
										ReleaseIdentifier 
									     NC.ReleaseIdentifier)
										 ">")
									LibNextDirectory
									(PACK* 
									   NoteCardsBaseDirectory
										 (OR 
										ReleaseIdentifier 
									     NC.ReleaseIdentifier)
										 ">" "LIBRARY>")
									NoteCardsBaseDirectory
									(PACK* 
									   NoteCardsBaseDirectory 
										 "LIBRARY>"]
				     (T (UNION (LIST NC.ThisDirectory)
						 (LIST (PACK* NoteCardsBaseDirectory
								  (OR ReleaseIdentifier 
									NC.ReleaseIdentifier)
								  ">")
							 (PACK* NoteCardsBaseDirectory
								  (OR ReleaseIdentifier 
									NC.ReleaseIdentifier)
								  ">" "LIBRARY>")
							 NoteCardsBaseDirectory
							 (PACK* NoteCardsBaseDirectory "LIBRARY>"]
	   (T (LIST NC.ThisDirectory])
)
(* * remove INITVARS of NOTECARDSNEXTDIRECTORIES from coms)

(PUTPROPS RGPATCH040 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (624 4740 (NC.FindFile 634 . 1968) (NC.SetUpNOTECARDSDIRECTORIES 1970 . 4738)))))
STOP