(DEFINE-FILE-INFO READTABLE "INTERLISP" PACKAGE "INTERLISP") (FILECREATED "15-Sep-87 11:26:06" |{MCS:MCS:STANFORD}<LANE>HASHBUFFER.;6| 6916 changes to%: (VARS HASHBUFFERCOMS) previous date%: " 3-Sep-87 17:06:23" |{MCS:MCS:STANFORD}<LANE>HASHBUFFER.;5|) (* " Copyright (c) 1985, 1986, 1987 by Stanford University. All rights reserved. ") (PRETTYCOMPRINT HASHBUFFERCOMS) (RPAQQ HASHBUFFERCOMS ((FNS CREATEHASHBUFFER OPENHASHBUFFER CLOSEHASHBUFFER GETHASHBUFFER PUTHASHBUFFER) (INITVARS (EMPTYHASHENTRYMARKER '**EMPTYHASHENTRY**)) (GLOBALVARS EMPTYHASHENTRYMARKER) (FNS HASHARRAY.TO.HASHFILE HASHFILE.TO.HASHARRAY) (DECLARE%: DONTCOPY (RECORDS HASHBUFFER)) (FILES HASH))) (DEFINEQ (CREATEHASHBUFFER [LAMBDA (FILE VALUETYPE ITEMLENGTH %#ENTRIES OVERFLOW HASHBITSFN EQUIVFN) (* cdl " 1-May-87 16:08") (DECLARE (GLOBALVARS HASHFILEDEFAULTSIZE)) (PROG [(HASHBUFFER (create HASHBUFFER HASHFILE ← (CREATEHASHFILE FILE VALUETYPE ITEMLENGTH %#ENTRIES) HASHARRAY ← (HASHARRAY (OR %#ENTRIES HASHFILEDEFAULTSIZE) OVERFLOW HASHBITSFN EQUIVFN] (replace (HASHBUFFER ACCESS) of HASHBUFFER with (GETFILEINFO (with HashFile (with HASHBUFFER HASHBUFFER HASHFILE) Stream) 'ACCESS)) (RETURN HASHBUFFER]) (OPENHASHBUFFER [LAMBDA (FILE ACCESS MINKEYS OVERFLOW HASHBITSFN EQUIVFN) (* cdl " 1-May-87 16:10") (PROG [(HASHBUFFER (create HASHBUFFER HASHFILE ← (OPENHASHFILE FILE ACCESS] (replace (HASHBUFFER HASHARRAY) of HASHBUFFER with (HASHARRAY (OR MINKEYS (with HashFile (with HASHBUFFER HASHBUFFER HASHFILE) %#Entries)) OVERFLOW HASHBITSFN EQUIVFN)) (replace (HASHBUFFER ACCESS) of HASHBUFFER with (GETFILEINFO (with HashFile (with HASHBUFFER HASHBUFFER HASHFILE) Stream) 'ACCESS)) (RETURN HASHBUFFER]) (CLOSEHASHBUFFER [LAMBDA (HASHBUFFER FILEONLY?) (* cdl " 1-May-87 16:21") (with HASHBUFFER HASHBUFFER (PROG1 (HASHFILEPROP HASHFILE 'NAME) (CLOSEHASHFILE HASHFILE) (if (NOT FILEONLY?) then (SETQ HASHARRAY NIL]) (GETHASHBUFFER [LAMBDA (KEY HASHBUFFER) (* cdl "24-Oct-85 08:37") (PROG (VALUE) (with HASHBUFFER HASHBUFFER (if (EQ EMPTYHASHENTRYMARKER (SETQ VALUE (GETHASH KEY HASHARRAY ))) then (RETURN) elseif VALUE then (RETURN VALUE) elseif (SETQ VALUE (GETHASHFILE KEY HASHFILE)) then (PUTHASH KEY VALUE HASHARRAY) (RETURN VALUE) else (PUTHASH KEY EMPTYHASHENTRYMARKER HASHARRAY]) (PUTHASHBUFFER [LAMBDA (KEY VALUE HASHBUFFER) (* cdl "24-Oct-85 08:26") (with HASHBUFFER HASHBUFFER (if (NEQ ACCESS 'INPUT) then (PUTHASHFILE KEY VALUE HASHFILE)) (PUTHASH KEY VALUE HASHARRAY]) ) (RPAQ? EMPTYHASHENTRYMARKER '**EMPTYHASHENTRY**) (DECLARE%: DOEVAL@COMPILE DONTCOPY (GLOBALVARS EMPTYHASHENTRYMARKER) ) (DEFINEQ (HASHARRAY.TO.HASHFILE [LAMBDA (HASHARRAY HASHFILE TESTFN) (* ; "Edited 3-Sep-87 17:05 by cdl") (DECLARE (SPECVARS HASHARRAY HASHFILE TESTFN)) (LET (REOPEN) (DECLARE (SPECVARS REOPEN)) [if (HASHFILEP HASHFILE) then (SETQ REOPEN T) else (SETQ HASHFILE (CREATEHASHFILE HASHFILE NIL NIL (HARRAYPROP HASHARRAY 'NUMKEYS] [RESETLST [RESETSAVE NIL `(CLOSEHASHFILE ,HASHFILE ,REOPEN] (MAPHASH HASHARRAY (FUNCTION (LAMBDA (VALUE KEY) (if (OR (NULL TESTFN) (APPLY* TESTFN KEY VALUE HASHARRAY HASHFILE)) then (PUTHASHFILE KEY VALUE HASHFILE] (if REOPEN then HASHFILE else (with HashFile HASHFILE File]) (HASHFILE.TO.HASHARRAY [LAMBDA (HASHFILE HASHARRAY TESTFN) (* ; "Edited 3-Sep-87 17:05 by cdl") (DECLARE (SPECVARS HASHFILE HASHARRAY TESTFN)) (LET (REOPEN) (DECLARE (SPECVARS REOPEN)) [if (HASHFILEP HASHFILE) then (SETQ REOPEN T) else (SETQ HASHFILE (OPENHASHFILE HASHFILE 'INPUT] [if (NULL HASHARRAY) then (SETQ HASHARRAY (with HashFile HASHFILE (HASHARRAY %#Entries] [RESETLST [RESETSAVE NIL `(CLOSEHASHFILE ,HASHFILE ,REOPEN] (MAPHASHFILE HASHFILE (FUNCTION (LAMBDA (KEY VALUE) (if (OR (NULL TESTFN) (APPLY* TESTFN KEY VALUE HASHFILE HASHARRAY )) then (PUTHASH KEY VALUE HASHARRAY] HASHARRAY]) ) (DECLARE%: DONTCOPY (DECLARE%: EVAL@COMPILE (RECORD HASHBUFFER (HASHARRAY HASHFILE ACCESS)) ) ) (FILESLOAD HASH) (PUTPROPS HASHBUFFER COPYRIGHT ("Stanford University" 1985 1986 1987)) (DECLARE%: DONTCOPY (FILEMAP (NIL (848 4618 (CREATEHASHBUFFER 858 . 1987) (OPENHASHBUFFER 1989 . 3081) (CLOSEHASHBUFFER 3083 . 3472) (GETHASHBUFFER 3474 . 4317) (PUTHASHBUFFER 4319 . 4616)) (4745 6703 ( HASHARRAY.TO.HASHFILE 4755 . 5690) (HASHFILE.TO.HASHARRAY 5692 . 6701))))) STOP