diff options
author | Valery Febvre <vfebvre at easter-eggs.com> | 2004-04-07 11:00:57 +0000 |
---|---|---|
committer | Valery Febvre <vfebvre at easter-eggs.com> | 2004-04-07 11:00:57 +0000 |
commit | d28f1cc0d5e6691948dd96bc703d57ade18f5d00 (patch) | |
tree | eda3e33eb704c7be22d15a3b3e2fe590b280fdb1 /python/wrap_objs.c | |
parent | c2c5801a663198579c5ea04fda99e4c8c655ce8f (diff) | |
download | lasso-d28f1cc0d5e6691948dd96bc703d57ade18f5d00.tar.gz lasso-d28f1cc0d5e6691948dd96bc703d57ade18f5d00.tar.xz lasso-d28f1cc0d5e6691948dd96bc703d57ade18f5d00.zip |
*** empty log message ***
Diffstat (limited to 'python/wrap_objs.c')
-rw-r--r-- | python/wrap_objs.c | 14 |
1 files changed, 14 insertions, 0 deletions
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 */ /*****************************************************************************/ |