examples/libxml.c
hubbub_error ref_node(void *ctx, void *node)
{
	context *c = (context *) ctx;

	if (node == c->document) {
		xmlDoc *n = (xmlDoc *) node;
		uintptr_t count = (uintptr_t) n->_private;

		n->_private = (void *) ++count;
	} else {
		xmlNode *n = (xmlNode *) node;
		uintptr_t count = (uintptr_t) n->_private;

		n->_private = (void *) ++count;
	}

	return HUBBUB_OK;
}
/**
 * Increase a node's reference count
 *
 * \param ctx   Our context
 * \param node  The node to reference
 * \return HUBBUB_OK on success, appropriate error otherwise
 */
Increase a node's reference count
\param ctx   Our context
\param node  The node to reference
\return HUBBUB_OK on success, appropriate error otherwise
Increase a node ' s reference count \ param ctx Our context \ param node The node to reference \ return HUBBUB_OK on success appropriate error otherwise
hubbub_error ref_node(void *ctx, void *node)
{
	context *c = (context *) ctx;
	if (node == c->document) {
		xmlDoc *n = (xmlDoc *) node;
		uintptr_t count = (uintptr_t) n->_private;
		n->_private = (void *) ++count;
	} else {
		xmlNode *n = (xmlNode *) node;
		uintptr_t count = (uintptr_t) n->_private;
		n->_private = (void *) ++count;
	}
	return HUBBUB_OK;
}
hubbub_error ref_node ( void * ctx , void * node ) { context * c = ( context * ) ctx ; if ( node == c -> document ) { xmlDoc * n = ( xmlDoc * ) node ; uintptr_t count = ( uintptr_t ) n -> _private ; n -> _private = ( void * ) ++ count ; } else { xmlNode * n = ( xmlNode * ) node ; uintptr_t count = ( uintptr_t ) n -> _private ; n -> _private = ( void * ) ++ count ; } return HUBBUB_OK ; }
Increase a node's reference count
 \param ctx   Our context
 \param node  The node to reference
 \return HUBBUB_OK on success, appropriate error otherwise
Increase a node ' s reference count \ param ctx Our context \ param node The node to reference \ return HUBBUB_OK on success appropriate error otherwise