SCCSID (@
(#)format.c 2.4);
return(lastc
= *fphack
++);
scanform(icount
,ifp
,itype
,ptype
)
IF init
==0 ANDF (exact
=(findsym(dot
,ptype
)==0)) ANDF maxoff
THEN
printf("\n%.8s:%16t",symbol
.symc
);
DO
IF (fphack
=fp
, getnum(rdfp
))
THEN fcount
=expv
; fp
= --fphack
; peekc
=0;
IF exact ANDF dot
==savdot ANDF itype
==ISP ANDF symbol
.symc
[0]=='_' ANDF
*fp
=='i'
THEN
exform(1,"x",itype
,ptype
); fp
++; printc(EOR
); /* entry mask */
ELSE 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
;
longpr
=(c
>='A')&(c
<='Z')|(c
=='f')|(c
=='4');
IF itype
==NSP ORF
*fp
=='a'
THEN wx
=itol(get(inkdot(2),itype
),w
);
THEN fw
.sb
=get(inkdot(4),itype
);
fw
.sc
=get(inkdot(6),itype
);
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;
printf("%-8o", w
&LOBYTE
); dotinc
=1; break;
printf("%-8r", w
&LOBYTE
); dotinc
=1; break;
printf("%-8r", w
); break;
printf("%-16R", wx
); break;
WHILE (c
=get(dot
,itype
)&LOBYTE
) ANDF errflg
==0
dotinc
=dot
-savdot
+1; dot
=savdot
; break;
printf("%-16X", wx
); break;
printf("%-24Y", wx
); break;
printf("%-8q", w
); break;
printf("%-16Q", wx
); break;
printf("%-8o", w
); break;
printf("%-16O", wx
); break;
printins(0,itype
,w
); printc(EOR
); break;
printf("%-8d", w
); break;
printf("%-16D", wx
); break;
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
);
WHILE lastc
!=EOR DO
rdc(); OD
THEN
signal(SIGINT
,sigint
); signal(SIGQUIT
,sigqit
);
*lp
=0; execl("/bin/sh", "sh", "-c", argp
, 0);
WHILE (rc
= wait(&status
)) != unixpid ANDF rc
!= -1 DONE
IF c
<SP ORF c
>'~' ORF c
=='@'
THEN
printf("@%c",(c
=='@' ? '@' : c
^0140));
IF (dot NEQ newdot
) >> 24 THEN
error(ADWRAP
); FI