summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValery Febvre <vfebvre at easter-eggs.com>2004-08-22 16:07:14 +0000
committerValery Febvre <vfebvre at easter-eggs.com>2004-08-22 16:07:14 +0000
commit3a48fd24cde5f0a2c779d47ee97fc10f662c9ea7 (patch)
tree00258bd50f72520039f31fd2240101c389960f19
parentf877c37ab22aa3d6d857657d093cc98f15577f8b (diff)
downloadlasso-3a48fd24cde5f0a2c779d47ee97fc10f662c9ea7.tar.gz
lasso-3a48fd24cde5f0a2c779d47ee97fc10f662c9ea7.tar.xz
lasso-3a48fd24cde5f0a2c779d47ee97fc10f662c9ea7.zip
Added lasso_node_new_ns_prop() method in LassoNode class
-rw-r--r--lasso/xml/xml.c34
-rw-r--r--lasso/xml/xml.h7
2 files changed, 38 insertions, 3 deletions
diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c
index 6b2d0447..c1529210 100644
--- a/lasso/xml/xml.c
+++ b/lasso/xml/xml.c
@@ -473,7 +473,6 @@ lasso_node_rename_prop(LassoNode *node,
* lasso_node_verify_signature:
* @node: a LassoNode
* @public_key_file: the public key
- * @err: return location for an allocated GError, or NULL to ignore errors
*
* Verifys the node signature.
*
@@ -498,7 +497,6 @@ lasso_node_verify_signature(LassoNode *node,
* lasso_node_verify_x509_signature:
* @node: a LassoNode
* @ca_certificate_file: the trusted certificate
- * @err: return location for an allocated GError, or NULL to ignore errors
*
* Verifys the node signature with X509 certificate.
*
@@ -612,6 +610,20 @@ lasso_node_new_child(LassoNode *node,
class->new_child(node, name, content, unbounded);
}
+static void
+lasso_node_new_ns_prop(LassoNode *node,
+ const xmlChar *name,
+ const xmlChar *value,
+ const xmlChar *href,
+ const xmlChar *prefix)
+{
+ LassoNodeClass *class;
+ g_return_if_fail(LASSO_IS_NODE(node));
+
+ class = LASSO_NODE_GET_CLASS(node);
+ class->new_ns_prop(node, name, value, href, prefix);
+}
+
static GData *
lasso_node_serialize(LassoNode *node,
GData *gd)
@@ -1570,6 +1582,23 @@ lasso_node_impl_new_child(LassoNode *node,
}
static void
+lasso_node_impl_new_ns_prop(LassoNode *node,
+ const xmlChar *name,
+ const xmlChar *value,
+ const xmlChar *href,
+ const xmlChar *prefix)
+{
+ xmlNsPtr ns;
+
+ g_return_if_fail (LASSO_IS_NODE(node));
+ g_return_if_fail (href != NULL || prefix != NULL);
+ g_return_if_fail (name != NULL || value != NULL);
+
+ ns = xmlNewNs(node->private->node, href, prefix);
+ xmlNewNsProp(node->private->node, ns, name, value);
+}
+
+static void
gdata_serialize_destroy_notify(gpointer data)
{
gint i;
@@ -1869,6 +1898,7 @@ lasso_node_class_init(LassoNodeClass *class)
class->build_query = lasso_node_impl_build_query;
class->get_xmlNode = lasso_node_impl_get_xmlNode;
class->new_child = lasso_node_impl_new_child;
+ class->new_ns_prop = lasso_node_impl_new_ns_prop;
class->serialize = lasso_node_impl_serialize;
class->set_name = lasso_node_impl_set_name;
class->set_ns = lasso_node_impl_set_ns;
diff --git a/lasso/xml/xml.h b/lasso/xml/xml.h
index 7df0cc4e..faf497d3 100644
--- a/lasso/xml/xml.h
+++ b/lasso/xml/xml.h
@@ -132,6 +132,11 @@ struct _LassoNodeClass {
const xmlChar *name,
const xmlChar *content,
gboolean unbounded);
+ void (* new_ns_prop) (LassoNode *node,
+ const xmlChar *name,
+ const xmlChar *value,
+ const xmlChar *href,
+ const xmlChar *prefix);
GData* (* serialize) (LassoNode *node,
GData *gd);
void (* set_name) (LassoNode *node,
@@ -214,7 +219,7 @@ LASSO_EXPORT gint lasso_node_verify_signature (LassoNode *node,
const gchar *public_key_file);
LASSO_EXPORT gint lasso_node_verify_x509_signature (LassoNode *node,
- const gchar *certificate_file);
+ const gchar *ca_certificate_file);
#ifdef __cplusplus
}