xref: /titanic_41/usr/src/cmd/eqn/integral.c (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
2 /*	  All Rights Reserved  	*/
3 
4 
5 /*
6  * Copyright (c) 1980 Regents of the University of California.
7  * All rights reserved. The Berkeley software License Agreement
8  * specifies the terms and conditions for redistribution.
9  */
10 
11 /*
12  * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
13  * All Rights Reserved.
14  */
15 
16 #ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.1	*/
17 
18 # include "e.h"
19 # include "e.def"
20 
21 integral(p, p1, p2) {
22 #ifndef	NEQN
23 	if (p1 != 0)
24 		printf(".ds %d \\h'-0.4m'\\v'0.4m'\\*(%d\\v'-0.4m'\n", p1, p1);
25 	if (p2 != 0)
26 		printf(".ds %d \\v'-0.3m'\\*(%d\\v'0.3m'\n", p2, p2);
27 #endif
28 	if (p1 != 0 && p2 != 0)
29 		shift2(p, p1, p2);
30 	else if (p1 != 0)
31 		bshiftb(p, SUB, p1);
32 	else if (p2 != 0)
33 		bshiftb(p, SUP, p2);
34 	if(dbg)printf(".\tintegral: S%d; h=%d b=%d\n",
35 		p, eht[p], ebase[p]);
36 	lfont[p] = ROM;
37 }
38 
39 setintegral() {
40 	char *f;
41 
42 	yyval = oalloc();
43 	f = "\\(is";
44 #ifndef NEQN
45 	printf(".ds %d \\s%d\\v'.1m'\\s+4%s\\s-4\\v'-.1m'\\s%d\n",
46 		yyval, ps, f, ps);
47 	eht[yyval] = VERT(EM(1.15, ps+4));
48 	ebase[yyval] = VERT(EM(0.3, ps));
49 #else NEQN
50 	printf(".ds %d %s\n", yyval, f);
51 	eht[yyval] = VERT(2);
52 	ebase[yyval] = 0;
53 #endif NEQN
54 	lfont[yyval] = rfont[yyval] = ROM;
55 }
56