/* Copyright (c) 1979 Regents of the University of California */
* pi - Pascal interpreter code translator
* Charles Haley, Bill Joy UCB
* Version 1.2 November 1978
* pxp - Pascal execution profiler
* Version 1.2 November 1978
* Yymain initializes each of the utility
* clusters and then starts the processing
Perror(filename
, "No lines in file");
* Initialize the clusters
writef(2, "File not rewritten because of errors\n");
pexit(eflg
? ERRS
: AOK
);
if (creat(firstname
, 0644) != 1) {
while ((c
= read(fout
[0], &fout
[3], 512)) > 0) {
if (write(1, &fout
[3], c
) != c
) {
short buf
[PX_HEAD_BYTES
/ sizeof ( short )];
hf
= open("/usr/lib/px_header", 0);
if (hf
>= 0 && read(hf
, buf
, PX_HEAD_BYTES
) > sizeof header
) {
header
.txt_size
= ubuf
[1];
header
.data_size
= ubuf
[2];
header
.bss_size
= ubuf
[3];
header
.syms_size
= ubuf
[4];
header
.entry_point
= ubuf
[5];
header
.tr_size
= ubuf
[6];
header
.dr_size
= ubuf
[7];
for (i
= 0; i
< PX_HEAD_BYTES
/ sizeof ( short ); i
++)
if (header
.magic
!= 0407)
header
.data_size
= ( unsigned ) lc
- header
.txt_size
;
header
.data_size
=- sizeof header
;
write(ofil
, &header
, sizeof header
);
lseek(ofil
, ( long ) ( PX_HEAD_BYTES
- sizeof ( int ) ) , 0);
i
= ( ( unsigned ) lc
) - PX_HEAD_BYTES
;
write(ofil
, &i
, sizeof (int));
write(i
, cp
, strlen(cp
));