[Pyrex] access to Modules/*.c or ignoring void**/char** casts

Josiah Carlson jcarlson at uci.edu
Fri Mar 25 02:17:14 CET 2005


Hey everyone,

I'm kind of new to Pyrex (only a few weeks), and I've been struggling
with this for a few days now, so I thought I would ask a group that
should probably know the answer...

Essentially, I'd like to dig into a memory mapped file object (mmap) so
that I don't have to use the (slow) API.

Problem 1:
Memory mapped file objects are defined in mmapmodule.c, which has no
includable header file.  There exists mmap.lib in the libs path, and
mmap.pyd in the dll path (I'm running windows), and the build process
properly includes the lib path, but I am unable to get it to include
anything sufficient (I get either "can't find mmap.lib|mmap.pyd" or
"cannot resolve symbol _mmap_buffer_getwritebuf").

Question 1:
How does one gain access to functions defined in mmapmodule.c, or any
function defined in any of the Python source Modules/*.c files?


Problem 2:
For my problem, there is always the buffer interface: get a read-write
buffer, then get the char* from the buffer.  Great, except for one
problem, in the buffer object definition...
    int get_buf(PyBufferObject, void **, int *)
...takes a void** where it assigns the char* to the data.  When I try to
use this, I get Pyrex errors of the form:
    Cannot assign type 'char (*(*))' to 'void (*(*))'

Question 2:
How would one tell Pyrex "don't worry about char**/void** casting", or
its equivalent?


Any pointers you can give me would be much appreciated.

Great job on Pyrex btw, I've gotten some important algorithms to my work
to be sped up 25x with relatively minimal fiddling.

 - Josiah




More information about the Pyrex mailing list