Callback via a function pointer (2)

Complete function wrapper:
double _pycall(double x, double y)
{
  PyObject *arglist, *result;
  arglist = Py_BuildValue("(dd)", x, y);
  result = PyEval_CallObject(_pyfunc_ptr, arglist);
  return PyFloat_AS_DOUBLE(result);
}
Initialize _pyfunc_ptr with the func1 argument supplied to the gridloop1 wrapper function
_pyfunc_ptr = func1;  /* func1 is PyObject* pointer */

previousnexttable of contents