File:  [Research Unix] / researchv9 / jtools / src / Jpic / textgen.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:59 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv9-SUN3_old, researchv9-SUN3, HEAD
researchv9-SUN3(old)

#include	<stdio.h>
#include	"pic.h"
#include	"y.tab.h"

struct obj *textgen(s, garb)
{
	int i, dx, dy, type;
	struct obj *p, *ppos;

	type = 'C';
	dx = dy = 0;
	for (i = 0; i < nattr; i++)
		switch (attr[i].a_type) {
		case LEFT:
			dx -= attr[i].a_val;
			break;
		case RIGHT:
			dx += attr[i].a_val;
			break;
		case UP:
			dy += attr[i].a_val;
			break;
		case DOWN:
			dy -= attr[i].a_val;
			break;
		case AT:
			ppos = (struct obj *) attr[i].a_val;
			curx = ppos->o_x;
			cury = ppos->o_y;
			break;
		case LJUST:
			type = 'L';
			break;
		case RJUST:
			type = 'R';
			break;
		case SPREAD:
			type = 'S';
			break;
		case FILL:
			type = 'F';
			break;
		case ABOVE:
			type = 'A';
			break;
		case BELOW:
			type = 'B';
			break;
		}
	dprintf("T %c %s\n", type, s);
	extreme(curx, cury);
	curx += dx;
	cury += dy;
	extreme(curx, cury);
	p = makenode(TEXT, 2);
	p->o_val[0] = s;
	p->o_val[1] = type;
	return(p);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.