Back to index

python3.2  3.2.2
Classes | Defines | Typedefs | Functions | Variables
ctypes.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  value
struct  tagCDataObject
struct  CThunkObject
struct  PyCFuncPtrObject
struct  fielddesc
struct  CFieldObject
struct  StgDictObject
struct  tagPyCArgObject
struct  basespec
union  tagPyCArgObject.value

Defines

#define max(a, b)   ((a) > (b) ? (a) : (b))
#define min(a, b)   ((a) < (b) ? (a) : (b))
#define PARAMFLAG_FIN   0x1
#define PARAMFLAG_FOUT   0x2
#define PARAMFLAG_FLCID   0x4
#define CThunk_CheckExact(v)   ((v)->ob_type == &PyCThunk_Type)
#define PyCStgDict_CheckExact(v)   ((v)->ob_type == &PyCStgDict_Type)
#define PyCStgDict_Check(v)   PyObject_TypeCheck(v, &PyCStgDict_Type)
#define CDataObject_CheckExact(v)   ((v)->ob_type == &PyCData_Type)
#define CDataObject_Check(v)   PyObject_TypeCheck(v, &PyCData_Type)
#define PyCSimpleTypeObject_CheckExact(v)   ((v)->ob_type == &PyCSimpleType_Type)
#define PyCSimpleTypeObject_Check(v)   PyObject_TypeCheck(v, &PyCSimpleType_Type)
#define PyCArrayTypeObject_Check(v)   PyObject_TypeCheck(v, &PyCArrayType_Type)
#define ArrayObject_Check(v)   PyObject_TypeCheck(v, &PyCArray_Type)
#define PointerObject_Check(v)   PyObject_TypeCheck(v, &PyCPointer_Type)
#define PyCPointerTypeObject_Check(v)   PyObject_TypeCheck(v, &PyCPointerType_Type)
#define PyCFuncPtrObject_Check(v)   PyObject_TypeCheck(v, &PyCFuncPtr_Type)
#define PyCFuncPtrTypeObject_Check(v)   PyObject_TypeCheck(v, &PyCFuncPtrType_Type)
#define PyCStructTypeObject_Check(v)   PyObject_TypeCheck(v, &PyCStructType_Type)
#define FUNCFLAG_STDCALL   0x0
#define FUNCFLAG_CDECL   0x1
#define FUNCFLAG_HRESULT   0x2
#define FUNCFLAG_PYTHONAPI   0x4
#define FUNCFLAG_USE_ERRNO   0x8
#define FUNCFLAG_USE_LASTERROR   0x10
#define TYPEFLAG_ISPOINTER   0x100
#define TYPEFLAG_HASPOINTER   0x200
#define DICTFLAG_FINAL   0x1000
#define PyCArg_CheckExact(v)   ((v)->ob_type == &PyCArg_Type)

Typedefs

typedef struct tagPyCArgObject
typedef struct tagCDataObject
typedef PyObject *(* GETFUNC )(void *, Py_ssize_t size)
typedef PyObject *(* SETFUNC )(void *, PyObject *value, Py_ssize_t size)
typedef PyCArgObject *(* PARAMFUNC )(CDataObject *obj)
typedef int(* PPROC )(void)

Functions

int PyCStructUnionType_update_stgdict (PyObject *fields, PyObject *type, int isStruct)
int PyType_stginfo (PyTypeObject *self, Py_ssize_t *psize, Py_ssize_t *palign, Py_ssize_t *plength)
int PyObject_stginfo (PyObject *self, Py_ssize_t *psize, Py_ssize_t *palign, Py_ssize_t *plength)
struct fielddesc_ctypes_get_fielddesc (const char *fmt)
PyObjectPyCField_FromDesc (PyObject *desc, Py_ssize_t index, Py_ssize_t *pfield_size, int bitsize, int *pbitofs, Py_ssize_t *psize, Py_ssize_t *poffset, Py_ssize_t *palign, int pack, int is_big_endian)
PyObjectPyCData_AtAddress (PyObject *type, void *buf)
PyObjectPyCData_FromBytes (PyObject *type, char *data, Py_ssize_t length)
PyObjectPyCArrayType_from_ctype (PyObject *itemtype, Py_ssize_t length)
CThunkObject_ctypes_alloc_callback (PyObject *callable, PyObject *converters, PyObject *restype, int flags)
StgDictObjectPyType_stgdict (PyObject *obj)
StgDictObjectPyObject_stgdict (PyObject *self)
int PyCStgDict_clone (StgDictObject *src, StgDictObject *dst)
PyObject_ctypes_callproc (PPROC pProc, PyObject *arguments, int flags, PyObject *argtypes, PyObject *restype, PyObject *checker)
PyCArgObject * PyCArgObject_new (void)
PyObjectPyCData_get (PyObject *type, GETFUNC getfunc, PyObject *src, Py_ssize_t index, Py_ssize_t size, char *ptr)
int PyCData_set (PyObject *dst, PyObject *type, SETFUNC setfunc, PyObject *value, Py_ssize_t index, Py_ssize_t size, char *ptr)
void _ctypes_extend_error (PyObject *exc_class, char *fmt,...)
ffi_type_ctypes_get_ffi_type (PyObject *obj)
void _ctypes_free_closure (void *)
void_ctypes_alloc_closure (void)
void _ctypes_add_traceback (char *, char *, int)
PyObjectPyCData_FromBaseObj (PyObject *type, PyObject *base, Py_ssize_t index, char *adr)
char * _ctypes_alloc_format_string (const char *prefix, const char *suffix)
int _ctypes_simple_instance (PyObject *obj)
PyObject_ctypes_get_errobj (int **pspace)

Variables

PyTypeObject PyCThunk_Type
PyTypeObject PyCStgDict_Type
PyTypeObject PyCData_Type
PyTypeObject PyCSimpleType_Type
PyTypeObject PyCField_Type
PyTypeObject PyCArrayType_Type
PyTypeObject PyCArray_Type
PyTypeObject PyCPointerType_Type
PyTypeObject PyCPointer_Type
PyTypeObject PyCFuncPtr_Type
PyTypeObject PyCFuncPtrType_Type
PyTypeObject PyCStructType_Type
PyMethodDef _ctypes_module_methods []
PyTypeObject PyCArg_Type
char basespec_string []
PyObjectPyExc_ArgError
char * _ctypes_conversion_encoding
char * _ctypes_conversion_errors
PyObject_ctypes_ptrtype_cache

