xref: /csrg-svn/old/eqn/common_source/funny.c (revision 48252)
1*48252Sbostic /*-
2*48252Sbostic  * Copyright (c) 1991 The Regents of the University of California.
3*48252Sbostic  * All rights reserved.
4*48252Sbostic  *
5*48252Sbostic  * %sccs.include.proprietary.c%
6*48252Sbostic  */
7*48252Sbostic 
814486Ssam #ifndef lint
9*48252Sbostic static char sccsid[] = "@(#)funny.c	4.4 (Berkeley) 04/17/91";
10*48252Sbostic #endif /* not lint */
1111004Sshannon 
1211004Sshannon # include "e.h"
1311004Sshannon # include "e.def"
1411004Sshannon 
funny(n)1511004Sshannon funny(n) int n; {
1611004Sshannon 	char *f;
1711004Sshannon 
1811004Sshannon 	yyval = oalloc();
1911004Sshannon 	switch(n) {
2011004Sshannon 	case SUM:
2111004Sshannon 		f = "\\(*S"; break;
2211004Sshannon 	case UNION:
2311004Sshannon 		f = "\\(cu"; break;
2411004Sshannon 	case INTER:	/* intersection */
2511004Sshannon 		f = "\\(ca"; break;
2611004Sshannon 	case PROD:
2711004Sshannon 		f = "\\(*P"; break;
2811004Sshannon 	default:
2911004Sshannon 		error(FATAL, "funny type %d in funny", n);
3011004Sshannon 	}
3111023Sshannon #ifndef NEQN
3211004Sshannon 	printf(".ds %d \\s%d\\v'.3m'\\s+5%s\\s-5\\v'-.3m'\\s%d\n", yyval, ps, f, ps);
3311004Sshannon 	eht[yyval] = VERT( (ps+5)*6 -(ps*6*2)/10 );
3411004Sshannon 	ebase[yyval] = VERT( (ps*6*3)/10 );
3511023Sshannon #else NEQN
3611023Sshannon 	printf(".ds %d %s\n", yyval, f);
3711023Sshannon 	eht[yyval] = VERT(2);
3811023Sshannon 	ebase[yyval] = 0;
3911023Sshannon #endif NEQN
4011004Sshannon 	if(dbg)printf(".\tfunny: S%d <- %s; h=%d b=%d\n",
4111004Sshannon 		yyval, f, eht[yyval], ebase[yyval]);
4211004Sshannon 	lfont[yyval] = rfont[yyval] = ROM;
4311004Sshannon }
44