ctypes 0.9.2发布 [英] ctypes 0.9.2 released

查看:91
本文介绍了ctypes 0.9.2发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ctypes 0.9.2发布 - 2004年10月28日

============================= =======


概述


ctypes是一个用于Python的ffi(外部函数接口)包

2.3及更高版本。


ctypes允许调用从dll /共享库中公开的函数

并具有广泛的工具来创建,访问和操作

Python中简单而复杂的C数据类型 - 换句话说:

用纯Python包装库。甚至可以在纯Python中实现C

回调函数。


ctypes在Windows,MacOS X,Linux,Solaris,FreeBSD,OpenBSD上运行。 br />
它也可能在其他系统上运行,前提是libffi支持这个平台的



在Windows上,ctypes包含一个ctypes。 com包允许

调用并实现自定义COM接口。


重要


如果您下载源代码分发,请选择Windows的ZIP

文件和其他系统的.tar.gz文件。

这些存档有不同的内容!

0.9.2中的变化

修复了几个漏洞和内存泄漏。


ctypes现在在Windows,Linux上进行了测试( x86和x86_64),OpenBSD

和Mac OS X.


实现了一些辅助函数:memmove,memset,string_at,wstring_at。

前者充当他们的C库对应物,后两者允许

读取某个地址的零终止(宽)字符串。


实现了一个强制转换(cobj,ctype)函数,它创建了一个新对象

来自现有对象的指定ctype。


ctypes现在明确地为回调分配可执行内存

它创建,这个使其在通常禁止执行数据的平台上运行正常(OpenBSD,AMD 64上的Win XP SP2)。


修复了非Unicode上的unicode处理Windows平台。


结构和联合中的位字段现在已实现。

对于位字段,可以指定位宽度作为第三个字段/>
如下所示在_fields_列表中:


类BitFieldSample(结构):

