static char sccsid
[] = "@(#)format.c 1.4 (Berkeley) 4/1/87";
scanform(icount
,ifp
,itype
,ptype
)
IF init
==0 ANDF (exact
=(findsym(dot
,ptype
)==0)) ANDF maxoff
THEN
printf("\n%s:%16t",cursym
->n_un
.n_name
);
DO IF
isdigit(modifier
= *fp
)
WHILE
isdigit(modifier
= *fp
++)
fp
=exform(fcount
,fp
,itype
,ptype
);
IF mkfault THEN
error(0); FI
exform(fcount
,ifp
,itype
,ptype
)
/* execute single format item `fcount' times
* sets `dotinc' and moves `dot'
* returns address of next format item
CHAR c
, modifier
, longpr
;
union{ /* compatible with both VAX and TAHOE */
longpr
=(c
>='A')&&(c
<='Z')||(c
=='f')||(c
=='4')||(c
=='p');
IF itype
==NSP ORF
*fp
=='a'
IF c
=='b' ORF c
=='B' ORF c
=='c' ORF c
=='C' ORF c
=='1'
IF errflg THEN
return(fp
); FI
IF mkfault THEN
error(0); FI
IF
charpos()==0 ANDF modifier
!='a' THEN
printf("%16m"); FI
printf("%T",fcount
); return(fp
);
printf("%M",fcount
); return(fp
);
psymoff(dot
,ptype
,":%16t"); dotinc
=0; break;
psymoff(var
[0],ptype
,"%16t"); break;
printf("%-16U",wx
); break;
THEN
printesc((w
>>8)&0xff);
ELSE
printc((w
>>8)&0xff);
printf("%-8o", (w
>>8)&0xff); dotinc
=1; break;
printf("%-8R", byte(wx
)); dotinc
=1; break;
printf("%-8R", w
); break;
printf("%-16R", wx
); break;
WHILE (c
=byte(get(dot
,itype
))) ANDF errflg
==0
dotinc
=dot
-savdot
+1; dot
=savdot
; break;
printf("%-16X", wx
); break;
printf("%-16Z", wx
); break;
printf("%-24Y", wx
); break;
printf("%-8q", w
); break;
printf("%-16Q", wx
); break;
printf("%-8o", w
); break;
printf("%-16O", wx
); break;
printins(itype
,wx
); printc(EOR
); break;
printf("%-8d", w
); break;
printf("%-16D", wx
); break;
if ((w
& ~0xFFFF00FF) == 0x8000)
printf("(reserved oprnd)");
case 'F': /* may be done with one get call on TAHOE */
if ((w
& ~0xFFFF00FF) == 0x8000)
printf("(reserved oprnd)");
fw
.s
[2] = shorten(get(inkdot(4),itype
));
fw
.s
[3] = shorten(get(inkdot(6),itype
));
printf("%-32.18F", fw
.d
);
printc('\n'); dotinc
=0; break;
WHILE
*fp
!= '"' ANDF
*fp
dot
=inkdot(-dotinc
*fcount
); return(fp
);
dot
=inkdot(fcount
); return(fp
);
dot
=inkdot(-fcount
); return(fp
);
STRING
getenv(), shell
= getenv("SHELL");
WHILE lastc
!=EOR DO
rdc(); OD
THEN
signal(SIGINT
,sigint
); signal(SIGQUIT
,sigqit
);
*lp
=0; execl(shell
, "sh", "-c", argp
, 0);
ELIF
*lp
= oldstlp
, unixpid
== -1
WHILE (rc
= wait(&status
)) != unixpid ANDF rc
!= -1 DONE
THEN
printf("^%c", c
^ 0100);
IF (dot
^ newdot
) >> 24 THEN
error(ADWRAP
); FI