home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
old
/
ckermit70
/
cklxtr.cm
< prev
next >
Wrap
Text File
|
1997-04-07
|
1KB
|
44 lines
&begin_parameters
SRC source:pathname,required
DST destination:pathname.pm,required
DBG switch(-debug),=0
&end_parameters
&if &DBG& &then &echo macro_lines input_lines command_lines
&attach_input
test_system_calls
s$create_file &DST& -organization fixed -record_size 4096
s$attach_port dest &DST& -no_hold_attach -no_hold_open
s$open dest -organization fixed -max_size 4096 -io_type output
create_buffer buffer -no_display
set_buffer_length 1000
&set buff_ndx 0
&set src_rec_cnt 0
&label read_loop
&set src_rec_cnt &src_rec_cnt& + 1
&set_string record (contents &SRC& &src_rec_cnt& -hold)
&if (command_status) ^= 0 &then &goto done
&if (end_of_file &SRC&) &then &goto done
&if (substr &$record& 1 1) = 'Z' &then &goto do_null
&set src_ndx 1
&label data_loop
set_buffer_longword (before (hexadecimal &buff_ndx&) 'x') &+
(substr &$record& &src_ndx& 8)
&set buff_ndx &buff_ndx& + 4
&set src_ndx &src_ndx& + 8
&if &src_ndx& <= 64 &then &goto data_loop
&goto rec_done
&label do_null
&set null_cnt 0(substr &$record& 2 2)x * 32
fill_buffer (before (hexadecimal &buff_ndx&) 'x') &+
(before (hexadecimal &null_cnt&) 'x') 0
&set buff_ndx &buff_ndx& + &null_cnt&
&label rec_done
&if &buff_ndx& < 4096 &then &goto read_loop
s$seq_write dest
&set buff_ndx 0
&goto read_loop
&label done
s$close dest
s$detach_port dest
quit