libdom
Loading...
Searching...
No Matches
nodelist.h File Reference

Go to the source code of this file.

Macros

#define dom_nodelist_item(l, i, n)
 

Typedefs

typedef struct dom_nodelist dom_nodelist
 

Functions

void dom_nodelist_ref (struct dom_nodelist *list)
 
void dom_nodelist_unref (struct dom_nodelist *list)
 
dom_exception dom_nodelist_get_length (struct dom_nodelist *list, uint32_t *length)
 
dom_exception _dom_nodelist_item (struct dom_nodelist *list, uint32_t index, struct dom_node **node)
 

Macro Definition Documentation

◆ dom_nodelist_item

#define dom_nodelist_item ( l,
i,
n )
Value:
(uint32_t) (i), (dom_node **) (n))
dom_exception _dom_nodelist_item(struct dom_nodelist *list, uint32_t index, struct dom_node **node)
Definition nodelist.c:305
Definition node.h:79
Definition nodelist.c:26

Typedef Documentation

◆ dom_nodelist

typedef struct dom_nodelist dom_nodelist

Function Documentation

◆ _dom_nodelist_item()

dom_exception _dom_nodelist_item ( dom_nodelist * list,
uint32_t index,
dom_node ** node )

Retrieve an item from a node list

Parameters
listThe list to retrieve the item from
indexThe list index to retrieve
nodePointer to location to receive item
Returns
DOM_NO_ERR.

::index is a zero-based index into list. ::index lies in the range [0, length-1]

The returned node will have had its reference count increased. The client should unref the node once it has finished with it.

NOTE: If node contains a node pointer already, it will NOT be unreffed. Managing the lifetime of that is up to the caller.

◆ dom_nodelist_get_length()

dom_exception dom_nodelist_get_length ( dom_nodelist * list,
uint32_t * length )

Retrieve the length of a node list

Parameters
listList to retrieve length of
lengthPointer to location to receive length
Returns
DOM_NO_ERR.

◆ dom_nodelist_ref()

void dom_nodelist_ref ( dom_nodelist * list)

Claim a reference on a DOM node list

Parameters
listThe list to claim a reference on

◆ dom_nodelist_unref()

void dom_nodelist_unref ( dom_nodelist * list)

Release a reference on a DOM node list

Parameters
listThe list to release the reference from

If the reference count reaches zero, any memory claimed by the list will be released