From 4143b787a2496b74c7a684fe8507c593b136cf8b Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 4 Feb 2017 11:05:20 +0000 Subject: util dom-str: Add additional dom event type strings. --- src/util/dom-str.c | 27 +++++++++++++++++++++++++++ src/util/dom-str.h | 3 +++ 2 files changed, 30 insertions(+) diff --git a/src/util/dom-str.c b/src/util/dom-str.c index b959afe..03fdd9e 100644 --- a/src/util/dom-str.c +++ b/src/util/dom-str.c @@ -15,7 +15,10 @@ #include "util/util.h" dom_string *nsl_dom_str_node_inserted; +dom_string *nsl_dom_str_node_removed; dom_string *nsl_dom_str_subtree_modified; +dom_string *nsl_dom_str_attr_modified; +dom_string *nsl_dom_str_characterdata_modified; /* Exported function, documented in src/util/dom-str.h */ @@ -31,6 +34,14 @@ nslayout_error nsl_dom_str_init(void) printf("Failed to create string!\n"); return NSLAYOUT_NO_MEM; } + exc = dom_string_create((const uint8_t *)"DOMNodeRemoved", + SLEN("DOMNodeRemoved"), + &nsl_dom_str_node_removed); + if (exc != DOM_NO_ERR) { + /* TODO: free stuff, return value */ + printf("Failed to create string!\n"); + return NSLAYOUT_NO_MEM; + } exc = dom_string_create((const uint8_t *)"DOMSubtreeModified", SLEN("DOMSubtreeModified"), &nsl_dom_str_subtree_modified); @@ -39,6 +50,22 @@ nslayout_error nsl_dom_str_init(void) printf("Failed to create string!\n"); return NSLAYOUT_NO_MEM; } + exc = dom_string_create((const uint8_t *)"DOMAttrModified", + SLEN("DOMAttrModified"), + &nsl_dom_str_attr_modified); + if (exc != DOM_NO_ERR) { + /* TODO: free stuff, return value */ + printf("Failed to create string!\n"); + return NSLAYOUT_NO_MEM; + } + exc = dom_string_create((const uint8_t *)"DOMCharacterDataModified", + SLEN("DOMCharacterDataModified"), + &nsl_dom_str_characterdata_modified); + if (exc != DOM_NO_ERR) { + /* TODO: free stuff, return value */ + printf("Failed to create string!\n"); + return NSLAYOUT_NO_MEM; + } return NSLAYOUT_OK; } diff --git a/src/util/dom-str.h b/src/util/dom-str.h index 9a51ad5..7c130c3 100644 --- a/src/util/dom-str.h +++ b/src/util/dom-str.h @@ -14,7 +14,10 @@ #include extern dom_string *nsl_dom_str_node_inserted; +extern dom_string *nsl_dom_str_node_removed; extern dom_string *nsl_dom_str_subtree_modified; +extern dom_string *nsl_dom_str_attr_modified; +extern dom_string *nsl_dom_str_characterdata_modified; /** * Create the internal DOM strings -- cgit v1.2.3