summaryrefslogtreecommitdiff
path: root/src/html
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-09-10 19:14:49 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-09-10 19:14:49 +0100
commita77488bab4732c30044b04e97d13707e03825bdf (patch)
treec2b056265adfe7acd76596ab5433d2ce7f227cd3 /src/html
parentc733e0fbd053ffa80b83839c4114a2a28b3ed2ec (diff)
downloadlibdom-a77488bab4732c30044b04e97d13707e03825bdf.tar.gz
libdom-a77488bab4732c30044b04e97d13707e03825bdf.tar.bz2
unsigned long -> uint32_t, signed long and long -> int32_t, plus collateral fixes. Test suite does not pass
Diffstat (limited to 'src/html')
-rw-r--r--src/html/html_button_element.c8
-rw-r--r--src/html/html_collection.c10
-rw-r--r--src/html/html_document.c2
-rw-r--r--src/html/html_element.c18
-rw-r--r--src/html/html_element.h12
-rw-r--r--src/html/html_form_element.c2
-rw-r--r--src/html/html_input_element.c16
-rw-r--r--src/html/html_options_collection.c10
-rw-r--r--src/html/html_select_element.c16
-rw-r--r--src/html/html_select_element.h2
-rw-r--r--src/html/html_text_area_element.c24
11 files changed, 60 insertions, 60 deletions
diff --git a/src/html/html_button_element.c b/src/html/html_button_element.c
index 47fdb7b..95b5d31 100644
--- a/src/html/html_button_element.c
+++ b/src/html/html_button_element.c
@@ -196,16 +196,16 @@ SIMPLE_GET(type);
SIMPLE_GET_SET(value);
dom_exception dom_html_button_element_get_tab_index(
- dom_html_button_element *button, long *tab_index)
+ dom_html_button_element *button, int32_t *tab_index)
{
- return dom_html_element_get_long_property(&button->base, "tabindex",
+ return dom_html_element_get_int32_t_property(&button->base, "tabindex",
SLEN("tabindex"), tab_index);
}
dom_exception dom_html_button_element_set_tab_index(
- dom_html_button_element *button, unsigned long tab_index)
+ dom_html_button_element *button, uint32_t tab_index)
{
- return dom_html_element_set_long_property(&button->base, "tabindex",
+ return dom_html_element_set_int32_t_property(&button->base, "tabindex",
SLEN("tabindex"), tab_index);
}
diff --git a/src/html/html_collection.c b/src/html/html_collection.c
index 1e43940..704d384 100644
--- a/src/html/html_collection.c
+++ b/src/html/html_collection.c
@@ -25,7 +25,7 @@
* \param doc The document
* \param root The root element of the collection
* \param ic The callback function used to determin whether certain node
- * belongs to the collection
+ * beint32_ts to the collection
* \param col The result collection object
* \return DOM_NO_ERR on success, appropriate dom_exception on failure.
*/
@@ -49,7 +49,7 @@ dom_exception _dom_html_collection_create(struct dom_html_document *doc,
* \param col The collection object to be initialised
* \param root The root element of the collection
* \param ic The callback function used to determin whether certain node
- * belongs to the collection
+ * beint32_ts to the collection
* \return DOM_NO_ERR on success.
*/
dom_exception _dom_html_collection_initialise(struct dom_html_document *doc,
@@ -113,7 +113,7 @@ void _dom_html_collection_destroy(struct dom_html_collection *col)
* \return DOM_NO_ERR on success.
*/
dom_exception dom_html_collection_get_length(dom_html_collection *col,
- unsigned long *len)
+ uint32_t *len)
{
struct dom_node_internal *node = col->root;
*len = 0;
@@ -157,10 +157,10 @@ dom_exception dom_html_collection_get_length(dom_html_collection *col,
* \return DOM_NO_ERR on success.
*/
dom_exception dom_html_collection_item(dom_html_collection *col,
- unsigned long index, struct dom_node **node)
+ uint32_t index, struct dom_node **node)
{
struct dom_node_internal *n = col->root;
- unsigned long len = 0;
+ uint32_t len = 0;
while (n != NULL) {
if (n->type == DOM_ELEMENT_NODE &&
diff --git a/src/html/html_document.c b/src/html/html_document.c
index ffc2e1c..1b238e9 100644
--- a/src/html/html_document.c
+++ b/src/html/html_document.c
@@ -340,7 +340,7 @@ dom_exception _dom_html_document_get_title(dom_html_document *doc,
} else {
dom_element *node;
dom_nodelist *nodes;
- unsigned long len;
+ uint32_t len;
exc = dom_document_get_elements_by_tag_name(doc,
doc->memoised[hds_TITLE],
diff --git a/src/html/html_element.c b/src/html/html_element.c
index b3b3bfc..9dc3155 100644
--- a/src/html/html_element.c
+++ b/src/html/html_element.c
@@ -220,7 +220,7 @@ dom_exception _dom_html_element_get_elements_by_tag_name_ns(
* \return DOM_NO_ERR on success, appropriate dom_exception on failure.
*/
dom_exception dom_html_element_get_bool_property(dom_html_element *ele,
- const char *name, unsigned long len, bool *has)
+ const char *name, uint32_t len, bool *has)
{
dom_string *str = NULL;
dom_attr *a = NULL;
@@ -259,7 +259,7 @@ fail:
* \return DOM_NO_ERR on success, appropriate dom_exception on failure.
*/
dom_exception dom_html_element_set_bool_property(dom_html_element *ele,
- const char *name, unsigned long len, bool has)
+ const char *name, uint32_t len, bool has)
{
dom_string *str = NULL;
dom_attr *a = NULL;
@@ -325,7 +325,7 @@ static char *_strndup(const char *s, size_t n)
}
/**
- * Get the a long property
+ * Get the a int32_t property
*
* \param ele The dom_html_element object
* \param name The name of the attribute
@@ -333,8 +333,8 @@ static char *_strndup(const char *s, size_t n)
* \param value The returned value, or -1 if prop. not set
* \return DOM_NO_ERR on success, appropriate dom_exception on failure.
*/
-dom_exception dom_html_element_get_long_property(dom_html_element *ele,
- const char *name, unsigned long len, long *value)
+dom_exception dom_html_element_get_int32_t_property(dom_html_element *ele,
+ const char *name, uint32_t len, int32_t *value)
{
dom_string *str = NULL, *s2 = NULL;
dom_attr *a = NULL;
@@ -372,7 +372,7 @@ fail:
}
/**
- * Set a long property
+ * Set a int32_t property
*
* \param ele The dom_html_element object
* \param name The name of the attribute
@@ -380,8 +380,8 @@ fail:
* \param value The value
* \return DOM_NO_ERR on success, appropriate dom_exception on failure.
*/
-dom_exception dom_html_element_set_long_property(dom_html_element *ele,
- const char *name, unsigned long len, unsigned long value)
+dom_exception dom_html_element_set_int32_t_property(dom_html_element *ele,
+ const char *name, uint32_t len, uint32_t value)
{
dom_string *str = NULL, *svalue = NULL;
dom_exception err;
@@ -391,7 +391,7 @@ dom_exception dom_html_element_set_long_property(dom_html_element *ele,
if (err != DOM_NO_ERR)
goto fail;
- if (snprintf(numbuffer, 32, "%lu", value) == 32)
+ if (snprintf(numbuffer, 32, "%u", value) == 32)
numbuffer[31] = '\0';
err = dom_string_create((const uint8_t *) numbuffer,
diff --git a/src/html/html_element.h b/src/html/html_element.h
index 140e3f1..a1130cc 100644
--- a/src/html/html_element.h
+++ b/src/html/html_element.h
@@ -113,14 +113,14 @@ dom_exception _dom_html_element_set_class_name(dom_html_element *element,
/* Some common functions used by all child classes */
dom_exception dom_html_element_get_bool_property(dom_html_element *ele,
- const char *name, unsigned long len, bool *has);
+ const char *name, uint32_t len, bool *has);
dom_exception dom_html_element_set_bool_property(dom_html_element *ele,
- const char *name, unsigned long len, bool has);
+ const char *name, uint32_t len, bool has);
-dom_exception dom_html_element_get_long_property(dom_html_element *ele,
- const char *name, unsigned long len, long *value);
-dom_exception dom_html_element_set_long_property(dom_html_element *ele,
- const char *name, unsigned long len, unsigned long value);
+dom_exception dom_html_element_get_int32_t_property(dom_html_element *ele,
+ const char *name, uint32_t len, int32_t *value);
+dom_exception dom_html_element_set_int32_t_property(dom_html_element *ele,
+ const char *name, uint32_t len, uint32_t value);
extern struct dom_html_element_vtable _dom_html_element_vtable;
diff --git a/src/html/html_form_element.c b/src/html/html_form_element.c
index fcdf42e..55ec0e9 100644
--- a/src/html/html_form_element.c
+++ b/src/html/html_form_element.c
@@ -168,7 +168,7 @@ dom_exception dom_html_form_element_get_elements(dom_html_form_element *ele,
* \return DOM_NO_ERR on success, appropriate dom_exception on failure.
*/
dom_exception dom_html_form_element_get_length(dom_html_form_element *ele,
- unsigned long *len)
+ uint32_t *len)
{
dom_exception err;
diff --git a/src/html/html_input_element.c b/src/html/html_input_element.c
index 694eb22..9586abb 100644
--- a/src/html/html_input_element.c
+++ b/src/html/html_input_element.c
@@ -356,30 +356,30 @@ SIMPLE_GET_SET(use_map);
SIMPLE_GET_SET(value);
dom_exception dom_html_input_element_get_tab_index(
- dom_html_input_element *input, long *tab_index)
+ dom_html_input_element *input, int32_t *tab_index)
{
- return dom_html_element_get_long_property(&input->base, "tabindex",
+ return dom_html_element_get_int32_t_property(&input->base, "tabindex",
SLEN("tabindex"), tab_index);
}
dom_exception dom_html_input_element_set_tab_index(
- dom_html_input_element *input, unsigned long tab_index)
+ dom_html_input_element *input, uint32_t tab_index)
{
- return dom_html_element_set_long_property(&input->base, "tabindex",
+ return dom_html_element_set_int32_t_property(&input->base, "tabindex",
SLEN("tabindex"), tab_index);
}
dom_exception dom_html_input_element_get_max_length(
- dom_html_input_element *input, long *max_length)
+ dom_html_input_element *input, int32_t *max_length)
{
- return dom_html_element_get_long_property(&input->base, "maxlength",
+ return dom_html_element_get_int32_t_property(&input->base, "maxlength",
SLEN("maxlength"), max_length);
}
dom_exception dom_html_input_element_set_max_length(
- dom_html_input_element *input, unsigned long max_length)
+ dom_html_input_element *input, uint32_t max_length)
{
- return dom_html_element_set_long_property(&input->base, "maxlength",
+ return dom_html_element_set_int32_t_property(&input->base, "maxlength",
SLEN("maxlength"), max_length);
}
diff --git a/src/html/html_options_collection.c b/src/html/html_options_collection.c
index 26926bf..0583d9c 100644
--- a/src/html/html_options_collection.c
+++ b/src/html/html_options_collection.c
@@ -26,7 +26,7 @@
* \param doc The document
* \param root The root element of the collection
* \param ic The callback function used to determin whether certain node
- * belongs to the collection
+ * beint32_ts to the collection
* \param col The result collection object
* \return DOM_NO_ERR on success, appropriate dom_exception on failure.
*/
@@ -51,7 +51,7 @@ dom_exception _dom_html_options_collection_create(struct dom_html_document *doc,
* \param col The collection object to be initialised
* \param root The root element of the collection
* \param ic The callback function used to determin whether certain node
- * belongs to the collection
+ * beint32_ts to the collection
* \return DOM_NO_ERR on success.
*/
dom_exception _dom_html_options_collection_initialise(struct dom_html_document *doc,
@@ -95,7 +95,7 @@ void _dom_html_options_collection_destroy(struct dom_html_options_collection *co
* \return DOM_NO_ERR on success.
*/
dom_exception dom_html_options_collection_get_length(dom_html_options_collection *col,
- unsigned long *len)
+ uint32_t *len)
{
return dom_html_collection_get_length(&col->base, len);
}
@@ -108,7 +108,7 @@ dom_exception dom_html_options_collection_get_length(dom_html_options_collection
* \return DOM_NO_ERR on success.
*/
dom_exception dom_html_options_collection_set_length(
- dom_html_options_collection *col, unsigned long len)
+ dom_html_options_collection *col, uint32_t len)
{
UNUSED(col);
UNUSED(len);
@@ -126,7 +126,7 @@ dom_exception dom_html_options_collection_set_length(
* \return DOM_NO_ERR on success.
*/
dom_exception dom_html_options_collection_item(dom_html_options_collection *col,
- unsigned long index, struct dom_node **node)
+ uint32_t index, struct dom_node **node)
{
return dom_html_collection_item(&col->base, index, node);
}
diff --git a/src/html/html_select_element.c b/src/html/html_select_element.c
index 2d92c5f..58c08bc 100644
--- a/src/html/html_select_element.c
+++ b/src/html/html_select_element.c
@@ -137,7 +137,7 @@ dom_exception _dom_html_select_element_copy(dom_node_internal *old,
* \return DOM_NO_ERR on success.
*/
dom_exception dom_html_select_element_get_selected_index(
- dom_html_select_element *ele, unsigned long *index)
+ dom_html_select_element *ele, uint32_t *index)
{
*index = ele->selected;
@@ -152,7 +152,7 @@ dom_exception dom_html_select_element_get_selected_index(
* \return DOM_NO_ERR on success.
*/
dom_exception dom_html_select_element_set_selected_index(
- dom_html_select_element *ele, unsigned long index)
+ dom_html_select_element *ele, uint32_t index)
{
ele->selected = index;
@@ -167,7 +167,7 @@ dom_exception dom_html_select_element_set_selected_index(
* \return DOM_NO_ERR on success.
*/
dom_exception dom_html_select_element_get_length(
- dom_html_select_element *ele, unsigned long *len)
+ dom_html_select_element *ele, uint32_t *len)
{
dom_exception err;
dom_html_document *doc = (dom_html_document *) dom_node_get_owner(ele);
@@ -194,7 +194,7 @@ dom_exception dom_html_select_element_get_length(
* todo: how to deal with set the len of the children option objects?
*/
dom_exception dom_html_select_element_set_length(
- dom_html_select_element *ele, unsigned long len)
+ dom_html_select_element *ele, uint32_t len)
{
UNUSED(ele);
UNUSED(len);
@@ -291,13 +291,13 @@ dom_exception dom_html_select_element_set_multiple(
}
dom_exception dom_html_select_element_get_size(
- dom_html_select_element *ele, unsigned long *size);
+ dom_html_select_element *ele, uint32_t *size);
dom_exception dom_html_select_element_set_size(
- dom_html_select_element *ele, unsigned long size);
+ dom_html_select_element *ele, uint32_t size);
dom_exception dom_html_select_element_get_tab_index(
- dom_html_select_element *ele, unsigned long *tab_index);
+ dom_html_select_element *ele, uint32_t *tab_index);
dom_exception dom_html_select_element_set_tab_index(
- dom_html_select_element *ele, unsigned long tab_index);
+ dom_html_select_element *ele, uint32_t tab_index);
/* Functions */
dom_exception dom_html_select_element_add(struct dom_html_element *ele,
diff --git a/src/html/html_select_element.h b/src/html/html_select_element.h
index 68c51e3..ae5c7dd 100644
--- a/src/html/html_select_element.h
+++ b/src/html/html_select_element.h
@@ -16,7 +16,7 @@
struct dom_html_select_element {
struct dom_html_element base;
/**< The base class */
- long selected;
+ int32_t selected;
/**< The selected element's index */
dom_html_options_collection *options;
/**< The options objects */
diff --git a/src/html/html_text_area_element.c b/src/html/html_text_area_element.c
index 887a2c0..1c7534c 100644
--- a/src/html/html_text_area_element.c
+++ b/src/html/html_text_area_element.c
@@ -365,44 +365,44 @@ dom_exception dom_html_text_area_element_get_type(
}
dom_exception dom_html_text_area_element_get_tab_index(
- dom_html_text_area_element *text_area, long *tab_index)
+ dom_html_text_area_element *text_area, int32_t *tab_index)
{
- return dom_html_element_get_long_property(&text_area->base, "tabindex",
+ return dom_html_element_get_int32_t_property(&text_area->base, "tabindex",
SLEN("tabindex"), tab_index);
}
dom_exception dom_html_text_area_element_set_tab_index(
- dom_html_text_area_element *text_area, unsigned long tab_index)
+ dom_html_text_area_element *text_area, uint32_t tab_index)
{
- return dom_html_element_set_long_property(&text_area->base, "tabindex",
+ return dom_html_element_set_int32_t_property(&text_area->base, "tabindex",
SLEN("tabindex"), tab_index);
}
dom_exception dom_html_text_area_element_get_cols(
- dom_html_text_area_element *text_area, long *cols)
+ dom_html_text_area_element *text_area, int32_t *cols)
{
- return dom_html_element_get_long_property(&text_area->base, "cols",
+ return dom_html_element_get_int32_t_property(&text_area->base, "cols",
SLEN("cols"), cols);
}
dom_exception dom_html_text_area_element_set_cols(
- dom_html_text_area_element *text_area, unsigned long cols)
+ dom_html_text_area_element *text_area, uint32_t cols)
{
- return dom_html_element_set_long_property(&text_area->base, "cols",
+ return dom_html_element_set_int32_t_property(&text_area->base, "cols",
SLEN("cols"), cols);
}
dom_exception dom_html_text_area_element_get_rows(
- dom_html_text_area_element *text_area, long *rows)
+ dom_html_text_area_element *text_area, int32_t *rows)
{
- return dom_html_element_get_long_property(&text_area->base, "rows",
+ return dom_html_element_get_int32_t_property(&text_area->base, "rows",
SLEN("rows"), rows);
}
dom_exception dom_html_text_area_element_set_rows(
- dom_html_text_area_element *text_area, unsigned long rows)
+ dom_html_text_area_element *text_area, uint32_t rows)
{
- return dom_html_element_set_long_property(&text_area->base, "rows",
+ return dom_html_element_set_int32_t_property(&text_area->base, "rows",
SLEN("rows"), rows);
}