xref: /onnv-gate/usr/src/cmd/eqn/funny.c (revision 364:f36290b8cb0b)
1*364Sceastha /*
2*364Sceastha  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
3*364Sceastha  * Use is subject to license terms.
4*364Sceastha  */
5*364Sceastha 
60Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
70Sstevel@tonic-gate /*	  All Rights Reserved  	*/
80Sstevel@tonic-gate 
90Sstevel@tonic-gate /*
100Sstevel@tonic-gate  * Copyright (c) 1980 Regents of the University of California.
110Sstevel@tonic-gate  * All rights reserved. The Berkeley software License Agreement
120Sstevel@tonic-gate  * specifies the terms and conditions for redistribution.
130Sstevel@tonic-gate  */
14*364Sceastha 
15*364Sceastha #pragma ident	"%Z%%M%	%I%	%E% SMI"
160Sstevel@tonic-gate 
17*364Sceastha #include "e.h"
18*364Sceastha #include "e.def"
190Sstevel@tonic-gate #include <locale.h>
200Sstevel@tonic-gate 
21*364Sceastha void
funny(int n)22*364Sceastha funny(int n)
23*364Sceastha {
240Sstevel@tonic-gate 	char *f;
250Sstevel@tonic-gate 
260Sstevel@tonic-gate 	yyval = oalloc();
27*364Sceastha 	switch (n) {
280Sstevel@tonic-gate 	case SUM:
290Sstevel@tonic-gate 		f = "\\(*S"; break;
300Sstevel@tonic-gate 	case UNION:
310Sstevel@tonic-gate 		f = "\\(cu"; break;
320Sstevel@tonic-gate 	case INTER:	/* intersection */
330Sstevel@tonic-gate 		f = "\\(ca"; break;
340Sstevel@tonic-gate 	case PROD:
350Sstevel@tonic-gate 		f = "\\(*P"; break;
360Sstevel@tonic-gate 	default:
37*364Sceastha 		(void) error(FATAL, gettext("funny type %d in funny"), n);
380Sstevel@tonic-gate 	}
390Sstevel@tonic-gate #ifndef NEQN
40*364Sceastha 	printf(".ds %d \\s%d\\v'.3m'\\s+5%s\\s-5\\v'-.3m'\\s%d\n",
41*364Sceastha 	    yyval, ps, f, ps);
420Sstevel@tonic-gate 	eht[yyval] = VERT(EM(1.0, ps+5) - EM(0.2, ps));
430Sstevel@tonic-gate 	ebase[yyval] = VERT(EM(0.3, ps));
44*364Sceastha #else	/* NEQN */
450Sstevel@tonic-gate 	printf(".ds %d %s\n", yyval, f);
460Sstevel@tonic-gate 	eht[yyval] = VERT(2);
470Sstevel@tonic-gate 	ebase[yyval] = 0;
48*364Sceastha #endif	/* NEQN */
49*364Sceastha 	if (dbg)
50*364Sceastha 		printf(".\tfunny: S%d <- %s; h=%d b=%d\n",
51*364Sceastha 		    yyval, f, eht[yyval], ebase[yyval]);
520Sstevel@tonic-gate 	lfont[yyval] = rfont[yyval] = ROM;
530Sstevel@tonic-gate }
54