| 1 | # Python Declarations |
|---|
| 2 | # |
|---|
| 3 | # Copyright (C) 2006,2007,2008 PySoy Group |
|---|
| 4 | # |
|---|
| 5 | # This program is free software; you can redistribute it and/or modify |
|---|
| 6 | # it under the terms of the GNU Affero General Public License as published |
|---|
| 7 | # by the Free Software Foundation, either version 3 of the License, or |
|---|
| 8 | # (at your option) any later version. |
|---|
| 9 | # |
|---|
| 10 | # This program is distributed in the hope that it will be useful, |
|---|
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | # GNU Affero General Public License for more details. |
|---|
| 14 | # |
|---|
| 15 | # You should have received a copy of the GNU Affero General Public License |
|---|
| 16 | # along with this program; if not, see http://www.gnu.org/licenses |
|---|
| 17 | # |
|---|
| 18 | # $Id$ |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | cdef extern from "Python.h": |
|---|
| 22 | cdef struct PyFunctionObject : |
|---|
| 23 | void* none |
|---|
| 24 | |
|---|
| 25 | void* PyMem_Malloc ( int ) nogil |
|---|
| 26 | void* PyMem_Realloc ( void*, int ) nogil |
|---|
| 27 | void PyMem_Free ( void* ) nogil |
|---|
| 28 | int PyObject_IsInstance ( void*, void* ) |
|---|
| 29 | void Py_INCREF ( object ) |
|---|
| 30 | void Py_DECREF ( object ) |
|---|
| 31 | object PyCObject_FromVoidPtr ( void*, void (*destr)(void *)) |
|---|
| 32 | void* PyCObject_AsVoidPtr ( object ) |
|---|
| 33 | object PyString_FromStringAndSize ( char *, int ) |
|---|
| 34 | |
|---|
| 35 | int PyEval_ThreadsInitialized() |
|---|
| 36 | void PyEval_AcquireLock() |
|---|
| 37 | void PyEval_ReleaseLock() |
|---|
| 38 | void PyEval_InitThreads() |
|---|
| 39 | |
|---|
| 40 | object PyObject_CallObject(object, object) |
|---|
| 41 | |
|---|
| 42 | cdef extern from "pythread.h" : |
|---|
| 43 | ctypedef void *PyThread_type_lock |
|---|
| 44 | void PyThread_init_thread() |
|---|
| 45 | long PyThread_start_new_thread(void (*)(void *), void *) |
|---|
| 46 | void PyThread_exit_thread() |
|---|
| 47 | void PyThread__PyThread_exit_thread() |
|---|
| 48 | long PyThread_get_thread_ident() |
|---|
| 49 | PyThread_type_lock PyThread_allocate_lock() |
|---|
| 50 | void PyThread_free_lock(PyThread_type_lock mutex) |
|---|
| 51 | int PyThread_acquire_lock(PyThread_type_lock mutex, int blocking) nogil |
|---|
| 52 | void PyThread_release_lock(PyThread_type_lock mutex) nogil |
|---|
| 53 | |
|---|
| 54 | cdef extern from "pystate.h" : |
|---|
| 55 | cdef struct PyThreadState : |
|---|
| 56 | void* none |
|---|
| 57 | PyThreadState* PyThreadState_Swap ( PyThreadState* ) |
|---|
| 58 | void PyEval_ReleaseLock ( ) |
|---|
| 59 | void PyEval_AcquireLock ( ) |
|---|
| 60 | |
|---|
| 61 | cdef extern from "ceval.h" : |
|---|
| 62 | PyThreadState* PyEval_SaveThread ( ) |
|---|
| 63 | void PyEval_RestoreThread ( PyThreadState* ) |
|---|