1 Sep 2006 10:03
Re: memmove args not auto-converted to pointers with ctypes 0.9.9.3 through 1.0.0
Niki Spahiev <niki <at> vintech.bg>
2006-09-01 08:03:43 GMT
2006-09-01 08:03:43 GMT
Lenard Lindstrom wrote: > On 30 Aug 2006 at 21:03, Thomas Heller wrote: >> >> So, the c_void_p .from_param method doesn't do this automatic byref() call, >> and it may indeed be a bug. Is it worth to fix it, for Python 2.5.1? >> > I would say it is not so much a bug as not what I expect as a C > programmer. (void *) pointers behave the same as any other pointer > when it comes to assignment except that no casting is required. So if > a non c_void_p pointer does an automatic byref() in its from_param > method I would expect the same for c_void_p. But this leads to an > ambiguity. If I pass a pointer to a c_void_p do I want an implicit > cast or a pointer to a pointer, an automatic byref() call? Using void * for pointer to a pointer is very unlikely. So automatic byref on pointers is not necessary. Niki Spahiev ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
, there are only some code snippets
explaining (well, to me) what is happoing now. Currently, for inline functions
the same code is generated as for normal functions, which will of course not work.
> Could we get a few more comments on the
> plan forward? Is there some intention to parse the body of the function
> to XML and thence to Py?
You mean convert the C code to Python code? Kind of writing a C emulator
in Python? Could maybe work for 'sane' header files, but Windows header
files sometimes even contain inline assembly in C/C++ inline functions.
> Absent some plan like that I dont see any
> alternative to compiling the header inlines into a library. Then the
> formerly no-compiler-needed ctypes port requires one, or one must start
> shipping (and installing in the library path?) a shared binary library
> with your 'python' package. Comments?
Why not. The code generator could just collect the inline function declararation,
and generate C code for a shared lib exposing the inline, and maybe also
intrinsic functions to normal ctypes.
Sounds like a good idea - if someone wants to implement that.
Thomas
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
RSS Feed