static void arrayAddItem()

in src/ujdecode.c [223:243]


static void arrayAddItem(void* context, JSOBJ obj, JSOBJ value)
{
	struct DecoderState *ds = context;
	ArrayItem *ai = (ArrayItem *) obj;
	ArrayEntry *ae = (ArrayEntry *) alloc(ds, sizeof(ArrayEntry));

	ae->next = NULL;
	ae->item = (Item *) value;

	if (ai->tail)
	{
		ai->tail->next = ae;
	}
	else
	{
		ai->head = ae;
	}
	ai->tail = ae;

	ai->length ++;
}