+ changed PipelinHeuristic to support new data access functions
[qpalma.git] / ParaParser / ParaParser.i
1 %module ParaParser
2 %{
3
4 #include "ParaParser.h"
5
6 %}
7
8 %include "typemaps.i"
9
10 %typemap(in) char ** {
11 /* Check if is a list */
12 if (PyList_Check($input)) {
13 int size = PyList_Size($input);
14 int i = 0;
15 $1 = (char **) malloc((size+1)*sizeof(char *));
16 for (i = 0; i < size; i++) {
17 PyObject *o = PyList_GetItem($input,i);
18 if (PyString_Check(o))
19 $1[i] = PyString_AsString(PyList_GetItem($input,i));
20 else {
21 PyErr_SetString(PyExc_TypeError,"list must contain strings");
22 free($1);
23 return NULL;
24 }
25 }
26 $1[i] = 0;
27 } else {
28 PyErr_SetString(PyExc_TypeError,"not a list");
29 return NULL;
30 }
31 }
32
33 %include "ParaParser.h"