[IronPython] ctypes for IronPython update

Sanghyeon Seo sanxiyn at gmail.com
Sun Jun 11 14:43:32 CEST 2006


I updated my ctypes module a bit:
http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/ctypes.py

* .value on primitive types is implemented
* Beginning of byref() implementation, using MakeByRefType()
* Improved __repr__() of ctypes types

A short demo showing all changes since the last update follows:

>>> from ctypes import *
>>> t = c_int()
>>> t
c_int(0)
>>> t.value
0
>>> p = byref(t)
>>> p
byref(c_int(0))
>>> libc = CDLL('libc.so.6')
>>> libc
<CDLL 'libc.so.6'>
>>> libc.time(p)
1150029601
>>> libc.time.method
Int32 time(System.Int32 ByRef)
>>> t # This is wrong!
c_int(0)

Seo Sanghyeon



More information about the Ironpython-users mailing list