From fa75018c1432d0aaaf4674b502fe6cafdfd5156c Mon Sep 17 00:00:00 2001 From: Detlev Casanova Date: Sun, 11 Jul 2010 18:28:07 +0200 Subject: Get the proper layman Python library and fix BareConfig constructor to take a Message class as first argument. --- src/stringlist.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/stringlist.c') 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); } + -- cgit v1.2.3-1-g7c22