xref: /illumos-gate/usr/src/cmd/eqn/integral.c (revision 2a8bcb4e)
1*779fc935Sceastha /*
2*779fc935Sceastha  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
3*779fc935Sceastha  * Use is subject to license terms.
4*779fc935Sceastha  */
5*779fc935Sceastha 
67c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
77c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
87c478bd9Sstevel@tonic-gate 
97c478bd9Sstevel@tonic-gate /*
107c478bd9Sstevel@tonic-gate  * Copyright (c) 1980 Regents of the University of California.
117c478bd9Sstevel@tonic-gate  * All rights reserved. The Berkeley software License Agreement
127c478bd9Sstevel@tonic-gate  * specifies the terms and conditions for redistribution.
137c478bd9Sstevel@tonic-gate  */
147c478bd9Sstevel@tonic-gate 
15*779fc935Sceastha #include "e.h"
16*779fc935Sceastha #include "e.def"
177c478bd9Sstevel@tonic-gate 
18*779fc935Sceastha void
integral(int p,int p1,int p2)19*779fc935Sceastha integral(int p, int p1, int p2)
20*779fc935Sceastha {
217c478bd9Sstevel@tonic-gate #ifndef	NEQN
227c478bd9Sstevel@tonic-gate 	if (p1 != 0)
237c478bd9Sstevel@tonic-gate 		printf(".ds %d \\h'-0.4m'\\v'0.4m'\\*(%d\\v'-0.4m'\n", p1, p1);
247c478bd9Sstevel@tonic-gate 	if (p2 != 0)
257c478bd9Sstevel@tonic-gate 		printf(".ds %d \\v'-0.3m'\\*(%d\\v'0.3m'\n", p2, p2);
267c478bd9Sstevel@tonic-gate #endif
277c478bd9Sstevel@tonic-gate 	if (p1 != 0 && p2 != 0)
287c478bd9Sstevel@tonic-gate 		shift2(p, p1, p2);
297c478bd9Sstevel@tonic-gate 	else if (p1 != 0)
307c478bd9Sstevel@tonic-gate 		bshiftb(p, SUB, p1);
317c478bd9Sstevel@tonic-gate 	else if (p2 != 0)
327c478bd9Sstevel@tonic-gate 		bshiftb(p, SUP, p2);
33*779fc935Sceastha 	if (dbg)
34*779fc935Sceastha 		printf(".\tintegral: S%d; h=%d b=%d\n",
35*779fc935Sceastha 		    p, eht[p], ebase[p]);
367c478bd9Sstevel@tonic-gate 	lfont[p] = ROM;
377c478bd9Sstevel@tonic-gate }
387c478bd9Sstevel@tonic-gate 
39*779fc935Sceastha void
setintegral(void)40*779fc935Sceastha setintegral(void)
41*779fc935Sceastha {
427c478bd9Sstevel@tonic-gate 	char *f;
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate 	yyval = oalloc();
457c478bd9Sstevel@tonic-gate 	f = "\\(is";
467c478bd9Sstevel@tonic-gate #ifndef NEQN
47*779fc935Sceastha 	printf(".ds %d \\s%d\\v'.1m'\\s+4%s\\s-4\\v'-.1m'\\s%d\n",
48*779fc935Sceastha 	    yyval, ps, f, ps);
497c478bd9Sstevel@tonic-gate 	eht[yyval] = VERT(EM(1.15, ps+4));
507c478bd9Sstevel@tonic-gate 	ebase[yyval] = VERT(EM(0.3, ps));
51*779fc935Sceastha #else	/* NEQN */
527c478bd9Sstevel@tonic-gate 	printf(".ds %d %s\n", yyval, f);
537c478bd9Sstevel@tonic-gate 	eht[yyval] = VERT(2);
547c478bd9Sstevel@tonic-gate 	ebase[yyval] = 0;
55*779fc935Sceastha #endif	/* NEQN */
567c478bd9Sstevel@tonic-gate 	lfont[yyval] = rfont[yyval] = ROM;
577c478bd9Sstevel@tonic-gate }
58