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