[seed] xml: Add XMLXPathObj class



commit 2c4abd31f3820b07fdd3d6e79404b5254923bfe0
Author: Robert Carr <racarr svn gnome org>
Date:   Tue May 12 02:35:33 2009 -0400

    xml: Add XMLXPathObj class
---
 modules/libxml/libxml.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/modules/libxml/libxml.c b/modules/libxml/libxml.c
index 9ffef71..b750cc4 100644
--- a/modules/libxml/libxml.c
+++ b/modules/libxml/libxml.c
@@ -12,11 +12,14 @@ SeedEngine *eng;
 SeedClass xml_doc_class;
 SeedClass xml_node_class;
 SeedClass xml_attr_class;
+
 SeedClass xml_xpath_class;
+SeedClass xml_xpathobj_class;
 
 #define XML_DOC_PRIV(obj) ((xmlDocPtr)seed_object_get_private(obj))
 #define XML_NODE_PRIV(obj) ((xmlNodePtr)seed_object_get_private(obj))
 #define XML_XPATH_PRIV(obj) ((xmlXPathContextPtr)seed_object_get_private (obj))
+#define XML_XPATHOBJ_PRIV(obj) ((xmlXPathObjectPtr)seed_object_get_private (obj))
 
 static SeedObject
 seed_make_xml_doc (SeedContext ctx, 
@@ -294,6 +297,13 @@ seed_xml_xpath_finalize (SeedObject object)
   xmlXPathFreeContext (xpath);
 }
 
+static void
+seed_xml_xpathobj_finalize (SeedObject object)
+{
+  xmlXPathObjectPtr xpath = XML_XPATHOBJ_PRIV (object);
+  xmlXPathFreeObject (xpath);
+}
+
 seed_static_function doc_funcs[] = {
   {0, 0, 0}
 };
@@ -353,6 +363,7 @@ seed_libxml_define_stuff ()
   seed_class_definition xml_node_class_def = seed_empty_class;
   seed_class_definition xml_attr_class_def = seed_empty_class;
   seed_class_definition xml_xpath_class_def = seed_empty_class;
+  seed_class_definition xml_xpathobj_class_def = seed_empty_class;
 
   xml_doc_class_def.class_name="XMLDocument";
   xml_doc_class_def.static_functions = doc_funcs;
@@ -378,6 +389,10 @@ seed_libxml_define_stuff ()
   xml_xpath_class_def.finalize = seed_xml_xpath_finalize;
   xml_xpath_class = seed_create_class (&xml_xpath_class_def);
   
+  xml_xpathobj_class_def.class_name = "XMLXPathObj";
+  xml_xpathobj_class_def.finalize = seed_xml_xpathobj_finalize;
+  xml_xpathobj_class = seed_create_class (&xml_xpathobj_class_def);
+  
   seed_create_function (eng->context, "parseFile", 
 			(SeedFunctionCallback) seed_xml_parse_file,
 			namespace_ref);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]