Skip to content

Commit

Permalink
Rmk32 eol convention for input defaults to ANY, extend OPENSTREAM so …
Browse files Browse the repository at this point in the history
…that EOL can be specified as an "external format" (#1785)

* FILEIO: EOL for input defaults to ANY, EXT-FORMAT can specify EOL

As per technical meeting on 7/15/2024

* Revert "FILEIO: EOL for input defaults to ANY, EXT-FORMAT can specify EOL"

This reverts commit 6a7e8c3.

* FILEIO:  Fix comment

* Added DETECTEDEOLCONVENTION to STREAM declaration

and recompiled calls to macro \CHECKEOLC.

* COMAPARETEXT:  was trying to set EOL to ANY on a Tedit stream

* LCOMS needing to be recompiled for \CHECKEOLC macro and Create STREAM

(plus a new (unchanged) version of IOCHAR needed to get the cleanup to work for the recompile)

* EXTERNALFORMAT macro and function implement EOL detection

* FILEIO: stream records detected EOL, also RENAMEFILE uses COPYBYTES

UFS doesn't check file devices identity, doesn't give type-change message.  Recompiled for create stream

* ADIR has TRUEDEVICE

* Revert "FILEIO: stream records detected EOL, also RENAMEFILE uses COPYBYTES"

This reverts commit fa97aa6.

* Revert "EXTERNALFORMAT macro and function implement EOL detection"

This reverts commit eb09861.

* Revert "LCOMS needing to be recompiled for \CHECKEOLC macro and Create STREAM"

This reverts commit 5967452.

* Revert "Added DETECTEDEOLCONVENTION to STREAM declaration"

This reverts commit 196f105.

* Trying to complete the ANY/EOLC and binary RENAMEFILE issues

* loadup glitch
  • Loading branch information
rmkaplan authored Dec 25, 2024
1 parent 33a53e4 commit 5b37dd0
Show file tree
Hide file tree
Showing 8 changed files with 285 additions and 166 deletions.
Binary file modified lispusers/COMPARETEXT.LCOM
Binary file not shown.
20 changes: 10 additions & 10 deletions lispusers/comparetext
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)

(FILECREATED "14-Jan-2024 13:20:30" {WMEDLEY}<lispusers>COMPARETEXT.;133 48539
(FILECREATED "17-Dec-2024 20:47:21" {WMEDLEY}<lispusers>COMPARETEXT.;134 48583

:EDIT-BY rmk

:CHANGES-TO (FNS IMCOMPARE.COLLECT.HASH.CHUNKS)

:PREVIOUS-DATE "14-Jan-2024 13:11:44" {WMEDLEY}<lispusers>COMPARETEXT.;132)
:PREVIOUS-DATE "14-Jan-2024 13:20:30" {WMEDLEY}<lispusers>COMPARETEXT.;133)


(PRETTYCOMPRINT COMPARETEXTCOMS)
Expand Down Expand Up @@ -291,7 +291,8 @@
TITLE TEXTWIDTH TEXTHEIGHT])

