<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to patches</title><link>https://sourceforge.net/p/ctypes/patches/</link><description>Recent changes to patches</description><atom:link href="https://sourceforge.net/p/ctypes/patches/feed.rss" rel="self"/><language>en</language><lastBuildDate>Fri, 09 Apr 2010 22:21:57 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/ctypes/patches/feed.rss" rel="self" type="application/rss+xml"/><item><title>ctypeslib: Add codegenerator support for volatile types</title><link>https://sourceforge.net/p/ctypes/patches/20/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;When the volatile keyword is used in C code, gccxml uses the type CvQualifiedType. This patch will allow the codegenerator to follow the type field to the true type that is being qualified by the volatile keyword. This change does not cause the generated python code to treat this variable any different but I doubt that such a distention makes any sense.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Michael D Hall</dc:creator><pubDate>Fri, 09 Apr 2010 22:21:57 -0000</pubDate><guid>https://sourceforge.net6f9de46459a84c3759a22bd5fa66107f867f0431</guid></item><item><title>for code generator to enable #define'd double constants</title><link>https://sourceforge.net/p/ctypes/patches/19/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The code generator doesn't handle any #defined constants with doubles. The patch contains a fix for the generator as well as coverage for the unit tests.&lt;/p&gt;
&lt;p&gt;The patch is applied against the ctypeslib-gccxml-0.9 branch, but might similarly work also against trunk.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">guyster</dc:creator><pubDate>Sat, 18 Oct 2008 22:32:21 -0000</pubDate><guid>https://sourceforge.net69d5f4b97215159dd878adf0fcc763353c9397d6</guid></item><item><title>import ctypes fails on OS X</title><link>https://sourceforge.net/p/ctypes/patches/18/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Trying to get ctypes to work on a stock MacBook Pro. (Python 2.3)&lt;/p&gt;
&lt;p&gt;easy_install fails due to dead links to starship.python.net.&lt;br /&gt;
Version 1.0.1 from sourceforge builds and installs, but does not import:&lt;/p&gt;
&lt;p&gt;if gestalt.gestalt("sysv") &amp;lt; 0x1040:&lt;br /&gt;
MacOS.Error: (-5551, 'undefined selector was passed to Gestalt')&lt;/p&gt;
&lt;p&gt;That's not a very friendly response.&lt;/p&gt;
&lt;p&gt;As I'm running 10.4.8, I've just commented out those lines.&lt;br /&gt;
However, this should be corrected in ctypes.&lt;/p&gt;
&lt;p&gt;--S&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Scott F. Johnston</dc:creator><pubDate>Fri, 02 Mar 2007 10:09:44 -0000</pubDate><guid>https://sourceforge.netbc92773b8d16695c9af04adc5273d2e8806e7457</guid></item><item><title>ctypeslib: loading libraries to resolve missing references</title><link>https://sourceforge.net/p/ctypes/patches/17/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The patch below adds the --preload option to resolve missing references from DLLs.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Michal J. Gajda</dc:creator><pubDate>Wed, 28 Feb 2007 11:47:24 -0000</pubDate><guid>https://sourceforge.net0f48ba0350c492f6102990aa936a28b95bd8b21c</guid></item><item><title>ctypeslib handling simple variables</title><link>https://sourceforge.net/p/ctypes/patches/16/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;xml2py.py doesn't seem to generate code for uninitialized variables. Since&lt;br /&gt;
it may be crucial for library interface (see errno.h), I attach the crude&lt;br /&gt;
patch that does that.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Michal J. Gajda</dc:creator><pubDate>Wed, 28 Feb 2007 11:44:55 -0000</pubDate><guid>https://sourceforge.nete714e00e4ac7dd2757d325ce4d9f5be0f4003924</guid></item><item><title>doc fixes</title><link>https://sourceforge.net/p/ctypes/patches/15/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Mostly changes in tutorials - mainly grammer and prose.&lt;br /&gt;
Also fixed a mistake in the reference manual for the in_dll method - args were reversed.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim Mitchell</dc:creator><pubDate>Mon, 15 Jan 2007 21:45:14 -0000</pubDate><guid>https://sourceforge.net14b7789fd584fe64f10b61f23c0ee343bdfb06d8</guid></item><item><title>Python API declarations</title><link>https://sourceforge.net/p/ctypes/patches/14/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The is a python module, pythonhdr.py, which declares several, hopefully useful, Python C API declarations and functions. Also includes is a unit test.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lenard Lindstrom</dc:creator><pubDate>Thu, 21 Dec 2006 04:28:22 -0000</pubDate><guid>https://sourceforge.netb761c0e02c329e567e1702b1f14ad404e60c4253</guid></item><item><title>Handle borrowed and stolen references</title><link>https://sourceforge.net/p/ctypes/patches/13/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;This patch creates a new C type, py_object_incref, for use as a return type for pythonapi functions that borrow a reference and as an argument for functions that steal a reference. py_object_incref cannot be instantiated or used as a structure field. As side benefits a CDataType subclass now accepts an optional _flags_ attribute to set selected stgdict flag fields and a new flag is defined to prevent a C type from being a structure field.&lt;/p&gt;
&lt;p&gt;The patch is applied to ctypes 1.0.1 release. It alters files _ctypes.c, ctypes.h, cfield.c, stgdict.c,__init__.py . The patch includes a new unit test test_py_object_incref.py . The following invocation of GNU patch 2.5 from the directory containing ctypes-1.0.1 seems to work:&lt;/p&gt;
&lt;p&gt;patch -p0 &amp;lt;py_object_incref.diff&lt;/p&gt;
&lt;p&gt;The patch has only been tested with MSVC 6 and Python 2.3. The following Python session is a usage example.&lt;/p&gt;
&lt;p&gt;Python 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on win32&lt;br /&gt;
Type "help", "copyright", "credits" or "license" for more information.&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; from ctypes import *&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; py_object_incref._type_&lt;br /&gt;
'o'&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; py_object_incref._flags_&lt;br /&gt;
256&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; # Borrowed reference&lt;br /&gt;
...&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; PyList_GetItem = pythonapi.PyList_GetItem&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; PyList_GetItem.restype = py_object_incref&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; PyList_GetItem.argtypes = [py_object, c_int]&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; PyList_GetItem([1, 2, 3], 1)&lt;br /&gt;
2&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; # Stolen reference&lt;br /&gt;
...&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; PyList_SetItem = pythonapi.PyList_SetItem&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; PyList_SetItem.argtypes = [py_object, c_int, py_object_incref]&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; x = [1, 2, 3]&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; PyList_SetItem(x, 2, 5)&lt;br /&gt;
0&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; x&lt;br /&gt;
[1, 2, 5]&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; # py_object_incref instances and fields not allowed&lt;br /&gt;
...&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; py_object_incref(None)&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
File "&amp;lt;stdin&amp;gt;", line 1, in ?&lt;br /&gt;
File "C:\prg\ctypes-1.0.1\ctypes\__init__.py", line 148, in __new__&lt;br /&gt;
_type_ = "H"&lt;br /&gt;
NotImplementedError: py_object_incref for argument and return types only.&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; class S(Structure):&lt;br /&gt;
...     _fields_ = ('o', py_object_incref),&lt;br /&gt;
...&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
File "&amp;lt;stdin&amp;gt;", line 1, in ?&lt;br /&gt;
TypeError: field 0 must be an allowed C type: got py_object_incref instead&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lenard Lindstrom</dc:creator><pubDate>Fri, 24 Nov 2006 21:33:49 -0000</pubDate><guid>https://sourceforge.net29dd369fc3559de6ae7eab28b48ffedb8755647d</guid></item><item><title>missing imports in documentation examples</title><link>https://sourceforge.net/p/ctypes/patches/12/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The attached patch fixes a couple of missing imports in&lt;br /&gt;
documentation examples. Original is from r51868.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Daniele Varrazzo</dc:creator><pubDate>Wed, 13 Sep 2006 12:32:36 -0000</pubDate><guid>https://sourceforge.net816d2efeaa716b43325973df026708138bc76582</guid></item><item><title>byref_at for returning references to array elements</title><link>https://sourceforge.net/p/ctypes/patches/11/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Implements a simple way to return references to array elements.  Allows &lt;br /&gt;
the following C code::&lt;/p&gt;
&lt;p&gt;// from the OpenGL Programming Guide (Red Book), Fifth Edition, pp &lt;br /&gt;
455&lt;br /&gt;
glTexGenfv(GL_T, GL_OBJECT_PLANE, &amp;amp;tmpMatrix[4]);&lt;/p&gt;
&lt;p&gt;To be written in ctypes like::&lt;/p&gt;
&lt;p&gt;glTexGenfv(GL_T, GL_OBJECT_PLANE, byref_at(tmpMatrix, 4))&lt;/p&gt;
&lt;p&gt;Instead of::&lt;/p&gt;
&lt;p&gt;p = cast(tmpMatrix, c_void_p)&lt;br /&gt;
p.value += sizeof(tmpMatrix._type_) * 4&lt;br /&gt;
glTexGenfv(GL_T, GL_OBJECT_PLANE, cast(p, c_float_p))&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Shane Holloway</dc:creator><pubDate>Mon, 14 Aug 2006 01:01:20 -0000</pubDate><guid>https://sourceforge.net6a40fdfaa6a37be24528ca0dee2457ffa9b802b5</guid></item></channel></rss>