(FILECREATED "18-Mar-85 16:49:46" {ERIS}<LISP>INTERMEZZO>PATCHES>LFUNPACKPATCH.;3 2303   

      changes to:  (VARS LFUNPACKPATCHCOMS)

      previous date: "18-Mar-85 16:46:55" {ERIS}<LISP>INTERMEZZO>PATCHES>LFUNPACKPATCH.;2)


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

(PRETTYCOMPRINT LFUNPACKPATCHCOMS)

(RPAQQ LFUNPACKPATCHCOMS ((DECLARE: (IGNOREDECL . T))
			  (FNS \LFUnpackName)))
(DECLARE: 
(DECLARE: DOEVAL@COMPILE DONTEVAL@LOAD DONTCOPY 
(RESETSAVE COMPILEIGNOREDECL (QUOTE T))
)
)
(DEFINEQ

(\LFUnpackName
  [DLAMBDA ((name (ONEOF ATOM STRINGP))
            (RETURNS (ONEOF NIL ExpandedName)))
                                                             (* mjs "18-Mar-85 16:37")

          (* * Unpacks file name into a UNAME of the form ((VERSION . VOLNUM) . CHARLIST) where VERSION is the version 
	  indicator (either a positive integer or one of OLD, OLDEST, NEW) VOLNUM is the logical volume number, and the 
	  CHARLIST is a list of characters in the name. Returns NIL if the given name is not valid.)


    (DPROG ((PARSEDNAME (\LFParseFileName name) PARSEDFILENAME)
            VOL charList version)
         (OR PARSEDNAME (RETURN))
         (SETQ VOL (\LFFindDirectoryVol (fetch (PARSEDFILENAME VOL) of PARSEDNAME)))
         (OR VOL (RETURN))
         (SETQ charList (for char instring (fetch (PARSEDFILENAME NAME) of PARSEDNAME)
			   collect                           (* check for illegal chars)
				   (SETQ char (\LFCASEARRAYFETCH char))
				   (if [FMEMB char (LIST 0 (\LFCASEARRAYFETCH (CHARCODE *))
							 (\LFCASEARRAYFETCH (CHARCODE ?]
				       then (RETURN NIL))
				   char))
         (OR charList (RETURN))
         (SETQ version (fetch (PARSEDFILENAME VERSION) of PARSEDNAME))
         (SETQ version (OR (FIXP version)
			   (SELECTQ version
				    (H (QUOTE OLD))
				    (L (QUOTE OLDEST))
				    (N (QUOTE NEW))
				    NIL)))
         (RETURN (create ExpandedName
			 VOLNUM ←(\PFVolumeNumber VOL)
			 CHARLIST ← charList
			 VERSION ← version)))])
)
(PUTPROPS LFUNPACKPATCH COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (527 2219 (\LFUnpackName 537 . 2217)))))
STOP