* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)yymain.c 5.2 (Berkeley) %G%";
* 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 (freopen(stdoutn
, "r", stdin
) == NULL
) {
if (freopen(firstname
, "w", stdout
) == NULL
) {
while ((c
= getchar()) > 0)
* this is the size of /usr/lib/npxheader
short buf
[HEAD_BYTES
/ sizeof ( short )];
hf
= open("/usr/lib/npx_header", 0);
if (hf
>= 0 && read(hf
, buf
, 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
< 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 ) ( HEAD_BYTES
- sizeof ( short ) ) , 0);
i
= ( ( unsigned ) lc
) - HEAD_BYTES
;
write(i
, cp
, strlen(cp
));