nrnpython.h
Go to the documentation of this file.00001 #ifndef nrnpython_h
00002 #define nrnpython_h
00003
00004 #include <../../nrnconf.h>
00005 #include <nrnpython_config.h>
00006 #if defined(USE_PYTHON)
00007 #undef _POSIX_C_SOURCE
00008 #include <Python.h>
00009
00010 #if (PY_MAJOR_VERSION >= 3)
00011 #define myPyMODINIT_FUNC PyObject*
00012 #else
00013 #define myPyMODINIT_FUNC void
00014
00015 #ifndef PyMODINIT_FUNC
00016 #define PyMODINIT_FUNC void
00017 #endif
00018 #ifndef PY_FORMAT_SIZE_T
00019 #define Py_ssize_t int
00020 #endif
00021 #endif
00022
00023 #endif
00024
00025 #if (PY_MAJOR_VERSION >= 3)
00026 #define PyString_Check PyUnicode_Check
00027 #define PyString_AsString(o) nrnpy_PyString_AsString(o)
00028 #define PyString_FromString PyUnicode_FromString
00029 #define PyInt_Check PyLong_Check
00030 #define PyInt_CheckExact PyLong_CheckExact
00031 #define PyInt_AS_LONG PyLong_AsLong
00032 #define PyInt_AsLong PyLong_AsLong
00033 #define PyInt_FromLong PyLong_FromLong
00034 #endif
00035
00036 #if defined(__cplusplus)
00037 extern "C" {
00038 #endif
00039
00040 #if (PY_MAJOR_VERSION >= 3)
00041 char* nrnpy_PyString_AsString(PyObject*);
00042 #endif
00043 extern PyObject* nrnpy_hoc_pop();
00044 extern int nrnpy_numbercheck(PyObject*);
00045
00046 #if defined(__cplusplus)
00047 }
00048 #endif
00049
00050 #endif