[ctypes-commit] ctypes/source cfield.c,1.38,1.39
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2004-08-20 14:24:24
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12739 Modified Files: cfield.c Log Message: Conversion functions for the 'O' typecode. Index: cfield.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/cfield.c,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** cfield.c 23 Jul 2004 14:35:54 -0000 1.38 --- cfield.c 20 Aug 2004 14:24:15 -0000 1.39 *************** *** 370,373 **** --- 370,388 ---- static PyObject * + O_get(void *ptr, unsigned size) + { + return *(PyObject **)ptr; + } + + static PyObject * + O_set(void *ptr, PyObject *value, unsigned size) + { + *(PyObject **)ptr = value; + Py_INCREF(value); + return value; + } + + + static PyObject * i_get(void *ptr, unsigned size) { *************** *** 873,876 **** --- 888,892 ---- { 'X', BSTR_set, BSTR_get, &ffi_type_pointer}, #endif + { 'O', O_set, O_get, &ffi_type_pointer}, { 0, NULL, NULL, NULL}, }; |