예제 #1
0
casede(){
	register i, req;
	register filep savoff;
	extern filep finds();

	if(dip != d)wbfl();
	req = '.';
	lgf++;
	skip();
	if((i=getrq())==0)goto de1;
	if((offset=finds(i)) == 0)goto de1;
	if(ds)copys();
		else req = copyb();
	wbfl();
	clrmn(oldmn);
	if(newmn)contab[newmn].rq = i | MMASK;
	if(apptr){
		savoff = offset;
		offset = apptr;
		wbt(IMP);
		offset = savoff;
	}
	offset = dip->op;
	if(req != '.')control(req,1);
de1:
	ds = app = 0;
	return;
}
예제 #2
0
파일: n5.c 프로젝트: aksr/heirloom
void
casewhile(void)
{
	tchar	c;
	int	k, level, nl;
	filep	newip;

	if (dip != d)
		wbfl();
	if ((nextb = alloc()) == 0) {
		errprint("out of space");
		edone(04);
		return;
	}
	newip = offset = nextb;
	wbf(mkxfunc(CC, 0));
	wbf(XFUNC);	/* caseif */
	wbf(' ');
	copyf++, clonef++;
	nl = level = 0;
	do {
		nlflg = 0;
		k = cbits(c = getch());
		switch (k) {
		case LEFT:
			level++;
			break;
		case RIGHT:
			level--;
			break;
		}
		wbf(c);
	} while (!nlflg || level > 0);
	if (level < 0 && warn & WARN_DELIM)
		errprint("%d excess delimiter(s)", -level);
	wbt(0);
	copyf--, clonef--;
	pushi(newip, LOOP, 0);
	offset = dip->op;
}