[Ann] ctypes 0.9.5 released

T

Thomas Heller

ctypes 0.9.5 released - Mar 11, 2005
====================================

Overview

ctypes is an advanced ffi (Foreign Function Interface) package for
Python 2.3 and higher.

ctypes allows to call functions exposed from dlls/shared libraries
and has extensive facilities to create, access and manipulate
simple and complicated C data types in Python - in other words:
wrap libraries in pure Python. It is even possible to implement C
callback functions in pure Python.

ctypes runs on Windows, MacOS X, Linux, Solaris, FreeBSD, OpenBSD.
It may also run on other systems, provided that libffi supports
this platform.

For windows, ctypes contains a ctypes.com package which allows to
call and implement custom COM interfaces.

Important

If you download the source distribution, please choose the ZIP
file for Windows, and the .tar.gz file for other machines.
These archive have different contents!

There have been lots of changes - if you are the author or user of
a package that uses ctypes, please test it with this release
and report problems on the ctypes-users mailing list.

Additions

New package ctypes.wrap. This contains decorators usable for
easier creation of wrapper functions.

This package also contains a toolchain for (semi)automatic
creation of wrappers for external libraries - it can parse
C header files and generate ctypes code for the declarations in
them. It can even handle preprocessor definitions! For details,
see http://starship.python.net/crew/theller/ctypes/codegen.html


Changes in 0.9.5

On systems where sizeof(int) == sizeof(long), c_int/c_long and
c_uint/c_ulong are now aliases. Similar for c_long/c_longlong and
c_ulong/c_ulonglong. This prevents unneeded type errors.

If an exception occurs in a callback function, a full traceback is
now printed. Raising SystemExit in a callback function now
correctly exists Python.

HRESULT is now a proper ctype - no longer a function. This allows
to use it in the argtypes sequence for function prototypes.

An easier way to define structures and unions that reference
themselves, or have dependencies to other data types. The
_fields_ attribute can now be set *after* the Structure/Union
class has been created. This makes the SetPointerType function
obsolete.

The semantics of the _fields_ attribute in sub-subclasses of
Structure and Union has been fixed. The baseclasses _fields_ list
is extended, not replaced, in subclasses. Assigning _fields_ when
it is no longer possible raises an error now.

Structures and unions now work as restype and in the argtypes list
for functions.

An important bug has been fixed with pointers.


Detailed changelogs are in CVS:

<http://cvs.sourceforge.net/viewcvs.py/ctypes/ctypes/ChangeLog?rev=HEAD>

<http://cvs.sourceforge.net/viewcvs.py/ctypes/ctypes/win32/com/ChangeLog?rev=HEAD>


Download

Downloads are available in the sourceforge files section
<http://sourceforge.net/project/showfiles.php?group_id=71702>

Separate source distributions are available for windows and non-windows systems.
Please use the .zip file for Windows (it contains the ctypes.com framework),
and use the .tar.gz file for non-Windows systems (it contains the
complete cross-platform libffi sources).

Binary windows installers, which contain compiled extension
modules, are also available, be sure to download the correct one
for the Python version you are using.


Homepage

<http://starship.python.net/crew/theller/ctypes/>

Enjoy,

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top