From 834640633d94c1df43bf81fdda31894351f7ae6d Mon Sep 17 00:00:00 2001 From: "Jeffrey H. Johnson" Date: Fri, 9 Apr 2021 05:01:31 -0400 Subject: [PATCH] Add 3rdparty/defin: DEFIN 11/2/85 by Steve Willett --- 3rdparty/defin/defin.com | Bin 0 -> 10112 bytes 3rdparty/defin/defin.doc | 43 +++++++++++ 3rdparty/defin/defin.pas | 160 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 203 insertions(+) create mode 100644 3rdparty/defin/defin.com create mode 100644 3rdparty/defin/defin.doc create mode 100644 3rdparty/defin/defin.pas diff --git a/3rdparty/defin/defin.com b/3rdparty/defin/defin.com new file mode 100644 index 0000000000000000000000000000000000000000..4acf79b8521abcc7b32ea75c471f62aa03003a3f GIT binary patch literal 10112 zcma)i3wRUPndlk4EXgm)HulKoF{6Pn$hIt8FtTgQJPafuU>2Na+Z2csjB#r$W1Cn8 zOBk9iNz-jfvUHp6V{?;kZkBE_*=-`4bW~3ps>uG6e*}0kie=;zX)O`VmViJ_)DWJal*u~gldym(UA7eoeic8Dgw((v+jVb$ zS2uo;{!nEsZY~>d28JWAHajy=901 z%ToFxK1YqZ-lXV10g=kSK;bGK`z!@e*DKW9^K}Xk3);}HDSAR{oS^7;r)u6sVcrHL zgO%?hHb%(Os4$Sa!C!$9-wiVKIzM_sP90Vy@ZGg&ro<)1pt_kCBgoLTDF|mPFsmCu;TOMhmBiNswLa!feiLV-#d^@aINU$oMT*y{_N)rfsw zZ+`}X6O$*|*Yx&Nh{}TIpue^99CE&moad1*R2fHL42bfI82?X0YLz!H^*5fJ^)OV!m;&cl=F_^8LH3)dm&?lL9mV)N1|~mM&*!FGd}hkc zXP7c^z(CtfX1v2toN_a!d|kj53UgVhx)_8nD2&AIf{ny$@vkN35AoZFZ?T$h+n19b&K;f z0`ofGM3sL;;0Ot^e`1^$P{Mf@O{lKZ1Q}40_x~PRTO0}H!o%~DCj}Tto&>lgZ0Ekl zjgZGCZk-~?N}{;Ygev@Z+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mode 100644 index 0000000..017e207 --- /dev/null +++ b/3rdparty/defin/defin.doc @@ -0,0 +1,43 @@ +DEFIN.DOC + +This is the description of the DEFIN.COM program which was +written by Steve Willett. + +This is a filter program which takes an input file and copies +it to an output file with the following modifications: + + 1. All seventh bits are first set low. + + 2. After that all characters which are neither printable + nor a carriage return or a line feed are replaced + with a "~" (tilde). + +This file treats the input file as an untyped (non text) file +and therefore ignores the ^Z (end of file) marker in CPM text +files. Therefore it will automatically undo the FIN stop which +is in a Perfect Writer FIN file. In addition it will probably +stick some garbage at the end of the file which was beyond the +^Z in the last record it reads. + +To use it just type DEFIN. The program prompts you for an input +file name and an output file name. It will display on the screen +the contents of the output file as it writes it. After DEFIN is +done, you can use Perfect Writer to edit your new output file. + +The new output file will probably have lots fo tildes in it! They +represent all the control characters and other special characters +which were inserted in the file by Perfect Formatter. In addition +there will be odd characters imbedded in the tildes - most printers +use printable characters with non-printable characters for their +commands. + +You can now use Perfect Writer's Search and Replace functions to +clean up your file. Try going through it and replacing all "~~"'s +with "~". This will shorten all those long strings of tildes. You +will have to recreate all the style and environment commands you had +in the original document, however, since these were converted by +Perfect Formatter into printer commands. + +Good luck! +Steve Willett + diff --git a/3rdparty/defin/defin.pas b/3rdparty/defin/defin.pas new file mode 100644 index 0000000..0f2a1d2 --- /dev/null +++ b/3rdparty/defin/defin.pas @@ -0,0 +1,160 @@ +program defin; +{a program to help recover a Perfect Writer .FIN file.} +{It converts all non-printable characters into "~"s} +{11/2/85 by Steve Willett} + +const + CR = 13; + LF = 10; + +type + string15 = string[15]; + string3 = string[3]; + filemode = (RD, WRT); + rawfile = file; + bytebuffer = array[0..127] of byte; + + +const + Overwrite : boolean = false; + Abort : boolean = false; + +var + InFile, OutFile : rawfile; + Count, ch : byte; + Buffer : bytebuffer; + +function Yes : boolean; +{to get a response to a yes/no question from the keyboard} + const Prompted : boolean = false; + var Answer : char; + begin + repeat + read(Kbd, Answer); + Answer := upcase(Answer); + if not (Answer in ['Y','N']) then begin + write(chr(7)); + if not Prompted then begin + Prompted := true; + write(' -enter "Y" or "N", please-'); + end; {if not Prompted} + end; {if not Y/N} + until (Answer in ['Y','N']); + writeln(Answer); + Yes := (Answer='Y'); + end; {Yes} + + +function FileOpen(var FL : rawfile; FN : string15; MD : filemode; OW : boolean) : boolean; +{to assign, open and test a file} + var Failed : boolean; + ErrorNumber : byte; + begin + assign(FL, FN); +{$I-} reset(FL); {$I+} + case MD of + WRT : begin + ErrorNumber := IOResult; + Failed := (ErrorNumber=0); + if OW then Failed := false; + if Failed then begin + writeln(FN,' already exists - overwrite?'); + Failed := not Yes; + end; {if Failed} + if not Failed then rewrite(FL); + end; {WRT case} + RD : begin + ErrorNumber := IOResult; + Failed := (ErrorNumber<>0); + if Failed then writeln('Cannot open input file ',FN,' I/O error #',ErrorNumber); + end; {RD case - if IOresult<>0} + end; {case MD} + FileOpen := not Failed; + end; {FileOpen} + + +procedure Initialize; +{to initialize variables and query for defaults} + + var InFileName, Name, OutFileName : string15; + Ext : string3; + ch : char; + Count, Count1 : integer; + + + + function Control(ch : char) : string3; + {to convert a char for writing to the screen} + begin + if ch<' ' then Control := '^'+chr(ord(ch)+64) else Control := ch; + end; + + + + function GetName(var NM : string15; EX : string3) : string15; + {to return a CPM filename with or without default extension EX} + var + Extent : boolean; + Count, Dot : integer; + Temp : string15; + + begin + writeln('Please enter a CP/M standard filename. "',NM,'" is the default'); + writeln('Type ".',EX,'" is assumed if not given explicitly'); + readln(Temp); + Dot := 0; + Count := 0; + while Count0 then begin + NM := copy(Temp, 1, Dot-1); + EX := copy(Temp, Dot+1, length(Temp)-Dot); + end {if Dot<>0} + else if Count<>0 then NM := Temp; + GetName := NM + '.' + EX; + end; {GetName} + + begin {Initialize} + + for Count := 1 to 20 do writeln(' '); + writeln('DEFIN - the file to help remove non-printable characters from'); + writeln('a Perfect Write .FIN file. Copyright 11/3/85 by Steve Willett'); + writeln('written in Turbo Pascal ver. 2.0 - copyright Borland International'); + writeln(''); + + Name := 'STRIP'; + writeln('File name of input file?'); + InFileName := GetName(Name, 'FIN'); + writeln('File name of output file?'); + OutFileName := GetName(Name, 'MSS'); + + Abort := not FileOpen(InFile, InFileName, RD, Overwrite); + if not Abort then + Abort := not FileOpen(OutFile, OutFileName, WRT, Overwrite); + + end; {Initialize} + + + +begin {defin} + Initialize; + if Abort then writeln('Aborting') else begin + while not eof(InFile) do begin + blockread(InFile, Buffer, 1); + for Count := 0 to 127 do begin + ch := Buffer[Count] and 127; + if not (ch in [CR, LF, 32..126]) then ch := 126; + write(chr(ch)); + Buffer[Count] := ch; + end; {forCount} + if eof(InFile) then Buffer[127] := 26; + blockwrite(OutFile, Buffer, 1); + end; {while not eof} + close(InFile); + close(OutFile); + end; +end. +