Example #1
0
static int parseit(struct charmap *map,unsigned char *s, long int row,
  void (*parseone)(struct charmap *map, unsigned char *s, unsigned char **rtn_name, long *rtn_line))
{
	unsigned char *name = NULL;  /* VS */
	long line = -1;
	ERROR *err;

	parseone(map,s,&name,&line);

	if (name) {
		if (line != -1) {
			/* We have an error */
			err = (ERROR *) alitem(&errnodes, sizeof(ERROR));
			err->file = name;
			err->org = err->line = line;
			err->src = row;
			err->msg = vsncpy(NULL, 0, sc("\\i"));
			err->msg = vsncpy(sv(err->msg), sv(s));
			enqueb(ERROR, link, &errors, err);
			return 1;
		} else
			vsrm(name);
	}
	return 0;
}
Example #2
0
UNDO *undomk(B *b)
{
	UNDO *undo = (UNDO *) alitem(&frdos, sizeof(UNDO));

	undo->nrecs = 0;
	undo->ptr = NULL;
	undo->last = NULL;
	undo->first = NULL;
	undo->b = b;
	izque(UNDOREC, link, &undo->recs);
	enquef(UNDO, link, &undos, undo);
	return undo;
}
Example #3
0
static void markpos(W *w, P *p)
{
	POS *newpos = (POS *)alitem(&frpos, SIZEOF(POS));

	newpos->p = NULL;
	pdupown(p, &newpos->p, "markpos");
	poffline(newpos->p);
	newpos->w = w;
	enqueb(POS, link, &pos, newpos);
	if (npos == 20) {
		newpos = pos.link.next;
		prm(newpos->p);
		demote(POS, link, &frpos, newpos);
	} else {
		++npos;
	}
}
Example #4
0
static IREC *alirec(void)
{				/* Allocate an IREC */
	return (IREC *)alitem(&fri, SIZEOF(IREC));
}
Example #5
0
static UNDOREC *alrec(void)
{
	UNDOREC *rec = (UNDOREC *) alitem(&frrecs, sizeof(UNDOREC));

	return rec;
}