summaryrefslogtreecommitdiff
path: root/src/core/namednodemap.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2007-07-12 23:45:43 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2007-07-12 23:45:43 +0000
commitdccc9726c0ea0258beed12309d0426713b4d74ed (patch)
tree38f659fcce45b6bb02466faeb8eedf8ef90ab274 /src/core/namednodemap.c
parent0448f3de0bc3e9aa71bd095e87fd1cc2584e0a99 (diff)
downloadlibdom-dccc9726c0ea0258beed12309d0426713b4d74ed.tar.gz
libdom-dccc9726c0ea0258beed12309d0426713b4d74ed.tar.bz2
Make NamedNodeMap more generic
svn path=/trunk/dom/; revision=3404
Diffstat (limited to 'src/core/namednodemap.c')
-rw-r--r--src/core/namednodemap.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/core/namednodemap.c b/src/core/namednodemap.c
index b13dee6..239dd6f 100644
--- a/src/core/namednodemap.c
+++ b/src/core/namednodemap.c
@@ -18,9 +18,9 @@
struct dom_namednodemap {
struct dom_document *owner; /**< Owning document */
- struct dom_node *root; /**< Node containing items in map */
+ struct dom_node *head; /**< Start of item list */
- dom_namednodemap_type type; /**< Type of map */
+ dom_node_type type; /**< Type of items in map */
uint32_t refcnt; /**< Reference count */
};
@@ -29,24 +29,24 @@ struct dom_namednodemap {
* Create a namednodemap
*
* \param doc The owning document
- * \param root Node containing items in map
- * \param type The type of map
+ * \param head Start of list containing items in map
+ * \param type The type of items in the map
* \param map Pointer to location to receive created map
* \return DOM_NO_ERR on success, DOM_NO_MEM_ERR on memory exhaustion
*
- * ::root must be a node owned by ::doc and must be either an Element or
+ * ::head must be a node owned by ::doc and must be either an Element or
* DocumentType node.
*
- * If ::root is of type Element, ::type must be DOM_NAMEDNODEMAP_ATTRIBUTES
- * If ::root is of type DocumentType, ::type may be either
- * DOM_NAMEDNODEMAP_ENTITIES or DOM_NAMEDNODEMAP_NOTATIONS.
+ * If ::head is of type Element, ::type must be DOM_ATTRIBUTE_NODE
+ * If ::head is of type DocumentType, ::type may be either
+ * DOM_ENTITY_NODE or DOM_NOTATION_NODE.
*
* The returned map will already be referenced, so the client need not
* explicitly reference it. The client must unref the map once it is
* finished with it.
*/
dom_exception dom_namednodemap_create(struct dom_document *doc,
- struct dom_node *root, dom_namednodemap_type type,
+ struct dom_node *head, dom_node_type type,
struct dom_namednodemap **map)
{
struct dom_namednodemap *m;
@@ -58,8 +58,8 @@ dom_exception dom_namednodemap_create(struct dom_document *doc,
dom_node_ref((struct dom_node *) doc);
m->owner = doc;
- dom_node_ref(root);
- m->root = root;
+ dom_node_ref(head);
+ m->head = head;
m->type = type;
@@ -93,7 +93,7 @@ void dom_namednodemap_unref(struct dom_namednodemap *map)
if (--map->refcnt == 0) {
struct dom_node *owner = (struct dom_node *) map->owner;
- dom_node_unref(map->root);
+ dom_node_unref(map->head);
/* Remove map from document */
dom_document_remove_namednodemap(map->owner, map);
@@ -330,15 +330,15 @@ dom_exception dom_namednodemap_remove_named_item_ns(
/**
* Match a namednodemap instance against a set of creation parameters
*
- * \param map The map to match
- * \param root Node containing items in map
- * \param type The type of map
+ * \param map The map to match
+ * \param head Start of list containing items in map
+ * \param type The type of items in the map
* \return true if list matches, false otherwise
*/
bool dom_namednodemap_match(struct dom_namednodemap *map,
- struct dom_node *root, dom_namednodemap_type type)
+ struct dom_node *head, dom_node_type type)
{
- if (map->root == root && map->type == type)
+ if (map->head == head && map->type == type)
return true;
return false;