(from stdlib-sig) ctypes or struct from an h file

Erik Max Francis max at alcyone.com
Mon Oct 19 04:57:17 EDT 2009


Yuvgoog Greenle wrote:
> Ok I see your point that C is ambiguous concerning compiler
> implementation. I think #pragma pack should work out the padding issue
> but I'm not sure if the floating point issue is solvable.
> 
> I don't have an idea for solving that one...

#pragma is implementation defined and need not be supported by any 
compilers.

The proper way to do this is to define a protocol and translate it to 
the native structures on both sides of the communication -- both in 
Python and in C.  There's really no way around this.

-- 
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
  San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis
   Diplomacy and defense are not substitutes for one another. Either
    alone would fail. -- John F. Kennedy, 1917-1963



More information about the Python-list mailing list