(DEFINE-FILE-INFO READTABLE "XCL" PACKAGE "INTERLISP")
(FILECREATED "18-Jun-87 10:15:07" 
{QV}<NOTECARDS>1.3K>NEXT>KIRKPATCH038.\;2 4404   

      |changes| |to:|  (FNS |NC.CardTypeStubLoader|)
                       (VARS KIRKPATCH038COMS)

      |previous| |date:| "18-Jun-87 10:09:41" 
{QV}<NOTECARDS>1.3K>NEXT>KIRKPATCH038.\;1)


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

(PRETTYCOMPRINT KIRKPATCH038COMS)

(RPAQQ KIRKPATCH038COMS ((* * |changes| |to| NCTYPESMECH 
                            |random| |access| |check| |to| 
                            |use| |stream| |instead| |of| 
                            |filename|)
                         (FNS |NC.CardTypeStubLoader|)))
(* * |changes| |to| NCTYPESMECH |random| |access| |check| 
|to| |use| |stream| |instead| |of| |filename|)

(DEFINEQ

(|NC.CardTypeStubLoader|
  (LAMBDA (|TypeName| |FileSuggestion|)
                             (* \; 
                          "Edited 18-Jun-87 10:14 by kirk:")
      
      (* * |Load| |card| |type| |TypeName| |using| 
      |FileSuggestion| |as| |the| |first| |place| 
      |to| |look.| |Otherwise| |look| |in| |the| 
      |directories| |specified| |by| 
      |NoteCardsDirectories.|)
      
      (* * |fgh| |2/3/86| |First| |written.|)
      
      (* * |kirk| |6/20/86| |Added| 
      |NCP.Add...CardStub| |fn| |load| |and| |call|)
      
      (* * |kirk| |9/9/86| |Changed| |the| |name| 
      |of| |the| FN |to| |search| |for| |to| 
      |NCAddStub...Card|)
      
      (* * |kirk| |9/21/86| |added| RESETLST)
      
      (* * |rg| 10/21/86\: |Changed| |to| |use| 
      |simpler| |scheme| |for| |finding| |files|)
      
      (* * |rht&rg| 11/7/86\: |Now| |passes|
      (QUOTE VARS) |arg| |to| LOADFNS |so| |that| 
      |interesting| |vars| |like| |link| |icon| 
      |bitmap| |will| |be| |loaded.|
      |There| |ought| |to| |be| \a |better| |way.|)
      
      (* * |rg| |5/18/87| |checks,| |via| 
      |disgusting| |kludge,| |to| |see| |if| |file| 
      |can| |be| |opened| |random| |access,| |if| 
      |not,| |loads| |whole| |file|)
      
      (* * |kirk| |6/18/87| |changed| |above| |to| 
      |use| |stream|)

    (LET*
     ((|FileName| (|NC.FindFile| |FileSuggestion| 
                         |TypeName| T))
      (|oldFILEDATES| (GETPROP |FileName| 'FILEDATES))
      |st|
      (|RandAccessible| (NLSETQ
                         (PROG1 (SETQ |st|
                                 (OPENSTREAM |FileName|
                                        'BOTH
                                        'OLD))
                                (CLOSEF |st|))))
      |NoInitFn| |AddTypeFn|)
     (|if| |FileName|
         |then|
         (RESETLST
          (RESETSAVE
           NIL
           `(COND
               (|oldFILEDATES| (PUTPROP \,
                                      (LIST 'QUOTE 
                                            |FileName|)
                                      'FILEDATES 
                                      |oldFILEDATES|))
               (T (REMPROP \, (LIST 'QUOTE |FileName|)
                         'FILEDATES))))
      
      (* * |Load| |and| |eval| |the| 
      |NC.Add...CardStub| |fn|)

          (SETQ |AddTypeFn| (PACK* '|NCAddStub.| |TypeName|
                                   '|Card|))
          (|if| |RandAccessible|
              |then| (SETQ |NoInitFn|
                      (EQ (CAAR (LOADFNS |AddTypeFn| 
                                       |FileName| NIL
                                       'VARS))
                          'NOT-FOUND\:))
            |else| (LOAD? |FileName| NC.LOADFLG)
                  (SETQ |NoInitFn| (NOT (FNTYP |AddTypeFn|)
                                        ))))
         (|NC.FixFileDates| |FileName|)
         (|if| |NoInitFn|
             |then| (|NC.ReportError| 
                           "NC.CardTypeStubLoader"
                           (CONCAT 
    "NoteCards: Can't find card type stub init procedure: " 
                                  |AddTypeFn| " in " 
                                  |FileName| "."))) 
      
      (* * |this| |should| |call| 
      |NC.AddCardTypeStub|)

         (APPLY |AddTypeFn|)))))
)
(PUTPROPS KIRKPATCH038 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE\: DONTCOPY
  (FILEMAP (NIL (833 4320 (|NC.CardTypeStubLoader| 843 . 4318)
))))
STOP