ctypes-commit Mailing List for ctypes (Page 98)
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...> - 2004-08-18 12:27:35
|
Update of /cvsroot/ctypes/ctypes/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27439 Modified Files: test_arrays.py Log Message: Slicing is now supported. Index: test_arrays.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_arrays.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_arrays.py 4 May 2004 09:15:19 -0000 1.7 --- test_arrays.py 18 Aug 2004 12:27:25 -0000 1.8 *************** *** 59,65 **** self.failUnlessEqual(len(ca), 3) ! # slicing is not supported: from operator import getslice, delitem ! self.assertRaises(TypeError, getslice, ca, 0, 1) # cannot delete items --- 59,65 ---- self.failUnlessEqual(len(ca), 3) ! # slicing is now supported, but not extended slicing (3-argument)! from operator import getslice, delitem ! self.assertRaises(TypeError, getslice, ca, 0, 1, -1) # cannot delete items |
From: Thomas H. <th...@us...> - 2004-08-18 12:23:29
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26057 Modified Files: _ctypes.c Log Message: Array and POINTER instance now support slicing, for POINTER only getslice is implemented (setslice is too dangerous, probably). Slices are accepted or returned as lists of the elements, except for character and unicode character pointer and arrays, where strings resp. unicode strings are used - much more convenient. Add some docstrings. Index: _ctypes.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes.c,v retrieving revision 1.150 retrieving revision 1.151 diff -C2 -d -r1.150 -r1.151 *** _ctypes.c 22 Jul 2004 13:48:03 -0000 1.150 --- _ctypes.c 18 Aug 2004 12:23:18 -0000 1.151 *************** *** 183,186 **** --- 183,189 ---- } + static char from_address_doc[] = + "C.from_address(integer) -> C instance\naccess a C instance at the specified address"; + static PyObject * CDataType_from_address(PyObject *type, PyObject *value) *************** *** 196,199 **** --- 199,205 ---- } + static char in_dll_doc[] = + "C.in_dll(dll, name) -> C instance\naccess a C instance in a dll"; + static PyObject * CDataType_in_dll(PyObject *type, PyObject *args) *************** *** 289,298 **** static PyMethodDef CDataType_methods[] = { ! { "from_param", CDataType_from_param, METH_O, ! from_param_doc }, ! { "from_address", CDataType_from_address, METH_O, ! "create an instance from an address"}, ! { "in_dll", CDataType_in_dll, METH_VARARGS, ! "access an instance in a dll"}, { NULL, NULL }, }; --- 295,301 ---- static PyMethodDef CDataType_methods[] = { ! { "from_param", CDataType_from_param, METH_O, from_param_doc }, ! { "from_address", CDataType_from_address, METH_O, from_address_doc }, ! { "in_dll", CDataType_in_dll, METH_VARARGS, in_dll_doc }, { NULL, NULL }, }; *************** *** 537,546 **** static PyMethodDef PointerType_methods[] = { ! { "from_address", CDataType_from_address, METH_O, ! "create an instance from an address"}, ! { "in_dll", CDataType_in_dll, METH_VARARGS, ! "access an instance in a dll"}, ! { "from_param", (PyCFunction)PointerType_from_param, METH_O, ! from_param_doc}, { "set_type", (PyCFunction)PointerType_set_type, METH_O }, { NULL, NULL }, --- 540,546 ---- static PyMethodDef PointerType_methods[] = { ! { "from_address", CDataType_from_address, METH_O, from_address_doc }, ! { "in_dll", CDataType_in_dll, METH_VARARGS, in_dll_doc}, ! { "from_param", (PyCFunction)PointerType_from_param, METH_O, from_param_doc}, { "set_type", (PyCFunction)PointerType_set_type, METH_O }, { NULL, NULL }, *************** *** 1290,1299 **** static PyMethodDef SimpleType_methods[] = { ! { "from_param", SimpleType_from_param, METH_O, ! from_param_doc }, ! { "from_address", CDataType_from_address, METH_O, ! "create an instance from an address"}, ! { "in_dll", CDataType_in_dll, METH_VARARGS, ! "access an instance in a dll"}, { NULL, NULL }, }; --- 1290,1296 ---- static PyMethodDef SimpleType_methods[] = { ! { "from_param", SimpleType_from_param, METH_O, from_param_doc }, ! { "from_address", CDataType_from_address, METH_O, from_address_doc }, ! { "in_dll", CDataType_in_dll, METH_VARARGS, in_dll_doc}, { NULL, NULL }, }; *************** *** 2824,2831 **** } ! #ifdef CAN_SLICE ! static PyListObject * Array_slice(CDataObject *self, int ilow, int ihigh) { PyListObject *np; int i, len; --- 2821,2829 ---- } ! static PyObject * Array_slice(CDataObject *self, int ilow, int ihigh) { + StgDictObject *stgdict, *itemdict; + PyObject *proto; PyListObject *np; int i, len; *************** *** 2841,2844 **** --- 2839,2855 ---- len = ihigh - ilow; + stgdict = PyObject_stgdict((PyObject *)self); + proto = stgdict->proto; + itemdict = PyType_stgdict(proto); + if (itemdict->getfunc == getentry("c")->getfunc) { + char *ptr = (char *)self->b_ptr; + return PyString_FromStringAndSize(ptr + ilow, len); + #ifdef HAVE_USABLE_WCHAR_T + } else if (itemdict->getfunc == getentry("u")->getfunc) { + wchar_t *ptr = (wchar_t *)self->b_ptr; + return PyUnicode_FromWideChar(ptr + ilow, len); + #endif + } + np = (PyListObject *) PyList_New(len); if (np == NULL) *************** *** 2849,2855 **** PyList_SET_ITEM(np, i, v); } ! return np; } - #endif static int --- 2860,2865 ---- PyList_SET_ITEM(np, i, v); } ! return (PyObject *)np; } static int *************** *** 2880,2889 **** } - #ifdef CAN_SLICE static int Array_ass_slice(CDataObject *self, int ilow, int ihigh, PyObject *value) { int i, len; - PyObject *item; if (value == NULL) { --- 2890,2897 ---- *************** *** 2922,2926 **** return 0; } - #endif static int --- 2930,2933 ---- *************** *** 2935,2949 **** 0, /* sq_repeat; */ (intargfunc)Array_item, /* sq_item; */ - #ifdef CAN_SLICE (intintargfunc)Array_slice, /* sq_slice; */ - #else - 0, /* sq_slice; */ - #endif (intobjargproc)Array_ass_item, /* sq_ass_item; */ - #ifdef CAN_SLICE (intintobjargproc)Array_ass_slice, /* sq_ass_slice; */ - #else - 0, /* sq_ass_slice; */ - #endif 0, /* sq_contains; */ --- 2942,2948 ---- *************** *** 3353,3356 **** --- 3352,3393 ---- } + static PyObject * + Pointer_slice(CDataObject *self, int ilow, int ihigh) + { + PyListObject *np; + StgDictObject *stgdict, *itemdict; + PyObject *proto; + int i, len; + + if (ilow < 0) + ilow = 0; + if (ihigh < ilow) + ihigh = ilow; + len = ihigh - ilow; + + stgdict = PyObject_stgdict((PyObject *)self); + proto = stgdict->proto; + itemdict = PyType_stgdict(proto); + if (itemdict->getfunc == getentry("c")->getfunc) { + char *ptr = *(char **)self->b_ptr; + return PyString_FromStringAndSize(ptr + ilow, len); + #ifdef HAVE_USABLE_WCHAR_T + } else if (itemdict->getfunc == getentry("u")->getfunc) { + wchar_t *ptr = *(wchar_t **)self->b_ptr; + return PyUnicode_FromWideChar(ptr + ilow, len); + #endif + } + + np = (PyListObject *) PyList_New(len); + if (np == NULL) + return NULL; + + for (i = 0; i < len; i++) { + PyObject *v = Pointer_item(self, i+ilow); + PyList_SET_ITEM(np, i, v); + } + return (PyObject *)np; + } + static PySequenceMethods Pointer_as_sequence = { 0, /* inquiry sq_length; */ *************** *** 3358,3362 **** 0, /* intargfunc sq_repeat; */ (intargfunc)Pointer_item, /* intargfunc sq_item; */ ! 0, /* intintargfunc sq_slice; */ (intobjargproc)Pointer_ass_item, /* intobjargproc sq_ass_item; */ 0, /* intintobjargproc sq_ass_slice; */ --- 3395,3399 ---- 0, /* intargfunc sq_repeat; */ (intargfunc)Pointer_item, /* intargfunc sq_item; */ ! (intintargfunc)Pointer_slice, /* intintargfunc sq_slice; */ (intobjargproc)Pointer_ass_item, /* intobjargproc sq_ass_item; */ 0, /* intintobjargproc sq_ass_slice; */ |
From: Thomas H. <th...@us...> - 2004-08-18 12:20:19
|
Update of /cvsroot/ctypes/ctypes/unittests/com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25312 Modified Files: test_sysalloc.py Log Message: Add two tests for VARIANTs containing strings. The latter shows that there are memory leaks since the VARIANT does not (yet?) clear itself. Index: test_sysalloc.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/com/test_sysalloc.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_sysalloc.py 28 Jul 2004 12:57:04 -0000 1.3 --- test_sysalloc.py 18 Aug 2004 12:20:09 -0000 1.4 *************** *** 3,7 **** from ctypes.com import mallocspy, ole32 ! from ctypes.com.automation import BSTR # We init COM before each test, and uninit afterwards. --- 3,7 ---- from ctypes.com import mallocspy, ole32 ! from ctypes.com.automation import BSTR, VARIANT # We init COM before each test, and uninit afterwards. *************** *** 110,113 **** --- 110,126 ---- self.expect = 0 + def test_VARIANT(self): + # We still have to clear variants manually, to avoid memory leaks. + for i in range(32): + v = VARIANT("Hello, World") + v.value = None + self.expect = 0 + + def test_VARIANT_memleak(self): + # This demonstrates the memory leak: + for i in range(32): + VARIANT("Hello, World") + self.expect = 32 + # Offtopic for this test: # XXX These need better error messages: |
From: Thomas H. <th...@us...> - 2004-08-18 12:17:00
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24487 Modified Files: callproc.c Log Message: Docstrings for the sizeof, addressof, alignment, byref functions. Index: callproc.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callproc.c,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** callproc.c 28 Jul 2004 13:13:30 -0000 1.93 --- callproc.c 18 Aug 2004 12:16:51 -0000 1.94 *************** *** 1089,1092 **** --- 1089,1108 ---- #endif + static char alignment_doc[] = + "addressof(C instance) -> integer\nReturn the address of the C instance"; + static char sizeof_doc[] = + "sizeof(C type) -> integer\n" + "sizeof(C instance) -> integer\n" + "Return the size in bytes of a C instance"; + + static char byref_doc[] = + "byref(C instance) -> byref-object\n" + "Return a pointer lookalike to the C instance, only usable\n" + "as function argument"; + static char addressof_doc[] = + "addressof(C instance) -> integer\n" + "Return the address of the C instance internal buffer"; + + PyMethodDef module_methods[] = { #ifdef MS_WIN32 *************** *** 1102,1109 **** {"dlsym", py_dl_sym, METH_VARARGS, "find symbol in shared library"}, #endif ! {"alignment", align_func, METH_O}, ! {"sizeof", sizeof_func, METH_O}, ! {"byref", byref, METH_O}, ! {"addressof", addressof, METH_O}, {NULL, NULL} /* Sentinel */ }; --- 1118,1125 ---- {"dlsym", py_dl_sym, METH_VARARGS, "find symbol in shared library"}, #endif ! {"alignment", align_func, METH_O, alignment_doc}, ! {"sizeof", sizeof_func, METH_O, sizeof_doc}, ! {"byref", byref, METH_O, byref_doc}, ! {"addressof", addressof, METH_O, addressof_doc}, {NULL, NULL} /* Sentinel */ }; |
From: Thomas H. <th...@us...> - 2004-08-17 20:20:19
|
Update of /cvsroot/ctypes/ctypes/source/libffi_msvc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1396 Modified Files: ffi.c Log Message: Remove unused code - this also fixes a compiler warning. Index: ffi.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/libffi_msvc/ffi.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ffi.c 7 May 2004 19:53:04 -0000 1.7 --- ffi.c 17 Aug 2004 20:14:46 -0000 1.8 *************** *** 452,600 **** } - /* ------- Native raw API support -------------------------------- */ - - #if !FFI_NO_RAW_API - - static void - ffi_closure_raw_SYSV (closure) - ffi_raw_closure *closure; - { - // this is our return value storage - long double res; - - // our various things... - ffi_raw *raw_args; - ffi_cif *cif; - unsigned short rtype; - void *resp = (void*)&res; - - /* get the cif */ - cif = closure->cif; - - /* the SYSV/X86 abi matches the RAW API exactly, well.. almost */ - #ifndef _MSC_VER - raw_args = (ffi_raw*) __builtin_dwarf_cfa (); - #endif - (closure->fun) (cif, resp, raw_args, closure->user_data); - - rtype = cif->flags; - - /* now, do a generic return based on the value of rtype */ - #ifndef _MSC_VER - if (rtype == FFI_TYPE_INT) - { - asm ("movl (%0),%%eax" : : "r" (resp) : "eax"); - } - else if (rtype == FFI_TYPE_FLOAT) - { - asm ("flds (%0)" : : "r" (resp) : "st" ); - } - else if (rtype == FFI_TYPE_DOUBLE) - { - asm ("fldl (%0)" : : "r" (resp) : "st", "st(1)" ); - } - else if (rtype == FFI_TYPE_LONGDOUBLE) - { - asm ("fldt (%0)" : : "r" (resp) : "st", "st(1)" ); - } - else if (rtype == FFI_TYPE_SINT64) - { - asm ("movl 0(%0),%%eax; movl 4(%0),%%edx" - : : "r"(resp) - : "eax", "edx"); - } - #endif - } - - - - - ffi_status - ffi_prep_raw_closure (ffi_raw_closure* closure, - ffi_cif* cif, - void (*fun)(ffi_cif*,void*,ffi_raw*,void*), - void *user_data) - { - int i; - - FFI_ASSERT (cif->abi == FFI_SYSV); - - // we currently don't support certain kinds of arguments for raw - // closures. This should be implemented by a separate assembly language - // routine, since it would require argument processing, something we - // don't do now for performance. - - for (i = cif->nargs-1; i >= 0; i--) - { - FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_STRUCT); - FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_LONGDOUBLE); - } - - - FFI_INIT_TRAMPOLINE (&closure->tramp[0], &ffi_closure_raw_SYSV, - (void*)closure, 0); - - closure->cif = cif; - closure->user_data = user_data; - closure->fun = fun; - - return FFI_OK; - } - - static void - ffi_prep_args_raw(char *stack, extended_cif *ecif) - { - memcpy (stack, ecif->avalue, ecif->cif->bytes); - } - - void - ffi_raw_call(/*@dependent@*/ ffi_cif *cif, - void (*fn)(), - /*@out@*/ void *rvalue, - /*@dependent@*/ ffi_raw *fake_avalue) - { - extended_cif ecif; - void **avalue = (void **)fake_avalue; - - ecif.cif = cif; - ecif.avalue = avalue; - - /* If the return value is a struct and we don't have a return */ - /* value address then we need to make one */ - - if ((rvalue == NULL) && - (cif->rtype->type == FFI_TYPE_STRUCT)) - { - /*@-sysunrecog@*/ - ecif.rvalue = alloca(cif->rtype->size); - /*@=sysunrecog@*/ - } - else - ecif.rvalue = rvalue; - - - switch (cif->abi) - { - case FFI_SYSV: - /*@-usedef@*/ - ffi_call_SYSV(ffi_prep_args_raw, &ecif, cif->bytes, - cif->flags, ecif.rvalue, fn); - /*@=usedef@*/ - break; - #ifdef X86_WIN32 - case FFI_STDCALL: - /*@-usedef@*/ - ffi_call_STDCALL(ffi_prep_args_raw, &ecif, cif->bytes, - cif->flags, ecif.rvalue, fn); - /*@=usedef@*/ - break; - #endif /* X86_WIN32 */ - default: - FFI_ASSERT(0); - break; - } - } - - #endif - #endif /* __x86_64__ */ --- 452,454 ---- |
From: Thomas H. <th...@us...> - 2004-07-28 13:35:04
|
Update of /cvsroot/ctypes/ctypes/win32/com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13057 Modified Files: ChangeLog Log Message: Make all hex constants long, to avoid future warnings in Python 2.3. Index: ChangeLog =================================================================== RCS file: /cvsroot/ctypes/ctypes/win32/com/ChangeLog,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ChangeLog 20 Jul 2004 15:22:52 -0000 1.3 --- ChangeLog 28 Jul 2004 13:34:54 -0000 1.4 *************** *** 1,2 **** --- 1,7 ---- + 2004-07-28 Thomas Heller <th...@py...> + + * com/hresult.py, samples: Make all 8-digit hex constants long, to + avoid future warnings in Python 2.3 + 2004-07-20 Thomas Heller <th...@py...> |
From: Thomas H. <th...@us...> - 2004-07-28 13:29:58
|
Update of /cvsroot/ctypes/ctypes/win32/com/samples/server/control In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12242 Modified Files: stoplite.py Log Message: Make all hex constants long, to avoid future warnings in Python 2.3. Index: stoplite.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/win32/com/samples/server/control/stoplite.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** stoplite.py 20 Jul 2004 15:32:22 -0000 1.5 --- stoplite.py 28 Jul 2004 13:29:49 -0000 1.6 *************** *** 393,398 **** def _CreateControlWindow(self, hwndParent, rect): ! WS_CHILD = 0x40000000 ! WS_VISIBLE = 0x10000000 win_id = 0 self._hwnd = windll.user32.CreateWindowExA( --- 393,398 ---- def _CreateControlWindow(self, hwndParent, rect): ! WS_CHILD = 0x40000000L ! WS_VISIBLE = 0x10000000L win_id = 0 self._hwnd = windll.user32.CreateWindowExA( *************** *** 422,426 **** OLEIVERB_PROPERTIES = -7 ! OLEOBJ_E_NOVERBS = 0x80040180 OLECLOSE_SAVEIFDIRTY = 0 --- 422,426 ---- OLEIVERB_PROPERTIES = -7 ! OLEOBJ_E_NOVERBS = 0x80040180L OLECLOSE_SAVEIFDIRTY = 0 |
From: Thomas H. <th...@us...> - 2004-07-28 13:29:50
|
Update of /cvsroot/ctypes/ctypes/win32/com/samples/server/IExplorer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12224 Modified Files: toolband.py Log Message: Make all hex constants long, to avoid future warnings in Python 2.3. Index: toolband.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/win32/com/samples/server/IExplorer/toolband.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** toolband.py 23 Jul 2004 13:43:02 -0000 1.4 --- toolband.py 28 Jul 2004 13:29:41 -0000 1.5 *************** *** 200,204 **** self.hwndParent = hwndParent.value # Register and create window ! WS_CHILD = 0x40000000 self.m_hwnd = windll.user32.CreateWindowExA(0, "button", "button", WS_CHILD, --- 200,204 ---- self.hwndParent = hwndParent.value # Register and create window ! WS_CHILD = 0x40000000L self.m_hwnd = windll.user32.CreateWindowExA(0, "button", "button", WS_CHILD, |
From: Thomas H. <th...@us...> - 2004-07-28 13:28:58
|
Update of /cvsroot/ctypes/ctypes/win32/com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12053 Modified Files: hresult.py Log Message: Make all hex constants long, to avoid future warnings in Python 2.3. Index: hresult.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/win32/com/hresult.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** hresult.py 16 Jul 2004 15:49:41 -0000 1.4 --- hresult.py 28 Jul 2004 13:28:47 -0000 1.5 *************** *** 6,21 **** S_FALSE = 1 ! E_UNEXPECTED = 0x8000FFFF ! E_NOTIMPL = 0x80004001 ! E_NOINTERFACE = 0x80004002 ! E_POINTER = 0x80004003 ! E_FAIL = 0x80004005 ! E_INVALIDARG = 0x80070057 ! CLASS_E_NOAGGREGATION = 0x80040110 ! CLASS_E_CLASSNOTAVAILABLE = 0x80040111 ! TYPE_E_ELEMENTNOTFOUND = 0x8002802B ! CO_E_CLASSSTRING = 0x800401F3 --- 6,21 ---- S_FALSE = 1 ! E_UNEXPECTED = 0x8000FFFFL ! E_NOTIMPL = 0x80004001L ! E_NOINTERFACE = 0x80004002L ! E_POINTER = 0x80004003L ! E_FAIL = 0x80004005L ! E_INVALIDARG = 0x80070057L ! CLASS_E_NOAGGREGATION = 0x80040110L ! CLASS_E_CLASSNOTAVAILABLE = 0x80040111L ! TYPE_E_ELEMENTNOTFOUND = 0x8002802BL ! CO_E_CLASSSTRING = 0x800401F3L |
From: Thomas H. <th...@us...> - 2004-07-28 13:13:41
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9454 Modified Files: callproc.c Log Message: Remove unused variable. Index: callproc.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callproc.c,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** callproc.c 28 Jul 2004 12:52:29 -0000 1.92 --- callproc.c 28 Jul 2004 13:13:30 -0000 1.93 *************** *** 1010,1014 **** PyObject *p1, *p2, *r = NULL; struct argument a, b; - int result; IUnknown *src, **pdst; if (!PyArg_ParseTuple(args, "OO:CopyComPointer", &p1, &p2)) --- 1010,1013 ---- |
From: Thomas H. <th...@us...> - 2004-07-28 12:57:14
|
Update of /cvsroot/ctypes/ctypes/unittests/com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6527 Modified Files: test_sysalloc.py Log Message: When the python.exe contains a static linked python (on windows), it cannot import any external extension module. So, use another way to locate and load the _ctypes_test dll/shared lib to run the tests. Index: test_sysalloc.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/com/test_sysalloc.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_sysalloc.py 30 Jun 2004 20:04:12 -0000 1.2 --- test_sysalloc.py 28 Jul 2004 12:57:04 -0000 1.3 *************** *** 9,12 **** --- 9,23 ---- ole32.CoUninitialize() + def find_test_dll(): + import sys, os + if os.name == "nt": + name = "_ctypes_test.pyd" + else: + name = "_ctypes_test.so" + for p in sys.path: + f = os.path.join(p, name) + if os.path.isfile(f): + return f + class MallocSpyTest(unittest.TestCase): def setUp(self): *************** *** 56,61 **** def test_GetString_C(self): - import _ctypes_test - # GetString is this function, implemented in C: # --- 67,70 ---- *************** *** 64,68 **** # *pbstr = SysAllocString(L"Goodbye!"); # } ! GetString = cdll[_ctypes_test.__file__].GetString # XXX Explain why we cannot create b outside the loop! --- 73,77 ---- # *pbstr = SysAllocString(L"Goodbye!"); # } ! GetString = CDLL(find_test_dll()).GetString # XXX Explain why we cannot create b outside the loop! |
From: Thomas H. <th...@us...> - 2004-07-28 12:57:05
|
Update of /cvsroot/ctypes/ctypes/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6460 Modified Files: test_win32.py test_values.py test_returnfuncptrs.py test_refcounts.py test_prototypes.py test_pointers.py test_functions.py test_cfuncs.py test_callbacks.py Log Message: When the python.exe contains a static linked python (on windows), it cannot import any external extension module. So, use another way to locate and load the _ctypes_test dll/shared lib to run the tests. Index: test_pointers.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_pointers.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test_pointers.py 4 May 2004 09:15:19 -0000 1.14 --- test_pointers.py 28 Jul 2004 12:56:55 -0000 1.15 *************** *** 2,6 **** from ctypes import * ! import _ctypes_test ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, --- 2,15 ---- from ctypes import * ! def find_test_dll(): ! import sys, os ! if os.name == "nt": ! name = "_ctypes_test.pyd" ! else: ! name = "_ctypes_test.so" ! for p in sys.path: ! f = os.path.join(p, name) ! if os.path.isfile(f): ! return f ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, *************** *** 11,15 **** class PointersTestCase(unittest.TestCase): def test_pass_pointers(self): ! dll = CDLL(_ctypes_test.__file__) func = dll._testfunc_p_p --- 20,24 ---- class PointersTestCase(unittest.TestCase): def test_pass_pointers(self): ! dll = CDLL(find_test_dll()) func = dll._testfunc_p_p *************** *** 25,29 **** def test_change_pointers(self): ! dll = CDLL(_ctypes_test.__file__) func = dll._testfunc_p_p --- 34,38 ---- def test_change_pointers(self): ! dll = CDLL(find_test_dll()) func = dll._testfunc_p_p *************** *** 60,64 **** callback = PROTOTYPE(func) ! dll = CDLL(_ctypes_test.__file__) # This function expects a function pointer, # and calls this with an integer pointer as parameter. --- 69,73 ---- callback = PROTOTYPE(func) ! dll = CDLL(find_test_dll()) # This function expects a function pointer, # and calls this with an integer pointer as parameter. Index: test_win32.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_win32.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_win32.py 23 Jul 2004 14:23:02 -0000 1.8 --- test_win32.py 28 Jul 2004 12:56:55 -0000 1.9 *************** *** 4,7 **** --- 4,18 ---- import unittest, sys + def find_test_dll(): + import sys, os + if os.name == "nt": + name = "_ctypes_test.pyd" + else: + name = "_ctypes_test.so" + for p in sys.path: + f = os.path.join(p, name) + if os.path.isfile(f): + return f + if sys.platform == "win32": *************** *** 53,58 **** ("bottom", c_long)] ! import _ctypes_test ! dll = CDLL(_ctypes_test.__file__) pt = POINT(10, 10) --- 64,68 ---- ("bottom", c_long)] ! dll = CDLL(find_test_dll()) pt = POINT(10, 10) Index: test_returnfuncptrs.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_returnfuncptrs.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_returnfuncptrs.py 18 May 2004 09:28:37 -0000 1.5 --- test_returnfuncptrs.py 28 Jul 2004 12:56:55 -0000 1.6 *************** *** 1,12 **** import unittest from ctypes import * ! import _ctypes_test class ReturnFuncPtrTestCase(unittest.TestCase): def test_with_prototype(self): - dll = CDLL(_ctypes_test.__file__) # The _ctypes_test shared lib/dll exports quite some functions for testing. # The get_strchr function returns a *pointer* to the C strchr function. get_strchr = dll.get_strchr get_strchr.restype = CFUNCTYPE(c_char_p, c_char_p, c_char) --- 1,22 ---- import unittest from ctypes import * ! ! def find_test_dll(): ! import sys, os ! if os.name == "nt": ! name = "_ctypes_test.pyd" ! else: ! name = "_ctypes_test.so" ! for p in sys.path: ! f = os.path.join(p, name) ! if os.path.isfile(f): ! return f class ReturnFuncPtrTestCase(unittest.TestCase): def test_with_prototype(self): # The _ctypes_test shared lib/dll exports quite some functions for testing. # The get_strchr function returns a *pointer* to the C strchr function. + dll = CDLL(find_test_dll()) get_strchr = dll.get_strchr get_strchr.restype = CFUNCTYPE(c_char_p, c_char_p, c_char) *************** *** 18,22 **** def test_without_prototype(self): ! dll = CDLL(_ctypes_test.__file__) get_strchr = dll.get_strchr addr = get_strchr() --- 28,32 ---- def test_without_prototype(self): ! dll = CDLL(find_test_dll()) get_strchr = dll.get_strchr addr = get_strchr() Index: test_refcounts.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_refcounts.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test_refcounts.py 11 Jun 2004 17:44:11 -0000 1.14 --- test_refcounts.py 28 Jul 2004 12:56:55 -0000 1.15 *************** *** 6,14 **** OtherCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_ulonglong) class RefcountTestCase(unittest.TestCase): - def setUp(self): - global dll - import _ctypes_test - dll = ctypes.CDLL(_ctypes_test.__file__) def test_1(self): --- 6,22 ---- OtherCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_ulonglong) + def find_test_dll(): + import sys, os + if os.name == "nt": + name = "_ctypes_test.pyd" + else: + name = "_ctypes_test.so" + for p in sys.path: + f = os.path.join(p, name) + if os.path.isfile(f): + return f + dll = ctypes.CDLL(find_test_dll()) + class RefcountTestCase(unittest.TestCase): def test_1(self): Index: test_values.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_values.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** test_values.py 22 Jul 2004 08:29:26 -0000 1.11 --- test_values.py 28 Jul 2004 12:56:55 -0000 1.12 *************** *** 5,14 **** import unittest from ctypes import * ! import _ctypes_test class ValuesTestCase(unittest.TestCase): def test_an_integer(self): ! ctdll = CDLL(_ctypes_test.__file__) an_integer = c_int.in_dll(ctdll, "an_integer") x = an_integer.value --- 5,23 ---- import unittest from ctypes import * ! def find_test_dll(): ! import sys, os ! if os.name == "nt": ! name = "_ctypes_test.pyd" ! else: ! name = "_ctypes_test.so" ! for p in sys.path: ! f = os.path.join(p, name) ! if os.path.isfile(f): ! return f class ValuesTestCase(unittest.TestCase): def test_an_integer(self): ! ctdll = CDLL(find_test_dll()) an_integer = c_int.in_dll(ctdll, "an_integer") x = an_integer.value *************** *** 18,22 **** def test_undefined(self): ! ctdll = CDLL(_ctypes_test.__file__) self.assertRaises(ValueError, c_int.in_dll, ctdll, "Undefined_Symbol") --- 27,31 ---- def test_undefined(self): ! ctdll = CDLL(find_test_dll()) self.assertRaises(ValueError, c_int.in_dll, ctdll, "Undefined_Symbol") Index: test_prototypes.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_prototypes.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_prototypes.py 4 May 2004 09:16:23 -0000 1.3 --- test_prototypes.py 28 Jul 2004 12:56:55 -0000 1.4 *************** *** 22,27 **** # In this case, there would have to be an additional reference to the argument... ! import _ctypes_test ! testdll = CDLL(_ctypes_test.__file__) def c_wbuffer(init): --- 22,36 ---- # In this case, there would have to be an additional reference to the argument... ! def find_test_dll(): ! import sys, os ! if os.name == "nt": ! name = "_ctypes_test.pyd" ! else: ! name = "_ctypes_test.so" ! for p in sys.path: ! f = os.path.join(p, name) ! if os.path.isfile(f): ! return f ! testdll = CDLL(find_test_dll()) def c_wbuffer(init): Index: test_cfuncs.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_cfuncs.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test_cfuncs.py 22 Jun 2004 12:32:22 -0000 1.10 --- test_cfuncs.py 28 Jul 2004 12:56:55 -0000 1.11 *************** *** 1,10 **** import unittest from ctypes import * ! import _ctypes_test class CFunctions(unittest.TestCase): def __init__(self, *args): unittest.TestCase.__init__(self, *args) ! self.dll = CDLL(_ctypes_test.__file__) def test_byte(self): --- 1,20 ---- import unittest from ctypes import * ! ! def find_test_dll(): ! import sys, os ! if os.name == "nt": ! name = "_ctypes_test.pyd" ! else: ! name = "_ctypes_test.so" ! for p in sys.path: ! f = os.path.join(p, name) ! if os.path.isfile(f): ! return f class CFunctions(unittest.TestCase): def __init__(self, *args): unittest.TestCase.__init__(self, *args) ! self.dll = CDLL(find_test_dll()) def test_byte(self): *************** *** 127,131 **** def __init__(self, *args): unittest.TestCase.__init__(self, *args) ! self.dll = stdcall_dll(_ctypes_test.__file__) if __name__ == '__main__': --- 137,141 ---- def __init__(self, *args): unittest.TestCase.__init__(self, *args) ! self.dll = stdcall_dll(find_test_dll()) if __name__ == '__main__': Index: test_functions.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_functions.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** test_functions.py 4 May 2004 09:15:19 -0000 1.35 --- test_functions.py 28 Jul 2004 12:56:55 -0000 1.36 *************** *** 15,24 **** WINFUNCTYPE = CFUNCTYPE class FunctionTestCase(unittest.TestCase): def setUp(self): global dll ! import _ctypes_test ! dll = CDLL(_ctypes_test.__file__) def test_mro(self): --- 15,34 ---- WINFUNCTYPE = CFUNCTYPE + def find_test_dll(): + import sys, os + if os.name == "nt": + name = "_ctypes_test.pyd" + else: + name = "_ctypes_test.so" + for p in sys.path: + f = os.path.join(p, name) + if os.path.isfile(f): + return f + class FunctionTestCase(unittest.TestCase): def setUp(self): global dll ! dll = CDLL(find_test_dll()) def test_mro(self): Index: test_callbacks.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_callbacks.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** test_callbacks.py 21 Jun 2004 11:31:00 -0000 1.18 --- test_callbacks.py 28 Jul 2004 12:56:55 -0000 1.19 *************** *** 106,114 **** ################################################################ class SampleCallbacksTestCase(unittest.TestCase): def test_integrate(self): # Derived from some then non-working code, posted by David Foster ! import _ctypes_test # The function prototype called by 'integrate': double func(double); --- 106,125 ---- ################################################################ + def find_test_dll(): + import sys, os + if os.name == "nt": + name = "_ctypes_test.pyd" + else: + name = "_ctypes_test.so" + for p in sys.path: + f = os.path.join(p, name) + if os.path.isfile(f): + return f + class SampleCallbacksTestCase(unittest.TestCase): def test_integrate(self): # Derived from some then non-working code, posted by David Foster ! dll = CDLL(find_test_dll()) # The function prototype called by 'integrate': double func(double); *************** *** 116,120 **** # The integrate function itself, exposed from the _ctypes_test dll ! integrate = CDLL(_ctypes_test.__file__).integrate integrate.argtypes = (c_double, c_double, CALLBACK, c_long) integrate.restype = c_double --- 127,131 ---- # The integrate function itself, exposed from the _ctypes_test dll ! integrate = dll.integrate integrate.argtypes = (c_double, c_double, CALLBACK, c_long) integrate.restype = c_double |
From: Thomas H. <th...@us...> - 2004-07-28 12:53:16
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5895 Modified Files: ChangeLog Log Message: CopyComPointer is no longer a function exported from the _ctypes dll/shared lib, instead it is a normal Python function implemented in the _ctypes extension. This allows to build _ctypes as a builtin module. Index: ChangeLog =================================================================== RCS file: /cvsroot/ctypes/ctypes/ChangeLog,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** ChangeLog 23 Jul 2004 17:49:43 -0000 1.45 --- ChangeLog 28 Jul 2004 12:53:03 -0000 1.46 *************** *** 1,2 **** --- 1,9 ---- + 2004-07-28 Thomas Heller <th...@py...> + + * (Message): CopyComPointer is no longer a function exported from + the _ctypes dll/shared lib, instead it is a normal Python function + implemented in the _ctypes extension. This allows to build + _ctypes as a builtin module. + 2004-07-23 Thomas Heller <th...@py...> |
From: Thomas H. <th...@us...> - 2004-07-28 12:52:41
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5771 Modified Files: callproc.c Log Message: Remove unused variable warning. Index: callproc.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callproc.c,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** callproc.c 28 Jul 2004 12:46:41 -0000 1.91 --- callproc.c 28 Jul 2004 12:52:29 -0000 1.92 *************** *** 734,738 **** --- 734,740 ---- short s; int i; + #if (SIZEOF_LONG != SIZEOF_INT) long l; + #endif switch (dict->size) { case 1: |
From: Thomas H. <th...@us...> - 2004-07-28 12:47:00
|
Update of /cvsroot/ctypes/ctypes/win32/com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4851 Modified Files: __init__.py Log Message: CopyComPointer is no longer a function exported from the _ctypes dll/shared lib, instead it is a normal Python function implemented in the _ctypes extension. This allows to build _ctypes as a builtin module. Index: __init__.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/win32/com/__init__.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** __init__.py 20 Jul 2004 15:10:52 -0000 1.39 --- __init__.py 28 Jul 2004 12:46:51 -0000 1.40 *************** *** 7,11 **** HRESULT = _ctypes.HRESULT ! CopyComPointer = windll[_ctypes.__file__].CopyComPointer ole32 = oledll.ole32 --- 7,11 ---- HRESULT = _ctypes.HRESULT ! CopyComPointer = _ctypes.CopyComPointer ole32 = oledll.ole32 |
From: Thomas H. <th...@us...> - 2004-07-28 12:46:51
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4795 Modified Files: callproc.c callbacks.c Log Message: CopyComPointer is no longer a function exported from the _ctypes dll/shared lib, instead it is a normal Python function implemented in the _ctypes extension. This allows to build _ctypes as a builtin module. Index: callbacks.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callbacks.c,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** callbacks.c 23 Jul 2004 12:17:14 -0000 1.58 --- callbacks.c 28 Jul 2004 12:46:41 -0000 1.59 *************** *** 452,467 **** /******************************************************************/ - STDAPI CopyComPointer(IUnknown *src, IUnknown **pdst) - { - if (pdst == NULL) - return E_POINTER; - if (src) - src->lpVtbl->AddRef(src); - *pdst = src; - return S_OK; - } - - /******************************************************************/ - long Call_GetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { --- 452,455 ---- *************** *** 576,579 **** --- 564,568 ---- } + #ifndef Py_NO_ENABLE_SHARED BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvRes) { *************** *** 587,590 **** --- 576,581 ---- #endif + #endif + /* Local Variables: Index: callproc.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callproc.c,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** callproc.c 23 Jul 2004 09:09:06 -0000 1.90 --- callproc.c 28 Jul 2004 12:46:41 -0000 1.91 *************** *** 1000,1003 **** --- 1000,1035 ---- } + static char copy_com_pointer_doc[] = + "CopyComPointer(a, b) -> integer\n"; + + static PyObject * + copy_com_pointer(PyObject *self, PyObject *args) + { + PyObject *p1, *p2, *r = NULL; + struct argument a, b; + int result; + IUnknown *src, **pdst; + if (!PyArg_ParseTuple(args, "OO:CopyComPointer", &p1, &p2)) + return NULL; + a.keep = b.keep = NULL; + + if (-1 == ConvParam(p1, 0, &a) || -1 == ConvParam(p2, 1, &b)) + goto done; + src = (IUnknown *)a.value.p; + pdst = (IUnknown **)b.value.p; + + if (pdst == NULL) + r = PyInt_FromLong(E_POINTER); + else { + if (src) + src->lpVtbl->AddRef(src); + *pdst = src; + r = PyInt_FromLong(S_OK); + } + done: + Py_XDECREF(a.keep); + Py_XDECREF(b.keep); + return r; + } #else *************** *** 1058,1061 **** --- 1090,1094 ---- PyMethodDef module_methods[] = { #ifdef MS_WIN32 + {"CopyComPointer", copy_com_pointer, METH_VARARGS, copy_com_pointer_doc}, {"FormatError", format_error, METH_VARARGS, format_error_doc}, {"LoadLibrary", load_library, METH_VARARGS, load_library_doc}, |
From: Thomas H. <th...@us...> - 2004-07-28 12:46:41
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4763 Modified Files: setup.py Log Message: CopyComPointer is no longer a function exported from the _ctypes dll/shared lib, instead it is a normal Python function implemented in the _ctypes extension. This allows to build _ctypes as a builtin module. Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** setup.py 23 Jul 2004 16:23:20 -0000 1.100 --- setup.py 28 Jul 2004 12:46:32 -0000 1.101 *************** *** 57,62 **** extensions = [Extension("_ctypes", export_symbols=["DllGetClassObject,PRIVATE", ! "DllCanUnloadNow,PRIVATE", ! "CopyComPointer"], libraries=["ole32", "user32", "oleaut32"], include_dirs=["source/libffi_msvc"], --- 57,61 ---- extensions = [Extension("_ctypes", export_symbols=["DllGetClassObject,PRIVATE", ! "DllCanUnloadNow,PRIVATE"], libraries=["ole32", "user32", "oleaut32"], include_dirs=["source/libffi_msvc"], |
From: Thomas H. <th...@us...> - 2004-07-23 17:49:52
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21118 Modified Files: ChangeLog Log Message: *** empty log message *** Index: ChangeLog =================================================================== RCS file: /cvsroot/ctypes/ctypes/ChangeLog,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** ChangeLog 23 Jul 2004 15:14:01 -0000 1.44 --- ChangeLog 23 Jul 2004 17:49:43 -0000 1.45 *************** *** 1,4 **** --- 1,7 ---- 2004-07-23 Thomas Heller <th...@py...> + (Message): ctypes 0.9.0 released. + + * (Message): c_int, c_uint and other integer variants now use the masked functions when converting Python integers/longs to C |
From: Thomas H. <th...@us...> - 2004-07-23 17:41:51
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19902 Modified Files: README.txt ANNOUNCE Log Message: Update for 0.9.0 release. Index: ANNOUNCE =================================================================== RCS file: /cvsroot/ctypes/ctypes/ANNOUNCE,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ANNOUNCE 23 Jul 2004 17:32:40 -0000 1.3 --- ANNOUNCE 23 Jul 2004 17:41:42 -0000 1.4 *************** *** 24,28 **** The big change is that ctypes now uses the same code base on all platforms, many, many bug should have been fixed this way on ! non-windows systems. There have been lots of improvements and additions both to ctypes --- 24,29 ---- The big change is that ctypes now uses the same code base on all platforms, many, many bug should have been fixed this way on ! non-windows systems. The destribution now contains libffi, no ! need to find, download, build and install a compatible version. There have been lots of improvements and additions both to ctypes *************** *** 61,70 **** <http://sourceforge.net/project/showfiles.php?group_id=71702> ! Source distributions are available for non windows systems as tar.gz file, ! for windows you should download the zip-file if you want to build ! ctypes from source - MSVC is required for that. Binary windows installers, which contain compiled extension ! modules, are also available, be sure to download the one for the Python version you are using. --- 62,73 ---- <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. Index: README.txt =================================================================== RCS file: /cvsroot/ctypes/ctypes/README.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** README.txt 23 Jul 2004 17:33:41 -0000 1.10 --- README.txt 23 Jul 2004 17:41:42 -0000 1.11 *************** *** 20,24 **** ctypes now uses the same code base and libffi on all platforms. For easier installation, the libffi sources are now included in ! the source distribution. --- 20,25 ---- ctypes now uses the same code base and libffi on all platforms. For easier installation, the libffi sources are now included in ! the source distribution - no need to find, build, and install a ! compatible libffi version. *************** *** 41,44 **** --- 42,51 ---- Installation from source + 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). + To install ctypes from source, unpack the distribution, enter the ctypes-0.9.0 directory, and enter *************** *** 46,51 **** python setup.py build ! This will build a static version of libffi, and then the ! Python extension modules. A C compiler is required. To run the builtin unittests, enter --- 53,58 ---- python setup.py build ! This will build the Python extension modules. A C compiler is ! required. To run the builtin unittests, enter |
From: Thomas H. <th...@us...> - 2004-07-23 17:34:33
|
Update of /cvsroot/ctypes/ctypes/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18651 Modified Files: index.stx Log Message: Update for 0.9.0 release. Index: index.stx =================================================================== RCS file: /cvsroot/ctypes/ctypes/docs/index.stx,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** index.stx 15 Jan 2004 21:02:36 -0000 1.6 --- index.stx 23 Jul 2004 17:34:24 -0000 1.7 *************** *** 17,32 **** News ! **'ctypes' version 0.6.3 has been released**. The changes are ! summarized "here":changes.html. ! Yasushi Masuda has translated the docs into ! "japanese":http://www.python.jp/pub/doc_jp/contrib/ctypes/. - A 'ctypes' - "Wiki":http://starship.python.net/crew/theller/moin.cgi/CtypesModule, - and a mailing list which should be used to discuss the - usage and further development of 'ctypes'. More info can be found - on the "list info page":http://lists.sourceforge.net/lists/listinfo/ctypes-users. --- 17,57 ---- News ! **'ctypes' version 0.9.0 has been released.** ! 'ctypes' now requires Python 2.3 or higher, Python 2.2 is no longer ! supported. ! ! The big change is that 'ctypes' now uses the same code base on all ! platforms, many, many bug should have been fixed this way on ! non-windows systems. ! ! There have been lots of improvements and additions both to ctypes ! itself, and to the ctypes.com windows framework, too many to ! remember now and document here. ! ! Most prominent additions to ctypes.com are: ! ! A ctypes.com.client module supporting dynamic dispatch ! ! An internet explorer toolband sample ! ! Many improvements to the stoplite sample ! ! Detailed changelogs are in CVS (well, sometimes I forget to update ! them): ! ! "ChangeLog":http://cvs.sourceforge.net/viewcvs.py/ctypes/ctypes/ChangeLog?rev=HEAD ! ! "com ChangeLog":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'. *************** *** 67,70 **** --- 92,108 ---- Old news + 'ctypes' version 0.6.3 has been released. The changes are + summarized "here":changes.html. + + Yasushi Masuda has translated the docs into + "japanese":http://www.python.jp/pub/doc_jp/contrib/ctypes/. + + A 'ctypes' + "Wiki":http://starship.python.net/crew/theller/moin.cgi/CtypesModule, + and a mailing list which should be used to discuss the + usage and further development of 'ctypes'. More info can be found + on the "list info page":http://lists.sourceforge.net/lists/listinfo/ctypes-users. + + 'ctypes' version 0.6.0 has been released, and the documentation has been updated. |
From: Thomas H. <th...@us...> - 2004-07-23 17:33:54
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18550 Modified Files: README.txt Log Message: Update for 0.9.0 release. Index: README.txt =================================================================== RCS file: /cvsroot/ctypes/ctypes/README.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** README.txt 23 Jul 2004 16:54:41 -0000 1.9 --- README.txt 23 Jul 2004 17:33:41 -0000 1.10 *************** *** 8,12 **** words: wrap libraries in pure Python. ! ctypes runs on Windows, MacOS X, Linux, Solaris. On Windows, ctypes contains (the beginning of) a COM framework --- 8,14 ---- words: wrap libraries in pure Python. ! ctypes runs on Windows, MacOS X, Linux, Solaris, FreeBSD. It may ! also run on other systems, provided that libffi supports this ! platform. On Windows, ctypes contains (the beginning of) a COM framework |
From: Thomas H. <th...@us...> - 2004-07-23 17:32:49
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18328 Modified Files: ANNOUNCE Log Message: Update for 0.9.0 release. Index: ANNOUNCE =================================================================== RCS file: /cvsroot/ctypes/ctypes/ANNOUNCE,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ANNOUNCE 16 Jan 2004 19:40:37 -0000 1.2 --- ANNOUNCE 23 Jul 2004 17:32:40 -0000 1.3 *************** *** 1,32 **** - It's release day ;-) ! ctypes 0.6.3 released ===================== Overview ! 'ctypes' is a Python package to create and manipulate C data types ! in Python, and to call functions in dynamic link libraries/shared ! dlls. It allows wrapping these libraries in pure Python. ! It works on Windows, Linux and MacOS X (the latter require that ! your machine is supported by libffi). - Changes ! A critical bug with pointer instances was fixed, this makes the ! 'incomplete types' sample code in the tutorial actually work. ! All ctypes objects are now correctly garbarge collected. This ! *may* lead to crashes in your program (especially with callback ! functions, or pointers handed out to longer running C code). You ! must keep a reference in Python to any object as long as it is ! used in foreign C code. ! All other known bugs have been fixed. - Again, a lot of changes to the COM package, but all this is still work in - progress and unstable, and it has to be properly documented. Homepage --- 1,72 ---- ! ctypes 0.9.0 released ===================== Overview ! ctypes is a ffi (Foreign Function Interface) package for Python. ! It allows to call functions exposed from dlls/shared libraries and ! has extensive facilities to create, access and manipulate simpole ! and complicated C data types transparently from Python - in other ! words: wrap libraries in pure Python. + ctypes runs on Windows, MacOS X, Linux, Solaris, FreeBSD. It may + also run on other systems, provided that libffi supports this + platform. ! Changes in 0.9.0 ! ctypes now requires Python 2.3 or higher, Python 2.2 is no longer ! supported. ! The big change is that ctypes now uses the same code base on all ! platforms, many, many bug should have been fixed this way on ! non-windows systems. ! ! There have been lots of improvements and additions both to ctypes ! itself, and to the ctypes.com windows framework, too many to ! remember now and document here. ! ! Most prominent additions to ctypes.com are: ! ! A ctypes.com.client module supporting dynamic dispatch ! ! An internet explorer toolband sample ! ! Many improvements to the stoplite sample ! ! Detailed changelogs are in CVS (well, sometimes I forget to update ! them): ! ! <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> ! ! Source distributions are available for non windows systems as tar.gz file, ! for windows you should download the zip-file if you want to build ! ctypes from source - MSVC is required for that. ! ! Binary windows installers, which contain compiled extension ! modules, are also available, be sure to download the one for the ! Python version you are using. Homepage |
From: Thomas H. <th...@us...> - 2004-07-23 16:54:50
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11963 Modified Files: README.txt Log Message: Update for 0.9.0 release. Index: README.txt =================================================================== RCS file: /cvsroot/ctypes/ctypes/README.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** README.txt 26 Jun 2003 18:28:39 -0000 1.8 --- README.txt 23 Jul 2004 16:54:41 -0000 1.9 *************** *** 1,76 **** ! ctypes is a ffi (Foreign Function Interface) package for Python. ! It allows to call functions exposed from dlls/shared libraries and has ! extensive facilities to create, access and manipulate simpole and ! complicated C data types transparently from Python - in other words: ! wrap libraries in pure Python. ! ctypes runs on Windows, MacOS X, Linux, Solaris. ! On Windows, ctypes contains (the beginning of) a COM framework mainly ! targetted to use and implement custom COM interfaces. ! ---- - ctypes requires Python 2.2 or higher, since it makes intensive use of the - new type system. ! For all platforms except Windows you'll need a very recent version of ! libffi which supports your processor. ! ---- - Unfortunately libffi is in a very sad state, there seem to be no - official releases recent enough to be used with ctypes (libffi-1.20 is - too old!). ! Currently libffi is maintained in the GCC CVS tree. Ronald Oussoren ! has kindly assembled a snapshot of libffi taken from the GCC CVS ! repository which works with this release, it is available for download ! from the ctypes download page ! http://sourceforge.net/project/showfiles.php?group_id=71702. ! ---- ! To install ctypes from source, unpack the distribution, ! enter the ctypes-0.6.x directory, and enter - python setup.py install --help ! to see the options available, then ! python setup.py install [options] ! to install it. If you want to run the unittests before, you should do ! python setup.py test ! To install from the binary windows installer, make sure you download ! the correct version depending on the Python version you use. ! For Python 2.2, you need ! ctypes-0.6.x.win32-py2.2.exe ! For Python 2.3, you need ! ctypes-0.6.x.win32-py2.3.exe ! ---- ! 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.6.2 ! Homepage: http://starship.python.net/crew/theller/ctypes.html - License: MIT ! Platforms: Windows, linux, MacOS X, solaris --- 1,126 ---- ! Overview ! ctypes is a ffi (Foreign Function Interface) package for Python. ! It allows to call functions exposed from dlls/shared libraries and ! has extensive facilities to create, access and manipulate simpole ! and complicated C data types transparently from Python - in other ! words: wrap libraries in pure Python. ! ctypes runs on Windows, MacOS X, Linux, Solaris. ! On Windows, ctypes contains (the beginning of) a COM framework ! mainly targetted to use and implement custom COM interfaces. ! News ! ctypes now uses the same code base and libffi on all platforms. ! For easier installation, the libffi sources are now included in ! the source distribution. ! Requirements ! ctypes 0.9 requires Python 2.3 or higher, since it makes intensive ! use of the new type system. ! ctypes uses libffi, which is copyright Red Hat, Inc. Complete ! license see below. ! Installation ! Windows ! On Windows, it is the easiest to download the executable ! installer for your Python version and execute this. ! Installation from source ! To install ctypes from source, unpack the distribution, enter ! the ctypes-0.9.0 directory, and enter ! python setup.py build ! This will build a static version of libffi, and then the ! Python extension modules. A C compiler is required. + To run the builtin unittests, enter ! python setup.py test ! There may still be some problems on certain platforms, and the ! tests may crash Python with a segfault - for this reason the ! unittests are run in separate processes. ! To install ctypes, enter ! python setup.py install --help ! to see the avaibable options, and finally ! python setup.py install [options] ! 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.0 ! ! Homepage: http://starship.python.net/crew/theller/ctypes.html ! ! ! ctypes license ! ! Copyright (c) 2000, 2001, 2002, 2003, 2004 Thomas Heller ! ! Permission is hereby granted, free of charge, to any person ! obtaining a copy of this software and associated documentation files ! (the "Software"), to deal in the Software without restriction, ! including without limitation the rights to use, copy, modify, merge, ! publish, distribute, sublicense, and/or sell copies of the Software, ! and to permit persons to whom the Software is furnished to do so, ! subject to the following conditions: ! ! The above copyright notice and this permission notice shall be ! included in all copies or substantial portions of the Software. ! ! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ! MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS ! BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ! ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ! CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ! SOFTWARE. ! ! libffi license ! ! libffi - Copyright (c) 1996-2003 Red Hat, Inc. ! ! Permission is hereby granted, free of charge, to any person ! obtaining a copy of this software and associated documentation files ! (the ``Software''), to deal in the Software without restriction, ! including without limitation the rights to use, copy, modify, merge, ! publish, distribute, sublicense, and/or sell copies of the Software, ! and to permit persons to whom the Software is furnished to do so, ! subject to the following conditions: ! ! The above copyright notice and this permission notice shall be ! included in all copies or substantial portions of the Software. ! ! THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, ! EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ! MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! NONINFRINGEMENT. IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ! ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF ! CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ! WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
From: Thomas H. <th...@us...> - 2004-07-23 16:53:36
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11797 Modified Files: LICENSE.txt Log Message: Add 2004 to copyright. Index: LICENSE.txt =================================================================== RCS file: /cvsroot/ctypes/ctypes/LICENSE.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LICENSE.txt 17 Jan 2003 13:46:47 -0000 1.1 --- LICENSE.txt 23 Jul 2004 16:53:23 -0000 1.2 *************** *** 1,3 **** ! Copyright (c) 2000, 2001, 2002, 2003 Thomas Heller Permission is hereby granted, free of charge, to any person obtaining --- 1,3 ---- ! Copyright (c) 2000, 2001, 2002, 2003, 2004 Thomas Heller Permission is hereby granted, free of charge, to any person obtaining |
From: Thomas H. <th...@us...> - 2004-07-23 16:23:30
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7187 Modified Files: setup.py Log Message: copy and paste bug... Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** setup.py 23 Jul 2004 14:52:25 -0000 1.99 --- setup.py 23 Jul 2004 16:23:20 -0000 1.100 *************** *** 400,404 **** data_files = [("ctypes/com/samples/server/control", ["win32/com/samples/server/control/test.html"]) ! ], else: --- 400,404 ---- data_files = [("ctypes/com/samples/server/control", ["win32/com/samples/server/control/test.html"]) ! ] else: |