# Python Declarations # # Copyright (C) 2006,2007,2008 PySoy Group # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program; if not, see http://www.gnu.org/licenses # # $Id$ cdef extern from "Python.h": cdef struct PyFunctionObject : void* none void* PyMem_Malloc ( int ) nogil void* PyMem_Realloc ( void*, int ) nogil void PyMem_Free ( void* ) nogil int PyObject_IsInstance ( void*, void* ) void Py_INCREF ( object ) void Py_DECREF ( object ) object PyCObject_FromVoidPtr ( void*, void (*destr)(void *)) void* PyCObject_AsVoidPtr ( object ) object PyString_FromStringAndSize ( char *, int ) int PyEval_ThreadsInitialized() void PyEval_AcquireLock() void PyEval_ReleaseLock() void PyEval_InitThreads() object PyObject_CallObject(object, object) cdef extern from "pythread.h" : ctypedef void *PyThread_type_lock void PyThread_init_thread() long PyThread_start_new_thread(void (*)(void *), void *) void PyThread_exit_thread() void PyThread__PyThread_exit_thread() long PyThread_get_thread_ident() PyThread_type_lock PyThread_allocate_lock() void PyThread_free_lock(PyThread_type_lock mutex) int PyThread_acquire_lock(PyThread_type_lock mutex, int blocking) nogil void PyThread_release_lock(PyThread_type_lock mutex) nogil cdef extern from "pystate.h" : cdef struct PyThreadState : void* none PyThreadState* PyThreadState_Swap ( PyThreadState* ) void PyEval_ReleaseLock ( ) void PyEval_AcquireLock ( ) cdef extern from "ceval.h" : PyThreadState* PyEval_SaveThread ( ) void PyEval_RestoreThread ( PyThreadState* )