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

Go to the source code of this file.

Macros

#define dom_tokenlist_item(l, i, n)
 

Typedefs

typedef struct dom_tokenlist dom_tokenlist
 

Functions

void dom_tokenlist_ref (struct dom_tokenlist *list)
 
void dom_tokenlist_unref (struct dom_tokenlist *list)
 
dom_exception dom_tokenlist_create (struct dom_element *ele, struct dom_string *attr, dom_tokenlist **list)
 
dom_exception dom_tokenlist_get_length (struct dom_tokenlist *list, uint32_t *length)
 
dom_exception _dom_tokenlist_item (struct dom_tokenlist *list, uint32_t index, struct dom_string **value)
 
dom_exception dom_tokenlist_get_value (struct dom_tokenlist *list, struct dom_string **value)
 
dom_exception dom_tokenlist_set_value (struct dom_tokenlist *list, struct dom_string *value)
 
dom_exception dom_tokenlist_contains (struct dom_tokenlist *list, struct dom_string *value, bool *contains)
 
dom_exception dom_tokenlist_add (struct dom_tokenlist *list, struct dom_string *value)
 
dom_exception dom_tokenlist_remove (struct dom_tokenlist *list, struct dom_string *value)
 

Macro Definition Documentation

◆ dom_tokenlist_item

#define dom_tokenlist_item ( l,
i,
n )
Value:
(uint32_t) (i), (struct dom_string **) (n))
dom_exception _dom_tokenlist_item(struct dom_tokenlist *list, uint32_t index, struct dom_string **value)
Definition tokenlist.c:404
Definition string.h:19
Definition tokenlist.c:28

Typedef Documentation

◆ dom_tokenlist

typedef struct dom_tokenlist dom_tokenlist

Function Documentation

◆ _dom_tokenlist_item()

dom_exception _dom_tokenlist_item ( dom_tokenlist * list,
uint32_t index,
dom_string ** value )

Get a particular item from the tokenlist

Parameters
listThe list to retrieve the item from
indexThe index of the item to retrieve
valueThe value of the item returns here
Returns
DOM_NO_ERR on success, otherwise the failure code

◆ dom_tokenlist_add()

dom_exception dom_tokenlist_add ( dom_tokenlist * list,
dom_string * value )

Add the given value to the tokenlist

Parameters
listThe list to add to
valueThe value to add
Returns
DOM_NO_ERR on success, otherwise the failure code

◆ dom_tokenlist_contains()

dom_exception dom_tokenlist_contains ( dom_tokenlist * list,
dom_string * value,
bool * contains )

Check if the given value is in the tokenlist

Parameters
listThe list to scan for the given value
valueThe value to look for in the token list
containsThis will be set based on whether or not the value is present
Returns
DOM_NO_ERR on success, otherwise the failure code

◆ dom_tokenlist_create()

dom_exception dom_tokenlist_create ( dom_element * ele,
dom_string * attr,
dom_tokenlist ** list )

Create a tokenlist

Parameters
eleThe element which owns the tokenlist attribute
attrThe name of the attribute we are treating as a tokenlist
listThe tokenlist output which is set on success
Returns
DOM_NO_ERR on success, DOM_NO_MEM_ERR on memory exhaustion

The returned list will already be referenced, so the client need not do so explicitly. The client must unref the list once finished with it.

This list will take its own references to ::ele and ::attr

◆ dom_tokenlist_get_length()

dom_exception dom_tokenlist_get_length ( dom_tokenlist * list,
uint32_t * length )

Get the length of the tokenlist

Parameters
listThe list to get the length of
lengthLength of the list outputs here
Returns
DOM_NO_ERR on success, otherwise the failure code

◆ dom_tokenlist_get_value()

dom_exception dom_tokenlist_get_value ( dom_tokenlist * list,
dom_string ** value )

Retrieve the value of the tokenlist as a string

Parameters
listThe list to retrieve the value of
valueThe value of the list returns here
Returns
DOM_NO_ERR on success, otherwise the failure code

◆ dom_tokenlist_ref()

void dom_tokenlist_ref ( dom_tokenlist * list)

Claim a ref on a tokenlist

Parameters
listThe tokenlist to claim a ref on

◆ dom_tokenlist_remove()

dom_exception dom_tokenlist_remove ( dom_tokenlist * list,
dom_string * value )

Remove the given value from the tokenlist

Parameters
listThe list to remove from
valueThe value to remove
Returns
DOM_NO_ERR on success, otherwise the failure code

◆ dom_tokenlist_set_value()

dom_exception dom_tokenlist_set_value ( dom_tokenlist * list,
dom_string * value )

Set the value of the tokenlist as a string

Parameters
listThe list to set the value of
valueThe value to set
Returns
DOM_NO_ERR on success, otherwise the failure code

◆ dom_tokenlist_unref()

void dom_tokenlist_unref ( dom_tokenlist * list)

Release a ref on a tokenlist

Parameters
listThe list to release the reference of

If you release the last ref, this cleans up the tokenlist