xref: /titanic_44/usr/src/cmd/eqn/integral.c (revision ea8dc4b6d2251b437950c0056bc626b311c73c27)
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 
20 void
21 integral(int p, int p1, int p2)
22 {
23 #ifndef	NEQN
24 	if (p1 != 0)
25 		printf(".ds %d \\h'-0.4m'\\v'0.4m'\\*(%d\\v'-0.4m'\n", p1, p1);
26 	if (p2 != 0)
27 		printf(".ds %d \\v'-0.3m'\\*(%d\\v'0.3m'\n", p2, p2);
28 #endif
29 	if (p1 != 0 && p2 != 0)
30 		shift2(p, p1, p2);
31 	else if (p1 != 0)
32 		bshiftb(p, SUB, p1);
33 	else if (p2 != 0)
34 		bshiftb(p, SUP, p2);
35 	if (dbg)
36 		printf(".\tintegral: S%d; h=%d b=%d\n",
37 		    p, eht[p], ebase[p]);
38 	lfont[p] = ROM;
39 }
40 
41 void
42 setintegral(void)
43 {
44 	char *f;
45 
46 	yyval = oalloc();
47 	f = "\\(is";
48 #ifndef NEQN
49 	printf(".ds %d \\s%d\\v'.1m'\\s+4%s\\s-4\\v'-.1m'\\s%d\n",
50 	    yyval, ps, f, ps);
51 	eht[yyval] = VERT(EM(1.15, ps+4));
52 	ebase[yyval] = VERT(EM(0.3, ps));
53 #else	/* NEQN */
54 	printf(".ds %d %s\n", yyval, f);
55 	eht[yyval] = VERT(2);
56 	ebase[yyval] = 0;
57 #endif	/* NEQN */
58 	lfont[yyval] = rfont[yyval] = ROM;
59 }
60