diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-01 18:13:48 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-01 18:13:48 +0400 |
commit | 39cb1432d8ab7c2263b3e4c5eeada5e25928938d (patch) | |
tree | d733b5292fdb36c32f35c771a18f3788a3cdfddb /source/blender/python/generic/py_capi_utils.h | |
parent | 81d9a3de4302e0d4722d75d727fbc9e9c626bd9e (diff) |
bugfix [#23285] Exporters not available whel using special characters in path name
- ID properties now suopport non utf-8 strings for their values but not their keys.
- moved utility functions into py_capi_utils.c from bpy_utils and bpy_rna.
- import/export paths have to be printed with repr() or %r, so non utf-8 chars are escaped.
Diffstat (limited to 'source/blender/python/generic/py_capi_utils.h')
-rw-r--r-- | source/blender/python/generic/py_capi_utils.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/source/blender/python/generic/py_capi_utils.h b/source/blender/python/generic/py_capi_utils.h new file mode 100644 index 00000000000..bab89dbb01a --- /dev/null +++ b/source/blender/python/generic/py_capi_utils.h @@ -0,0 +1,41 @@ +/** + * $Id: + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contributor(s): Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef PY_CAPI_UTILS_H +#define PY_CAPI_UTILS_H + +struct PyObject; + +void PyC_ObSpit(char *name, PyObject *var); +void PyC_LineSpit(void); +PyObject * PyC_ExceptionBuffer(void); +PyObject * PyC_Object_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...); +void PyC_FileAndNum(const char **filename, int *lineno); +int PyC_AsArray(void *array, PyObject *value, int length, PyTypeObject *type, char *error_prefix); + +/* follow http://www.python.org/dev/peps/pep-0383/ */ +PyObject * PyC_UnicodeFromByte(const char *str); +const char * PuC_UnicodeAsByte(PyObject *py_str, PyObject **coerce); /* coerce must be NULL */ + +#endif // PY_CAPI_UTILS_H |