4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * Contributor(s): Campbell Barton
22 * ***** END GPL LICENSE BLOCK *****
25 /** \file blender/python/generic/py_capi_utils.h
30 #ifndef PY_CAPI_UTILS_H
31 #define PY_CAPI_UTILS_H
33 void PyC_ObSpit(const char *name, PyObject *var);
34 void PyC_LineSpit(void);
35 PyObject * PyC_ExceptionBuffer(void);
36 PyObject * PyC_Object_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...);
37 void PyC_FileAndNum(const char **filename, int *lineno);
38 int PyC_AsArray(void *array, PyObject *value, int length, PyTypeObject *type, const char *error_prefix);
40 /* follow http://www.python.org/dev/peps/pep-0383/ */
41 PyObject * PyC_UnicodeFromByte(const char *str);
42 const char * PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce); /* coerce must be NULL */
44 /* name namespace function for bpy & bge */
45 PyObject * PyC_DefaultNameSpace(const char *filename);
46 void PyC_RunQuicky(const char *filepath, int n, ...);
48 void PyC_MainModule_Backup(PyObject **main_mod);
49 void PyC_MainModule_Restore(PyObject *main_mod);
51 void PyC_SetHomePath(const char *py_path_bundle);
53 #endif // PY_CAPI_UTILS_H