if (pos == 0 && n->elems[1]) { e->posn = 1; return n->elems[1];
if (pos < 2 && n->elems[pos+1]) { e->posn = pos+1; return n->elems[e->posn];
void *next234(enum234 *e) {    node234 *n = e->node;    int pos = e->posn;    if (n->kids[pos+1]) {	n = n->kids[pos+1];	while (n->kids[0])	    n = n->kids[0];	e->node = n;	e->posn = 0;	return n->elems[0];    }    if (pos == 0 && n->elems[1]) {	e->posn = 1;	return n->elems[1];    }    do {	node234 *nn = n->parent;	if (nn == NULL)	    return NULL;	       /* end of tree */	pos = (nn->kids[0] == n ? 0 :	       nn->kids[1] == n ? 1 :	       nn->kids[2] == n ? 2 : 3);	n = nn;    } while (pos == 3 || n->kids[pos+1] == NULL);    e->node = n;    e->posn = pos;    return n->elems[pos];}