Win32 Extensions From C module
dale.hirt at verizon.net
Sun Feb 16 20:16:56 CET 2003
-----BEGIN PGP SIGNED MESSAGE-----
I am currently working on the subversion (http://subversion.tigris.org) python bindings. It utilizes swig to help build some of the code, however, that is not a main concern.
I have a function that can take in a PyObject *, and I have figured out how it can determine if the type is a string, a FILE *, or an int. What I currently cannot do is check, when only compiling on Win32, if it's type is a HANDLE. The Win32 extensions define a PyHANDLE object, yet short of keeping a copy of his source code tree around, I don't know how I can say PyHANDLE_Check(), or get out the underlying HANDLE.
Here is a brief outline of how I would like the function to look. I've cut out all the extraneous code.:
apr_file_t *svn_swig_py_make_file (PyObject *py_file)
if (py_file == NULL || py_file == Py_None)
if (PyString_Check (py_file))
if (PyFile_Check (py_file))
file = PyFile_AsFile (py_file);
else if(PyHANDLE_Check (py_file))
handle = PyHANDLE_AsHANDLE(py_file);
else if (PyInt_Check (py_file))
fd = PyInt_AsLong (py_file);
Has anyone else done something like this? Is there something that I'm missing? Is there a mailing list specifically for Win32 extensions, or is this the right list? I appreciate any and all help, and pointers.
Jabber ID: chaosopher at jabber.org
ICQ: Chaosopher #27726121
MSN: chaosopher at hotmail.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (MingW32)
-----END PGP SIGNATURE-----
More information about the Python-list