I am using ctypes to wrap a C-library (which I have control over) with Python. I want to wrap a C-function with declaration:
int fread_int( FILE * stream );
I've encountered the same problem.
Take a look at this file:
http://svn.python.org/projects/ctypes/trunk/ctypeslib/ctypeslib/contrib/pythonhdr.py
You can use PyFile_AsFile from it.