Wrapper code

Every object in Python is represented by C struct PyObject
Wrapper code converts between PyObject variables and plain C variables (from PyObject r1 and r2 to double, and double result to PyObject):
static PyObject *_wrap_hw1(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    double arg1, arg2, result;

    PyArg_ParseTuple(args,(char *)"dd:hw1",&arg1,&arg2))

    result = hw1(arg1,arg2);
    
    resultobj = PyFloat_FromDouble(result);
    return resultobj;
}

previousnexttable of contents