Hi guys, I'm new to swig and I have the following function which i cant fix:

int get_list(const char * string, struct entry ** results);

the entry struct is properly converted to a python class.
I googled but couldn't find any explanation i could use.
I want to make it return a python list of entry python objects, but don't know how to convert the C entry to a python object in the argout code snippet.
I've managed to get thus far:
%typemap(argout) struct entry **
{
    PyObject *o = PyList_New(0);
    int i;
    for(i=0; flux_entry[i] ; i++)
    {
        PyList_Append(o, SWIG_HOW_TO_CONVERT_TO_PYOBJECT($1[i]));
    }
    $result = o;
}

what should i replace SWIG_HOW_TO_CONVERT_TO_PYOBJECT with?

p.s.

the array is allocated within the C function, so i'd also like to make sure it's freed somewhere :)

thanks!