xref: /titanic_53/usr/src/cmd/eqn/funny.c (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
2*7c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
3*7c478bd9Sstevel@tonic-gate 
4*7c478bd9Sstevel@tonic-gate 
5*7c478bd9Sstevel@tonic-gate /*
6*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1980 Regents of the University of California.
7*7c478bd9Sstevel@tonic-gate  * All rights reserved. The Berkeley software License Agreement
8*7c478bd9Sstevel@tonic-gate  * specifies the terms and conditions for redistribution.
9*7c478bd9Sstevel@tonic-gate  */
10*7c478bd9Sstevel@tonic-gate 
11*7c478bd9Sstevel@tonic-gate /*
12*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
13*7c478bd9Sstevel@tonic-gate  * All Rights Reserved.
14*7c478bd9Sstevel@tonic-gate  */
15*7c478bd9Sstevel@tonic-gate 
16*7c478bd9Sstevel@tonic-gate #ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.1	*/
17*7c478bd9Sstevel@tonic-gate 
18*7c478bd9Sstevel@tonic-gate # include "e.h"
19*7c478bd9Sstevel@tonic-gate # include "e.def"
20*7c478bd9Sstevel@tonic-gate #include <locale.h>
21*7c478bd9Sstevel@tonic-gate 
22*7c478bd9Sstevel@tonic-gate funny(n) int n; {
23*7c478bd9Sstevel@tonic-gate 	char *f;
24*7c478bd9Sstevel@tonic-gate 
25*7c478bd9Sstevel@tonic-gate 	yyval = oalloc();
26*7c478bd9Sstevel@tonic-gate 	switch(n) {
27*7c478bd9Sstevel@tonic-gate 	case SUM:
28*7c478bd9Sstevel@tonic-gate 		f = "\\(*S"; break;
29*7c478bd9Sstevel@tonic-gate 	case UNION:
30*7c478bd9Sstevel@tonic-gate 		f = "\\(cu"; break;
31*7c478bd9Sstevel@tonic-gate 	case INTER:	/* intersection */
32*7c478bd9Sstevel@tonic-gate 		f = "\\(ca"; break;
33*7c478bd9Sstevel@tonic-gate 	case PROD:
34*7c478bd9Sstevel@tonic-gate 		f = "\\(*P"; break;
35*7c478bd9Sstevel@tonic-gate 	default:
36*7c478bd9Sstevel@tonic-gate 		error(FATAL, gettext("funny type %d in funny"), n);
37*7c478bd9Sstevel@tonic-gate 	}
38*7c478bd9Sstevel@tonic-gate #ifndef NEQN
39*7c478bd9Sstevel@tonic-gate 	printf(".ds %d \\s%d\\v'.3m'\\s+5%s\\s-5\\v'-.3m'\\s%d\n", yyval, ps, f, ps);
40*7c478bd9Sstevel@tonic-gate 	eht[yyval] = VERT(EM(1.0, ps+5) - EM(0.2, ps));
41*7c478bd9Sstevel@tonic-gate 	ebase[yyval] = VERT(EM(0.3, ps));
42*7c478bd9Sstevel@tonic-gate #else NEQN
43*7c478bd9Sstevel@tonic-gate 	printf(".ds %d %s\n", yyval, f);
44*7c478bd9Sstevel@tonic-gate 	eht[yyval] = VERT(2);
45*7c478bd9Sstevel@tonic-gate 	ebase[yyval] = 0;
46*7c478bd9Sstevel@tonic-gate #endif NEQN
47*7c478bd9Sstevel@tonic-gate 	if(dbg)printf(".\tfunny: S%d <- %s; h=%d b=%d\n",
48*7c478bd9Sstevel@tonic-gate 		yyval, f, eht[yyval], ebase[yyval]);
49*7c478bd9Sstevel@tonic-gate 	lfont[yyval] = rfont[yyval] = ROM;
50*7c478bd9Sstevel@tonic-gate }
51