libdom
Loading...
Searching...
No Matches
Functions
html_options_collection.c File Reference
#include <assert.h>
#include <stdlib.h>
#include <libwapcaplet/libwapcaplet.h>
#include "html/html_options_collection.h"
#include "core/node.h"
#include "core/element.h"
#include "core/string.h"
#include "utils/utils.h"

Functions

dom_exception _dom_html_options_collection_create (struct dom_html_document *doc, struct dom_node_internal *root, dom_callback_is_in_collection ic, void *ctx, struct dom_html_options_collection **col)
 
dom_exception _dom_html_options_collection_initialise (struct dom_html_document *doc, struct dom_html_options_collection *col, struct dom_node_internal *root, dom_callback_is_in_collection ic, void *ctx)
 
void _dom_html_options_collection_finalise (struct dom_html_options_collection *col)
 
void _dom_html_options_collection_destroy (struct dom_html_options_collection *col)
 
dom_exception dom_html_options_collection_get_length (dom_html_options_collection *col, uint32_t *len)
 
dom_exception dom_html_options_collection_set_length (dom_html_options_collection *col, uint32_t len)
 
dom_exception dom_html_options_collection_item (dom_html_options_collection *col, uint32_t index, struct dom_node **node)
 
dom_exception dom_html_options_collection_named_item (dom_html_options_collection *col, dom_string *name, struct dom_node **node)
 
void dom_html_options_collection_ref (dom_html_options_collection *col)
 
void dom_html_options_collection_unref (dom_html_options_collection *col)
 

Function Documentation

◆ _dom_html_options_collection_create()

dom_exception _dom_html_options_collection_create ( struct dom_html_document * doc,
struct dom_node_internal * root,
dom_callback_is_in_collection ic,
void * ctx,
struct dom_html_options_collection ** col )

Create a dom_html_options_collection

Parameters
docThe document
rootThe root element of the collection
icThe callback function used to determin whether certain node beint32_ts to the collection
colThe result collection object
Returns
DOM_NO_ERR on success, appropriate dom_exception on failure.

◆ _dom_html_options_collection_destroy()

void _dom_html_options_collection_destroy ( struct dom_html_options_collection * col)

Destroy a dom_html_options_collection object

Parameters
colThe dom_html_options_collection object

◆ _dom_html_options_collection_finalise()

void _dom_html_options_collection_finalise ( struct dom_html_options_collection * col)

Finalise a dom_html_options_collection object

Parameters
colThe dom_html_options_collection object

◆ _dom_html_options_collection_initialise()

dom_exception _dom_html_options_collection_initialise ( struct dom_html_document * doc,
struct dom_html_options_collection * col,
struct dom_node_internal * root,
dom_callback_is_in_collection ic,
void * ctx )

Intialiase a dom_html_options_collection

Parameters
docThe document
colThe collection object to be initialised
rootThe root element of the collection
icThe callback function used to determin whether certain node beint32_ts to the collection
Returns
DOM_NO_ERR on success.

◆ dom_html_options_collection_get_length()

dom_exception dom_html_options_collection_get_length ( dom_html_options_collection * col,
uint32_t * len )

Get the length of this dom_html_options_collection

Parameters
colThe dom_html_options_collection object
lenThe returned length of this collection
Returns
DOM_NO_ERR on success.

◆ dom_html_options_collection_item()

dom_exception dom_html_options_collection_item ( dom_html_options_collection * col,
uint32_t index,
struct dom_node ** node )

Get the node with certain index

Parameters
colThe dom_html_options_collection object
indexThe index number based on zero
nodeThe returned node object
Returns
DOM_NO_ERR on success.

◆ dom_html_options_collection_named_item()

dom_exception dom_html_options_collection_named_item ( dom_html_options_collection * col,
dom_string * name,
struct dom_node ** node )

Get the node in the collection according name

Parameters
colThe collection
nameThe name of target node
nodeThe returned node object
Returns
DOM_NO_ERR on success.

◆ dom_html_options_collection_ref()

void dom_html_options_collection_ref ( dom_html_options_collection * col)

Claim a reference on this collection

\pram col The collection object

◆ dom_html_options_collection_set_length()

dom_exception dom_html_options_collection_set_length ( dom_html_options_collection * col,
uint32_t len )

Set the length of this dom_html_options_collection

Parameters
colThe dom_html_options_collection object
lenThe length of this collection to be set
Returns
DOM_NO_ERR on success.

◆ dom_html_options_collection_unref()

void dom_html_options_collection_unref ( dom_html_options_collection * col)

Relese a reference on this collection

\pram col The collection object