C wrapper

Sheldon shejo284 at gmail.com
Tue Nov 7 21:27:00 CET 2006

Robert Kern skrev:

> Sheldon wrote:
> > This function is there and is called init_mymodule() but I have other
> > functions that are not static.
> Is the module's name "_mymodule"? Or is it "mymodule"?
> --
> Robert Kern
> "I have come to believe that the whole world is an enigma, a harmless enigma
>  that is made terrible by our own mad attempt to interpret it as though it had
>  an underlying truth."
>   -- Umberto Eco

Here is the file/module name: _msgpps_functions.c
Here is the initfunction:

PyMODINIT_FUNC init_msgpps_functions(void) {
  PyObject* m;
  ErrorObject = PyString_FromString("_msgpps_functions.error");
  if(ErrorObject == NULL ||						\
    Py_FatalError("Can't define _msgpps_functions.error");
  }     /*  access to Numeric PyArray functions */

I have not main() function in the file. Instead the main function is
called the same name:

static PyObject* _msgpps_functions(PyObject* self, PyObject* args)

Now I am new at this and I have been reading anything I can find. The
only thing that is out of place is the part which I didn't include:

    /* Initialize the Python interpreter.  Required. */

    /* Add a static module */
because I still don't understand this part.


More information about the Python-list mailing list