static char sccsid
[] = "@(#)n9.c 2.1 (CWI) 85/07/18";
int w
, cnt
, delim
, rem
, temp
;
length
= quant(atoi(), HOR
);
if ((cbits(c
= getch())) == delim
) {
} else if (cbits(c
) == FILLER
)
if (!(cnt
= length
/ w
)) {
*i
++ = makem(-(temp
= ((w
- length
) / 2)));
*i
++ = makem(-(w
- length
- temp
));
if (cbits(c
) == RULE
|| cbits(c
) == UNDERLINE
|| cbits(c
) == ROOTEN
)
while ((i
= cbits(getch())) != c
&& (i
!= '\n'))
for (k
= 0; (k
< NOV
) && ((j
= cbits(i
= getch())) != delim
) && (j
!= '\n'); k
++) {
for (k
= 1; o
[k
] ; k
++) {
*pbp
++ = makem(w
[0] / 2);
*pbp
++ = makem(-((w
[k
] + w
[k
+1]) / 2));
dwn
= (2 * t
.Halfline
) | MOT
| VMOT
;
while (((k
= cbits(i
= getch())) != delim
) && (k
!= '\n') && (j
<= (brabuf
+ NC
- 4))) {
*--j
= *brabuf
= (cnt
* t
.Halfline
) | MOT
| NMOT
| VMOT
;
*--j
= *brabuf
= (cnt
* EM
) / 2 | MOT
| NMOT
| VMOT
;
if ((cbits(c
= getch())) == delim
) {
c
= BOXRULE
| chbits
; /*default box rule*/
rem
= makem(i
% v
) | neg
;
while ((vlp
< (vlbuf
+ NC
- 3)) && cnt
--) {
#define NPAIR (NC/2-6) /* max pairs in spline, etc. */
setdraw() /* generate internal cookies for a drawing function */
int i
, j
, k
, dx
[NPAIR
], dy
[NPAIR
], delim
, type
;
/* input is \D'f dx dy dx dy ... c' (or at least it had better be) */
/* this does drawing function f with character c and the */
/* specified dx,dy pairs interpreted as appropriate */
/* pairs are deltas from last point, except for radii */
/* l dx dy: line from here by dx,dy */
/* c x: circle of diameter x, left side here */
/* e x y: ellipse of diameters x,y, left side here */
ccw arc: ctr at dx1,dy1, then end at dx2,dy2 from there */
spline to dx1,dy1 to dx2,dy2 ... */
/* f dx dy ...: f is any other char: like spline */
for (i
= 0; i
< NPAIR
; i
++) {
/* ought to pick up optional drawing character */
dx
[i
] = quant(atoi(), HOR
);
else if (dx
[i
] < -MAXMOT
)
if (cbits((c
= getch())) == delim
) { /* spacer */
dy
[i
] = quant(atoi(), VERT
);
else if (dy
[i
] < -MAXMOT
)
drawbuf
[0] = DRAWFCN
| chbits
| ZBIT
;
drawbuf
[1] = type
| chbits
| ZBIT
;
drawbuf
[2] = '.' | chbits
| ZBIT
; /* use default drawing character */
for (k
= 0, j
= 3; k
< i
; k
++) {
drawbuf
[j
++] = MOT
| ((dx
[k
] >= 0) ? dx
[k
] : (NMOT
| -dx
[k
]));
drawbuf
[j
++] = MOT
| VMOT
| ((dy
[k
] >= 0) ? dy
[k
] : (NMOT
| -dy
[k
]));
if (type
== DRAWELLIPSE
) {
drawbuf
[5] = drawbuf
[4] | NMOT
; /* so the net vertical is zero */
drawbuf
[j
++] = DRAWFCN
| chbits
| ZBIT
; /* marks end for ptout */
if (skip() || ismot(j
= getch()) || (i
= cbits(j
)) == '\n')
if (skip() || ismot(ch
) || (ch
= cbits(ch
)) == fc
)
register tchar ii
, jj
, *fp
;
int length
, ws
, npad
, temp
, type
;
tchar
**pp
, *padptr
[NPP
];
tabch
= ldrch
= fc
= IMP
;
savepos
= numtab
[HP
].val
;
gchtab
[tabch
] &= ~TABBIT
;
gchtab
[ldrch
] &= ~LDRBIT
;
gchtab
[IMP
] |= TABBIT
|LDRBIT
|FCBIT
;
if ((tabtab
[j
] & TABMASK
) == 0) {
errprint("zero field width.");
if ((length
= ((tabtab
[j
] & TABMASK
) - numtab
[HP
].val
)) > 0 )
type
= tabtab
[j
] & (~TABMASK
);
if (pp
> (padptr
+ NPP
- 1))
if (fp
> (fbuf
+ FBUFSZ
- 3))
temp
= i
= (j
= length
- ws
) / npad
;
for (; npad
> 0; npad
--) {
if ((j
= width(rchar
)) > 0) {
while (nchar
-->0 && pbp
< &pbbuf
[NC
-3]) {
while (((j
= cbits(ii
= getch())) != savtc
) && (j
!= '\n') && (j
!= savlc
)) {
if (fp
> (fbuf
+ FBUFSZ
- 3))
length
-= ws
/ 2; /*CTAB*/
if ((j
= width(rchar
)) != 0 && length
> 0) {
while (nchar
-- > 0 && pbp
< &pbbuf
[NC
-3])
length
= (length
/ HOR
) * HOR
;
gchtab
[tabch
] &= ~TABBIT
;
gchtab
[ldrch
] &= ~LDRBIT
;
numtab
[HP
].val
= savepos
;