Class Documentation

union value

Definition at line 27 of file ctypes.h.

Class Members
char c
double d
long double D
float f
int i
long l
short s
struct tagCDataObject

Definition at line 46 of file ctypes.h.

Collaboration diagram for tagCDataObject:
Class Members
CDataObject * b_base
Py_ssize_t b_index
Py_ssize_t b_length
int b_needsfree
PyObject * b_objects
PyObject_HEAD char * b_ptr
Py_ssize_t b_size
struct CThunkObject

Definition at line 59 of file ctypes.h.

Collaboration diagram for CThunkObject:
Class Members
ffi_type * atypes
PyObject * callable
ffi_cif cif
PyObject * converters
ffi_type * ffi_restype
int flags
void * pcl_exec
PyObject_VAR_HEAD ffi_closure * pcl_write
PyObject * restype
SETFUNC setfunc
struct PyCFuncPtrObject

Definition at line 75 of file ctypes.h.

Collaboration diagram for PyCFuncPtrObject:
Class Members
PyObject * argtypes
CDataObject * b_base
Py_ssize_t b_index
Py_ssize_t b_length
int b_needsfree
PyObject * b_objects
PyObject_HEAD char * b_ptr
Py_ssize_t b_size
PyObject * callable
PyObject * checker
PyObject * converters
PyObject * errcheck
PyObject * paramflags
PyObject * restype
CThunkObject * thunk
struct fielddesc

Definition at line 163 of file ctypes.h.

Collaboration diagram for fielddesc:
Class Members
char code
GETFUNC getfunc
GETFUNC getfunc_swapped
ffi_type * pffi_type
SETFUNC setfunc
SETFUNC setfunc_swapped
struct CFieldObject

Definition at line 172 of file ctypes.h.

Collaboration diagram for CFieldObject:
Class Members
int anonymous
GETFUNC getfunc
Py_ssize_t index
PyObject_HEAD Py_ssize_t offset
PyObject * proto
SETFUNC setfunc
Py_ssize_t size
struct StgDictObject

Definition at line 186 of file ctypes.h.

Collaboration diagram for StgDictObject:
Class Members
Py_ssize_t align
PyObject * argtypes
PyObject * checker
PyObject * converters
PyDictObject dict
ffi_type ffi_type_pointer
int flags
char * format
GETFUNC getfunc
Py_ssize_t length
int ndim
PARAMFUNC paramfunc
PyObject * proto
PyObject * restype
SETFUNC setfunc
Py_ssize_t * shape
Py_ssize_t size
struct tagPyCArgObject

Definition at line 295 of file ctypes.h.

Collaboration diagram for tagPyCArgObject:
Class Members
PyObject * obj
PyObject_HEAD ffi_type * pffi_type
Py_ssize_t size
char tag
union tagPyCArgObject value
struct basespec

Definition at line 331 of file ctypes.h.

Class Members
char * adr
CDataObject * base
Py_ssize_t index
union tagPyCArgObject.value

Definition at line 299 of file ctypes.h.

Class Members
char b
char c
long double D
double d
float f
short h
int i
long l
void * p

Define Documentation

Definition at line 146 of file ctypes.h.

Definition at line 118 of file ctypes.h.

#define CDataObject_CheckExact (   v)    ((v)->ob_type == &PyCData_Type)

Definition at line 117 of file ctypes.h.

#define CThunk_CheckExact (   v)    ((v)->ob_type == &PyCThunk_Type)

Definition at line 73 of file ctypes.h.

#define DICTFLAG_FINAL   0x1000

Definition at line 293 of file ctypes.h.

#define FUNCFLAG_CDECL   0x1

Definition at line 284 of file ctypes.h.

#define FUNCFLAG_HRESULT   0x2

Definition at line 285 of file ctypes.h.

#define FUNCFLAG_PYTHONAPI   0x4

Definition at line 286 of file ctypes.h.

#define FUNCFLAG_STDCALL   0x0

Definition at line 283 of file ctypes.h.

#define FUNCFLAG_USE_ERRNO   0x8

Definition at line 287 of file ctypes.h.

#define FUNCFLAG_USE_LASTERROR   0x10

Definition at line 288 of file ctypes.h.

#define max (   a,
  b 
)    ((a) > (b) ? (a) : (b))

Definition at line 6 of file ctypes.h.

#define min (   a,
  b 
)    ((a) < (b) ? (a) : (b))

Definition at line 7 of file ctypes.h.

#define PARAMFLAG_FIN   0x1

Definition at line 9 of file ctypes.h.

#define PARAMFLAG_FLCID   0x4

Definition at line 11 of file ctypes.h.

#define PARAMFLAG_FOUT   0x2

Definition at line 10 of file ctypes.h.

Definition at line 147 of file ctypes.h.

#define PyCArg_CheckExact (   v)    ((v)->ob_type == &PyCArg_Type)

Definition at line 318 of file ctypes.h.

Definition at line 145 of file ctypes.h.

Definition at line 149 of file ctypes.h.

Definition at line 150 of file ctypes.h.

Definition at line 148 of file ctypes.h.

Definition at line 122 of file ctypes.h.

#define PyCSimpleTypeObject_CheckExact (   v)    ((v)->ob_type == &PyCSimpleType_Type)

Definition at line 121 of file ctypes.h.

Definition at line 108 of file ctypes.h.

#define PyCStgDict_CheckExact (   v)    ((v)->ob_type == &PyCStgDict_Type)

Definition at line 107 of file ctypes.h.

Definition at line 151 of file ctypes.h.

#define TYPEFLAG_HASPOINTER   0x200

Definition at line 291 of file ctypes.h.

#define TYPEFLAG_ISPOINTER   0x100

Definition at line 290 of file ctypes.h.


Typedef Documentation

typedef PyObject*(* GETFUNC)(void *, Py_ssize_t size)

Definition at line 16 of file ctypes.h.

typedef PyCArgObject*(* PARAMFUNC)(CDataObject *obj)

Definition at line 18 of file ctypes.h.

typedef int(* PPROC)(void)

Definition at line 269 of file ctypes.h.