_fields_ = [(" anInt",c_int ),

(aBitField",c_int,3)


POINTER(无)现在返回c_void_p。这个更改是为了更简单的代码生成而产生的,并且有意义,因为''无'是指b / b
拼写''无效'的方式。

详细更改日志在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>

未来计划


0.9版本系列的最终目的是消除

剩余的错误,特别是在我无法访问的平台上,以及

定位一个摇滚稳定的ctypes 1.0版本。


当ctypes 1.0发布时,com框架将被拆分为一个单独的框架命名为''comtypes''。

下载


下载在sourceforge文件部分提供

< http:// sourceforge.net/project/showfiles.php?group_id=71702>


独立来源di适用于Windows和非Windows系统的分配。

请使用Windows的.zip文件(它包含ctypes.com框架),

并使用.tar用于非Windows系统的.gz文件(它包含

完整的跨平台libffi源代码)。

二进制窗口安装程序,包含已编译的扩展名

模块,也可用,请务必为您正在使用的Python版本下载正确的



主页


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


享受,


Thomas

ctypes 0.9.2 released - Oct 28, 2004
====================================

Overview

ctypes is a 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.

On 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 systems.
These archive have different contents!

Changes in 0.9.2

Fixed several bugs and memory leaks.

ctypes is now tested on Windows, Linux (x86 and x86_64), OpenBSD
and Mac OS X.

Implemented some helper functions: memmove, memset, string_at, wstring_at.
The former act as their C library counterpart, the latter two allow
to read a zero-terminated (wide) strings at a certain address.

Implemented a cast(cobj, ctype) function, which creates a new object
of the specified ctype from an existing object.

ctypes now explicitely allocates executable memory for the callbacks
it creates, this makes it work correctly on platforms where
executing data is normally forbidden (OpenBSD, Win XP SP2 on AMD 64).

Fixed the unicode handling on non-windows platforms.

Bit fields in structures and unions are now implemented.
For a bit field, one would specify the width in bits as the third
part in the _fields_ list like this:

class BitFieldSample(Structure):
_fields_ = [("anInt", c_int),
("aBitField", c_int, 3)]

POINTER(None) now returns c_void_p. This change was made for easier
code generation, and makes sense since ''None'' is the ctypes way to
spell ''void''.
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>
Future plans

The ultimate purpose of the 0.9 release series is to shake out the
remaining bugs, especially on platforms I have no access to, and
to target a rock stable ctypes 1.0 release.

When ctypes 1.0 is released, the com framework will be split off
into a separate framework named ''comtypes''.
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

推荐答案

>>>>> "托马斯" == Thomas Heller< th ***** @ python.net>写道:
>>>>> "Thomas" == Thomas Heller <th*****@python.net> writes:
未来计划
0.9版本系列的最终目的是消除剩余的bug,特别是在我无法访问的平台上,以及
目标是一个摇滚稳定的ctypes 1.0版本。
当ctypes 1.0发布时,com框架将分成一个名为comtypes的独立框架。
Future plans
The ultimate purpose of the 0.9 release series is to shake out the
remaining bugs, especially on platforms I have no access to, and
to target a rock stable ctypes 1.0 release.
When ctypes 1.0 is released, the com framework will be split off
into a separate framework named ''comtypes''.




恭喜!我维护debian的ctypes。我暂缓上传

0.9版本,因为他们不支持Python 2.2。一个Python 2.2软件包

出现在debian中的ctypes 0.6.2,我想确保在上传0.9.x之前没有人使用它./x / br / >

除此之外,我想知道是不是时候把ctypes包含在标准的Python发行版中了。

。对于Python 2.4来说太晚了,但是对于Python 2.5来说怎么样?


Ganesan



Congratulations! I maintain ctypes for debian. I am holding off uploading
the 0.9 versions because they don''t support Python 2.2. A Python 2.2 package
was present in debian for ctypes 0.6.2, I want to be sure that no one is
using it before uploading 0.9.x.

That aside, I am wondering if it isn''t time to push ctypes for inclusion
into the standard Python distribution. Too late for Python 2.4, but how
about Python 2.5?

Ganesan


Ganesan R < RG ****** @ myrealbox.com>写道:

...
Ganesan R <rg******@myrealbox.com> wrote:
...
除此之外,我想知道是不是时候把ctypes包含在标准的Python发行版中了。 Python 2.4太迟了,但是关于Python 2.5的怎么样?
That aside, I am wondering if it isn''t time to push ctypes for inclusion
into the standard Python distribution. Too late for Python 2.4, but how
about Python 2.5?




借调! Python 2.5应该主要是关于标准库

增强,而ctypes将是对Python的stdlib的一个巨大增强。

Alex



Seconded! Python 2.5 should be mostly about standard-library
enhancements, and ctypes would be a huge enhancement to Python''s stdlib.
Alex


在文章< 1g ***************************** @ yahoo.com>,
al*****@yahoo.com (Alex Martelli)写道:
In article <1g*****************************@yahoo.com>,
al*****@yahoo.com (Alex Martelli) wrote:
Ganesan R< rg ****** @ myrealbox.com>写道:
...
Ganesan R <rg******@myrealbox.com> wrote:
...
除此之外,我想知道是不是时候把ctypes包含在标准的Python发行版中了。对于Python 2.4来说太晚了,但是关于Python 2.5怎么样?
That aside, I am wondering if it isn''t time to push ctypes for inclusion
into the standard Python distribution. Too late for Python 2.4, but how
about Python 2.5?



借调! Python 2.5应该主要是关于标准库的增强,而ctypes将是对Python的stdlib的巨大增强。



Seconded! Python 2.5 should be mostly about standard-library
enhancements, and ctypes would be a huge enhancement to Python''s stdlib.




一般来说,Guido是非常不愿意接受容易引起段错误的事情。

我预测你会非常难以说服他/ b $ b他... ...


只是



In general, Guido is very reluctant to accept thing which make is easy
to cause segfaults. I predict you''ll have a very hard time convincing
him...

Just


这篇关于ctypes 0.9.2发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