xref: /onnv-gate/usr/src/cmd/troff/nroff.d/n6.c (revision 217:758a5315b0d7)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
220Sstevel@tonic-gate /*
230Sstevel@tonic-gate  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
280Sstevel@tonic-gate /*	  All Rights Reserved  	*/
290Sstevel@tonic-gate 
300Sstevel@tonic-gate /*
310Sstevel@tonic-gate  * University Copyright- Copyright (c) 1982, 1986, 1988
320Sstevel@tonic-gate  * The Regents of the University of California
330Sstevel@tonic-gate  * All Rights Reserved
340Sstevel@tonic-gate  *
350Sstevel@tonic-gate  * University Acknowledgment- Portions of this document are derived from
360Sstevel@tonic-gate  * software developed by the University of California, Berkeley, and its
370Sstevel@tonic-gate  * contributors.
380Sstevel@tonic-gate  */
390Sstevel@tonic-gate 
40*217Smuffin #pragma ident	"%Z%%M%	%I%	%E% SMI"
41*217Smuffin 
420Sstevel@tonic-gate #include "tdef.h"
430Sstevel@tonic-gate #include "tw.h"
440Sstevel@tonic-gate #include "ext.h"
450Sstevel@tonic-gate #include <ctype.h>
460Sstevel@tonic-gate 
470Sstevel@tonic-gate /*
480Sstevel@tonic-gate  * n6.c -- width functions, sizes and fonts
490Sstevel@tonic-gate */
500Sstevel@tonic-gate 
510Sstevel@tonic-gate int	bdtab[NFONT+1] ={ 0, 0, 0, 3, 3, 0, };
520Sstevel@tonic-gate int	sbold = 0;
530Sstevel@tonic-gate int	fontlab[NFONT+1] = { 0, 'R', 'I', 'B', PAIR('B','I'), 'S', 0 };
540Sstevel@tonic-gate 
550Sstevel@tonic-gate extern	int	nchtab;
560Sstevel@tonic-gate 
57*217Smuffin int
width(j)580Sstevel@tonic-gate width(j)
59*217Smuffin tchar j;
600Sstevel@tonic-gate {
61*217Smuffin 	int	i, k;
620Sstevel@tonic-gate 
630Sstevel@tonic-gate 	if (j & (ZBIT|MOT)) {
640Sstevel@tonic-gate 		if (iszbit(j))
650Sstevel@tonic-gate 			return(0);
660Sstevel@tonic-gate 		if (isvmot(j))
670Sstevel@tonic-gate 			return(0);
680Sstevel@tonic-gate 		k = absmot(j);
690Sstevel@tonic-gate 		if (isnmot(j))
700Sstevel@tonic-gate 			k = -k;
710Sstevel@tonic-gate 		return(k);
720Sstevel@tonic-gate 	}
730Sstevel@tonic-gate 	i = cbits(j);
740Sstevel@tonic-gate 	if (i < ' ') {
750Sstevel@tonic-gate 		if (i == '\b')
760Sstevel@tonic-gate 			return(-widthp);
770Sstevel@tonic-gate 		if (i == PRESC)
780Sstevel@tonic-gate 			i = eschar;
790Sstevel@tonic-gate 		else if (iscontrol(i))
800Sstevel@tonic-gate 			return(0);
810Sstevel@tonic-gate 	}
820Sstevel@tonic-gate 	if (i==ohc)
830Sstevel@tonic-gate 		return(0);
840Sstevel@tonic-gate #ifdef EUC
850Sstevel@tonic-gate #ifdef NROFF
860Sstevel@tonic-gate 	if (multi_locale) {
870Sstevel@tonic-gate 		if ((j & MBMASK) || (j & CSMASK)) {
880Sstevel@tonic-gate 			switch(j & MBMASK) {
890Sstevel@tonic-gate 				case BYTE_CHR:
900Sstevel@tonic-gate 				case LASTOFMB:
910Sstevel@tonic-gate 					k = t.Char * csi_width[cs(j)];
920Sstevel@tonic-gate 					break;
930Sstevel@tonic-gate 				default:
940Sstevel@tonic-gate 					k = 0;
950Sstevel@tonic-gate 					break;
960Sstevel@tonic-gate 			}
970Sstevel@tonic-gate 			widthp = k;
980Sstevel@tonic-gate 			return(k);
990Sstevel@tonic-gate 		}
1000Sstevel@tonic-gate 	}
1010Sstevel@tonic-gate 	i &= 0x1ff;
1020Sstevel@tonic-gate #endif /* NROFF */
1030Sstevel@tonic-gate #endif /* EUC */
1040Sstevel@tonic-gate 	i = trtab[i];
1050Sstevel@tonic-gate 	if (i < 32)
1060Sstevel@tonic-gate 		return(0);
1070Sstevel@tonic-gate 	k = t.width[i] * t.Char;
1080Sstevel@tonic-gate 	widthp = k;
1090Sstevel@tonic-gate 	return(k);
1100Sstevel@tonic-gate }
1110Sstevel@tonic-gate 
1120Sstevel@tonic-gate 
setch()1130Sstevel@tonic-gate tchar setch()
1140Sstevel@tonic-gate {
115*217Smuffin 	int	j;
1160Sstevel@tonic-gate 	char	temp[10];
117*217Smuffin 	char	*s;
1180Sstevel@tonic-gate 
1190Sstevel@tonic-gate 	s = temp;
1200Sstevel@tonic-gate 	if ((*s++ = getach()) == 0 || (*s++ = getach()) == 0)
1210Sstevel@tonic-gate 		return(0);
1220Sstevel@tonic-gate 	*s = '\0';
1230Sstevel@tonic-gate 	if ((j = findch(temp)) > 0)
1240Sstevel@tonic-gate 		return j | chbits;
1250Sstevel@tonic-gate 	else
1260Sstevel@tonic-gate 		return 0;
1270Sstevel@tonic-gate }
1280Sstevel@tonic-gate 
setabs()1290Sstevel@tonic-gate tchar setabs()		/* set absolute char from \C'...' */
1300Sstevel@tonic-gate {			/* for now, a no-op */
1310Sstevel@tonic-gate 	int i, n, nf;
1320Sstevel@tonic-gate 
1330Sstevel@tonic-gate 	getch();
1340Sstevel@tonic-gate 	n = 0;
1350Sstevel@tonic-gate 	n = inumb(&n);
1360Sstevel@tonic-gate 	getch();
1370Sstevel@tonic-gate 	if (nonumb)
1380Sstevel@tonic-gate 		return 0;
1390Sstevel@tonic-gate 	return n + nchtab + _SPECCHAR_ST;
1400Sstevel@tonic-gate }
1410Sstevel@tonic-gate 
142*217Smuffin int
findft(i)1430Sstevel@tonic-gate findft(i)
144*217Smuffin int	i;
1450Sstevel@tonic-gate {
146*217Smuffin 	int	k;
1470Sstevel@tonic-gate 
1480Sstevel@tonic-gate 	if ((k = i - '0') >= 0 && k <= nfonts && k < smnt)
1490Sstevel@tonic-gate 		return(k);
1500Sstevel@tonic-gate 	for (k = 0; fontlab[k] != i; k++)
1510Sstevel@tonic-gate 		if (k > nfonts)
1520Sstevel@tonic-gate 			return(-1);
1530Sstevel@tonic-gate 	return(k);
1540Sstevel@tonic-gate }
1550Sstevel@tonic-gate 
156*217Smuffin int
caseps()1570Sstevel@tonic-gate caseps()
1580Sstevel@tonic-gate {
159*217Smuffin 	return (0);
1600Sstevel@tonic-gate }
1610Sstevel@tonic-gate 
162*217Smuffin int
mchbits()1630Sstevel@tonic-gate mchbits()
1640Sstevel@tonic-gate {
1650Sstevel@tonic-gate 	chbits = 0;
1660Sstevel@tonic-gate 	setfbits(chbits, font);
1670Sstevel@tonic-gate 	sps = width(' ' | chbits);
168*217Smuffin 
169*217Smuffin 	return (0);
1700Sstevel@tonic-gate }
1710Sstevel@tonic-gate 
1720Sstevel@tonic-gate 
173*217Smuffin int
setps()1740Sstevel@tonic-gate setps()
1750Sstevel@tonic-gate {
176*217Smuffin 	int	i, j;
1770Sstevel@tonic-gate 
1780Sstevel@tonic-gate 	i = cbits(getch());
1790Sstevel@tonic-gate 	if (ischar(i) && isdigit(i)) {		/* \sd or \sdd */
1800Sstevel@tonic-gate 		i -= '0';
1810Sstevel@tonic-gate 		if (i == 0)		/* \s0 */
1820Sstevel@tonic-gate 			;
1830Sstevel@tonic-gate 		else if (i <= 3 && ischar(j = cbits(ch = getch())) &&
1840Sstevel@tonic-gate 		    isdigit(j)) {	/* \sdd */
1850Sstevel@tonic-gate 			ch = 0;
1860Sstevel@tonic-gate 		}
1870Sstevel@tonic-gate 	} else if (i == '(') {		/* \s(dd */
1880Sstevel@tonic-gate 		getch();
1890Sstevel@tonic-gate 		getch();
1900Sstevel@tonic-gate 	} else if (i == '+' || i == '-') {	/* \s+, \s- */
1910Sstevel@tonic-gate 		j = cbits(getch());
1920Sstevel@tonic-gate 		if (ischar(j) && isdigit(j)) {		/* \s+d, \s-d */
1930Sstevel@tonic-gate 			;
1940Sstevel@tonic-gate 		} else if (j == '(') {		/* \s+(dd, \s-(dd */
1950Sstevel@tonic-gate 			getch();
1960Sstevel@tonic-gate 			getch();
1970Sstevel@tonic-gate 		}
1980Sstevel@tonic-gate 	}
199*217Smuffin 
200*217Smuffin 	return (0);
2010Sstevel@tonic-gate }
2020Sstevel@tonic-gate 
2030Sstevel@tonic-gate 
setht()2040Sstevel@tonic-gate tchar setht()		/* set character height from \H'...' */
2050Sstevel@tonic-gate {
2060Sstevel@tonic-gate 	int	n;
2070Sstevel@tonic-gate 	tchar c;
2080Sstevel@tonic-gate 
2090Sstevel@tonic-gate 	getch();
2100Sstevel@tonic-gate 	n = inumb(&apts);
2110Sstevel@tonic-gate 	getch();
2120Sstevel@tonic-gate 	return(0);
2130Sstevel@tonic-gate }
2140Sstevel@tonic-gate 
2150Sstevel@tonic-gate 
setslant()2160Sstevel@tonic-gate tchar setslant()		/* set slant from \S'...' */
2170Sstevel@tonic-gate {
2180Sstevel@tonic-gate 	int	n;
2190Sstevel@tonic-gate 	tchar c;
2200Sstevel@tonic-gate 
2210Sstevel@tonic-gate 	getch();
2220Sstevel@tonic-gate 	n = 0;
2230Sstevel@tonic-gate 	n = inumb(&n);
2240Sstevel@tonic-gate 	getch();
2250Sstevel@tonic-gate 	return(0);
2260Sstevel@tonic-gate }
2270Sstevel@tonic-gate 
2280Sstevel@tonic-gate 
229*217Smuffin int
caseft()2300Sstevel@tonic-gate caseft()
2310Sstevel@tonic-gate {
2320Sstevel@tonic-gate 	skip();
2330Sstevel@tonic-gate 	setfont(1);
234*217Smuffin 
235*217Smuffin 	return (0);
2360Sstevel@tonic-gate }
2370Sstevel@tonic-gate 
2380Sstevel@tonic-gate 
239*217Smuffin int
setfont(a)2400Sstevel@tonic-gate setfont(a)
2410Sstevel@tonic-gate int	a;
2420Sstevel@tonic-gate {
243*217Smuffin 	int	i, j;
2440Sstevel@tonic-gate 
2450Sstevel@tonic-gate 	if (a)
2460Sstevel@tonic-gate 		i = getrq();
2470Sstevel@tonic-gate 	else
2480Sstevel@tonic-gate 		i = getsn();
2490Sstevel@tonic-gate 	if (!i || i == 'P') {
2500Sstevel@tonic-gate 		j = font1;
2510Sstevel@tonic-gate 		goto s0;
2520Sstevel@tonic-gate 	}
2530Sstevel@tonic-gate 	if (i == 'S' || i == '0')
254*217Smuffin 		return (0);
2550Sstevel@tonic-gate 	if ((j = findft(i, fontlab)) == -1)
256*217Smuffin 		return (0);
2570Sstevel@tonic-gate s0:
2580Sstevel@tonic-gate 	font1 = font;
2590Sstevel@tonic-gate 	font = j;
2600Sstevel@tonic-gate 	mchbits();
261*217Smuffin 
262*217Smuffin 	return (0);
2630Sstevel@tonic-gate }
2640Sstevel@tonic-gate 
2650Sstevel@tonic-gate 
266*217Smuffin int
setwd()2670Sstevel@tonic-gate setwd()
2680Sstevel@tonic-gate {
269*217Smuffin 	int	base, wid;
270*217Smuffin 	tchar i;
2710Sstevel@tonic-gate 	int	delim, emsz, k;
2720Sstevel@tonic-gate 	int	savhp, savapts, savapts1, savfont, savfont1, savpts, savpts1;
2730Sstevel@tonic-gate 
2740Sstevel@tonic-gate 	base = numtab[ST].val = numtab[ST].val = wid = numtab[CT].val = 0;
2750Sstevel@tonic-gate 	if (ismot(i = getch()))
276*217Smuffin 		return (0);
2770Sstevel@tonic-gate 	delim = cbits(i);
2780Sstevel@tonic-gate 	savhp = numtab[HP].val;
2790Sstevel@tonic-gate 	numtab[HP].val = 0;
2800Sstevel@tonic-gate 	savapts = apts;
2810Sstevel@tonic-gate 	savapts1 = apts1;
2820Sstevel@tonic-gate 	savfont = font;
2830Sstevel@tonic-gate 	savfont1 = font1;
2840Sstevel@tonic-gate 	savpts = pts;
2850Sstevel@tonic-gate 	savpts1 = pts1;
2860Sstevel@tonic-gate 	setwdf++;
2870Sstevel@tonic-gate 	while (cbits(i = getch()) != delim && !nlflg) {
2880Sstevel@tonic-gate 		k = width(i);
2890Sstevel@tonic-gate 		wid += k;
2900Sstevel@tonic-gate 		numtab[HP].val += k;
2910Sstevel@tonic-gate 		if (!ismot(i)) {
2920Sstevel@tonic-gate 			emsz = (INCH * pts + 36) / 72;
2930Sstevel@tonic-gate 		} else if (isvmot(i)) {
2940Sstevel@tonic-gate 			k = absmot(i);
2950Sstevel@tonic-gate 			if (isnmot(i))
2960Sstevel@tonic-gate 				k = -k;
2970Sstevel@tonic-gate 			base -= k;
2980Sstevel@tonic-gate 			emsz = 0;
2990Sstevel@tonic-gate 		} else
3000Sstevel@tonic-gate 			continue;
3010Sstevel@tonic-gate 		if (base < numtab[SB].val)
3020Sstevel@tonic-gate 			numtab[SB].val = base;
3030Sstevel@tonic-gate 		if ((k = base + emsz) > numtab[ST].val)
3040Sstevel@tonic-gate 			numtab[ST].val = k;
3050Sstevel@tonic-gate 	}
3060Sstevel@tonic-gate 	setn1(wid, 0, (tchar) 0);
3070Sstevel@tonic-gate 	numtab[HP].val = savhp;
3080Sstevel@tonic-gate 	apts = savapts;
3090Sstevel@tonic-gate 	apts1 = savapts1;
3100Sstevel@tonic-gate 	font = savfont;
3110Sstevel@tonic-gate 	font1 = savfont1;
3120Sstevel@tonic-gate 	pts = savpts;
3130Sstevel@tonic-gate 	pts1 = savpts1;
3140Sstevel@tonic-gate 	mchbits();
3150Sstevel@tonic-gate 	setwdf = 0;
316*217Smuffin 
317*217Smuffin 	return (0);
3180Sstevel@tonic-gate }
3190Sstevel@tonic-gate 
3200Sstevel@tonic-gate 
vmot()3210Sstevel@tonic-gate tchar vmot()
3220Sstevel@tonic-gate {
3230Sstevel@tonic-gate 	dfact = lss;
3240Sstevel@tonic-gate 	vflag++;
3250Sstevel@tonic-gate 	return(mot());
3260Sstevel@tonic-gate }
3270Sstevel@tonic-gate 
3280Sstevel@tonic-gate 
hmot()3290Sstevel@tonic-gate tchar hmot()
3300Sstevel@tonic-gate {
3310Sstevel@tonic-gate 	dfact = EM;
3320Sstevel@tonic-gate 	return(mot());
3330Sstevel@tonic-gate }
3340Sstevel@tonic-gate 
3350Sstevel@tonic-gate 
mot()3360Sstevel@tonic-gate tchar mot()
3370Sstevel@tonic-gate {
338*217Smuffin 	int j, n;
339*217Smuffin 	tchar i;
3400Sstevel@tonic-gate 
3410Sstevel@tonic-gate 	j = HOR;
3420Sstevel@tonic-gate 	getch(); /*eat delim*/
3430Sstevel@tonic-gate 	if (n = atoi()) {
3440Sstevel@tonic-gate 		if (vflag)
3450Sstevel@tonic-gate 			j = VERT;
3460Sstevel@tonic-gate 		i = makem(quant(n, j));
3470Sstevel@tonic-gate 	} else
3480Sstevel@tonic-gate 		i = 0;
3490Sstevel@tonic-gate 	getch();
3500Sstevel@tonic-gate 	vflag = 0;
3510Sstevel@tonic-gate 	dfact = 1;
3520Sstevel@tonic-gate 	return(i);
3530Sstevel@tonic-gate }
3540Sstevel@tonic-gate 
3550Sstevel@tonic-gate 
sethl(k)3560Sstevel@tonic-gate tchar sethl(k)
3570Sstevel@tonic-gate int	k;
3580Sstevel@tonic-gate {
359*217Smuffin 	int	j;
3600Sstevel@tonic-gate 	tchar i;
3610Sstevel@tonic-gate 
3620Sstevel@tonic-gate 	j = t.Halfline;
3630Sstevel@tonic-gate 	if (k == 'u')
3640Sstevel@tonic-gate 		j = -j;
3650Sstevel@tonic-gate 	else if (k == 'r')
3660Sstevel@tonic-gate 		j = -2 * j;
3670Sstevel@tonic-gate 	vflag++;
3680Sstevel@tonic-gate 	i = makem(j);
3690Sstevel@tonic-gate 	vflag = 0;
3700Sstevel@tonic-gate 	return(i);
3710Sstevel@tonic-gate }
3720Sstevel@tonic-gate 
3730Sstevel@tonic-gate 
makem(i)3740Sstevel@tonic-gate tchar makem(i)
3750Sstevel@tonic-gate int	i;
3760Sstevel@tonic-gate {
377*217Smuffin 	tchar j;
3780Sstevel@tonic-gate 
3790Sstevel@tonic-gate 	if ((j = i) < 0)
3800Sstevel@tonic-gate 		j = -j;
3810Sstevel@tonic-gate 	j |= MOT;
3820Sstevel@tonic-gate 	if (i < 0)
3830Sstevel@tonic-gate 		j |= NMOT;
3840Sstevel@tonic-gate 	if (vflag)
3850Sstevel@tonic-gate 		j |= VMOT;
3860Sstevel@tonic-gate 	return(j);
3870Sstevel@tonic-gate }
3880Sstevel@tonic-gate 
3890Sstevel@tonic-gate 
getlg(i)3900Sstevel@tonic-gate tchar getlg(i)
3910Sstevel@tonic-gate tchar	i;
3920Sstevel@tonic-gate {
3930Sstevel@tonic-gate 	return(i);
3940Sstevel@tonic-gate }
3950Sstevel@tonic-gate 
3960Sstevel@tonic-gate 
397*217Smuffin int
caselg()3980Sstevel@tonic-gate caselg()
3990Sstevel@tonic-gate {
400*217Smuffin 	return (0);
4010Sstevel@tonic-gate }
4020Sstevel@tonic-gate 
4030Sstevel@tonic-gate 
404*217Smuffin int
casefp()4050Sstevel@tonic-gate casefp()
4060Sstevel@tonic-gate {
407*217Smuffin 	int	i, j;
4080Sstevel@tonic-gate 
4090Sstevel@tonic-gate 	skip();
4100Sstevel@tonic-gate 	if ((i = cbits(getch()) - '0') < 0 || i > nfonts)
411*217Smuffin 		return (0);
4120Sstevel@tonic-gate 	if (skip() || !(j = getrq()))
413*217Smuffin 		return (0);
4140Sstevel@tonic-gate 	fontlab[i] = j;
415*217Smuffin 
416*217Smuffin 	return (0);
4170Sstevel@tonic-gate }
4180Sstevel@tonic-gate 
4190Sstevel@tonic-gate 
420*217Smuffin int
casecs()4210Sstevel@tonic-gate casecs()
4220Sstevel@tonic-gate {
423*217Smuffin 	return (0);
4240Sstevel@tonic-gate }
4250Sstevel@tonic-gate 
4260Sstevel@tonic-gate 
427*217Smuffin int
casebd()4280Sstevel@tonic-gate casebd()
4290Sstevel@tonic-gate {
430*217Smuffin 	int	i, j, k;
4310Sstevel@tonic-gate 
4320Sstevel@tonic-gate 	k = 0;
4330Sstevel@tonic-gate bd0:
4340Sstevel@tonic-gate 	if (skip() || !(i = getrq()) || (j = findft(i)) == -1) {
4350Sstevel@tonic-gate 		if (k)
4360Sstevel@tonic-gate 			goto bd1;
4370Sstevel@tonic-gate 		else
438*217Smuffin 			return (0);
4390Sstevel@tonic-gate 	}
4400Sstevel@tonic-gate 	if (j == smnt) {
4410Sstevel@tonic-gate 		k = smnt;
4420Sstevel@tonic-gate 		goto bd0;
4430Sstevel@tonic-gate 	}
4440Sstevel@tonic-gate 	if (k) {
4450Sstevel@tonic-gate 		sbold = j;
4460Sstevel@tonic-gate 		j = k;
4470Sstevel@tonic-gate 	}
4480Sstevel@tonic-gate bd1:
4490Sstevel@tonic-gate 	skip();
4500Sstevel@tonic-gate 	noscale++;
4510Sstevel@tonic-gate 	bdtab[j] = atoi();
4520Sstevel@tonic-gate 	noscale = 0;
453*217Smuffin 
454*217Smuffin 	return (0);
4550Sstevel@tonic-gate }
4560Sstevel@tonic-gate 
4570Sstevel@tonic-gate 
458*217Smuffin int
casevs()4590Sstevel@tonic-gate casevs()
4600Sstevel@tonic-gate {
461*217Smuffin 	int	i;
4620Sstevel@tonic-gate 
4630Sstevel@tonic-gate 	skip();
4640Sstevel@tonic-gate 	vflag++;
4650Sstevel@tonic-gate 	dfact = INCH; /*default scaling is points!*/
4660Sstevel@tonic-gate 	dfactd = 72;
4670Sstevel@tonic-gate 	res = VERT;
4680Sstevel@tonic-gate 	i = inumb(&lss);
4690Sstevel@tonic-gate 	if (nonumb)
4700Sstevel@tonic-gate 		i = lss1;
4710Sstevel@tonic-gate 	if (i < VERT)
4720Sstevel@tonic-gate 		i = VERT;	/* was VERT */
4730Sstevel@tonic-gate 	lss1 = lss;
4740Sstevel@tonic-gate 	lss = i;
475*217Smuffin 
476*217Smuffin 	return (0);
4770Sstevel@tonic-gate }
4780Sstevel@tonic-gate 
4790Sstevel@tonic-gate 
4800Sstevel@tonic-gate 
481*217Smuffin int
casess()4820Sstevel@tonic-gate casess()
4830Sstevel@tonic-gate {
484*217Smuffin 	return (0);
4850Sstevel@tonic-gate }
4860Sstevel@tonic-gate 
4870Sstevel@tonic-gate 
xlss()4880Sstevel@tonic-gate tchar xlss()
4890Sstevel@tonic-gate {
4900Sstevel@tonic-gate 	/* stores \x'...' into
4910Sstevel@tonic-gate 	 * two successive tchars.
4920Sstevel@tonic-gate 	 * the first contains HX, the second the value,
4930Sstevel@tonic-gate 	 * encoded as a vertical motion.
4940Sstevel@tonic-gate 	 * decoding is done in n2.c by pchar().
4950Sstevel@tonic-gate 	 */
4960Sstevel@tonic-gate 	int	i;
4970Sstevel@tonic-gate 
4980Sstevel@tonic-gate 	getch();
4990Sstevel@tonic-gate 	dfact = lss;
5000Sstevel@tonic-gate 	i = quant(atoi(), VERT);
5010Sstevel@tonic-gate 	dfact = 1;
5020Sstevel@tonic-gate 	getch();
5030Sstevel@tonic-gate 	if (i >= 0)
5040Sstevel@tonic-gate 		*pbp++ = MOT | VMOT | i;
5050Sstevel@tonic-gate 	else
5060Sstevel@tonic-gate 		*pbp++ = MOT | VMOT | NMOT | -i;
5070Sstevel@tonic-gate 	return(HX);
5080Sstevel@tonic-gate }
509