Blender  V2.59
py_capi_utils.h
Go to the documentation of this file.
00001 /*
00002  * $Id: py_capi_utils.h 38265 2011-07-09 17:41:39Z campbellbarton $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * Contributor(s): Campbell Barton
00021  *
00022  * ***** END GPL LICENSE BLOCK *****
00023  */
00024 
00030 #ifndef PY_CAPI_UTILS_H
00031 #define PY_CAPI_UTILS_H
00032 
00033 void                    PyC_ObSpit(const char *name, PyObject *var);
00034 void                    PyC_LineSpit(void);
00035 PyObject *              PyC_ExceptionBuffer(void);
00036 PyObject *              PyC_Object_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...);
00037 void                    PyC_FileAndNum(const char **filename, int *lineno);
00038 int                             PyC_AsArray(void *array, PyObject *value, const int length, const PyTypeObject *type, const short is_double, const char *error_prefix);
00039 
00040 /* follow http://www.python.org/dev/peps/pep-0383/ */
00041 PyObject *              PyC_UnicodeFromByte(const char *str);
00042 const char *    PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce); /* coerce must be NULL */
00043 
00044 /* name namespace function for bpy & bge */
00045 PyObject *              PyC_DefaultNameSpace(const char *filename);
00046 void                    PyC_RunQuicky(const char *filepath, int n, ...);
00047 
00048 void PyC_MainModule_Backup(PyObject **main_mod);
00049 void PyC_MainModule_Restore(PyObject *main_mod);
00050 
00051 void PyC_SetHomePath(const char *py_path_bundle);
00052 
00053 #define PYC_INTERPRETER_ACTIVE (((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current)) != NULL)
00054 
00055 #endif // PY_CAPI_UTILS_H