(FILECREATED " 7-Dec-85 19:24:08" {QV}<NOTECARDS>1.3K>RHTPATCH012.;3 4246   

      changes to:  (MACROS NC.AutoloadApply*)
		   (VARS RHTPATCH012COMS)
		   (RECORDS AutoloadFnEntry)
		   (FNS NC.LookupAutoloadFnFile NC.StoreAutoloadFnFile NC.LoadFileFromDirectories)

      previous date: " 6-Dec-85 18:51:39" {QV}<NOTECARDS>1.3K>RHTPATCH012.;2)


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

(PRETTYCOMPRINT RHTPATCH012COMS)

(RPAQQ RHTPATCH012COMS ((* * Auto loader modifications. This stuff should replace the stuff in 
			     NCUTILITIES under the header "* * Auto loader" %.)
			  (RECORDS AutoloadFnEntry)
			  (GLOBALVARS NC.AutoloadableFnsTable NC.AutoloadFnTableSize)
			  (VARS (NC.AutoloadFnTableSize 200)
				(NC.AutoloadableFnsTable (HASHARRAY NC.AutoloadFnTableSize)))
			  (FNS NC.LookupAutoloadFnFile NC.StoreAutoloadFnFile 
			       NC.LoadFileFromDirectories)
			  (MACROS NC.AutoloadApply*)
			  (P (NC.StoreAutoloadFnFile (FUNCTION NC.ConvertNoteFileVersion2To3)
						     (QUOTE NCCONVERTVERSION2TO3)
						     (QUOTE NOTECARDSDIRECTORIES)))))
(* * Auto loader modifications. This stuff should replace the stuff in NCUTILITIES under the 
header "* * Auto loader" %.)

[DECLARE: EVAL@COMPILE 

(DATATYPE AutoloadFnEntry (FileName Directories))
]
(/DECLAREDATATYPE (QUOTE AutoloadFnEntry)
		  (QUOTE (POINTER POINTER))
		  (QUOTE ((AutoloadFnEntry 0 POINTER)
			  (AutoloadFnEntry 2 POINTER)))
		  (QUOTE 4))
(DECLARE: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS NC.AutoloadableFnsTable NC.AutoloadFnTableSize)
)

(RPAQQ NC.AutoloadFnTableSize 200)

(RPAQ NC.AutoloadableFnsTable (HASHARRAY NC.AutoloadFnTableSize))
(DEFINEQ

(NC.LookupAutoloadFnFile
  (LAMBDA (AutoloadFn)                                       (* rht: " 6-Dec-85 12:53")

          (* * Fetch the entry associated with given function from the autoload table.)


    (GETHASH AutoloadFn NC.AutoloadableFnsTable)))

(NC.StoreAutoloadFnFile
  (LAMBDA (AutoloadFn FileName Directories)                  (* rht: " 6-Dec-85 12:54")

          (* * Store an entry in the autoload table for given AutoloadFn. It consists of FileName and Directories variable or
	  list or NIL.)


    (PUTHASH AutoloadFn (create AutoloadFnEntry
				    FileName ← FileName
				    Directories ← Directories)
	       NC.AutoloadableFnsTable)))

(NC.LoadFileFromDirectories
  (LAMBDA (FileName Directories)                             (* rht: " 6-Dec-85 13:04")

          (* * Try to load FileName from Directories. The latter can be a list in which case the elements should be directory
	  paths. It can be an atom in which case it should be a DIRECTORIES var. Or it can be NIL in which case it defaults 
	  to the litatom NOTECARDSDIRECTORIES.)


    (OR Directories (SETQ Directories (QUOTE NOTECARDSDIRECTORIES)))
    (APPLY* (QUOTE FILESLOAD)
	      (LIST (QUOTE FROM)
		      Directories)
	      FileName)))
)
(DECLARE: EVAL@COMPILE 
(DEFMACRO NC.AutoloadApply* Args (* * First arg is name of function to apply. Rest are args. The fn 
				    name should be in the global table with an accompanying file to 
				    autoload from.)
	  (LET ((Fn (CAR Args)))
	       (BQUOTE (if (GETD , Fn)
			   then
			   (APPLY* , Fn ,@ (CDR Args))
			   else
			   (LET ((AutoloadFnEntry (NC.LookupAutoloadFnFile , Fn))
				 FileName)
				(if AutoloadFnEntry then (NC.LoadFileFromDirectories
				      (SETQ FileName (fetch (AutoloadFnEntry FileName)
							    of AutoloadFnEntry))
				      (fetch (AutoloadFnEntry Directories)
					     of AutoloadFnEntry))
				    (if (GETD , Fn)
					then
					(APPLY* , Fn ,@ (CDR Args))
					else
					(NC.ReportError "NC.AutoloadApply*"
							(CONCAT "Loaded file " FileName 
								", but still no definition of "
								, Fn)))
				    else
				    (NC.ReportError "NC.AutoloadApply*" (CONCAT "No definition of " , 
										Fn 
							   " in table of autoloadable functions.")))))
		       )))
)
(NC.StoreAutoloadFnFile (FUNCTION NC.ConvertNoteFileVersion2To3)
			(QUOTE NCCONVERTVERSION2TO3)
			(QUOTE NOTECARDSDIRECTORIES))
(PUTPROPS RHTPATCH012 COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1682 3011 (NC.LookupAutoloadFnFile 1692 . 1962) (NC.StoreAutoloadFnFile 1964 . 2391) (
NC.LoadFileFromDirectories 2393 . 3009)))))
STOP