|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T p
Length: 3154 (0xc52) Types: TextFile Names: »pxtoch.BSD4_n.ch«
└─⟦060c9c824⟧ Bits:30007080 DKUUG TeX 2/12/89 └─⟦this⟧ »./tex82/Unsupported/MFpxl/mfware/pxtoch.BSD4_n.ch« └─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12 └─⟦beba6c409⟧ »unix3.0/Unsupported.tar.Z« └─⟦25c524ae4⟧ └─⟦this⟧ »Unsupported/MFpxl/mfware/pxtoch.BSD4_n.ch«
% Change file for pxtoch % History % 10/83 HWT Initial port % 11/22/83 RKF Updated to Version 1 of pxtoch % 3/6/87 PAM adjusted to match version 1.1 @x Only print changes \pageno=\contentspagenumber \advance\pageno by 1 @y \pageno=\contentspagenumber \advance\pageno by 1 \let\maybe=\iffalse @z @x @d banner=='This is PXtoCH, Version 1.1' {printed when the program starts} @y @d banner=='This is PXtoCH, Version 1.1 for Berkeley Unix' {printed when the program starts} @z @x @d print(#)==write(error_file,#) @d print_ln(#)==write_ln(error_file,#) @y @d error_file==output {here, errors go to the standard output} @d print(#)==write(error_file,#) @d print_ln(#)==write_ln(error_file,#) @z @x @p program PXtoCH(@!pxl_file,@!chr_file,error_file); @y @p program PXtoCH(@!output,@!pxl_file,@!chr_file); @z @x No error file for Unix @<Reset error file@>@/ @y @z @x @!pxl_file:packed file of 0..255; @y @!pxl_file:packed file of -128..127; @!pxl_fname,@!chr_fname:packed array [1..100] of char; @z @x @<Reset input...@>= reset(pxl_file); @y @<Reset input...@>= if argc < 3 then begin print_ln('Usage: pxtoch <pxl-file> <chr-file>'); halt; end; argv(1, pxl_fname); reset(pxl_file, pxl_fname); @z @x @ Additionally, an error file is provided which contains all error messages for each character. This file can be specified to be the terminal, in which case all the error messages will be displayed when the program is run. @<Glob...@>= @!error_file:text; @ @<Reset error file@>= rewrite(error_file); @y @ In this version, all error messages go to the standard output. The definition of |error_file| had to be made earlier because of the preceding definitions for |print| and |print_ln|. And since we don't have a separate |error_file| in the Unix implementation, we get rid of the definition resetting it, as well. @z @x @p function read_halfword: integer; var @!word1,@!word2:byte; begin@/ read(pxl_file,word1);@/ read(pxl_file,word2);@/ read_halfword:=word1*two_8+word2;@/ end; @ |Read_word| reads in four bytes from |pxl_file|. @p function read_word:integer; var i:integer; @!word1:byte; @!word2:integer; begin@/ word2:=0; for i := 1 to 4 do begin@/ read (pxl_file,word1);@/ word2 := word2*two_8 + word1; end; read_word:=word2; end; @ |Read_byte| reads in one byte from |pxl_file|. @p function read_byte:integer; var word1:integer; begin@/ read (pxl_file,word1);@/ read_byte:=word1; end; @y @p function read_byte: integer; forward; {don't disturb module numbering} @# function read_halfword: integer; var @!word1,@!word2:byte; begin@/ word1:=read_byte;@/ word2:=read_byte;@/ read_halfword:=word1*two_8+word2;@/ end; @ |Read_word| reads in four bytes from |pxl_file|. @p function read_word:integer; var i:integer; @!word2:integer; begin@/ word2:=0; for i := 1 to 4 do begin@/ word2 := word2*two_8 + read_byte; end; read_word:=word2; end; @ |Read_byte| reads in one byte from |pxl_file|. @p function read_byte; var word1:integer; begin@/ read (pxl_file,word1);@/ if word1<0 then word1:=word1+256; read_byte:=word1; end; @z @x rewrite (chr_file); @y argv(2,chr_fname); rewrite (chr_file,chr_fname); @z