diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/protocols/py_single_sign_on_and_federation.c | 14 | ||||
-rw-r--r-- | python/protocols/py_single_sign_on_and_federation.h | 8 | ||||
-rw-r--r-- | python/wrap_objs.c | 14 | ||||
-rw-r--r-- | python/wrap_objs.h | 2 |
4 files changed, 27 insertions, 11 deletions
diff --git a/python/protocols/py_single_sign_on_and_federation.c b/python/protocols/py_single_sign_on_and_federation.c index 719e079c..04c90c80 100644 --- a/python/protocols/py_single_sign_on_and_federation.c +++ b/python/protocols/py_single_sign_on_and_federation.c @@ -27,7 +27,7 @@ #include "../xml/py_xml.h" #include "py_single_sign_on_and_federation.h" -PyObject *wrap_LassoAuthnRequest(LassoAuthnRequest *request) { +PyObject *lassoAuthnRequest_wrap(lassoAuthnRequest *request) { PyObject *ret; if (request == NULL) { @@ -35,17 +35,17 @@ PyObject *wrap_LassoAuthnRequest(LassoAuthnRequest *request) { return (Py_None); } ret = PyCObject_FromVoidPtrAndDesc((void *) request, - (char *) "LassoAuthnRequest *", NULL); + (char *) "lassoAuthnRequest *", NULL); return (ret); } /******************************************************************************/ -/* LassoAuthnRequest */ +/* lassoAuthnRequest */ /******************************************************************************/ PyObject *authn_request_getattr(PyObject *self, PyObject *args) { PyObject *lareq_obj; - LassoAuthnRequest *lareq; + lassoAuthnRequest *lareq; const char *attr; if (CheckArgs(args, "OS:authn_request_get_attr")) { @@ -54,7 +54,7 @@ PyObject *authn_request_getattr(PyObject *self, PyObject *args) { } else return NULL; - lareq = LassoAuthnRequest_get(lareq_obj); + lareq = lassoAuthnRequest_get(lareq_obj); if (!strcmp(attr, "__members__")) return Py_BuildValue("[s]", "node"); @@ -84,7 +84,7 @@ PyObject *authn_request_build(PyObject *self, PyObject *args) { GPtrArray *idpList = NULL; const xmlChar *consent; - LassoAuthnRequest *request; + lassoAuthnRequest *request; if(!PyArg_ParseTuple(args, (char *) "ssssssOOssiOs:build_authn_request", &providerID, &nameIDPolicy, &forceAuthn, &isPassive, @@ -108,5 +108,5 @@ PyObject *authn_request_build(PyObject *self, PyObject *args) { NULL, consent); - return (wrap_LassoAuthnRequest(request)); + return (lassoAuthnRequest_wrap(request)); } diff --git a/python/protocols/py_single_sign_on_and_federation.h b/python/protocols/py_single_sign_on_and_federation.h index d8acb324..bfd79d5f 100644 --- a/python/protocols/py_single_sign_on_and_federation.h +++ b/python/protocols/py_single_sign_on_and_federation.h @@ -29,11 +29,11 @@ typedef struct { PyObject_HEAD - LassoAuthnRequest *obj; -} LassoAuthnRequest_object; + lassoAuthnRequest *obj; +} lassoAuthnRequest_object; -#define LassoAuthnRequest_get(v) (((v) == Py_None) ? NULL : (((LassoAuthnRequest_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) -PyObject *LassoAuthnRequest_wrap(LassoAuthnRequest *request); +#define lassoAuthnRequest_get(v) (((v) == Py_None) ? NULL : (((lassoAuthnRequest_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj)) +PyObject *lassoAuthnRequest_wrap(lassoAuthnRequest *request); PyObject *authn_request_getattr(PyObject *self, PyObject *args); PyObject *authn_request_build(PyObject *self, PyObject *args); diff --git a/python/wrap_objs.c b/python/wrap_objs.c index b195efb8..e3a71840 100644 --- a/python/wrap_objs.c +++ b/python/wrap_objs.c @@ -19,6 +19,20 @@ xmlChar **PythonStringList_get(PyObject *list_obj) { return list; } +GPtrArray *PythonStringList2_get(PyObject *list_obj) { + int i; + GPtrArray *list = NULL; + + if (list_obj == Py_None) return NULL; + + /* convert Python list into a GLib GPtrArray */ + list = g_ptr_array_new(); + for (i=0; i<PyList_Size(list_obj); i++) + g_ptr_array_add(list, PyString_AsString(PyList_GetItem(list_obj, i))); + + return list; +} + /*****************************************************************************/ /* Functions to wrap C objects -> Python objects */ /*****************************************************************************/ diff --git a/python/wrap_objs.h b/python/wrap_objs.h index 2812bb71..a74dfe86 100644 --- a/python/wrap_objs.h +++ b/python/wrap_objs.h @@ -47,7 +47,9 @@ typedef struct { /* Functions to wrap Python objects -> C objects */ #define PythonFile_get(v) (((v) == Py_None) ? NULL : (PyFile_Check(v) ? (PyFile_AsFile(v)) : stdout)) + xmlChar **PythonStringList_get(PyObject *list_obj); +GPtrArray *PythonStringList2_get(PyObject *list_obj); PyObject *wrap_int(int val); PyObject *wrap_charPtr(char *str); |