/* Copyright (c) 1979 Regents of the University of California */
static char sccsid
[] = "@(#)yymain.c 1.1 8/27/80";
* 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
[HEADER_BYTES
/ sizeof ( short )];
if (hf
>= 0 && read(hf
, buf
, HEADER_BYTES
) > sizeof(struct exec
)) {
magichdr
.a_magic
= ubuf
[0];
magichdr
.a_text
= ubuf
[1];
magichdr
.a_data
= ubuf
[2];
magichdr
.a_bss
= ubuf
[3];
magichdr
.a_syms
= ubuf
[4];
magichdr
.a_entry
= ubuf
[5];
magichdr
.a_trsize
= ubuf
[6];
magichdr
.a_drsize
= ubuf
[7];
for (i
= 0; i
< HEADER_BYTES
/ sizeof ( short ); i
++)
if (magichdr
.a_magic
!= 0407)
magichdr
.a_data
= ( unsigned ) lc
- magichdr
.a_text
;
magichdr
.a_data
-= sizeof (struct exec
);
write(ofil
, &magichdr
, sizeof(struct exec
));
pxhd
.objsize
= ( ( unsigned ) lc
) - HEADER_BYTES
;
pxhd
.magicnum
= MAGICNUM
;
lseek(ofil
, ( long ) ( HEADER_BYTES
- sizeof ( pxhd
) ) , 0);
write(ofil
, &pxhd
, sizeof (pxhd
));
write(i
, cp
, strlen(cp
));