diff options
| author | Valery Febvre <vfebvre at easter-eggs.com> | 2004-05-02 22:07:29 +0000 |
|---|---|---|
| committer | Valery Febvre <vfebvre at easter-eggs.com> | 2004-05-02 22:07:29 +0000 |
| commit | 8b78246a863ddeda5f64d7d1652a646acf825ac3 (patch) | |
| tree | fb79497e440ca406405a01b7e2209dd3c3f23412 | |
| parent | b7bf15e57a21d38a3a44687b5f8fd4c2067794f8 (diff) | |
| download | lasso-8b78246a863ddeda5f64d7d1652a646acf825ac3.tar.gz lasso-8b78246a863ddeda5f64d7d1652a646acf825ac3.tar.xz lasso-8b78246a863ddeda5f64d7d1652a646acf825ac3.zip | |
Funct lasso_node_set_node() renamed -> lasso_node_set_xmlNode()
| -rw-r--r-- | lasso/xml/ds_signature.c | 2 | ||||
| -rw-r--r-- | lasso/xml/xml.c | 55 | ||||
| -rw-r--r-- | lasso/xml/xml.h | 4 |
3 files changed, 30 insertions, 31 deletions
diff --git a/lasso/xml/ds_signature.c b/lasso/xml/ds_signature.c index 4129f446..6a71563b 100644 --- a/lasso/xml/ds_signature.c +++ b/lasso/xml/ds_signature.c @@ -152,7 +152,7 @@ LassoNode* lasso_ds_signature_new(xmlDocPtr doc, printf("Error: failed to add X509Data node\n"); } - LASSO_NODE_GET_CLASS(node)->set_node(node, signature); + LASSO_NODE_GET_CLASS(node)->set_xmlNode(node, signature); return (node); } diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index ff1f3670..415dc1c3 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -255,16 +255,6 @@ lasso_node_set_name(LassoNode *node, } static void -lasso_node_set_node(LassoNode *node, - xmlNodePtr libxml_node) -{ - g_return_if_fail(LASSO_IS_NODE(node)); - - LassoNodeClass *class = LASSO_NODE_GET_CLASS(node); - class->set_node(node, libxml_node); -} - -static void lasso_node_set_ns(LassoNode *node, const xmlChar *href, const xmlChar *prefix) @@ -286,6 +276,16 @@ lasso_node_set_prop(LassoNode *node, class->set_prop(node, name, value); } +static void +lasso_node_set_xmlNode(LassoNode *node, + xmlNodePtr libxml_node) +{ + g_return_if_fail(LASSO_IS_NODE(node)); + + LassoNodeClass *class = LASSO_NODE_GET_CLASS(node); + class->set_xmlNode(node, libxml_node); +} + /*****************************************************************************/ /* implementation methods */ /*****************************************************************************/ @@ -448,20 +448,21 @@ static LassoNode * lasso_node_impl_get_child(LassoNode *node, const xmlChar *name) { + /* /\* No recurssive version *\/ */ /* xmlNodePtr cur; */ - /* No recurssive version */ /* cur = node->private->node->children; */ /* while (cur != NULL) { */ /* if(cur->type == XML_ELEMENT_NODE) { */ /* if (xmlStrEqual(cur->name, name)) { */ - /* return (lasso_node_new(cur)); */ + /* return (lasso_node_new(cur)); */ /* } */ /* } */ /* cur = cur->next; */ /* } */ /* return (NULL); */ + /* Recurssive version */ xmlNodePtr cur; LassoNode *ret; @@ -476,14 +477,12 @@ lasso_node_impl_get_child(LassoNode *node, if (cur->children != NULL) { ret = lasso_node_get_child(lasso_node_new(cur->children), name); if (ret != NULL) { - return (ret); + return (ret); } } cur = cur->next; } return (NULL); - - /* return (lasso_node_new(child)); */ } static GPtrArray * @@ -542,7 +541,7 @@ lasso_node_impl_parse_memory(LassoNode *node, doc = xmlParseMemory(buffer, strlen(buffer)); /* get root element of doc and duplicate it */ root = xmlCopyNode(xmlDocGetRootElement(doc), 1); - lasso_node_set_node(node, root); + lasso_node_set_xmlNode(node, root); /* free doc */ xmlFreeDoc(doc); } @@ -841,17 +840,6 @@ lasso_node_impl_set_name(LassoNode *node, } static void -lasso_node_impl_set_node(LassoNode *node, - xmlNodePtr libxml_node) -{ - g_return_if_fail (LASSO_IS_NODE(node)); - g_return_if_fail (libxml_node != NULL); - - xmlFreeNode(node->private->node); - node->private->node = libxml_node; -} - -static void lasso_node_impl_set_ns(LassoNode *node, const xmlChar *href, const xmlChar *prefix) @@ -892,6 +880,17 @@ lasso_node_impl_set_prop(LassoNode *node, xmlSetProp(node->private->node, name, value); } +static void +lasso_node_impl_set_xmlNode(LassoNode *node, + xmlNodePtr libxml_node) +{ + g_return_if_fail (LASSO_IS_NODE(node)); + g_return_if_fail (libxml_node != NULL); + + xmlFreeNode(node->private->node); + node->private->node = libxml_node; +} + /*****************************************************************************/ /* instance and class init functions */ /*****************************************************************************/ @@ -955,9 +954,9 @@ lasso_node_class_init(LassoNodeClass *class) class->new_child = lasso_node_impl_new_child; class->new_ns = lasso_node_impl_new_ns; class->set_name = lasso_node_impl_set_name; - class->set_node = lasso_node_impl_set_node; class->set_ns = lasso_node_impl_set_ns; class->set_prop = lasso_node_impl_set_prop; + class->set_xmlNode = lasso_node_impl_set_xmlNode; /* override parent class methods */ gobject_class->dispose = (void *)lasso_node_dispose; gobject_class->finalize = (void *)lasso_node_finalize; diff --git a/lasso/xml/xml.h b/lasso/xml/xml.h index f696de50..c7e16d9d 100644 --- a/lasso/xml/xml.h +++ b/lasso/xml/xml.h @@ -100,14 +100,14 @@ struct _LassoNodeClass { const xmlChar *); void (* set_name) (LassoNode *, const xmlChar *); - void (* set_node) (LassoNode *, - xmlNodePtr); void (* set_ns) (LassoNode *node, const xmlChar *href, const xmlChar *prefix); void (* set_prop) (LassoNode *, const xmlChar *, const xmlChar *); + void (* set_xmlNode) (LassoNode *, + xmlNodePtr); }; typedef enum { |
