diff options
author | Detlev Casanova <detlev.casanova@gmail.com> | 2010-07-11 18:28:07 +0200 |
---|---|---|
committer | Detlev Casanova <detlev.casanova@gmail.com> | 2010-07-11 18:28:07 +0200 |
commit | fa75018c1432d0aaaf4674b502fe6cafdfd5156c (patch) | |
tree | 9eaa84d075157700f563bbcac11637c3e5323fc2 /src/stringlist.c | |
parent | 74ee4280886f8adc28b16404c469f63f6aa83e55 (diff) | |
download | layman-fa75018c1432d0aaaf4674b502fe6cafdfd5156c.tar.gz layman-fa75018c1432d0aaaf4674b502fe6cafdfd5156c.tar.bz2 layman-fa75018c1432d0aaaf4674b502fe6cafdfd5156c.zip |
Get the proper layman Python library and fix BareConfig constructor to
take a Message class as first argument.
Diffstat (limited to 'src/stringlist.c')
-rw-r--r-- | src/stringlist.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/stringlist.c b/src/stringlist.c index dc2a45d..22d6ef6 100644 --- a/src/stringlist.c +++ b/src/stringlist.c @@ -34,7 +34,7 @@ StringList* listToCList(PyObject* list) PyObject* cListToPyList(StringList* list) { if (!list) - return NULL; + Py_RETURN_NONE; PyObject *ret = PyList_New(list->count); for(int i = 0; i < list->count; i++) @@ -45,6 +45,21 @@ PyObject* cListToPyList(StringList* list) return ret; } +void stringListPrint(StringList* list) +{ + if (!list) + return; + + for(int i = 0; i < list->count; i++) + { + printf("\"%s\"", list->list[i]); + if (i < list->count - 1) + printf(", "); + } + + free(list); +} + void stringListFree(StringList* list) { if (!list) @@ -57,3 +72,4 @@ void stringListFree(StringList* list) free(list); } + |