FreeBSD/contrib/mdocml/eqn.c
/*
 * Allocate a box as the last child of the parent node.
 */
Allocate a box as the last child of the parent node.
Allocate a box as the last child of the parent node .
static struct eqn_box *
eqn_box_alloc(struct eqn_node *ep, struct eqn_box *parent)
{
	struct eqn_box	*bp;
	bp = mandoc_calloc(1, sizeof(struct eqn_box));
	bp->parent = parent;
	bp->parent->args++;
	bp->expectargs = UINT_MAX;
	bp->size = ep->gsize;
	if (NULL != parent->first) {
		parent->last->next = bp;
		bp->prev = parent->last;
	} else
		parent->first = bp;
	parent->last = bp;
	return bp;
}
static struct eqn_box * eqn_box_alloc ( struct eqn_node * ep , struct eqn_box * parent ) { struct eqn_box * bp ; bp = mandoc_calloc ( 1 , sizeof ( struct eqn_box ) ) ; bp -> parent = parent ; bp -> parent -> args ++ ; bp -> expectargs = UINT_MAX ; bp -> size = ep -> gsize ; if ( NULL != parent -> first ) { parent -> last -> next = bp ; bp -> prev = parent -> last ; } else parent -> first = bp ; parent -> last = bp ; return bp ; }
Allocate a box as the last child of the parent node.
Allocate a box as the last child of the parent node .