From a58eaf592509012ff6fc8a92887d74f899a89a55 Mon Sep 17 00:00:00 2001 From: Christophe Nowicki Date: Mon, 13 Sep 2004 15:55:23 +0000 Subject: bind property providerIDs for LassoIdentity added typemap, convert GPtrArray to PHP indexed string array --- swig/Lasso.i | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'swig') diff --git a/swig/Lasso.i b/swig/Lasso.i index 5f12e070..7357824f 100644 --- a/swig/Lasso.i +++ b/swig/Lasso.i @@ -549,6 +549,31 @@ int get_exception_type(int errorCode) { %exception; %enddef +/*********************************************************************** + *********************************************************************** + * TypeMaps * + *********************************************************************** + ***********************************************************************/ + +#ifdef SWIGPHP4 +/* GPtrArray -> PHP Indexed Array used by Identity->providerIDs */ +%typemap(out) GPtrArray* { + int i; + zval *new_element; + + zend_printf("ici"); + array_init($result); + + for (i = 0; i < $1->len; i++) + { + MAKE_STD_ZVAL(new_element); + ZVAL_STRING(new_element, (char *) g_ptr_array_index($1, i), 1); + zend_hash_next_index_insert(HASH_OF($result), &new_element, sizeof(new_element), NULL); + zend_printf("ici"); + } +} +#endif + /*********************************************************************** *********************************************************************** @@ -912,6 +937,9 @@ typedef struct { %immutable isDirty; gboolean isDirty; + %immutable providerIDs; + GPtrArray* providerIDs; + /* Constructor, Destructor & Static Methods */ LassoIdentity(); @@ -938,6 +966,13 @@ gboolean LassoIdentity_isDirty_get(LassoIdentity *self) { return self->is_dirty; } +/* providerIDs */ +#define LassoIdentity_get_providerIDs LassoIdentity_providerIDs_get +GPtrArray* LassoIdentity_providerIDs_get(LassoIdentity *self) { + return self->providerIDs; +} + + /* Constructors, destructors & static methods implementations */ #define new_LassoIdentity lasso_identity_new @@ -2031,3 +2066,6 @@ gint LassoLecp_setSessionFromDump(LassoLecp *self, gchar *dump) { #define LassoLecp_processAuthnResponseEnvelopeMsg lasso_lecp_process_authn_response_envelope_msg %} + + + -- cgit