|
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: 8354 (0x20a2) Types: TextFile Names: »pktogf.SYS_V.ch«
└─⟦060c9c824⟧ Bits:30007080 DKUUG TeX 2/12/89 └─⟦this⟧ »./tex82/Unsupported/MFpxl/mfware/pktogf.SYS_V.ch« └─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12 └─⟦beba6c409⟧ »unix3.0/Unsupported.tar.Z« └─⟦25c524ae4⟧ └─⟦this⟧ »Unsupported/MFpxl/mfware/pktogf.SYS_V.ch«
% Change file for the PKtoGF processor, for use on System V UNIX % History: % % First release at PKtoGF Version 0.0 January,1988 % % Changed version number for version 1.0 January 27, 1988 (P. MacKay) % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [0] WEAVE: print changes only %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x % System V version adapted from BSD version by P. MacKay % Hope it works, I can't test it. \pageno=\contentspagenumber \advance\pageno by 1 @y \pageno=\contentspagenumber \advance\pageno by 1 \let\maybe=\iffalse \def\title{PK\lowercase{to}GF changes for System V {\mc UNIX}} @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [2] Change banner string %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x @d banner=='This is PKtoGF, Version 1.0' @y @d banner=='This is PKtoGF, Version 1.0 for System V UNIX' @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [4] Add #include PKtoGF_ext.h to main %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x @p program PKtoGF(input, output); label @<Labels in the outer block@>@/ const @<Constants in the outer block@>@/ type @<Types in the outer block@>@/ var @<Globals in the outer block@>@/ procedure initialize; {this procedure gets things started properly} @y @p program PKtoGF(input, output); label @<Labels in the outer block@>@/ const @<Constants in the outer block@>@/ type @<Types in the outer block@>@/ var @<Globals in the outer block@>@/ @\@=#include "pktogf_ext.h"@>@\ procedure initialize; {this procedure gets things started properly} @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [6] change name_length to file_name_size, update to 256 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x @!name_length=80; {maximum length of a file name} @y @!file_name_size=256; {maximum length of a file name} @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [27] change byte_file, add UNIX_file_name, change word_file type %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x @!eight_bits=0..255; {packed file byte} @!byte_file=packed file of eight_bits ; {for packed file words} @y @!eight_bits=0..255; {packed file byte} @!UNIX_file_name=packed array [1..file_name_size] of char; @!byte_file=record@/ stdio_ptr: ^integer; {pointer for stdio FILE struct} loc_ptr: ^integer; {pointer to byte position ptr to keep in sync with file} file_name: UNIX_file_name; {file name saved by open routines} end; @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [29] redefine open_gf_file and open_pk_file; add filename generation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x @p procedure open_gf_file; {prepares to write packed bytes in a |gf_file|} begin rewrite(gf_file,gf_name); gf_loc := 0 ; end; @# procedure open_pk_file; {prepares the input for reading} begin reset(pk_file,pk_name); pk_loc := 0 ; end; @y @d NO_search_path=0 @p procedure open_gf_file; {prepares to write packed bytes in a |gf_file|} var i, j, k, name_len: integer; begin if argc < 3 then begin@/ j := file_name_size;@/ while (j > 1) and (pk_name[j] <> '/') do@/ decr(j); if (pk_name[j] = '/') then incr(j); { to avoid picking up the / } name_len := 1;@/ while (j < file_name_size) and (not (pk_name[j] = '.') or (pk_name[j] = ' ')) do begin @/ gf_name[name_len] := pk_name[j]; incr(name_len); incr(j); end; gf_name[name_len] := '.'; incr(name_len); incr(j);@/ while (j < file_name_size) and (not (pk_name[j] = 'p') or (pk_name[j] = ' ')) do begin @/ gf_name[name_len] := pk_name[j]; incr(name_len); incr(j); end; gf_name[name_len] := 'g'; incr(name_len);@/ gf_name[name_len] := 'f'; incr(name_len);@/ gf_name[name_len] := ' ';@/ print_ln('[Output file named ''', gf_name:name_len-1, ''']');@/ end; if not b_open_out(gf_file, gf_name) then begin@/ i:=1; while (i < file_name_size) and (gf_name[i] <> ' ') do@/ incr(i); abort('Error opening GF output file: ', gf_name:i); end; gf_loc := 0 ; end; @# procedure open_pk_file; {prepares the input for reading} var i: integer; begin if not b_open_in(pk_file, pk_name, NO_search_path) then begin@/ i:=1; while (i < file_name_size) and (pk_name[i] <> ' ') do@/ incr(i); abort('Unable to open PK input file: ', pk_name:i); end; b_set_ptr(pk_file, pk_loc);@/ pk_loc := 0 ; end; @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [30] redefine gf_name and pk_name types %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x @!gf_name,@!pk_name:packed array[1..name_length] of char; {names of input @y @!gf_name,@!pk_name:UNIX_file_name; {names of input @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [31] redefine gf_byte to use our routines. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x @p procedure gf_byte (i : integer) ; begin gf_file^ := i ; put(gf_file) ; incr(gf_loc) ; end; @y @d gf_byte(#)==begin b_write_byte(gf_file,#); incr(gf_loc) end @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [32] redefine pk_byte %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x @p function pk_byte : eight_bits ; var nybble, temp : eight_bits ; begin temp := pk_file^ ; get(pk_file) ; pk_loc := pk_loc + 1 ; pk_byte := temp ; end ; @y @d pk_byte==b_read_unsigned(pk_file) @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [33] reorder file opens so we have magnification available for % building output file name before we call open_gf_file %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %@x %open_pk_file ; %open_gf_file ; %pixel_integer(gf_id) %@y %open_pk_file ;@/ %@<Read preamble@>;@/ %open_gf_file ;@/ %pixel_integer(gf_id) %@z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [34] redefine get_16 and get_32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x @p function signed_byte : integer ; var a : integer ; begin a := pk_byte ; if a > 127 then a := a - 256 ; signed_byte := a ; end ; @# function get_16 : integer ; var a : integer ; begin a := pk_byte ; get_16 := a * 256 + pk_byte ; end ; @# function signed_16 : integer ; var a : integer ; begin a := signed_byte ; signed_16 := a * 256 + pk_byte ; end ; @# function get_32 : integer ; var a : integer ; begin a := get_16 ; if a > 32767 then a := a - 65536 ; get_32 := a * 65536 + get_16 ; end ; @y @d get_16==b_read_2_unsigned(pk_file) @d get_32==b_read_4_signed(pk_file) @p function signed_byte : integer ; var a : integer ; begin a := b_read_unsigned(pk_file); if a > 127 then a := a - 256 ; signed_byte := a ; end ; @# function signed_16 : integer ; var a : integer ; begin a := signed_byte ; signed_16 := a * 256 + pk_byte ; end ; @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [58] recode dialog to decode command line arguments %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x @ @p procedure dialog ; var i : integer ; {index variable} buffer : packed array [1..name_length] of char; {input buffer} begin for i := 1 to name_length do begin gf_name[i] := ' ' ; pk_name[i] := ' ' ; end; print('Input file name: ') ; flush_buffer ; get_line(pk_name) ; print('Output file name: ') ; flush_buffer ; get_line(gf_name) ; end ; @y @ @p procedure dialog ; var i : integer ; {index variable} begin for i := 1 to file_name_size do begin gf_name[i] := ' ' ; pk_name[i] := ' ' ; end; if (argc < 2) or (argc > 3) then abort('Usage: PKtoGF PK-file [GF-file]'); argv(2, pk_name);@/ if (argc > 2) then argv(3, gf_name);@/ end ; @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [59] change eof() to b_eof() %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x while not eof(pk_file) do i := pk_byte ; @y while not b_eof(pk_file) do i := pk_byte ; @z