ctypes-commit Mailing List for ctypes (Page 22)
Brought to you by:
theller
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
(90) |
Jun
(143) |
Jul
(106) |
Aug
(94) |
Sep
(84) |
Oct
(163) |
Nov
(60) |
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(128) |
Feb
(79) |
Mar
(227) |
Apr
(192) |
May
(179) |
Jun
(41) |
Jul
(53) |
Aug
(103) |
Sep
(28) |
Oct
(38) |
Nov
(81) |
Dec
(17) |
2006 |
Jan
(184) |
Feb
(111) |
Mar
(188) |
Apr
(67) |
May
(58) |
Jun
(123) |
Jul
(73) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Thomas H. <th...@us...> - 2006-02-16 20:00:56
|
Update of /cvsroot/ctypes/ctypes/docs/manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28588 Modified Files: Tag: branch_1_0 manual.html Log Message: Regenerated. |
From: Thomas H. <th...@us...> - 2006-02-16 19:57:30
|
Update of /cvsroot/ctypes/ctypes/docs/manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27351 Modified Files: Tag: branch_1_0 make.bat Log Message: Index: make.bat =================================================================== RCS file: /cvsroot/ctypes/ctypes/docs/manual/Attic/make.bat,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** make.bat 27 Jan 2006 20:28:54 -0000 1.1.2.1 --- make.bat 16 Feb 2006 19:57:22 -0000 1.1.2.2 *************** *** 1 **** ! c:\python24\scripts\rst2html.py manual.txt manual.html \ No newline at end of file --- 1,2 ---- ! c:\python24\scripts\rst2html.py manual.txt manual.html ! c:\python24\scripts\rst2html.py tutorial.txt tutorial.html |
From: Thomas H. <th...@us...> - 2006-02-16 19:56:50
|
Update of /cvsroot/ctypes/ctypes/docs/manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27120 Added Files: Tag: branch_1_0 tutorial.txt Log Message: Amit Aronovitch converted the tutorial to rst. (Shy Sherebrin did the same before, but I never committed it to CVS). Thanks to both of you, apologies to Shi. --- NEW FILE: tutorial.txt --- =============== ctypes tutorial =============== .. contents:: This tutorial describes version 0.6.3 of ``ctypes``. There have been quite some changes to version 0.4.x, the most important are listed `here <changes.html>`__. 1. Loading dynamic link libraries ================================= ``ctypes`` exports the ``cdll``, and on Windows also ``windll`` and ``oledll`` objects to load dynamic link libraries. You load libraries by accessing them as attributes of these objects. ``cdll`` loads libraries which export functions using the standard ``cdecl`` calling convention, while ``windll`` libraries call [...1016 lines suppressed...] 18. Bugs, ToDo and non-implemented things ========================================= Bitfields are not implemented. Enumeration types are not implemented. You can do it easily yourself, using ``c_int`` as the base class. ``long double`` is not implemented. .. no longer true: You cannot pass structures to functions as arguments, and you cannot set them as return type (only pointers). .. no longer true? Callback functions implemented in Python can *only* return integers. .. Local Variables: compile-command: "make_html" End: |
From: Thomas H. <th...@us...> - 2006-02-16 19:48:32
|
Update of /cvsroot/ctypes/ctypes/docs/manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23947 Modified Files: Tag: branch_1_0 manual.html Log Message: Regenerated, after corrections from Shy Sherebrin. Index: manual.html =================================================================== RCS file: /cvsroot/ctypes/ctypes/docs/manual/Attic/manual.html,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** manual.html 13 Feb 2006 22:09:12 -0000 1.1.2.7 --- manual.html 16 Feb 2006 19:48:23 -0000 1.1.2.8 *************** *** 353,359 **** <p>Load and return the library with the given libname. On most systems <tt class="docutils literal"><span class="pre">libname</span></tt> is the filename of the shared library; when ! it's not a pathname it will be searched in a system dependend list of locations (on many systems additional search paths can be ! specified by an environemtn variable). Sometimes the file extension (like <tt class="docutils literal"><span class="pre">.dll</span></tt> on Windows) can be omitted.</p> <p><tt class="docutils literal"><span class="pre">mode</span></tt> allows to override the default flags passed to the --- 353,359 ---- <p>Load and return the library with the given libname. On most systems <tt class="docutils literal"><span class="pre">libname</span></tt> is the filename of the shared library; when ! it's not a pathname it will be searched in a system dependent list of locations (on many systems additional search paths can be ! specified by an environment variable). Sometimes the file extension (like <tt class="docutils literal"><span class="pre">.dll</span></tt> on Windows) can be omitted.</p> <p><tt class="docutils literal"><span class="pre">mode</span></tt> allows to override the default flags passed to the *************** *** 363,367 **** <p><tt class="docutils literal"><span class="pre">load_version(name,</span> <span class="pre">version=None,</span> <span class="pre">mode=None)</span></tt></p> <blockquote> ! <p>Build a system dependend filename from <tt class="docutils literal"><span class="pre">name</span></tt> and optionally <tt class="docutils literal"><span class="pre">version</span></tt>, then load and return it. <tt class="docutils literal"><span class="pre">name</span></tt> is the library name without any prefix like <tt class="docutils literal"><span class="pre">lib</span></tt> and suffix like <tt class="docutils literal"><span class="pre">.so</span></tt> or --- 363,367 ---- <p><tt class="docutils literal"><span class="pre">load_version(name,</span> <span class="pre">version=None,</span> <span class="pre">mode=None)</span></tt></p> <blockquote> ! <p>Build a system dependent filename from <tt class="docutils literal"><span class="pre">name</span></tt> and optionally <tt class="docutils literal"><span class="pre">version</span></tt>, then load and return it. <tt class="docutils literal"><span class="pre">name</span></tt> is the library name without any prefix like <tt class="docutils literal"><span class="pre">lib</span></tt> and suffix like <tt class="docutils literal"><span class="pre">.so</span></tt> or *************** *** 412,416 **** default return type of <tt class="docutils literal"><span class="pre">int</span></tt>. ctypes does release the Python global interpreter lock (GIL) just before calling the actual ! function, and reaquire it before returing, so a chance is given to other threads to run.</blockquote> <p><tt class="docutils literal"><span class="pre">windll</span></tt></p> --- 412,416 ---- default return type of <tt class="docutils literal"><span class="pre">int</span></tt>. ctypes does release the Python global interpreter lock (GIL) just before calling the actual ! function, and reacquire it before returing, so a chance is given to other threads to run.</blockquote> <p><tt class="docutils literal"><span class="pre">windll</span></tt></p> *************** *** 418,423 **** Windows only. Functions provided by libraries loaded by <tt class="docutils literal"><span class="pre">windll</span></tt> will be called using the Windows <tt class="docutils literal"><span class="pre">__stdcall</span></tt> calling ! convention. ctypes can to detect the case that the wrong number ! of parameters have been passed to the function call by examining the stack pointer before and after the function call. If the wrong parameter count was used, an exception is raised (although --- 418,423 ---- Windows only. Functions provided by libraries loaded by <tt class="docutils literal"><span class="pre">windll</span></tt> will be called using the Windows <tt class="docutils literal"><span class="pre">__stdcall</span></tt> calling ! convention. ctypes can detect when the wrong number ! of parameters has been passed to the function call by examining the stack pointer before and after the function call. If the wrong parameter count was used, an exception is raised (although *************** *** 431,435 **** <tt class="docutils literal"><span class="pre">HRESULT</span></tt> value. These are long values containing error or success codes. In case the function return an error <tt class="docutils literal"><span class="pre">HRESULT</span></tt> ! value, a <cite>WindowsError`</cite> is raised. GIL released during the function call.</blockquote> <p><tt class="docutils literal"><span class="pre">pydll</span></tt></p> --- 431,435 ---- <tt class="docutils literal"><span class="pre">HRESULT</span></tt> value. These are long values containing error or success codes. In case the function return an error <tt class="docutils literal"><span class="pre">HRESULT</span></tt> ! value, a <tt class="docutils literal"><span class="pre">WindowsError</span></tt> is raised. The GIL is released during the function call.</blockquote> <p><tt class="docutils literal"><span class="pre">pydll</span></tt></p> *************** *** 733,737 **** <p>A descriptor will be created for each field, it allows to access the fields contents from instances. Accessed from the class, the fields ! expose <cite>readonly `</cite>.offset`` and <tt class="docutils literal"><span class="pre">.size</span></tt> attributes. <tt class="docutils literal"><span class="pre">offset</span></tt> is the byte-offset of the field from the beginning of the structure/union, <tt class="docutils literal"><span class="pre">size</span></tt> is the number of bytes the field contains.</p> --- 733,737 ---- <p>A descriptor will be created for each field, it allows to access the fields contents from instances. Accessed from the class, the fields ! expose readonly <tt class="docutils literal"><span class="pre">.offset</span></tt> and <tt class="docutils literal"><span class="pre">.size</span></tt> attributes. <tt class="docutils literal"><span class="pre">offset</span></tt> is the byte-offset of the field from the beginning of the structure/union, <tt class="docutils literal"><span class="pre">size</span></tt> is the number of bytes the field contains.</p> *************** *** 755,759 **** <p>Integer fields support bit sizes. The bit-size must be specified as the third item of the <tt class="docutils literal"><span class="pre">_fields_</span></tt> tuple. Bit fields are constructed ! in the same way the hosts C compiler does it.</p> </div> <div class="section"> --- 755,762 ---- <p>Integer fields support bit sizes. The bit-size must be specified as the third item of the <tt class="docutils literal"><span class="pre">_fields_</span></tt> tuple. Bit fields are constructed ! in the same way the hosts C compiler does it. For bit fields, the ! field descriptors <tt class="docutils literal"><span class="pre">.size</span></tt> attribute contains the number of bits in ! the high word, the bit offset from the beginning of the structure in ! the low word. XXX is that correct?</p> </div> <div class="section"> *************** *** 768,771 **** --- 771,776 ---- ("value", ...)] </pre> + <p><tt class="docutils literal"><span class="pre">_fields_</span></tt> must be set, and cannot be changed, after the type is + used for the first time.</p> </div> <div class="section"> |
From: Thomas H. <th...@us...> - 2006-02-16 19:47:42
|
Update of /cvsroot/ctypes/ctypes/docs/manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23602 Modified Files: Tag: branch_1_0 libraries.txt Log Message: Corrections by Shy Sherebrin. Index: libraries.txt =================================================================== RCS file: /cvsroot/ctypes/ctypes/docs/manual/Attic/libraries.txt,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** libraries.txt 13 Feb 2006 21:39:24 -0000 1.1.2.3 --- libraries.txt 16 Feb 2006 19:47:30 -0000 1.1.2.4 *************** *** 25,31 **** Load and return the library with the given libname. On most systems ``libname`` is the filename of the shared library; when ! it's not a pathname it will be searched in a system dependend list of locations (on many systems additional search paths can be ! specified by an environemtn variable). Sometimes the file extension (like ``.dll`` on Windows) can be omitted. --- 25,31 ---- Load and return the library with the given libname. On most systems ``libname`` is the filename of the shared library; when ! it's not a pathname it will be searched in a system dependent list of locations (on many systems additional search paths can be ! specified by an environment variable). Sometimes the file extension (like ``.dll`` on Windows) can be omitted. *************** *** 36,40 **** ``load_version(name, version=None, mode=None)`` ! Build a system dependend filename from ``name`` and optionally ``version``, then load and return it. ``name`` is the library name without any prefix like ``lib`` and suffix like ``.so`` or --- 36,40 ---- ``load_version(name, version=None, mode=None)`` ! Build a system dependent filename from ``name`` and optionally ``version``, then load and return it. ``name`` is the library name without any prefix like ``lib`` and suffix like ``.so`` or *************** *** 94,98 **** default return type of ``int``. ctypes does release the Python global interpreter lock (GIL) just before calling the actual ! function, and reaquire it before returing, so a chance is given to other threads to run. --- 94,98 ---- default return type of ``int``. ctypes does release the Python global interpreter lock (GIL) just before calling the actual ! function, and reacquire it before returing, so a chance is given to other threads to run. *************** *** 101,106 **** Windows only. Functions provided by libraries loaded by ``windll`` will be called using the Windows ``__stdcall`` calling ! convention. ctypes can to detect the case that the wrong number ! of parameters have been passed to the function call by examining the stack pointer before and after the function call. If the wrong parameter count was used, an exception is raised (although --- 101,106 ---- Windows only. Functions provided by libraries loaded by ``windll`` will be called using the Windows ``__stdcall`` calling ! convention. ctypes can detect when the wrong number ! of parameters has been passed to the function call by examining the stack pointer before and after the function call. If the wrong parameter count was used, an exception is raised (although *************** *** 115,119 **** ``HRESULT`` value. These are long values containing error or success codes. In case the function return an error ``HRESULT`` ! value, a `WindowsError`` is raised. GIL released during the function call. --- 115,119 ---- ``HRESULT`` value. These are long values containing error or success codes. In case the function return an error ``HRESULT`` ! value, a ``WindowsError`` is raised. The GIL is released during the function call. |
From: Bob I. <et...@us...> - 2006-02-16 00:17:34
|
Update of /cvsroot/ctypes/ctypes/source/darwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13419/source/darwin Modified Files: Tag: branch_1_0 README.Thomas dlfcn.h dlfcn_simple.c Log Message: ctypes_dlfcn and enhanced Mac OS X dlfcn compatibility Index: dlfcn_simple.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/darwin/dlfcn_simple.c,v retrieving revision 1.1 retrieving revision 1.1.16.1 diff -C2 -d -r1.1 -r1.1.16.1 *** dlfcn_simple.c 24 Jan 2003 08:07:46 -0000 1.1 --- dlfcn_simple.c 16 Feb 2006 00:17:25 -0000 1.1.16.1 *************** *** 38,50 **** #include <limits.h> #include <mach-o/dyld.h> #include "dlfcn.h" #define ERR_STR_LEN 256 ! static void *dlsymIntern(void *handle, const char *symbol); ! static const char *error(int setget, const char *str, ...); /* Set and get the error string for use by dlerror */ --- 38,81 ---- #include <limits.h> #include <mach-o/dyld.h> + #include <AvailabilityMacros.h> #include "dlfcn.h" + #ifdef CTYPES_DARWIN_DLFCN + #define ERR_STR_LEN 256 ! #ifndef MAC_OS_X_VERSION_10_3 ! #define MAC_OS_X_VERSION_10_3 1030 ! #endif ! #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 ! #define DARWIN_HAS_DLOPEN ! extern void * dlopen(const char *path, int mode) __attribute__((weak_import)); ! extern void * dlsym(void * handle, const char *symbol) __attribute__((weak_import)); ! extern const char * dlerror(void) __attribute__((weak_import)); ! extern int dlclose(void * handle) __attribute__((weak_import)); ! extern int dladdr(const void *, Dl_info *) __attribute__((weak_import)); ! #endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 */ ! ! #ifndef DARWIN_HAS_DLOPEN ! #define dlopen darwin_dlopen ! #define dlsym darwin_dlsym ! #define dlerror darwin_dlerror ! #define dlclose darwin_dlclose ! #define dladdr darwin_dladdr ! #endif ! ! void * (*ctypes_dlopen)(const char *path, int mode); ! void * (*ctypes_dlsym)(void * handle, const char *symbol); ! const char * (*ctypes_dlerror)(void); ! int (*ctypes_dlclose)(void * handle); ! int (*ctypes_dladdr)(const void *, Dl_info *); + #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3 + /* Mac OS X 10.3+ has dlopen, so strip all this dead code to avoid warnings */ + static void *dlsymIntern(void *handle, const char *symbol); + + static const char *error(int setget, const char *str, ...); /* Set and get the error string for use by dlerror */ *************** *** 75,80 **** } ! /* dlopen */ ! void *dlopen(const char *path, int mode) { void *module = 0; --- 106,111 ---- } ! /* darwin_dlopen */ ! static void *darwin_dlopen(const char *path, int mode) { void *module = 0; *************** *** 115,121 **** /* dlsymIntern is used by dlsym to find the symbol */ ! void *dlsymIntern(void *handle, const char *symbol) { ! NSSymbol *nssym = 0; /* If the handle is -1, if is the app global context */ if (handle == (void *)-1) --- 146,152 ---- /* dlsymIntern is used by dlsym to find the symbol */ ! static void *dlsymIntern(void *handle, const char *symbol) { ! NSSymbol nssym = 0; /* If the handle is -1, if is the app global context */ if (handle == (void *)-1) *************** *** 158,167 **** } ! const char *dlerror(void) { return error(1, (char *)NULL); } ! int dlclose(void *handle) { if ((((struct mach_header *)handle)->magic == MH_MAGIC) || --- 189,198 ---- } ! static const char *darwin_dlerror(void) { return error(1, (char *)NULL); } ! static int darwin_dlclose(void *handle) { if ((((struct mach_header *)handle)->magic == MH_MAGIC) || *************** *** 181,185 **** /* dlsym, prepend the underscore and call dlsymIntern */ ! void *dlsym(void *handle, const char *symbol) { static char undersym[257]; /* Saves calls to malloc(3) */ --- 212,216 ---- /* dlsym, prepend the underscore and call dlsymIntern */ ! static void *darwin_dlsym(void *handle, const char *symbol) { static char undersym[257]; /* Saves calls to malloc(3) */ *************** *** 209,210 **** --- 240,272 ---- return value; } + + static int darwin_dladdr(const void *handle, Dl_info *info) { + return 0; + } + #endif /* MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3 */ + + #if __GNUC__ < 4 + #pragma CALL_ON_LOAD ctypes_dlfcn_init + #else + static void __attribute__ ((constructor)) ctypes_dlfcn_init(void); + static + #endif + void ctypes_dlfcn_init(void) { + if (dlopen != NULL) { + ctypes_dlsym = dlsym; + ctypes_dlopen = dlopen; + ctypes_dlerror = dlerror; + ctypes_dlclose = dlclose; + ctypes_dladdr = dladdr; + } else { + #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3 + ctypes_dlsym = darwin_dlsym; + ctypes_dlopen = darwin_dlopen; + ctypes_dlerror = darwin_dlerror; + ctypes_dlclose = darwin_dlclose; + ctypes_dladdr = darwin_dladdr; + #endif /* MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3 */ + } + } + + #endif /* CTYPES_DARWIN_DLFCN */ Index: dlfcn.h =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/darwin/dlfcn.h,v retrieving revision 1.1 retrieving revision 1.1.16.1 diff -C2 -d -r1.1 -r1.1.16.1 *** dlfcn.h 24 Jan 2003 08:07:46 -0000 1.1 --- dlfcn.h 16 Feb 2006 00:17:25 -0000 1.1.16.1 *************** *** 32,35 **** --- 32,37 ---- #define _DLFCN_H_ + #include <AvailabilityMacros.h> + #ifdef __cplusplus extern "C" { *************** *** 49,57 **** extern void * dlopen(const char *path, int mode); extern void * dlsym(void * handle, const char *symbol); extern const char * dlerror(void); extern int dlclose(void * handle); ! extern int dladdr(void *, Dl_info *); #define RTLD_LAZY 0x1 --- 51,69 ---- + #if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_2 + #warning CTYPES_DARWIN_DLFCN + #define CTYPES_DARWIN_DLFCN + extern void * (*ctypes_dlopen)(const char *path, int mode); + extern void * (*ctypes_dlsym)(void * handle, const char *symbol); + extern const char * (*ctypes_dlerror)(void); + extern int (*ctypes_dlclose)(void * handle); + extern int (*ctypes_dladdr)(const void *, Dl_info *); + #else extern void * dlopen(const char *path, int mode); extern void * dlsym(void * handle, const char *symbol); extern const char * dlerror(void); extern int dlclose(void * handle); ! extern int dladdr(const void *, Dl_info *); ! #endif #define RTLD_LAZY 0x1 *************** *** 62,65 **** --- 74,80 ---- #define RTLD_NODELETE 0x80 + /* These are from the Mac OS X 10.4 headers */ + #define RTLD_NEXT ((void *) -1) /* Search subsequent objects. */ + #define RTLD_DEFAULT ((void *) -2) /* Use default search algorithm. */ #ifdef __cplusplus Index: README.Thomas =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/darwin/README.Thomas,v retrieving revision 1.1 retrieving revision 1.1.16.1 diff -C2 -d -r1.1 -r1.1.16.1 *** README.Thomas 24 Jan 2003 08:07:46 -0000 1.1 --- README.Thomas 16 Feb 2006 00:17:25 -0000 1.1.16.1 *************** *** 4,6 **** The LICENSE in this directory applies to these files. ! Thomas Heller, Jan 2003 \ No newline at end of file --- 4,11 ---- The LICENSE in this directory applies to these files. ! Thomas Heller, Jan 2003 ! ! These files have been modified so they fall back to the system ! dlfcn calls if available in libSystem. ! ! Bob Ippolito, Feb 2006 |
From: Bob I. <et...@us...> - 2006-02-16 00:17:34
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13419/source Modified Files: Tag: branch_1_0 _ctypes.c callproc.c malloc_closure.c Added Files: Tag: branch_1_0 ctypes_dlfcn.h Log Message: ctypes_dlfcn and enhanced Mac OS X dlfcn compatibility Index: malloc_closure.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/malloc_closure.c,v retrieving revision 1.10.6.1 retrieving revision 1.10.6.2 diff -C2 -d -r1.10.6.1 -r1.10.6.2 *** malloc_closure.c 17 Aug 2005 15:54:24 -0000 1.10.6.1 --- malloc_closure.c 16 Feb 2006 00:17:25 -0000 1.10.6.2 *************** *** 1,3 **** - #include <Python.h> #include <ffi.h> #ifdef MS_WIN32 --- 1,2 ---- *************** *** 10,13 **** --- 9,13 ---- # endif #endif + #include <Python.h> #include "ctypes.h" Index: callproc.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callproc.c,v retrieving revision 1.127.2.26 retrieving revision 1.127.2.27 diff -C2 -d -r1.127.2.26 -r1.127.2.27 *** callproc.c 10 Feb 2006 18:35:32 -0000 1.127.2.26 --- callproc.c 16 Feb 2006 00:17:25 -0000 1.127.2.27 *************** *** 61,65 **** #include <windows.h> #else ! #include <dlfcn.h> #endif --- 61,65 ---- #include <windows.h> #else ! #include "ctypes_dlfcn.h" #endif *************** *** 1156,1163 **** return NULL; mode |= RTLD_NOW; ! handle = dlopen(name, mode); if (!handle) { PyErr_SetString(PyExc_OSError, ! dlerror()); return NULL; } --- 1156,1163 ---- return NULL; mode |= RTLD_NOW; ! handle = ctypes_dlopen(name, mode); if (!handle) { PyErr_SetString(PyExc_OSError, ! ctypes_dlerror()); return NULL; } *************** *** 1173,1177 **** if (dlclose(handle)) { PyErr_SetString(PyExc_OSError, ! dlerror()); return NULL; } --- 1173,1177 ---- if (dlclose(handle)) { PyErr_SetString(PyExc_OSError, ! ctypes_dlerror()); return NULL; } *************** *** 1188,1195 **** if (!PyArg_ParseTuple(args, "is:dlsym", &handle, &name)) return NULL; ! ptr = dlsym(handle, name); if (!ptr) { PyErr_SetString(PyExc_OSError, ! dlerror()); return NULL; } --- 1188,1195 ---- if (!PyArg_ParseTuple(args, "is:dlsym", &handle, &name)) return NULL; ! ptr = ctypes_dlsym(handle, name); if (!ptr) { PyErr_SetString(PyExc_OSError, ! ctypes_dlerror()); return NULL; } --- NEW FILE: ctypes_dlfcn.h --- /******************************************************************/ #ifndef _CTYPES_DLFCN_H_ #define _CTYPES_DLFCN_H_ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef MS_WIN32 #include <dlfcn.h> #ifndef CTYPES_DARWIN_DLFCN #define ctypes_dlsym dlsym #define ctypes_dlerror dlerror #define ctypes_dlopen dlopen #define ctypes_dlclose dlclose #define ctypes_dladdr dladdr #endif /* !CTYPES_DARWIN_DLFCN */ #endif /* !MS_WIN32 */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* _CTYPES_DLFCN_H_ */ Index: _ctypes.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes.c,v retrieving revision 1.226.2.51 retrieving revision 1.226.2.52 diff -C2 -d -r1.226.2.51 -r1.226.2.52 *** _ctypes.c 14 Feb 2006 19:02:39 -0000 1.226.2.51 --- _ctypes.c 16 Feb 2006 00:17:25 -0000 1.226.2.52 *************** *** 113,117 **** # endif #else ! #include <dlfcn.h> #endif #include "ctypes.h" --- 113,117 ---- # endif #else ! #include "ctypes_dlfcn.h" #endif #include "ctypes.h" *************** *** 258,262 **** } #else ! address = (void *)dlsym(handle, name); if (!address) { PyErr_Format(PyExc_ValueError, --- 258,262 ---- } #else ! address = (void *)ctypes_dlsym(handle, name); if (!address) { PyErr_Format(PyExc_ValueError, *************** *** 266,270 **** name, #endif ! dlerror()); return NULL; } --- 266,270 ---- name, #endif ! ctypes_dlerror()); return NULL; } *************** *** 2531,2535 **** } #else ! address = (PPROC)dlsym(handle, name); if (!address) { PyErr_Format(PyExc_AttributeError, --- 2531,2535 ---- } #else ! address = (PPROC)ctypes_dlsym(handle, name); if (!address) { PyErr_Format(PyExc_AttributeError, *************** *** 2539,2543 **** name, #endif ! dlerror()); return NULL; } --- 2539,2543 ---- name, #endif ! ctypes_dlerror()); return NULL; } |
From: Bob I. <et...@us...> - 2006-02-16 00:17:34
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13419 Modified Files: Tag: branch_1_0 ChangeLog Log Message: ctypes_dlfcn and enhanced Mac OS X dlfcn compatibility Index: ChangeLog =================================================================== RCS file: /cvsroot/ctypes/ctypes/ChangeLog,v retrieving revision 1.86.2.40 retrieving revision 1.86.2.41 diff -C2 -d -r1.86.2.40 -r1.86.2.41 *** ChangeLog 15 Feb 2006 19:39:31 -0000 1.86.2.40 --- ChangeLog 16 Feb 2006 00:17:25 -0000 1.86.2.41 *************** *** 1,2 **** --- 1,14 ---- + 2006-02-15 Bob Ippolito <bo...@re...> + + * New ctypes_dlfcn.h created to allow for potential indirection + of dl functions. Changed code to use "ctypes_" prefix on all + dl functions. + + * Darwin's dlfcn compatibility wrapper no longer used for 10.3 + and later, as it has a native implementation in libSystem. + Compiler macros and weak linking are used to make sure + the right thing happens even if compiled on OS X 10.3+ with a + deployment target of 10.2. Tested with gcc-3.3 and gcc-4.0. + 2006-02-15 Thomas Heller <th...@py...> |
From: Thomas H. <th...@us...> - 2006-02-15 20:15:31
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23293 Modified Files: Tag: branch_1_0 ANNOUNCE Log Message: Fix pointer to the ChangeLog in CVS. Index: ANNOUNCE =================================================================== RCS file: /cvsroot/ctypes/ctypes/ANNOUNCE,v retrieving revision 1.21.2.1 retrieving revision 1.21.2.2 diff -C2 -d -r1.21.2.1 -r1.21.2.2 *** ANNOUNCE 15 Feb 2006 18:51:38 -0000 1.21.2.1 --- ANNOUNCE 15 Feb 2006 20:15:21 -0000 1.21.2.2 *************** *** 146,154 **** ! 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> --- 146,152 ---- ! Detailed changelog is in CVS: ! <http://cvs.sourceforge.net/viewcvs.py/ctypes/ctypes/ChangeLog?rev=1.86.2.39> |
From: Thomas H. <th...@us...> - 2006-02-15 19:39:39
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11877 Modified Files: Tag: branch_1_0 MANIFEST.windows.in ChangeLog Log Message: 0.9.9.3 released. Index: MANIFEST.windows.in =================================================================== RCS file: /cvsroot/ctypes/ctypes/MANIFEST.windows.in,v retrieving revision 1.5.4.1 retrieving revision 1.5.4.2 diff -C2 -d -r1.5.4.1 -r1.5.4.2 *** MANIFEST.windows.in 15 Feb 2006 19:25:42 -0000 1.5.4.1 --- MANIFEST.windows.in 15 Feb 2006 19:39:31 -0000 1.5.4.2 *************** *** 4,10 **** include ctypes\.CTYPES_DEVEL include source\ctypes.h source\libffi_msvc\*.h include wince\_ctypes.vcw wince\_ctypes.vcp wince\_ctypes_test.vcp - recursive-include unittests *.py include docs\*.html include docs\*.css --- 4,10 ---- include ctypes\.CTYPES_DEVEL include source\ctypes.h source\libffi_msvc\*.h + include source\libffi_arm_wince\*.h source\libffi_arm_wince\*.c source\libffi_arm_wince\*.asm include wince\_ctypes.vcw wince\_ctypes.vcp wince\_ctypes_test.vcp include docs\*.html include docs\*.css *************** *** 14,17 **** recursive-include samples *.py - - recursive-include win32\com\samples *.py *.txt *.html --- 14,15 ---- Index: ChangeLog =================================================================== RCS file: /cvsroot/ctypes/ctypes/ChangeLog,v retrieving revision 1.86.2.39 retrieving revision 1.86.2.40 diff -C2 -d -r1.86.2.39 -r1.86.2.40 *** ChangeLog 10 Feb 2006 19:32:09 -0000 1.86.2.39 --- ChangeLog 15 Feb 2006 19:39:31 -0000 1.86.2.40 *************** *** 1,2 **** --- 1,6 ---- + 2006-02-15 Thomas Heller <th...@py...> + + * ctypes 0.9.9.3 released. + 2006-02-10 Thomas Heller <th...@py...> |
From: Thomas H. <th...@us...> - 2006-02-15 19:25:54
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7515 Modified Files: Tag: branch_1_0 MANIFEST.windows.in Log Message: Add wince files. Index: MANIFEST.windows.in =================================================================== RCS file: /cvsroot/ctypes/ctypes/MANIFEST.windows.in,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -C2 -d -r1.5 -r1.5.4.1 *** MANIFEST.windows.in 27 Aug 2004 16:14:23 -0000 1.5 --- MANIFEST.windows.in 15 Feb 2006 19:25:42 -0000 1.5.4.1 *************** *** 4,7 **** --- 4,8 ---- include ctypes\.CTYPES_DEVEL include source\ctypes.h source\libffi_msvc\*.h + include wince\_ctypes.vcw wince\_ctypes.vcp wince\_ctypes_test.vcp recursive-include unittests *.py |
From: Thomas H. <th...@us...> - 2006-02-15 18:56:52
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27138 Modified Files: Tag: branch_1_0 README.txt Log Message: Version 0.9.9.3 Index: README.txt =================================================================== RCS file: /cvsroot/ctypes/ctypes/README.txt,v retrieving revision 1.11.4.2 retrieving revision 1.11.4.3 diff -C2 -d -r1.11.4.2 -r1.11.4.3 *** README.txt 4 Nov 2005 07:33:05 -0000 1.11.4.2 --- README.txt 15 Feb 2006 18:56:43 -0000 1.11.4.3 *************** *** 71,85 **** ! Additional notes - On Windows, ctypes uses win32 structured exception handling, to - make it as safe as possible, although it should be pretty clear - that it's easy to crash the Python interpreter with it. ! The source distribution contains an extensive, although ! inclomplete, tutorial (which you can also read online), as well as ! example scripts demonstrating the use. ! Current version: 0.9.9 Homepage: http://starship.python.net/crew/theller/ctypes.html --- 71,82 ---- ! For Windows CE, a project file is provided in ! wince\_ctypes.vcw. MS embedded Visual C 4.0 is required to ! build the extension modules. ! Additional notes ! Current version: 0.9.9.3 Homepage: http://starship.python.net/crew/theller/ctypes.html *************** *** 88,92 **** ctypes license ! Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005 Thomas Heller Permission is hereby granted, free of charge, to any person --- 85,89 ---- ctypes license ! Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Thomas Heller Permission is hereby granted, free of charge, to any person |
From: Thomas H. <th...@us...> - 2006-02-15 18:51:50
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25121 Modified Files: Tag: branch_1_0 ANNOUNCE ACKS Log Message: Index: ANNOUNCE =================================================================== RCS file: /cvsroot/ctypes/ctypes/ANNOUNCE,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -C2 -d -r1.21 -r1.21.2.1 *** ANNOUNCE 18 Mar 2005 19:21:23 -0000 1.21 --- ANNOUNCE 15 Feb 2006 18:51:38 -0000 1.21.2.1 *************** *** 1,4 **** ! ctypes 0.9.6 released - Mar 18, 2005 ! ==================================== Overview --- 1,4 ---- ! ctypes 0.9.9.3 released - Feb 15, 2006 ! ====================================== Overview *************** *** 13,26 **** callback functions in pure Python. ! ctypes now includes a code generator toolchain which allows automatic creation of library wrappers from C header files. This feature is still experimental and beta quality. ! 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 --- 13,23 ---- callback functions in pure Python. ! ctypes includes a code generator toolchain which allows automatic creation of library wrappers from C header files. This feature is still experimental and beta quality. ! ctypes runs on Windows, Windows CE, MacOS X, Linux, Solaris, ! FreeBSD, OpenBSD. It may also run on other systems, provided that ! libffi supports this platform. Important *************** *** 34,37 **** --- 31,82 ---- and report problems on the ctypes-users mailing list. + Changes in 0.9.9.3 + + (These are the most important changes, see the ChangeLog for + complete details) + + Windows + + The ctypes.com package is no longer included and supported. + It is replaced by the comtypes package which will be released + separately. + + ctypes has been ported to Windows CE by Luke Dunstan. + + Other platforms + + Hye-Shik Chang has written a new build system for libffi + which should remove possible licensing issues. + + All platforms + + The library loading code has been rewritten by Andreas Degert, + there are now sophisticated methods to find shared libraries. + On OS X, this uses files from Bob Ippolito's macholib. + See the manual for details. + + Finally I started to write the manual, it is available online: + + http://tinyurl.com/7bpg4 + + New 'errcheck' protocol to check the return values of foreign + functions, suggested by Mike Fletcher. + + Lots of bug fixes, especially for 64-bit platforms. Improved + performance when creating ctypes instances. + + Subclasses of simple types (c_int, c_void_p, and so on) now + behave as expected - they are not automatically converted into + native Python types any longer. + + Support for explicit byte ordering in structures has been + added (BigEndianStructure, LittleEndianStructure base + classes). + + call byref() automatically, if needed, for POINTER types in + argtypes. + + Lots of improvements to the code generator. + Changes in 0.9.6 *************** *** 59,64 **** details. - ----------------------- - Additions in 0.9.5 --- 104,107 ---- *************** *** 116,122 **** 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 --- 159,165 ---- Separate source distributions are available for windows and non-windows systems. ! Please use the .zip file for Windows and Windows CE, 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 Index: ACKS =================================================================== RCS file: /cvsroot/ctypes/ctypes/ACKS,v retrieving revision 1.13 retrieving revision 1.13.4.1 diff -C2 -d -r1.13 -r1.13.4.1 *** ACKS 7 Sep 2004 06:39:43 -0000 1.13 --- ACKS 15 Feb 2006 18:51:38 -0000 1.13.4.1 *************** *** 14,20 **** --- 14,23 ---- Robin Becker Dave Brueck + Hye-Shik Chang Greg Chapman David Creemer + Andreas Daegert Bruce Dodson + Luke Dunstan Chuck Esterbrook Mike Fletcher |
From: Thomas H. <th...@us...> - 2006-02-14 20:49:00
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18117 Modified Files: Tag: branch_1_0 test_byteswap.py Log Message: Add test. Index: test_byteswap.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/Attic/test_byteswap.py,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -C2 -d -r1.1.2.8 -r1.1.2.9 *** test_byteswap.py 14 Feb 2006 19:17:23 -0000 1.1.2.8 --- test_byteswap.py 14 Feb 2006 20:48:47 -0000 1.1.2.9 *************** *** 199,202 **** --- 199,221 ---- self.assertRaises(TypeError, setattr, S, "_fields_", [("s", T)]) + def test_struct_fields(self): + if sys.byteorder == "little": + base = BigEndianStructure + fmt = ">bhid" + else: + base = LittleEndianStructure + fmt = "<bhid" + + class S(base): + _pack_ = 1 # struct with '<' or '>' uses standard alignment. + _fields_ = [("b", c_byte), + ("h", c_short), + ("i", c_int), + ("d", c_double)] + + s1 = S(0x12, 0x1234, 0x12345678, 3.14) + s2 = struct.pack(fmt, 0x12, 0x1234, 0x12345678, 3.14) + self.failUnlessEqual(bin(s1), bin(s2)) + if __name__ == "__main__": unittest.main() |
From: Thomas H. <th...@us...> - 2006-02-14 20:48:23
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17960 Modified Files: Tag: branch_1_0 test_funcptr.py Log Message: Fixes for Windows CE. Index: test_funcptr.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/Attic/test_funcptr.py,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** test_funcptr.py 14 Feb 2006 18:35:46 -0000 1.1.2.6 --- test_funcptr.py 14 Feb 2006 20:48:15 -0000 1.1.2.7 *************** *** 1,3 **** ! import unittest from ctypes import * --- 1,3 ---- ! import os, unittest from ctypes import * *************** *** 40,44 **** #self.assertRaises(TypeError, c, 1, 2, 3) self.failUnlessEqual(c(1, 2, 3, 4, 5, 6), 3) ! if not WINFUNCTYPE is CFUNCTYPE: self.assertRaises(TypeError, s, 1, 2, 3) --- 40,44 ---- #self.assertRaises(TypeError, c, 1, 2, 3) self.failUnlessEqual(c(1, 2, 3, 4, 5, 6), 3) ! if not WINFUNCTYPE is CFUNCTYPE and os.name != "ce": self.assertRaises(TypeError, s, 1, 2, 3) |
From: Thomas H. <th...@us...> - 2006-02-14 19:43:57
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29969 Modified Files: Tag: branch_1_0 test_loading.py Log Message: Skip one test on x86-solaris. Index: test_loading.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/Attic/test_loading.py,v retrieving revision 1.1.2.9 retrieving revision 1.1.2.10 diff -C2 -d -r1.1.2.9 -r1.1.2.10 *** test_loading.py 14 Feb 2006 18:39:54 -0000 1.1.2.9 --- test_loading.py 14 Feb 2006 19:43:47 -0000 1.1.2.10 *************** *** 32,36 **** self.assertRaises(OSError, cdll.load_version, self.unknowndll, "") ! if os.name == "posix": def test_find(self): name = "c" --- 32,36 ---- self.assertRaises(OSError, cdll.load_version, self.unknowndll, "") ! if os.name == "posix" and sys.platform != "sunos5": def test_find(self): name = "c" |
From: Thomas H. <th...@us...> - 2006-02-14 19:17:31
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21121 Modified Files: Tag: branch_1_0 test_byteswap.py Log Message: Cleanup, add tests. Index: test_byteswap.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/Attic/test_byteswap.py,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** test_byteswap.py 14 Dec 2005 20:55:01 -0000 1.1.2.7 --- test_byteswap.py 14 Feb 2006 19:17:23 -0000 1.1.2.8 *************** *** 4,16 **** from ctypes import * - ##class BITS(Structure): - ## _fields_ = [("i%d" % i, c_uint, 1) for i in range(32)] - - ##for i in range(32): - ## print getattr(BITS, "i%d" % i) - - ##def dump(s): - ## print hexlify(buffer(s)) - def bin(s): return hexlify(buffer(s)).upper() --- 4,7 ---- *************** *** 159,180 **** self.failUnless(c_char.__ctype_be__ is c_char) ! ''' ! ################################################################ ! ! def test(): ! from ctypes import BigEndianStructure ! class PT(BigEndianStructure): ! ## class PT(Structure): ! _fields_ = [("x", c_int), ! ("y", c_int), ! ("b", c_char), ! ## ("c", c_wchar), ! ("c", c_byte), ! ("d", c_ubyte), ! ## ("e", POINTER(c_int)), ! ## ("f", POINTER(POINTER(c_int))), ! ## ("float", c_float), ! ## ("double", c_double), ("b1", c_byte, 3), --- 150,174 ---- self.failUnless(c_char.__ctype_be__ is c_char) ! def test_struct_fields(self): ! if sys.byteorder == "little": ! base = BigEndianStructure ! else: ! base = LittleEndianStructure ! class T(base): ! pass ! _fields_ = [("a", c_ubyte), ! ("b", c_byte), ! ("c", c_short), ! ("d", c_ushort), ! ("e", c_int), ! ("f", c_uint), ! ("g", c_long), ! ("h", c_ulong), ! ("i", c_longlong), ! ("k", c_ulonglong), ! ("l", c_float), ! ("m", c_double), ! ("n", c_char), ("b1", c_byte, 3), *************** *** 182,232 **** ("b3", c_byte, 2), ("a", c_int * 3 * 3 * 3)] ! for desc in PT._fields_: ! print getattr(PT, desc[0]) ! ! if __name__ == "__main__": ! test() ! ! from ctypes import BigEndianStructure ! ! class SCSI_6(BigEndianStructure): ! _pack_ = 1 ! _fields_ = [("opcode", c_ubyte, 8), ! ! ("lun", c_ulong, 3), ! ("blockaddr", c_ulong, 21), ! ("transferlen", c_ulong, 8), ! ! ("controlbyte", c_ubyte, 8)] ! print sizeof(SCSI_6) ! ! def bin(s): ! from binascii import hexlify ! return hexlify(str(buffer(s))) ! ! print bin(SCSI_6(-1)) ! print bin(SCSI_6(0, -1)) ! print bin(SCSI_6(0, 0, -1)) ! print bin(SCSI_6(0, 0, 0, -1)) ! print bin(SCSI_6(0, 0, 0, 0, -1)) ! ! class SCSI_12(BigEndianStructure): ! _pack_ = 1 ! _fields_ = [("opcode", c_ubyte, 8), ! ! ("lun", c_ubyte, 3), ! ("_res1", c_ubyte, 4), ! ("reladdr", c_ubyte, 1), ! ! ("blockaddr", c_ulong), ! ("_res2", c_ubyte), ! ("_res3", c_ubyte), ! ("_res4", c_ubyte), ! ("transferlen", c_ushort), ! ("controlbyte", c_ubyte)] ! ''' if __name__ == "__main__": --- 176,201 ---- ("b3", c_byte, 2), ("a", c_int * 3 * 3 * 3)] + T._fields_ = _fields_ ! # these fields do not support different byte order: ! for typ in c_wchar, c_void_p, POINTER(c_int): ! _fields_.append(("x", typ)) ! class T(base): ! pass ! self.assertRaises(TypeError, setattr, T, "_fields_", [("x", typ)]) ! def test_struct_struct(self): ! # Nested structures with different byte order not (yet) supported ! if sys.byteorder == "little": ! base = BigEndianStructure ! else: ! base = LittleEndianStructure ! class T(Structure): ! _fields_ = [("a", c_int), ! ("b", c_int)] ! class S(base): ! pass ! self.assertRaises(TypeError, setattr, S, "_fields_", [("s", T)]) if __name__ == "__main__": |
From: Thomas H. <th...@us...> - 2006-02-14 19:02:53
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14631/source Modified Files: Tag: branch_1_0 _ctypes.c Log Message: Bump version number to 0.9.9.3. Index: _ctypes.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes.c,v retrieving revision 1.226.2.50 retrieving revision 1.226.2.51 diff -C2 -d -r1.226.2.50 -r1.226.2.51 *** _ctypes.c 10 Feb 2006 18:35:32 -0000 1.226.2.50 --- _ctypes.c 14 Feb 2006 19:02:39 -0000 1.226.2.51 *************** *** 4464,4468 **** PyModule_AddObject(m, "FUNCFLAG_CDECL", PyInt_FromLong(FUNCFLAG_CDECL)); PyModule_AddObject(m, "FUNCFLAG_PYTHONAPI", PyInt_FromLong(FUNCFLAG_PYTHONAPI)); ! PyModule_AddStringConstant(m, "__version__", "0.9.9.1"); PyModule_AddObject(m, "_memmove_addr", PyLong_FromVoidPtr(memmove)); --- 4464,4468 ---- PyModule_AddObject(m, "FUNCFLAG_CDECL", PyInt_FromLong(FUNCFLAG_CDECL)); PyModule_AddObject(m, "FUNCFLAG_PYTHONAPI", PyInt_FromLong(FUNCFLAG_PYTHONAPI)); ! PyModule_AddStringConstant(m, "__version__", "0.9.9.3"); PyModule_AddObject(m, "_memmove_addr", PyLong_FromVoidPtr(memmove)); |
From: Thomas H. <th...@us...> - 2006-02-14 19:02:51
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14631 Modified Files: Tag: branch_1_0 setup.py Log Message: Bump version number to 0.9.9.3. Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.122.2.14 retrieving revision 1.122.2.15 diff -C2 -d -r1.122.2.14 -r1.122.2.15 *** setup.py 4 Feb 2006 06:50:29 -0000 1.122.2.14 --- setup.py 14 Feb 2006 19:02:39 -0000 1.122.2.15 *************** *** 12,16 **** LIBFFI_SOURCES='source/libffi' ! __version__ = "0.9.9.1" ################################################################ --- 12,16 ---- LIBFFI_SOURCES='source/libffi' ! __version__ = "0.9.9.3" ################################################################ |
From: Thomas H. <th...@us...> - 2006-02-14 19:02:49
|
Update of /cvsroot/ctypes/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14631/ctypes Modified Files: Tag: branch_1_0 __init__.py Log Message: Bump version number to 0.9.9.3. Index: __init__.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/__init__.py,v retrieving revision 1.61.2.33 retrieving revision 1.61.2.34 diff -C2 -d -r1.61.2.33 -r1.61.2.34 *** __init__.py 14 Feb 2006 18:34:24 -0000 1.61.2.33 --- __init__.py 14 Feb 2006 19:02:39 -0000 1.61.2.34 *************** *** 11,15 **** del _magicfile ! __version__ = "0.9.9.1" from _ctypes import Union, Structure, Array --- 11,15 ---- del _magicfile ! __version__ = "0.9.9.3" from _ctypes import Union, Structure, Array |
From: Thomas H. <th...@us...> - 2006-02-14 18:40:05
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7065 Modified Files: Tag: branch_1_0 test_loading.py Log Message: Index: test_loading.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/Attic/test_loading.py,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -C2 -d -r1.1.2.8 -r1.1.2.9 *** test_loading.py 14 Feb 2006 17:47:25 -0000 1.1.2.8 --- test_loading.py 14 Feb 2006 18:39:54 -0000 1.1.2.9 *************** *** 8,13 **** def test_load(self): - print (os.name, sys.platform) - if os.name == "nt": name = "msvcrt" --- 8,11 ---- |
From: Thomas H. <th...@us...> - 2006-02-14 18:36:51
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5772 Modified Files: Tag: branch_1_0 _ctypes_test.c Log Message: Index: _ctypes_test.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes_test.c,v retrieving revision 1.46.2.10 retrieving revision 1.46.2.11 diff -C2 -d -r1.46.2.10 -r1.46.2.11 *** _ctypes_test.c 14 Feb 2006 17:22:45 -0000 1.46.2.10 --- _ctypes_test.c 14 Feb 2006 18:36:43 -0000 1.46.2.11 *************** *** 39,43 **** EXPORT(void) my_qsort(void *base, size_t num, size_t width, int(*compare)(const void*, const void*)) { ! return qsort(base, num, width, compare); } --- 39,43 ---- EXPORT(void) my_qsort(void *base, size_t num, size_t width, int(*compare)(const void*, const void*)) { ! qsort(base, num, width, compare); } *************** *** 532,575 **** #include <search.h> - struct _sortit { - void *base; - size_t num; - size_t width; - int (_cdecl *compare)(const void *, const void *); - }; - - EXPORT(int) cmp(int *a, int *b) - { - return *a - *b; - } - - static DWORD WINAPI my_qsort(struct _sortit *s) - { - printf("Thread started\n"); - qsort(s->base, s->num, s->width, s->compare); - printf("Thread ending\n"); - return 42; - } - - EXPORT(void *) qsort_in_thread(void *base, size_t num, size_t width, - int (_cdecl *compare)(const void*, const void *)) - { - HANDLE hThread; - DWORD threadid; - static struct _sortit sortit; - - sortit.base = base; - sortit.num = num; - sortit.width = width; - sortit.compare = compare; - hThread = CreateThread(NULL, /* default security descriptor */ - 0, /* default stack size */ - &my_qsort, /* start address */ - &sortit, /* parameter */ - 0, /* dwCreationFlags */ - &threadid); - return (void *)hThread; - } - EXPORT (HRESULT) KeepObject(IUnknown *punk) { --- 532,535 ---- |
From: Thomas H. <th...@us...> - 2006-02-14 18:36:27
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5571 Modified Files: Tag: branch_1_0 test_stringptr.py Log Message: Index: test_stringptr.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/Attic/test_stringptr.py,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** test_stringptr.py 14 Feb 2006 17:13:20 -0000 1.1.2.3 --- test_stringptr.py 14 Feb 2006 18:36:18 -0000 1.1.2.4 *************** *** 43,47 **** def test_functions(self): ! strchr = lib.strchr strchr.restype = c_char_p --- 43,47 ---- def test_functions(self): ! strchr = lib.my_strchr strchr.restype = c_char_p |
From: Thomas H. <th...@us...> - 2006-02-14 18:35:55
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5335 Modified Files: Tag: branch_1_0 test_funcptr.py Log Message: Index: test_funcptr.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/Attic/test_funcptr.py,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** test_funcptr.py 14 Feb 2006 17:22:45 -0000 1.1.2.5 --- test_funcptr.py 14 Feb 2006 18:35:46 -0000 1.1.2.6 *************** *** 95,99 **** return value ! strchr = lib.strchr strchr.restype = c_char_p strchr.argtypes = (c_char_p, c_char) --- 95,99 ---- return value ! strchr = lib.my_strchr strchr.restype = c_char_p strchr.argtypes = (c_char_p, c_char) |
From: Thomas H. <th...@us...> - 2006-02-14 18:35:04
|
Update of /cvsroot/ctypes/ctypes/comtypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4863 Modified Files: Tag: branch_1_0 test_basic.py Log Message: Index: test_basic.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/comtypes/test/Attic/test_basic.py,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** test_basic.py 8 Nov 2005 20:43:38 -0000 1.1.2.1 --- test_basic.py 14 Feb 2006 18:34:52 -0000 1.1.2.2 *************** *** 128,131 **** ! if __name__ == "__main__": ut.main() --- 128,134 ---- ! def main(): ut.main() + + if __name__ == "__main__": + main() |