(IMCOMPARE.COLLECT.HASH.CHUNKS
[LAMBDA (CHUNK HASH.TYPE) (* ; "Edited 14-Jan-2024 13:20 by rmk")
[LAMBDA (CHUNK HASH.TYPE) (* ; "Edited 17-Dec-2024 20:46 by rmk")
(* ; "Edited 14-Jan-2024 13:20 by rmk")
(* ; "Edited 18-Oct-2023 17:45 by rmk")
(* ; "Edited 20-Jan-2022 23:09 by rmk")
(* ; "Edited 24-Dec-2021 22:30 by rmk")
Expand All @@ -315,7 +316,6 @@
(OPENTEXTSTREAM STREAM NIL NIL NIL
`(OBJECTBYTE ,(CHARCODE *]
'(PROGN (CLOSEF? OLDVALUE])
(SETFILEINFO STREAM 'EOL 'ANY)
(CL:UNLESS (fetch (IMCOMPARE.CHUNK CHUNKLENGTH) of CHUNK)

(* ;;
Expand Down Expand Up @@ -780,12 +780,12 @@
GRAPHER)
)
(DECLARE%: DONTCOPY
(FILEMAP (NIL (1234 40907 (COMPARETEXT 1244 . 2884) (COMPARETEXT.WINDOW 2886 . 6684) (
(FILEMAP (NIL (1234 40951 (COMPARETEXT 1244 . 2884) (COMPARETEXT.WINDOW 2886 . 6684) (
COMPARETEXT.TSTREAM 6686 . 9907) (COMPARETEXT.SETSEL 9909 . 10814) (CHUNKNODELABEL 10816 . 11937) (
IMCOMPARE.BOXNODE 11939 . 12915) (IMCOMPARE.CHUNKS 12917 . 17525) (IMCOMPARE.COLLECT.HASH.CHUNKS 17527
. 20676) (IMCOMPARE.DISPLAYGRAPH 20678 . 28757) (IMCOMPARE.HASH 28759 . 33117) (
IMCOMPARE.MERGE.CONNECTED.CHUNKS 33119 . 36615) (IMCOMPARE.MERGE.UNCONNECTED.CHUNKS 36617 . 38572) (
IMCOMPARE.SHOW.DIST 38574 . 39020) (IMCOMPARE.UPDATE.SYMBOL.TABLE 39022 . 40905)) (40908 47392 (
IMCOMPARE.LEFTBUTTONFN 40918 . 43822) (IMCOMPARE.MIDDLEBUTTONFN 43824 . 46940) (IMCOMPARE.COPYBUTTONFN
46942 . 47390)) (47445 48136 (TAIL1 47455 . 47809) (TAIL2 47811 . 48134)))))
. 20720) (IMCOMPARE.DISPLAYGRAPH 20722 . 28801) (IMCOMPARE.HASH 28803 . 33161) (
IMCOMPARE.MERGE.CONNECTED.CHUNKS 33163 . 36659) (IMCOMPARE.MERGE.UNCONNECTED.CHUNKS 36661 . 38616) (
IMCOMPARE.SHOW.DIST 38618 . 39064) (IMCOMPARE.UPDATE.SYMBOL.TABLE 39066 . 40949)) (40952 47436 (
IMCOMPARE.LEFTBUTTONFN 40962 . 43866) (IMCOMPARE.MIDDLEBUTTONFN 43868 . 46984) (IMCOMPARE.COPYBUTTONFN
46986 . 47434)) (47489 48180 (TAIL1 47499 . 47853) (TAIL2 47855 . 48178)))))
STOP
104 changes: 72 additions & 32 deletions sources/ADIR
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)

(FILECREATED " 6-May-2024 15:54:01" {WMEDLEY}<sources>ADIR.;45 67756
(FILECREATED "25-Dec-2024 11:31:30" {MEDLEY}<sources>ADIR.;15 70102

:EDIT-BY rmk

:CHANGES-TO (FNS \UPF.DIRECTORY)
:CHANGES-TO (FNS TRUEDEVICE.STUB)

:PREVIOUS-DATE " 4-May-2024 16:25:09" {WMEDLEY}<sources>ADIR.;44)
:PREVIOUS-DATE "25-Dec-2024 07:35:38" {MEDLEY}<sources>ADIR.;13)


(PRETTYCOMPRINT ADIRCOMS)
Expand All @@ -16,10 +16,12 @@
(FNS DELFILE FULLNAME INFILE INFILEP IOFILE OPENFILE OPENSTREAM OUTFILE OUTFILEP
RENAMEFILE SIMPLE.FINDFILE VMEMSIZE \COPYSYS \FLUSHVM \LOGOUT0)
(CONSTANTS (MULTIPLE.STREAMS.PER.FILE.ALLOWED T))
(FNS TRUEDEVICE.STUB)
(P (MOVD? 'SIMPLE.FINDFILE 'FINDFILE NIL T)
(MOVD? 'EVQ 'TRUEFILENAME)
(MOVD? 'EVQ 'PSEUDOFILENAME)
(MOVD? 'NILL 'PSEUDOHOSTP))
(MOVD? 'NILL 'PSEUDOHOSTP)
(MOVD? 'TRUEDEVICE.STUB 'TRUEDEVICE))
(DECLARE%: DONTEVAL@LOAD DOCOPY (P

(* ;; "for the benefit of the call to PATHNAMEP in OPENSTREAM. PATHNAMEP (and pathnames) get defined much later in the loadup.")
Expand Down Expand Up @@ -197,7 +199,8 @@
(fetch (IFPAGE NActivePages) of \InterfacePage])

(\COPYSYS
[LAMBDA (FILE SYSNAME DONTSAVE) (* ; "Edited 14-Sep-2023 23:19 by rmk")
[LAMBDA (FILE SYSNAME DONTSAVE) (* ; "Edited 18-Dec-2024 13:21 by rmk")
(* ; "Edited 14-Sep-2023 23:19 by rmk")
(* ; "Edited 3-Jul-2023 19:21 by rmk")
(* ; "Edited 1-Jul-2023 12:34 by rmk")
(* ; "Edited 29-Jun-2023 11:41 by rmk")
Expand Down Expand Up @@ -241,8 +244,7 @@
(SETQ TEMPNAME (COPYFILE (COND
(LDEDEST (CONCAT "{DSK}" LDEDEST))
(T "{DSK}~/lisp.virtualmem"))
TARGETFILE
'((TYPE BINARY]
TARGETFILE]
(COND
((NULL VAL) (* ; "Continuing in the current image")
(CL:WHEN TARGETFILE (RENAMEFILE TEMPNAME TARGETFILE))
Expand Down Expand Up @@ -298,6 +300,14 @@

(CONSTANTS (MULTIPLE.STREAMS.PER.FILE.ALLOWED T))
)
(DEFINEQ

(TRUEDEVICE.STUB
[LAMBDA (X) (* ; "Edited 25-Dec-2024 11:31 by rmk")
(if (type? FDEV X)
then X
else (\GETDEVICEFROMNAME X NIL T])
)

(MOVD? 'SIMPLE.FINDFILE 'FINDFILE NIL T)

Expand All @@ -306,6 +316,8 @@
(MOVD? 'EVQ 'PSEUDOFILENAME)

(MOVD? 'NILL 'PSEUDOHOSTP)

(MOVD? 'TRUEDEVICE.STUB 'TRUEDEVICE)
(DECLARE%: DONTEVAL@LOAD DOCOPY


Expand All @@ -317,7 +329,8 @@
(DEFINEQ

(UNPACKFILENAME.STRING
[LAMBDA (FILE ONEFIELDFLG DIRFLG OSTYPE PACKFLG CLFLG) (* ; "Edited 4-May-2024 12:45 by rmk")
[LAMBDA (FILE ONEFIELDFLG DIRFLG OSTYPE PACKFLG CLFLG) (* ; "Edited 11-May-2024 21:23 by rmk")
(* ; "Edited 4-May-2024 12:45 by rmk")
(* ; "Edited 9-Mar-2024 10:23 by rmk")
(* ; "Edited 13-Nov-2023 20:28 by rmk")
(* ; "Edited 28-Apr-2022 11:40 by rmk")
Expand Down Expand Up @@ -467,29 +480,54 @@
THEN
(* ;; "DIRECTORY advances over initial duplicate brackets (but DIRSTART could be a subdirectory character instead)")

(CL:WHEN [AND (EQ DIRSTART (SUB1 $$OFFSET))
(FMEMB (\GETBASECHAR $$FATP $$BASE (SUB1 $$OFFSET
))
(CHARCODE (> / <]
(SETQ DIRSTART $$OFFSET))
(SETQ C (CHARCODE >))
(GO COERCE)
(IF (EQ DIRSTART (SUB1 $$OFFSET))
THEN (CL:WHEN (FMEMB (\GETBASECHAR $$FATP $$BASE
(SUB1 $$OFFSET))
(CHARCODE (> / <)))
(SETQ DIRSTART $$OFFSET))
ELSE
(* ;;
 "< in the middle: DIRTY flushes it, alternative is (\ILLEGAL.ARG FILE)")

(SETQ DIRDIRTY T))
ELSE (SETQ DIRSTART STARTPOS)

(* ;;
 "DIRSTART updates for duplicates, but NAME may want all the brackets")

(SETQ DIRBRKSTART STARTPOS))

(* ;; "Borrow DIREND code below if we don't want < after the last > to show up as the first character of the name.")

[SETQ NAMESTART (SETQ NAMEEND (SETQ EXTENSIONSTART (SETQ VERSIONSTART
NIL]))
((> /) (* ; "Preceding string is for sure a directory that maybe ends here (unless we're already in an extension")
(IF DIRSTART
THEN
(* ;;

(* ;; "> and / in the middle or end of a directory are essentially equivalent: the directory is dirty unless there is exactly one >. A sequence >//>/ reduces at output to a singleton >. It is also dirty if a single occurence is a slash--that is also canonicalized to a single >.")

(* ;; "It is not clear yet whether < in the middle should be treated in the same way, or whether that should cause an error.")

(IF (EQ DIRSTART (SUB1 $$OFFSET))
THEN (CL:WHEN (FMEMB (\GETBASECHAR $$FATP $$BASE (SUB1
$$OFFSET
))
(CHARCODE (> / <)))

(* ;;
 "Advance over initial duplicate brackets (but DIRSTART could be a subdirectory character)")

(CL:WHEN [AND (EQ DIRSTART (SUB1 $$OFFSET))
(FMEMB (\GETBASECHAR $$FATP $$BASE (SUB1 $$OFFSET))
(CHARCODE (> / <]
(SETQ DIRSTART $$OFFSET))
(SETQ DIRSTART $$OFFSET))
ELSEIF (OR (FMEMB (\GETBASECHAR $$FATP $$BASE (SUB1 $$OFFSET))
(CHARCODE (> /)))
(EQ C (CHARCODE /)))
THEN
(* ;; "Either extending a sequence, or a single slash.")

(SETQ DIRDIRTY T))
ELSE (SETQ DIRSTART STARTPOS)
(SETQ DIRBRKSTART STARTPOS))
(IF DIREND
Expand Down Expand Up @@ -662,7 +700,8 @@
(PUSH $$VAL F FVAL])

(\UPF.DIRECTORY
[LAMBDA (DIRSTART DIREND DIRDIRTY $$BASE $$FATP $$READONLY)(* ; "Edited 6-May-2024 15:53 by rmk")
[LAMBDA (DIRSTART DIREND DIRDIRTY $$BASE $$FATP $$READONLY)(* ; "Edited 11-May-2024 18:55 by rmk")
(* ; "Edited 6-May-2024 15:53 by rmk")
(* ; "Edited 4-May-2024 16:25 by rmk")
(* ; "Edited 8-Mar-2024 23:03 by rmk")
(* ; "Edited 28-Apr-2022 09:15 by rmk")
Expand Down Expand Up @@ -691,15 +730,15 @@
DO (ADD DESTPOS 1)
(SETQ C (\GETBASECHAR $$FATP $$BASE DIROFF))
(SELCHARQ C
((> /)
((> / <)
(\PUTBASECHAR $$FATP DESTBASE DESTPOS (CHARCODE >))

(* ;; "Advance past duplicates")

(FIND I FROM (ADD1 DIROFF) TO DIREND
WHILE (FMEMB (\GETBASECHAR $$FATP $$BASE I)
(CHARCODE (> /))) FINALLY (SETQ DIROFF
(SUB1 I))))
(CHARCODE (> / <))) FINALLY (SETQ DIROFF
(SUB1 I))))
(\PUTBASECHAR $$FATP DESTBASE DESTPOS C))
FINALLY (REPLACE (STRINGP LENGTH) OF DEST WITH DESTPOS)
(RETURN DEST))
Expand Down Expand Up @@ -1250,14 +1289,15 @@
(ADDTOVAR LAMA PACKFILENAME.STRING PACKFILENAME)
)
(DECLARE%: DONTCOPY
(FILEMAP (NIL (3112 15769 (DELFILE 3122 . 3283) (FULLNAME 3285 . 3652) (INFILE 3654 . 3913) (INFILEP
3915 . 4050) (IOFILE 4052 . 4303) (OPENFILE 4305 . 4608) (OPENSTREAM 4610 . 8950) (OUTFILE 8952 . 9214
) (OUTFILEP 9216 . 9352) (RENAMEFILE 9354 . 9660) (SIMPLE.FINDFILE 9662 . 10072) (VMEMSIZE 10074 .
10241) (\COPYSYS 10243 . 14488) (\FLUSHVM 14490 . 15562) (\LOGOUT0 15564 . 15767)) (16227 38951 (
UNPACKFILENAME.STRING 16237 . 36252) (\UPF.DIRECTORY 36254 . 38949)) (40479 42785 (UNPACKFILENAME
40489 . 40675) (LASTCHPOS 40677 . 41371) (FILENAMEFIELD 41373 . 41667) (FILENAMEFIELD.STRING 41669 .
42073) (PACKFILENAME 42075 . 42418) (PACKFILENAME.STRING 42420 . 42783)) (57255 58168 (
FILEDIRCASEARRAY 57265 . 58166)) (58335 65515 (LOGOUT 58345 . 59262) (MAKESYS 59264 . 60893) (SYSOUT
60895 . 62447) (SAVEVM 62449 . 63249) (HERALD 63251 . 63411) (INTERPRET.REM.CM 63413 . 65138) (
\USEREVENT 65140 . 65513)) (65697 67424 (USERNAME 65707 . 66663) (SETUSERNAME 66665 . 67422)))))
(FILEMAP (NIL (3201 15904 (DELFILE 3211 . 3372) (FULLNAME 3374 . 3741) (INFILE 3743 . 4002) (INFILEP
4004 . 4139) (IOFILE 4141 . 4392) (OPENFILE 4394 . 4697) (OPENSTREAM 4699 . 9039) (OUTFILE 9041 . 9303
) (OUTFILEP 9305 . 9441) (RENAMEFILE 9443 . 9749) (SIMPLE.FINDFILE 9751 . 10161) (VMEMSIZE 10163 .
10330) (\COPYSYS 10332 . 14623) (\FLUSHVM 14625 . 15697) (\LOGOUT0 15699 . 15902)) (16033 16269 (
TRUEDEVICE.STUB 16043 . 16267)) (16637 41297 (UNPACKFILENAME.STRING 16647 . 38483) (\UPF.DIRECTORY
38485 . 41295)) (42825 45131 (UNPACKFILENAME 42835 . 43021) (LASTCHPOS 43023 . 43717) (FILENAMEFIELD
43719 . 44013) (FILENAMEFIELD.STRING 44015 . 44419) (PACKFILENAME 44421 . 44764) (PACKFILENAME.STRING
44766 . 45129)) (59601 60514 (FILEDIRCASEARRAY 59611 . 60512)) (60681 67861 (LOGOUT 60691 . 61608) (
MAKESYS 61610 . 63239) (SYSOUT 63241 . 64793) (SAVEVM 64795 . 65595) (HERALD 65597 . 65757) (
INTERPRET.REM.CM 65759 . 67484) (\USEREVENT 67486 . 67859)) (68043 69770 (USERNAME 68053 . 69009) (
SETUSERNAME 69011 . 69768)))))
STOP
Binary file modified sources/ADIR.LCOM
Binary file not shown.
Loading

0 comments on commit 5b37dd0

Please sign in to comment.