Definition at line 17 of file ctypes.h.

typedef struct tagCDataObject

Definition at line 15 of file ctypes.h.

typedef struct tagPyCArgObject

Definition at line 14 of file ctypes.h.


Function Documentation

void _ctypes_add_traceback ( char *  ,
char *  ,
int   
)

Definition at line 95 of file callbacks.c.

{
    PyObject *py_globals = 0;
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;

    py_globals = PyDict_New();
    if (!py_globals) goto bad;
    py_code = PyCode_NewEmpty(filename, funcname, lineno);
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_Get(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
        );
    if (!py_frame) goto bad;
    py_frame->f_lineno = lineno;
    PyTraceBack_Here(py_frame);
  bad:
    Py_XDECREF(py_globals);
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

Here is the call graph for this function:

Here is the caller graph for this function:

CThunkObject* _ctypes_alloc_callback ( PyObject callable,
PyObject converters,
PyObject restype,
int  flags 
)

Definition at line 355 of file callbacks.c.

{
    int result;
    CThunkObject *p;
    Py_ssize_t nArgs, i;
    ffi_abi cc;

    nArgs = PySequence_Size(converters);
    p = CThunkObject_new(nArgs);
    if (p == NULL)
        return NULL;

    assert(CThunk_CheckExact((PyObject *)p));

    p->pcl_write = ffi_closure_alloc(sizeof(ffi_closure),
                                                                &p->pcl_exec);
    if (p->pcl_write == NULL) {
        PyErr_NoMemory();
        goto error;
    }

    p->flags = flags;
    for (i = 0; i < nArgs; ++i) {
        PyObject *cnv = PySequence_GetItem(converters, i);
        if (cnv == NULL)
            goto error;
        p->atypes[i] = _ctypes_get_ffi_type(cnv);
        Py_DECREF(cnv);
    }
    p->atypes[i] = NULL;

    Py_INCREF(restype);
    p->restype = restype;
    if (restype == Py_None) {
        p->setfunc = NULL;
        p->ffi_restype = &ffi_type_void;
    } else {
        StgDictObject *dict = PyType_stgdict(restype);
        if (dict == NULL || dict->setfunc == NULL) {
          PyErr_SetString(PyExc_TypeError,
                          "invalid result type for callback function");
          goto error;
        }
        p->setfunc = dict->setfunc;
        p->ffi_restype = &dict->ffi_type_pointer;
    }

    cc = FFI_DEFAULT_ABI;
#if defined(MS_WIN32) && !defined(_WIN32_WCE) && !defined(MS_WIN64)
    if ((flags & FUNCFLAG_CDECL) == 0)
        cc = FFI_STDCALL;
#endif
    result = ffi_prep_cif(&p->cif, cc,
                          Py_SAFE_DOWNCAST(nArgs, Py_ssize_t, int),
                          _ctypes_get_ffi_type(restype),
                          &p->atypes[0]);
    if (result != FFI_OK) {
        PyErr_Format(PyExc_RuntimeError,
                     "ffi_prep_cif failed with %d", result);
        goto error;
    }
#if defined(X86_DARWIN) || defined(POWERPC_DARWIN)
    result = ffi_prep_closure(p->pcl_write, &p->cif, closure_fcn, p);
#else
    result = ffi_prep_closure_loc(p->pcl_write, &p->cif, closure_fcn,
                              p,
                              p->pcl_exec);
#endif
    if (result != FFI_OK) {
        PyErr_Format(PyExc_RuntimeError,
                     "ffi_prep_closure failed with %d", result);
        goto error;
    }

    Py_INCREF(converters);
    p->converters = converters;
    Py_INCREF(callable);
    p->callable = callable;
    return p;

  error:
    Py_XDECREF(p);
    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* _ctypes_alloc_format_string ( const char *  prefix,
const char *  suffix 
)

Definition at line 268 of file _ctypes.c.

{
    size_t len;
    char *result;

    if (suffix == NULL) {
        assert(PyErr_Occurred());
        return NULL;
    }
    len = strlen(suffix);
    if (prefix)
        len += strlen(prefix);
    result = PyMem_Malloc(len + 1);
    if (result == NULL)
        return NULL;
    if (prefix)
        strcpy(result, prefix);
    else
        result[0] = '\0';
    strcat(result, suffix);
    return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PyObject* _ctypes_callproc ( PPROC  pProc,
PyObject arguments,
int  flags,
PyObject argtypes,
PyObject restype,
PyObject checker 
)

Definition at line 1049 of file callproc.c.

{
    Py_ssize_t i, n, argcount, argtype_count;
    void *resbuf;
    struct argument *args, *pa;
    ffi_type **atypes;
    ffi_type *rtype;
    void **avalues;
    PyObject *retval = NULL;

    n = argcount = PyTuple_GET_SIZE(argtuple);
#ifdef MS_WIN32
    /* an optional COM object this pointer */
    if (pIunk)
        ++argcount;
#endif

    args = (struct argument *)alloca(sizeof(struct argument) * argcount);
    if (!args) {
        PyErr_NoMemory();
        return NULL;
    }
    memset(args, 0, sizeof(struct argument) * argcount);
    argtype_count = argtypes ? PyTuple_GET_SIZE(argtypes) : 0;
#ifdef MS_WIN32
    if (pIunk) {
        args[0].ffi_type = &ffi_type_pointer;
        args[0].value.p = pIunk;
        pa = &args[1];
    } else
#endif
        pa = &args[0];

    /* Convert the arguments */
    for (i = 0; i < n; ++i, ++pa) {
        PyObject *converter;
        PyObject *arg;
        int err;

        arg = PyTuple_GET_ITEM(argtuple, i);            /* borrowed ref */
        /* For cdecl functions, we allow more actual arguments
           than the length of the argtypes tuple.
           This is checked in _ctypes::PyCFuncPtr_Call
        */
        if (argtypes && argtype_count > i) {
            PyObject *v;
            converter = PyTuple_GET_ITEM(argtypes, i);
            v = PyObject_CallFunctionObjArgs(converter,
                                               arg,
                                               NULL);
            if (v == NULL) {
                _ctypes_extend_error(PyExc_ArgError, "argument %d: ", i+1);
                goto cleanup;
            }

            err = ConvParam(v, i+1, pa);
            Py_DECREF(v);
            if (-1 == err) {
                _ctypes_extend_error(PyExc_ArgError, "argument %d: ", i+1);
                goto cleanup;
            }
        } else {
            err = ConvParam(arg, i+1, pa);
            if (-1 == err) {
                _ctypes_extend_error(PyExc_ArgError, "argument %d: ", i+1);
                goto cleanup; /* leaking ? */
            }
        }
    }

    rtype = _ctypes_get_ffi_type(restype);
    resbuf = alloca(max(rtype->size, sizeof(ffi_arg)));

    avalues = (void **)alloca(sizeof(void *) * argcount);
    atypes = (ffi_type **)alloca(sizeof(ffi_type *) * argcount);
    if (!resbuf || !avalues || !atypes) {
        PyErr_NoMemory();
        goto cleanup;
    }
    for (i = 0; i < argcount; ++i) {
        atypes[i] = args[i].ffi_type;
        if (atypes[i]->type == FFI_TYPE_STRUCT
#ifdef _WIN64
            && atypes[i]->size <= sizeof(void *)
#endif
            )
            avalues[i] = (void *)args[i].value.p;
        else
            avalues[i] = (void *)&args[i].value;
    }

    if (-1 == _call_function_pointer(flags, pProc, avalues, atypes,
                                     rtype, resbuf,
                                     Py_SAFE_DOWNCAST(argcount,
                                                      Py_ssize_t,
                                                      int)))
        goto cleanup;

#ifdef WORDS_BIGENDIAN
    /* libffi returns the result in a buffer with sizeof(ffi_arg). This
       causes problems on big endian machines, since the result buffer
       address cannot simply be used as result pointer, instead we must
       adjust the pointer value:
     */
    /*
      XXX I should find out and clarify why this is needed at all,
      especially why adjusting for ffi_type_float must be avoided on
      64-bit platforms.
     */
    if (rtype->type != FFI_TYPE_FLOAT
        && rtype->type != FFI_TYPE_STRUCT
        && rtype->size < sizeof(ffi_arg))
        resbuf = (char *)resbuf + sizeof(ffi_arg) - rtype->size;
#endif

#ifdef MS_WIN32
    if (iid && pIunk) {
        if (*(int *)resbuf & 0x80000000)
            retval = GetComError(*(HRESULT *)resbuf, iid, pIunk);
        else
            retval = PyLong_FromLong(*(int *)resbuf);
    } else if (flags & FUNCFLAG_HRESULT) {
        if (*(int *)resbuf & 0x80000000)
            retval = PyErr_SetFromWindowsErr(*(int *)resbuf);
        else
            retval = PyLong_FromLong(*(int *)resbuf);
    } else
#endif
        retval = GetResult(restype, resbuf, checker);
  cleanup:
    for (i = 0; i < argcount; ++i)
        Py_XDECREF(args[i].keep);
    return retval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _ctypes_extend_error ( PyObject exc_class,
char *  fmt,
  ... 
)

Definition at line 928 of file callproc.c.

{
    va_list vargs;
    PyObject *tp, *v, *tb, *s, *cls_str, *msg_str;

    va_start(vargs, fmt);
    s = PyUnicode_FromFormatV(fmt, vargs);
    va_end(vargs);
    if (!s)
        return;

    PyErr_Fetch(&tp, &v, &tb);
    PyErr_NormalizeException(&tp, &v, &tb);
    cls_str = PyObject_Str(tp);
    if (cls_str) {
        PyUnicode_AppendAndDel(&s, cls_str);
        PyUnicode_AppendAndDel(&s, PyUnicode_FromString(": "));
        if (s == NULL)
            goto error;
    } else
        PyErr_Clear();
    msg_str = PyObject_Str(v);
    if (msg_str)
        PyUnicode_AppendAndDel(&s, msg_str);
    else {
        PyErr_Clear();
        PyUnicode_AppendAndDel(&s, PyUnicode_FromString("???"));
        if (s == NULL)
            goto error;
    }
    PyErr_SetObject(exc_class, s);
error:
    Py_XDECREF(tp);
    Py_XDECREF(v);
    Py_XDECREF(tb);
    Py_XDECREF(s);
}

Here is the call graph for this function:

Here is the caller graph for this function:

PyObject* _ctypes_get_errobj ( int **  pspace)

Definition at line 126 of file callproc.c.

{
    PyObject *dict = PyThreadState_GetDict();
    PyObject *errobj;
    static PyObject *error_object_name;
    if (dict == 0) {
        PyErr_SetString(PyExc_RuntimeError,
                        "cannot get thread state");
        return NULL;
    }
    if (error_object_name == NULL) {
        error_object_name = PyUnicode_InternFromString("ctypes.error_object");
        if (error_object_name == NULL)
            return NULL;
    }
    errobj = PyDict_GetItem(dict, error_object_name);
    if (errobj) {
        if (!PyCapsule_IsValid(errobj, CTYPES_CAPSULE_NAME_PYMEM)) {
            PyErr_SetString(PyExc_RuntimeError,
                "ctypes.error_object is an invalid capsule");
            return NULL;
        }
        Py_INCREF(errobj);
    }
    else {
        void *space = PyMem_Malloc(sizeof(int) * 2);
        if (space == NULL)
            return NULL;
        memset(space, 0, sizeof(int) * 2);
        errobj = PyCapsule_New(space, CTYPES_CAPSULE_NAME_PYMEM, pymem_destructor);
        if (errobj == NULL)
            return NULL;
        if (-1 == PyDict_SetItem(dict, error_object_name,
                                 errobj)) {
            Py_DECREF(errobj);
            return NULL;
        }
    }
    *pspace = (int *)PyCapsule_GetPointer(errobj, CTYPES_CAPSULE_NAME_PYMEM);
    return errobj;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 704 of file callproc.c.

{
    StgDictObject *dict;
    if (obj == NULL)
        return &ffi_type_sint;
    dict = PyType_stgdict(obj);
    if (dict == NULL)
        return &ffi_type_sint;
#if defined(MS_WIN32) && !defined(_WIN32_WCE)
    /* This little trick works correctly with MSVC.
       It returns small structures in registers
    */
    if (dict->ffi_type_pointer.type == FFI_TYPE_STRUCT) {
        if (dict->ffi_type_pointer.size <= 4)
            return &ffi_type_sint32;
        else if (dict->ffi_type_pointer.size <= 8)
            return &ffi_type_sint64;
    }
#endif
    return &dict->ffi_type_pointer;
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct fielddesc* _ctypes_get_fielddesc ( const char *  fmt) [read]

Definition at line 1645 of file cfield.c.

{
    static int initialized = 0;
    struct fielddesc *table = formattable;

    if (!initialized) {
        initialized = 1;
#ifdef CTYPES_UNICODE
        if (sizeof(wchar_t) == sizeof(short))
            _ctypes_get_fielddesc("u")->pffi_type = &ffi_type_sshort;
        else if (sizeof(wchar_t) == sizeof(int))
            _ctypes_get_fielddesc("u")->pffi_type = &ffi_type_sint;
        else if (sizeof(wchar_t) == sizeof(long))
            _ctypes_get_fielddesc("u")->pffi_type = &ffi_type_slong;
#endif
    }

    for (; table->code; ++table) {
        if (table->code == fmt[0])
            return table;
    }
    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2715 of file _ctypes.c.

{
    PyTypeObject *type = (PyTypeObject *)obj;

    if (PyCSimpleTypeObject_Check(type))
        return type->tp_base != &Simple_Type;
    return 0;
}

Here is the caller graph for this function:

PyCArgObject* PyCArgObject_new ( void  )

Definition at line 420 of file callproc.c.

{
    PyCArgObject *p;
    p = PyObject_New(PyCArgObject, &PyCArg_Type);
    if (p == NULL)
        return NULL;
    p->pffi_type = NULL;
    p->tag = '\0';
    p->obj = NULL;
    memset(&p->value, 0, sizeof(p->value));
    return p;
}

Here is the caller graph for this function:

PyObject* PyCArrayType_from_ctype ( PyObject itemtype,
Py_ssize_t  length 
)

Definition at line 4448 of file _ctypes.c.

{
    static PyObject *cache;
    PyObject *key;
    PyObject *result;
    char name[256];
    PyObject *len;

    if (cache == NULL) {
        cache = PyDict_New();
        if (cache == NULL)
            return NULL;
    }
    len = PyLong_FromSsize_t(length);
    if (len == NULL)
        return NULL;
    key = PyTuple_Pack(2, itemtype, len);
    Py_DECREF(len);
    if (!key)
        return NULL;
    result = PyDict_GetItemProxy(cache, key);
    if (result) {
        Py_INCREF(result);
        Py_DECREF(key);
        return result;
    }

    if (!PyType_Check(itemtype)) {
        PyErr_SetString(PyExc_TypeError,
                        "Expected a type object");
        return NULL;
    }
#ifdef MS_WIN64
    sprintf(name, "%.200s_Array_%Id",
        ((PyTypeObject *)itemtype)->tp_name, length);
#else
    sprintf(name, "%.200s_Array_%ld",
        ((PyTypeObject *)itemtype)->tp_name, (long)length);
#endif

    result = PyObject_CallFunction((PyObject *)&PyCArrayType_Type,
                                   "s(O){s:n,s:O}",
                                   name,
                                   &PyCArray_Type,
                                   "_length_",
                                   length,
                                   "_type_",
                                   itemtype
        );
    if (result == NULL) {
        Py_DECREF(key);
        return NULL;
    }
    if (-1 == PyDict_SetItemProxy(cache, key, result)) {
        Py_DECREF(key);
        Py_DECREF(result);
        return NULL;
    }
    Py_DECREF(key);
    return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PyObject* PyCData_AtAddress ( PyObject type,
void buf 
)

Definition at line 2686 of file _ctypes.c.

{
    CDataObject *pd;
    StgDictObject *dict;

    assert(PyType_Check(type));
    dict = PyType_stgdict(type);
    if (!dict) {
        PyErr_SetString(PyExc_TypeError,
                        "abstract class");
        return NULL;
    }
    dict->flags |= DICTFLAG_FINAL;

    pd = (CDataObject *)((PyTypeObject *)type)->tp_alloc((PyTypeObject *)type, 0);
    if (!pd)
        return NULL;
    assert(CDataObject_Check(pd));
    pd->b_ptr = (char *)buf;
    pd->b_length = dict->length;
    pd->b_size = dict->size;
    return (PyObject *)pd;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PyObject* PyCData_FromBaseObj ( PyObject type,
PyObject base,
Py_ssize_t  index,
char *  adr 
)

Definition at line 2644 of file _ctypes.c.

{
    CDataObject *cmem;
    StgDictObject *dict;

    assert(PyType_Check(type));
    dict = PyType_stgdict(type);
    if (!dict) {
        PyErr_SetString(PyExc_TypeError,
                        "abstract class");
        return NULL;
    }
    dict->flags |= DICTFLAG_FINAL;
    cmem = (CDataObject *)((PyTypeObject *)type)->tp_alloc((PyTypeObject *)type, 0);
    if (cmem == NULL)
        return NULL;
    assert(CDataObject_Check(cmem));

    cmem->b_length = dict->length;
    cmem->b_size = dict->size;
    if (base) { /* use base's buffer */
        assert(CDataObject_Check(base));
        cmem->b_ptr = adr;
        cmem->b_needsfree = 0;
        Py_INCREF(base);
        cmem->b_base = (CDataObject *)base;
        cmem->b_index = index;
    } else { /* copy contents of adr */
        if (-1 == PyCData_MallocBuffer(cmem, dict)) {
            return NULL;
            Py_DECREF(cmem);
        }
        memcpy(cmem->b_ptr, adr, dict->size);
        cmem->b_index = index;
    }
    return (PyObject *)cmem;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PyObject* PyCData_FromBytes ( PyObject type,
char *  data,
Py_ssize_t  length 
)
PyObject* PyCData_get ( PyObject type,
GETFUNC  getfunc,
PyObject src,
Py_ssize_t  index,
Py_ssize_t  size,
char *  ptr 
)

Definition at line 2725 of file _ctypes.c.

{
    StgDictObject *dict;
    if (getfunc)
        return getfunc(adr, size);
    assert(type);
    dict = PyType_stgdict(type);
    if (dict && dict->getfunc && !_ctypes_simple_instance(type))
        return dict->getfunc(adr, size);
    return PyCData_FromBaseObj(type, src, index, adr);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int PyCData_set ( PyObject dst,
PyObject type,
SETFUNC  setfunc,
PyObject value,
Py_ssize_t  index,
Py_ssize_t  size,
char *  ptr 
)

Definition at line 2844 of file _ctypes.c.

{
    CDataObject *mem = (CDataObject *)dst;
    PyObject *result;

    if (!CDataObject_Check(dst)) {
        PyErr_SetString(PyExc_TypeError,
                        "not a ctype instance");
        return -1;
    }

    result = _PyCData_set(mem, type, setfunc, value,
                        size, ptr);
    if (result == NULL)
        return -1;

    /* KeepRef steals a refcount from it's last argument */
    /* If KeepRef fails, we are stumped.  The dst memory block has already
       been changed */
    return KeepRef(mem, index, result);
}

Here is the call graph for this function:

Here is the caller graph for this function:

PyObject* PyCField_FromDesc ( PyObject desc,
Py_ssize_t  index,
Py_ssize_t pfield_size,
int  bitsize,
int pbitofs,
Py_ssize_t psize,
Py_ssize_t poffset,
Py_ssize_t palign,
int  pack,
int  is_big_endian 
)

Definition at line 48 of file cfield.c.

{
    CFieldObject *self;
    PyObject *proto;
    Py_ssize_t size, align, length;
    SETFUNC setfunc = NULL;
    GETFUNC getfunc = NULL;
    StgDictObject *dict;
    int fieldtype;
#define NO_BITFIELD 0
#define NEW_BITFIELD 1
#define CONT_BITFIELD 2
#define EXPAND_BITFIELD 3

    self = (CFieldObject *)PyObject_CallObject((PyObject *)&PyCField_Type,
                                               NULL);
    if (self == NULL)
        return NULL;
    dict = PyType_stgdict(desc);
    if (!dict) {
        PyErr_SetString(PyExc_TypeError,
                        "has no _stginfo_");
        Py_DECREF(self);
        return NULL;
    }
    if (bitsize /* this is a bitfield request */
        && *pfield_size /* we have a bitfield open */
#ifdef MS_WIN32
        /* MSVC, GCC with -mms-bitfields */
        && dict->size * 8 == *pfield_size
#else
        /* GCC */
        && dict->size * 8 <= *pfield_size
#endif
        && (*pbitofs + bitsize) <= *pfield_size) {
        /* continue bit field */
        fieldtype = CONT_BITFIELD;
#ifndef MS_WIN32
    } else if (bitsize /* this is a bitfield request */
        && *pfield_size /* we have a bitfield open */
        && dict->size * 8 >= *pfield_size
        && (*pbitofs + bitsize) <= dict->size * 8) {
        /* expand bit field */
        fieldtype = EXPAND_BITFIELD;
#endif
    } else if (bitsize) {
        /* start new bitfield */
        fieldtype = NEW_BITFIELD;
        *pbitofs = 0;
        *pfield_size = dict->size * 8;
    } else {
        /* not a bit field */
        fieldtype = NO_BITFIELD;
        *pbitofs = 0;
        *pfield_size = 0;
    }

    size = dict->size;
    length = dict->length;
    proto = desc;

    /*  Field descriptors for 'c_char * n' are be scpecial cased to
        return a Python string instead of an Array object instance...
    */
    if (PyCArrayTypeObject_Check(proto)) {
        StgDictObject *adict = PyType_stgdict(proto);
        StgDictObject *idict;
        if (adict && adict->proto) {
            idict = PyType_stgdict(adict->proto);
            if (!idict) {
                PyErr_SetString(PyExc_TypeError,
                                "has no _stginfo_");
                Py_DECREF(self);
                return NULL;
            }
            if (idict->getfunc == _ctypes_get_fielddesc("c")->getfunc) {
                struct fielddesc *fd = _ctypes_get_fielddesc("s");
                getfunc = fd->getfunc;
                setfunc = fd->setfunc;
            }
#ifdef CTYPES_UNICODE
            if (idict->getfunc == _ctypes_get_fielddesc("u")->getfunc) {
                struct fielddesc *fd = _ctypes_get_fielddesc("U");
                getfunc = fd->getfunc;
                setfunc = fd->setfunc;
            }
#endif
        }
    }

    self->setfunc = setfunc;
    self->getfunc = getfunc;
    self->index = index;

    Py_INCREF(proto);
    self->proto = proto;

    switch (fieldtype) {
    case NEW_BITFIELD:
        if (big_endian)
            self->size = (bitsize << 16) + *pfield_size - *pbitofs - bitsize;
        else
            self->size = (bitsize << 16) + *pbitofs;
        *pbitofs = bitsize;
        /* fall through */
    case NO_BITFIELD:
        if (pack)
            align = min(pack, dict->align);
        else
            align = dict->align;
        if (align && *poffset % align) {
            Py_ssize_t delta = align - (*poffset % align);
            *psize += delta;
            *poffset += delta;
        }

        if (bitsize == 0)
            self->size = size;
        *psize += size;

        self->offset = *poffset;
        *poffset += size;

        *palign = align;
        break;

    case EXPAND_BITFIELD:
        *poffset += dict->size - *pfield_size/8;
        *psize += dict->size - *pfield_size/8;

        *pfield_size = dict->size * 8;

        if (big_endian)
            self->size = (bitsize << 16) + *pfield_size - *pbitofs - bitsize;
        else
            self->size = (bitsize << 16) + *pbitofs;

        self->offset = *poffset - size; /* poffset is already updated for the NEXT field */
        *pbitofs += bitsize;
        break;

    case CONT_BITFIELD:
        if (big_endian)
            self->size = (bitsize << 16) + *pfield_size - *pbitofs - bitsize;
        else
            self->size = (bitsize << 16) + *pbitofs;

        self->offset = *poffset - size; /* poffset is already updated for the NEXT field */
        *pbitofs += bitsize;
        break;
    }

    return (PyObject *)self;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 52 of file stgdict.c.

{
    char *d, *s;
    Py_ssize_t size;

    PyCStgDict_clear(dst);
    PyMem_Free(dst->ffi_type_pointer.elements);
    PyMem_Free(dst->format);
    dst->format = NULL;
    PyMem_Free(dst->shape);
    dst->shape = NULL;
    dst->ffi_type_pointer.elements = NULL;

    d = (char *)dst;
    s = (char *)src;
    memcpy(d + sizeof(PyDictObject),
           s + sizeof(PyDictObject),
           sizeof(StgDictObject) - sizeof(PyDictObject));

    Py_XINCREF(dst->proto);
    Py_XINCREF(dst->argtypes);
    Py_XINCREF(dst->converters);
    Py_XINCREF(dst->restype);
    Py_XINCREF(dst->checker);

    if (src->format) {
        dst->format = PyMem_Malloc(strlen(src->format) + 1);
        if (dst->format == NULL)
            return -1;
        strcpy(dst->format, src->format);
    }
    if (src->shape) {
        dst->shape = PyMem_Malloc(sizeof(Py_ssize_t) * src->ndim);
        if (dst->shape == NULL)
            return -1;
        memcpy(dst->shape, src->shape,
               sizeof(Py_ssize_t) * src->ndim);
    }

    if (src->ffi_type_pointer.elements == NULL)
        return 0;
    size = sizeof(ffi_type *) * (src->length + 1);
    dst->ffi_type_pointer.elements = PyMem_Malloc(size);
    if (dst->ffi_type_pointer.elements == NULL) {
        PyErr_NoMemory();
        return -1;
    }
    memcpy(dst->ffi_type_pointer.elements,
           src->ffi_type_pointer.elements,
           size);
    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int PyCStructUnionType_update_stgdict ( PyObject fields,
PyObject type,
int  isStruct 
)

Definition at line 304 of file stgdict.c.

{
    StgDictObject *stgdict, *basedict;
    Py_ssize_t len, offset, size, align, i;
    Py_ssize_t union_size, total_align;
    Py_ssize_t field_size = 0;
    int bitofs;
    PyObject *isPacked;
    int pack = 0;
    Py_ssize_t ffi_ofs;
    int big_endian;

    /* HACK Alert: I cannot be bothered to fix ctypes.com, so there has to
       be a way to use the old, broken sematics: _fields_ are not extended
       but replaced in subclasses.

       XXX Remove this in ctypes 1.0!
    */
    int use_broken_old_ctypes_semantics;

    if (fields == NULL)
        return 0;

#ifdef WORDS_BIGENDIAN
    big_endian = PyObject_HasAttrString(type, "_swappedbytes_") ? 0 : 1;
#else
    big_endian = PyObject_HasAttrString(type, "_swappedbytes_") ? 1 : 0;
#endif

    use_broken_old_ctypes_semantics = \
        PyObject_HasAttrString(type, "_use_broken_old_ctypes_structure_semantics_");

    isPacked = PyObject_GetAttrString(type, "_pack_");
    if (isPacked) {
        pack = PyLong_AsLong(isPacked);
        if (pack < 0 || PyErr_Occurred()) {
            Py_XDECREF(isPacked);
            PyErr_SetString(PyExc_ValueError,
                            "_pack_ must be a non-negative integer");
            return -1;
        }
        Py_DECREF(isPacked);
    } else
        PyErr_Clear();

    len = PySequence_Length(fields);
    if (len == -1) {
        PyErr_SetString(PyExc_TypeError,
                        "'_fields_' must be a sequence of pairs");
        return -1;
    }

    stgdict = PyType_stgdict(type);
    if (!stgdict)
        return -1;
    /* If this structure/union is already marked final we cannot assign
       _fields_ anymore. */

    if (stgdict->flags & DICTFLAG_FINAL) {/* is final ? */
        PyErr_SetString(PyExc_AttributeError,
                        "_fields_ is final");
        return -1;
    }

    if (stgdict->format) {
        PyMem_Free(stgdict->format);
        stgdict->format = NULL;
    }

    if (stgdict->ffi_type_pointer.elements)
        PyMem_Free(stgdict->ffi_type_pointer.elements);

    basedict = PyType_stgdict((PyObject *)((PyTypeObject *)type)->tp_base);
    if (basedict && !use_broken_old_ctypes_semantics) {
        size = offset = basedict->size;
        align = basedict->align;
        union_size = 0;
        total_align = align ? align : 1;
        stgdict->ffi_type_pointer.type = FFI_TYPE_STRUCT;
        stgdict->ffi_type_pointer.elements = PyMem_Malloc(sizeof(ffi_type *) * (basedict->length + len + 1));
        if (stgdict->ffi_type_pointer.elements == NULL) {
            PyErr_NoMemory();
            return -1;
        }
        memset(stgdict->ffi_type_pointer.elements, 0,
               sizeof(ffi_type *) * (basedict->length + len + 1));
        memcpy(stgdict->ffi_type_pointer.elements,
               basedict->ffi_type_pointer.elements,
               sizeof(ffi_type *) * (basedict->length));
        ffi_ofs = basedict->length;
    } else {
        offset = 0;
        size = 0;
        align = 0;
        union_size = 0;
        total_align = 1;
        stgdict->ffi_type_pointer.type = FFI_TYPE_STRUCT;
        stgdict->ffi_type_pointer.elements = PyMem_Malloc(sizeof(ffi_type *) * (len + 1));
        if (stgdict->ffi_type_pointer.elements == NULL) {
            PyErr_NoMemory();
            return -1;
        }
        memset(stgdict->ffi_type_pointer.elements, 0,
               sizeof(ffi_type *) * (len + 1));
        ffi_ofs = 0;
    }

    assert(stgdict->format == NULL);
    if (isStruct && !isPacked) {
        stgdict->format = _ctypes_alloc_format_string(NULL, "T{");
    } else {
        /* PEP3118 doesn't support union, or packed structures (well,
           only standard packing, but we dont support the pep for
           that). Use 'B' for bytes. */
        stgdict->format = _ctypes_alloc_format_string(NULL, "B");
    }

#define realdict ((PyObject *)&stgdict->dict)
    for (i = 0; i < len; ++i) {
        PyObject *name = NULL, *desc = NULL;
        PyObject *pair = PySequence_GetItem(fields, i);
        PyObject *prop;
        StgDictObject *dict;
        int bitsize = 0;

        if (!pair || !PyArg_ParseTuple(pair, "OO|i", &name, &desc, &bitsize)) {
            PyErr_SetString(PyExc_AttributeError,
                            "'_fields_' must be a sequence of pairs");
            Py_XDECREF(pair);
            return -1;
        }
        dict = PyType_stgdict(desc);
        if (dict == NULL) {
            Py_DECREF(pair);
            PyErr_Format(PyExc_TypeError,
                         "second item in _fields_ tuple (index %zd) must be a C type",
                         i);
            return -1;
        }
        stgdict->ffi_type_pointer.elements[ffi_ofs + i] = &dict->ffi_type_pointer;
        if (dict->flags & (TYPEFLAG_ISPOINTER | TYPEFLAG_HASPOINTER))
            stgdict->flags |= TYPEFLAG_HASPOINTER;
        dict->flags |= DICTFLAG_FINAL; /* mark field type final */
        if (PyTuple_Size(pair) == 3) { /* bits specified */
            switch(dict->ffi_type_pointer.type) {
            case FFI_TYPE_UINT8:
            case FFI_TYPE_UINT16:
            case FFI_TYPE_UINT32:
            case FFI_TYPE_SINT64:
            case FFI_TYPE_UINT64:
                break;

            case FFI_TYPE_SINT8:
            case FFI_TYPE_SINT16:
            case FFI_TYPE_SINT32:
                if (dict->getfunc != _ctypes_get_fielddesc("c")->getfunc
#ifdef CTYPES_UNICODE
                    && dict->getfunc != _ctypes_get_fielddesc("u")->getfunc
#endif
                    )
                    break;
                /* else fall through */
            default:
                PyErr_Format(PyExc_TypeError,
                             "bit fields not allowed for type %s",
                             ((PyTypeObject *)desc)->tp_name);
                Py_DECREF(pair);
                return -1;
            }
            if (bitsize <= 0 || bitsize > dict->size * 8) {
                PyErr_SetString(PyExc_ValueError,
                                "number of bits invalid for bit field");
                Py_DECREF(pair);
                return -1;
            }
        } else
            bitsize = 0;
        if (isStruct && !isPacked) {
            char *fieldfmt = dict->format ? dict->format : "B";
            char *fieldname = _PyUnicode_AsString(name);
            char *ptr;
            Py_ssize_t len = strlen(fieldname) + strlen(fieldfmt);
            char *buf = alloca(len + 2 + 1);

            sprintf(buf, "%s:%s:", fieldfmt, fieldname);

            ptr = stgdict->format;
            stgdict->format = _ctypes_alloc_format_string(stgdict->format, buf);
            PyMem_Free(ptr);

            if (stgdict->format == NULL) {
                Py_DECREF(pair);
                return -1;
            }
        }
        if (isStruct) {
            prop = PyCField_FromDesc(desc, i,
                                   &field_size, bitsize, &bitofs,
                                   &size, &offset, &align,
                                   pack, big_endian);
        } else /* union */ {
            size = 0;
            offset = 0;
            align = 0;
            prop = PyCField_FromDesc(desc, i,
                                   &field_size, bitsize, &bitofs,
                                   &size, &offset, &align,
                                   pack, big_endian);
            union_size = max(size, union_size);
        }
        total_align = max(align, total_align);

        if (!prop) {
            Py_DECREF(pair);
            return -1;
        }
        if (-1 == PyObject_SetAttr(type, name, prop)) {
            Py_DECREF(prop);
            Py_DECREF(pair);
            return -1;
        }
        Py_DECREF(pair);
        Py_DECREF(prop);
    }
#undef realdict

    if (isStruct && !isPacked) {
        char *ptr = stgdict->format;
        stgdict->format = _ctypes_alloc_format_string(stgdict->format, "}");
        PyMem_Free(ptr);
        if (stgdict->format == NULL)
            return -1;
    }

    if (!isStruct)
        size = union_size;

    /* Adjust the size according to the alignment requirements */
    size = ((size + total_align - 1) / total_align) * total_align;

    stgdict->ffi_type_pointer.alignment = Py_SAFE_DOWNCAST(total_align,
                                                           Py_ssize_t,
                                                           unsigned short);
    stgdict->ffi_type_pointer.size = size;

    stgdict->size = size;
    stgdict->align = total_align;
    stgdict->length = len;      /* ADD ffi_ofs? */

    /* We did check that this flag was NOT set above, it must not
       have been set until now. */
    if (stgdict->flags & DICTFLAG_FINAL) {
        PyErr_SetString(PyExc_AttributeError,
                        "Structure or union cannot contain itself");
        return -1;
    }
    stgdict->flags |= DICTFLAG_FINAL;

    return MakeAnonFields(type);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 167 of file stgdict.c.

{
    PyTypeObject *type = self->ob_type;
    if (!type->tp_dict || !PyCStgDict_CheckExact(type->tp_dict))
        return NULL;
    return (StgDictObject *)type->tp_dict;
}

Here is the caller graph for this function:

int PyObject_stginfo ( PyObject self,
Py_ssize_t psize,
Py_ssize_t palign,
Py_ssize_t plength 
)

Definition at line 149 of file stgdict.c.

{
    PyTypeObject *type;

    if (!PyType_Check(obj))
        return NULL;
    type = (PyTypeObject *)obj;
    if (!type->tp_dict || !PyCStgDict_CheckExact(type->tp_dict))
        return NULL;
    return (StgDictObject *)type->tp_dict;
}
int PyType_stginfo ( PyTypeObject self,
Py_ssize_t psize,
Py_ssize_t palign,
Py_ssize_t plength 
)

Variable Documentation

Definition at line 1807 of file callproc.c.

Definition at line 128 of file _ctypes.c.

Definition at line 518 of file callproc.c.

Definition at line 4405 of file _ctypes.c.

Definition at line 1380 of file _ctypes.c.

Definition at line 2573 of file _ctypes.c.

Definition at line 297 of file cfield.c.

Definition at line 3907 of file _ctypes.c.

Definition at line 2288 of file _ctypes.c.

Definition at line 5017 of file _ctypes.c.

Definition at line 990 of file _ctypes.c.

Definition at line 2070 of file _ctypes.c.

Definition at line 105 of file stgdict.c.

Definition at line 713 of file _ctypes.c.

Definition at line 44 of file callbacks.c.

Definition at line 125 of file _ctypes.c.