00001 //----------------------------------------------------------------------------- 00002 // 00003 // Copyright (c) 1998 - 2007, The Regents of the University of California 00004 // Produced at the Lawrence Livermore National Laboratory 00005 // All rights reserved. 00006 // 00007 // This file is part of PyCXX. For details,see http://cxx.sourceforge.net/. The 00008 // full copyright notice is contained in the file COPYRIGHT located at the root 00009 // of the PyCXX distribution. 00010 // 00011 // Redistribution and use in source and binary forms, with or without 00012 // modification, are permitted provided that the following conditions are met: 00013 // 00014 // - Redistributions of source code must retain the above copyright notice, 00015 // this list of conditions and the disclaimer below. 00016 // - Redistributions in binary form must reproduce the above copyright notice, 00017 // this list of conditions and the disclaimer (as noted below) in the 00018 // documentation and/or materials provided with the distribution. 00019 // - Neither the name of the UC/LLNL nor the names of its contributors may be 00020 // used to endorse or promote products derived from this software without 00021 // specific prior written permission. 00022 // 00023 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00024 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00025 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00026 // ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OF THE UNIVERSITY OF 00027 // CALIFORNIA, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR 00028 // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00029 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00030 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00031 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00032 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00033 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 00034 // DAMAGE. 00035 // 00036 //----------------------------------------------------------------------------- 00037 00038 #ifndef __CXX_INDIRECT_PYTHON_INTERFACE__HXX__ 00039 #define __CXX_INDIRECT_PYTHON_INTERFACE__HXX__ 00040 00041 #include "CXX/WrapPython.h" 00042 #include "CXX/Config.hxx" 00043 00044 namespace Py 00045 { 00046 bool InitialisePythonIndirectInterface(); 00047 00048 // 00049 // Wrap Exception variables as function calls 00050 // 00051 PYCXX_EXPORT PyObject * _Exc_Exception(); 00052 PYCXX_EXPORT PyObject * _Exc_StandardError(); 00053 PYCXX_EXPORT PyObject * _Exc_ArithmeticError(); 00054 PYCXX_EXPORT PyObject * _Exc_LookupError(); 00055 00056 PYCXX_EXPORT PyObject * _Exc_AssertionError(); 00057 PYCXX_EXPORT PyObject * _Exc_AttributeError(); 00058 PYCXX_EXPORT PyObject * _Exc_EOFError(); 00059 PYCXX_EXPORT PyObject * _Exc_FloatingPointError(); 00060 PYCXX_EXPORT PyObject * _Exc_EnvironmentError(); 00061 PYCXX_EXPORT PyObject * _Exc_IOError(); 00062 PYCXX_EXPORT PyObject * _Exc_OSError(); 00063 PYCXX_EXPORT PyObject * _Exc_ImportError(); 00064 PYCXX_EXPORT PyObject * _Exc_IndexError(); 00065 PYCXX_EXPORT PyObject * _Exc_KeyError(); 00066 PYCXX_EXPORT PyObject * _Exc_KeyboardInterrupt(); 00067 PYCXX_EXPORT PyObject * _Exc_MemoryError(); 00068 PYCXX_EXPORT PyObject * _Exc_NameError(); 00069 PYCXX_EXPORT PyObject * _Exc_OverflowError(); 00070 PYCXX_EXPORT PyObject * _Exc_RuntimeError(); 00071 PYCXX_EXPORT PyObject * _Exc_NotImplementedError(); 00072 PYCXX_EXPORT PyObject * _Exc_SyntaxError(); 00073 PYCXX_EXPORT PyObject * _Exc_SystemError(); 00074 PYCXX_EXPORT PyObject * _Exc_SystemExit(); 00075 PYCXX_EXPORT PyObject * _Exc_TypeError(); 00076 PYCXX_EXPORT PyObject * _Exc_ValueError(); 00077 PYCXX_EXPORT PyObject * _Exc_ZeroDivisionError(); 00078 #ifdef MS_WINDOWS 00079 PYCXX_EXPORT PyObject * _Exc_WindowsError(); 00080 #endif 00081 00082 PYCXX_EXPORT PyObject * _Exc_MemoryErrorInst(); 00083 00084 #if PY_MAJOR_VERSION >= 2 00085 PYCXX_EXPORT PyObject * _Exc_IndentationError(); 00086 PYCXX_EXPORT PyObject * _Exc_TabError(); 00087 PYCXX_EXPORT PyObject * _Exc_UnboundLocalError(); 00088 PYCXX_EXPORT PyObject * _Exc_UnicodeError(); 00089 #endif 00090 00091 // 00092 // Wrap Object variables as function calls 00093 // 00094 PYCXX_EXPORT PyObject * _None(); 00095 00096 PYCXX_EXPORT PyObject * _False(); 00097 PYCXX_EXPORT PyObject * _True(); 00098 00099 // 00100 // Wrap Type variables as function calls 00101 // 00102 PYCXX_EXPORT PyTypeObject * _List_Type(); 00103 PYCXX_EXPORT bool _List_Check( PyObject *o ); 00104 00105 PYCXX_EXPORT PyTypeObject * _Buffer_Type(); 00106 PYCXX_EXPORT bool _Buffer_Check( PyObject *op ); 00107 00108 PYCXX_EXPORT PyTypeObject * _Class_Type(); 00109 PYCXX_EXPORT bool _Class_Check( PyObject *op ); 00110 00111 PYCXX_EXPORT PyTypeObject * _Instance_Type(); 00112 PYCXX_EXPORT bool _Instance_Check( PyObject *op ); 00113 00114 PYCXX_EXPORT PyTypeObject * _Method_Type(); 00115 PYCXX_EXPORT bool _Method_Check( PyObject *op ); 00116 00117 PYCXX_EXPORT PyTypeObject * _CObject_Type(); 00118 PYCXX_EXPORT bool _CObject_Check( PyObject *op ); 00119 00120 PYCXX_EXPORT PyTypeObject * _Complex_Type(); 00121 PYCXX_EXPORT bool _Complex_Check( PyObject *op ); 00122 00123 PYCXX_EXPORT PyTypeObject * _Dict_Type(); 00124 PYCXX_EXPORT bool _Dict_Check( PyObject *op ); 00125 00126 PYCXX_EXPORT PyTypeObject * _File_Type(); 00127 PYCXX_EXPORT bool _File_Check( PyObject *op ); 00128 00129 PYCXX_EXPORT PyTypeObject * _Float_Type(); 00130 PYCXX_EXPORT bool _Float_Check( PyObject *op ); 00131 00132 PYCXX_EXPORT PyTypeObject * _Frame_Type(); 00133 PYCXX_EXPORT bool _Frame_Check( PyObject *op ); 00134 00135 PYCXX_EXPORT PyTypeObject * _Function_Type(); 00136 PYCXX_EXPORT bool _Function_Check( PyObject *op ); 00137 00138 PYCXX_EXPORT PyTypeObject * _Bool_Type(); 00139 PYCXX_EXPORT bool _Boolean_Check( PyObject *op ); 00140 00141 PYCXX_EXPORT PyTypeObject * _Int_Type(); 00142 PYCXX_EXPORT bool _Int_Check( PyObject *op ); 00143 00144 PYCXX_EXPORT PyTypeObject * _List_Type(); 00145 PYCXX_EXPORT bool _List_Check( PyObject *op ); 00146 00147 PYCXX_EXPORT PyTypeObject * _Long_Type(); 00148 PYCXX_EXPORT bool _Long_Check( PyObject *op ); 00149 00150 PYCXX_EXPORT PyTypeObject * _CFunction_Type(); 00151 PYCXX_EXPORT bool _CFunction_Check( PyObject *op ); 00152 00153 PYCXX_EXPORT PyTypeObject * _Module_Type(); 00154 PYCXX_EXPORT bool _Module_Check( PyObject *op ); 00155 00156 PYCXX_EXPORT PyTypeObject * _Type_Type(); 00157 PYCXX_EXPORT bool _Type_Check( PyObject *op ); 00158 00159 PYCXX_EXPORT PyTypeObject * _Range_Type(); 00160 PYCXX_EXPORT bool _Range_Check( PyObject *op ); 00161 00162 PYCXX_EXPORT PyTypeObject * _Slice_Type(); 00163 PYCXX_EXPORT bool _Slice_Check( PyObject *op ); 00164 00165 PYCXX_EXPORT PyTypeObject * _String_Type(); 00166 PYCXX_EXPORT bool _String_Check( PyObject *op ); 00167 00168 PYCXX_EXPORT PyTypeObject * _Unicode_Type(); 00169 PYCXX_EXPORT bool _Unicode_Check( PyObject *op ); 00170 00171 PYCXX_EXPORT PyTypeObject * _TraceBack_Type(); 00172 PYCXX_EXPORT bool _TraceBack_Check( PyObject *v ); 00173 00174 PYCXX_EXPORT PyTypeObject * _Tuple_Type(); 00175 PYCXX_EXPORT bool _Tuple_Check( PyObject *op ); 00176 00177 #if PY_MAJOR_VERSION >= 2 00178 PYCXX_EXPORT PyTypeObject * _Unicode_Type(); 00179 PYCXX_EXPORT bool _Unicode_Check( PyObject *op ); 00180 #endif 00181 00182 PYCXX_EXPORT int &_Py_DebugFlag(); 00183 PYCXX_EXPORT int &_Py_InteractiveFlag(); 00184 PYCXX_EXPORT int &_Py_OptimizeFlag(); 00185 PYCXX_EXPORT int &_Py_NoSiteFlag(); 00186 PYCXX_EXPORT int &_Py_TabcheckFlag(); 00187 PYCXX_EXPORT int &_Py_VerboseFlag(); 00188 00189 #if PY_MAJOR_VERSION >= 2 00190 PYCXX_EXPORT int &_Py_UnicodeFlag(); 00191 #endif 00192 00193 PYCXX_EXPORT void _XINCREF( PyObject *op ); 00194 PYCXX_EXPORT void _XDECREF( PyObject *op ); 00195 00196 PYCXX_EXPORT char *__Py_PackageContext(); 00197 } 00198 00199 #endif // __CXX_INDIRECT_PYTHON_INTERFACE__HXX__