summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2010-12-03 09:40:59 +0100
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2010-12-03 09:40:59 +0100
commitd97adfc27ac1558d3cb729fe054641d97f6d3fba (patch)
treee569786585f9c2cc200e4fb71c73406c504105cc
parent4161904317e5df32e402f365950456352c0a2c57 (diff)
parent6c598662a058049b54ca2f3f4cf8104a65734466 (diff)
downloadlasso-d97adfc27ac1558d3cb729fe054641d97f6d3fba.tar.gz
lasso-d97adfc27ac1558d3cb729fe054641d97f6d3fba.tar.xz
lasso-d97adfc27ac1558d3cb729fe054641d97f6d3fba.zip
Merge branch 'hotfixes-2.3.5'
-rw-r--r--bindings/ghashtable.h10
-rw-r--r--bindings/perl/Makefile.am2
-rw-r--r--bindings/perl/ghashtable_handling.c31
-rw-r--r--tests/assertion_query_saml2.c1
-rw-r--r--tests/idwsf2_tests.c1
-rw-r--r--tests/login_tests.c1
-rw-r--r--tests/login_tests_saml2.c2
7 files changed, 30 insertions, 18 deletions
diff --git a/bindings/ghashtable.h b/bindings/ghashtable.h
index 4e4a7d2e..ef9133f1 100644
--- a/bindings/ghashtable.h
+++ b/bindings/ghashtable.h
@@ -2,6 +2,8 @@
#define G_HASHTABLE_H 1
#if (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 14)
+#include "../lasso/utils.h"
+
typedef struct _GHashNode GHashNode;
struct _GHashNode
@@ -32,7 +34,7 @@ static gboolean return_true(G_GNUC_UNUSED gpointer a, G_GNUC_UNUSED gpointer b,
return TRUE;
}
-void
+static void
g_hash_table_remove_all (GHashTable *hash_table)
{
lasso_return_if_fail(hash_table != NULL);
@@ -51,7 +53,7 @@ g_hash_table_get_keys (GHashTable *hash_table)
gint i;
GList *retval;
- lasso_return_if_fail(hash_table != NULL, NULL);
+ lasso_return_val_if_fail(hash_table != NULL, NULL);
retval = NULL;
for (i = 0; i < hash_table->size; i++)
@@ -61,14 +63,14 @@ g_hash_table_get_keys (GHashTable *hash_table)
return retval;
}
-GList *
+static GList *
g_hash_table_get_values (GHashTable *hash_table)
{
GHashNode *node;
gint i;
GList *retval;
- lasso_return_if_fail(hash_table != NULL, NULL);
+ lasso_return_val_if_fail(hash_table != NULL, NULL);
retval = NULL;
for (i = 0; i < hash_table->size; i++)
diff --git a/bindings/perl/Makefile.am b/bindings/perl/Makefile.am
index 3ee1d18a..fcbdbeea 100644
--- a/bindings/perl/Makefile.am
+++ b/bindings/perl/Makefile.am
@@ -58,7 +58,7 @@ distclean-local:
clean-local:
-@if [ -f Makefile.perl ]; then make -f Makefile.perl clean; fi; rm -f Makefile.perl
-install-exec-local:
+install-exec-local: Makefile.perl
make -f Makefile.perl install DESTDIR=$(DESTDIR) PREFIX=$(prefix)
uninstall-local:
diff --git a/bindings/perl/ghashtable_handling.c b/bindings/perl/ghashtable_handling.c
index b49ed9f5..541041d8 100644
--- a/bindings/perl/ghashtable_handling.c
+++ b/bindings/perl/ghashtable_handling.c
@@ -78,6 +78,15 @@ set_hash_of_objects(GHashTable **hash, HV *hv)
}
}
+static void
+__ht_foreach_get_hos(gpointer key, gpointer value, gpointer user_data)
+{
+ HV *hv = user_data;
+
+ (void)hv_store(hv, key, strlen(key), newSVpv(value, 0), 0);
+}
+
+
/**
* get_hash_of_strings:
* @hash: a #GHashTable of strings
@@ -85,18 +94,21 @@ set_hash_of_objects(GHashTable **hash, HV *hv)
HV*
get_hash_of_strings(GHashTable *hash)
{
- GHashTableIter iter;
- gpointer key, value;
HV *hv;
hv = newHV();
- g_hash_table_iter_init(&iter, hash);
- while (g_hash_table_iter_next(&iter, &key, &value)) {
- (void)hv_store(hv, key, strlen(key), newSVpv(value, 0), 0);
- }
+ g_hash_table_foreach(hash, __ht_foreach_get_hos, hv);
return hv;
}
+static void
+__ht_foreach_get_hoo(gpointer key, gpointer value, gpointer user_data)
+{
+ HV *hv = user_data;
+
+ (void)hv_store(hv, key, strlen(key), gperl_new_object(value, FALSE), 0);
+}
+
/**
* get_hash_of_objects:
* @hash: a #GHashTable of objects
@@ -104,14 +116,9 @@ get_hash_of_strings(GHashTable *hash)
HV*
get_hash_of_objects(GHashTable *hash)
{
- GHashTableIter iter;
- gpointer key, value;
HV *hv;
hv = newHV();
- g_hash_table_iter_init(&iter, hash);
- while (g_hash_table_iter_next(&iter, &key, &value)) {
- (void)hv_store(hv, key, strlen(key), gperl_new_object(value, FALSE), 0);
- }
+ g_hash_table_foreach(hash, __ht_foreach_get_hos, hv);
return hv;
}
diff --git a/tests/assertion_query_saml2.c b/tests/assertion_query_saml2.c
index 12e4b345..f9de88b2 100644
--- a/tests/assertion_query_saml2.c
+++ b/tests/assertion_query_saml2.c
@@ -31,6 +31,7 @@
#include "../lasso/utils.h"
#include "../lasso/backward_comp.h"
#include "../lasso/xml/saml-2.0/saml2_xsd.h"
+#include "../bindings/ghashtable.h"
#include "./tests.h"
diff --git a/tests/idwsf2_tests.c b/tests/idwsf2_tests.c
index 027c02bb..2da7eaf8 100644
--- a/tests/idwsf2_tests.c
+++ b/tests/idwsf2_tests.c
@@ -39,6 +39,7 @@
#include <../lasso/id-wsf-2.0/saml2_login.h>
#include <../lasso/xml/saml-2.0/samlp2_authn_request.h>
+#include <../lasso/xml/idwsf_strings.h>
#include "./tests.h"
diff --git a/tests/login_tests.c b/tests/login_tests.c
index 43718620..df8eaf22 100644
--- a/tests/login_tests.c
+++ b/tests/login_tests.c
@@ -31,6 +31,7 @@
#include "../lasso/utils.h"
#include "../lasso/backward_comp.h"
#include "./tests.h"
+#include "../bindings/ghashtable.h"
static char*
diff --git a/tests/login_tests_saml2.c b/tests/login_tests_saml2.c
index 0864ec17..7188f391 100644
--- a/tests/login_tests_saml2.c
+++ b/tests/login_tests_saml2.c
@@ -32,7 +32,7 @@
#include "../lasso/utils.h"
#include "../lasso/backward_comp.h"
#include "../lasso/xml/saml-2.0/samlp2_logout_request.h"
-
+#include "../bindings/ghashtable.h"
#include "./tests.h"
static char*