Author: struggleyb
Date: Fri Sep 18 03:46:19 2009
New Revision: 9593
URL:
http://source.netsurf-browser.org?rev=9593&view=rev
Log:
Add a new function for convenient use.
Modified:
branches/struggleyb/libdom-html/src/core/node.c
branches/struggleyb/libdom-html/src/core/node.h
Modified: branches/struggleyb/libdom-html/src/core/node.c
URL:
http://source.netsurf-browser.org/branches/struggleyb/libdom-html/src/cor...
==============================================================================
--- branches/struggleyb/libdom-html/src/core/node.c (original)
+++ branches/struggleyb/libdom-html/src/core/node.c Fri Sep 18 03:46:19 2009
@@ -2499,6 +2499,28 @@
}
/**
+ * Create a lwc_string using the node's owner's lwc_context
+ *
+ * \param node The node object
+ * \param data The string data
+ * \param len The length of the string data
+ * \param str The returned lwc_string
+ * \return DOM_NO_ERR on success, appropirate dom_exception on failure.
+ */
+dom_exception _dom_node_create_lwcstring(dom_node_internal *node,
+ const uint8_t *data, size_t len, struct lwc_string_s **str)
+{
+ lwc_context *ctx = NULL;
+ dom_document *doc = dom_node_get_owner(node);
+
+ assert(doc != NULL);
+ ctx = _dom_document_get_intern_context(doc);
+ assert(ctx != NULL);
+
+ return _dom_document_create_lwcstring(doc, data, len, str);
+}
+
+/**
* Try to destroy this node.
*
* \param node The node to destroy
Modified: branches/struggleyb/libdom-html/src/core/node.h
URL:
http://source.netsurf-browser.org/branches/struggleyb/libdom-html/src/cor...
==============================================================================
--- branches/struggleyb/libdom-html/src/core/node.h (original)
+++ branches/struggleyb/libdom-html/src/core/node.h Fri Sep 18 03:46:19 2009
@@ -288,6 +288,8 @@
struct dom_string *str, struct lwc_string_s **intern);
void _dom_node_unref_intern_string(dom_node_internal *node,
struct lwc_string_s *inter);
+dom_exception _dom_node_create_lwcstring(dom_node_internal *node,
+ const uint8_t *data, size_t len, struct lwc_string_s **str);
/* Try to destroy the node, if its refcnt is not zero, then append it to the
* owner document's pending list */