Blender V2.61 - r43446
Functions

py_capi_utils.c File Reference

#include <Python.h>
#include <frameobject.h>
#include "py_capi_utils.h"
#include "BLI_string_utf8.h"

Go to the source code of this file.

Functions

int PyC_AsArray (void *array, PyObject *value, const int length, const PyTypeObject *type, const short is_double, const char *error_prefix)
void PyC_ObSpit (const char *name, PyObject *var)
void PyC_LineSpit (void)
void PyC_FileAndNum (const char **filename, int *lineno)
void PyC_FileAndNum_Safe (const char **filename, int *lineno)
PyObject * PyC_Object_GetAttrStringArgs (PyObject *o, Py_ssize_t n,...)
PyObject * PyC_Err_Format_Prefix (PyObject *exception_type_prefix, const char *format,...)
PyObject * PyC_ExceptionBuffer (void)
const char * PyC_UnicodeAsByte (PyObject *py_str, PyObject **coerce)
PyObject * PyC_UnicodeFromByteAndSize (const char *str, Py_ssize_t size)
PyObject * PyC_UnicodeFromByte (const char *str)
PyObject * PyC_DefaultNameSpace (const char *filename)
void PyC_MainModule_Backup (PyObject **main_mod)
void PyC_MainModule_Restore (PyObject *main_mod)
void PyC_SetHomePath (const char *py_path_bundle)
void PyC_RunQuicky (const char *filepath, int n,...)

Detailed Description

Extend upon CPython's API, filling in some gaps, these functions use PyC_ prefix to distinguish them apart from CPython.

Note:
This module should only depend on CPython, however it currently uses BLI_string_utf8() for unicode conversion.

Definition in file py_capi_utils.c.


Function Documentation

int PyC_AsArray ( void *  array,
PyObject *  value,
const int  length,
const PyTypeObject *  type,
const short  is_double,
const char *  error_prefix 
)
PyObject* PyC_DefaultNameSpace ( const char *  filename)

Definition at line 431 of file py_capi_utils.c.

References interp().

Referenced by BPY_button_exec(), BPY_string_exec(), PyC_RunQuicky(), and python_script_exec().

PyObject* PyC_Err_Format_Prefix ( PyObject *  exception_type_prefix,
const char *  format,
  ... 
)

Definition at line 233 of file py_capi_utils.c.

References NULL.

Referenced by bpy_class_call(), and pyrna_py_to_prop().

PyObject* PyC_ExceptionBuffer ( void  )

Definition at line 298 of file py_capi_utils.c.

References NULL.

Referenced by BPy_errors_to_report(), pointer_type_from_py(), and pyrna_py_to_prop().

void PyC_FileAndNum ( const char **  filename,
int *  lineno 
)

Definition at line 153 of file py_capi_utils.c.

References mod(), and NULL.

Referenced by BPy_errors_to_report(), PyC_FileAndNum_Safe(), and PyC_LineSpit().

void PyC_FileAndNum_Safe ( const char **  filename,
int *  lineno 
)

Definition at line 192 of file py_capi_utils.c.

References PyC_FileAndNum(), and PYC_INTERPRETER_ACTIVE.

void PyC_LineSpit ( void  )

Definition at line 135 of file py_capi_utils.c.

References PyC_FileAndNum(), and PYC_INTERPRETER_ACTIVE.

Referenced by _RNA_warning().

void PyC_MainModule_Backup ( PyObject **  main_mod)

Definition at line 446 of file py_capi_utils.c.

References interp().

Referenced by BPY_button_exec(), BPY_string_exec(), and python_script_exec().

void PyC_MainModule_Restore ( PyObject *  main_mod)

Definition at line 453 of file py_capi_utils.c.

References interp().

Referenced by BPY_string_exec(), and python_script_exec().

PyObject* PyC_Object_GetAttrStringArgs ( PyObject *  o,
Py_ssize_t  n,
  ... 
)

Definition at line 202 of file py_capi_utils.c.

References i.

void PyC_ObSpit ( const char *  name,
PyObject *  var 
)

Definition at line 115 of file py_capi_utils.c.

References NULL.

Referenced by bpy_class_free(), PyC_RunQuicky(), pyrna_srna_ExternalType(), and pyrna_subtype_set_rna().

void PyC_RunQuicky ( const char *  filepath,
int  n,
  ... 
)

Definition at line 503 of file py_capi_utils.c.

References i, NULL, PyC_DefaultNameSpace(), and PyC_ObSpit().

void PyC_SetHomePath ( const char *  py_path_bundle)

Definition at line 461 of file py_capi_utils.c.

References BLI_setenv(), BLI_strncpy_wchar_from_utf8(), and NULL.

Referenced by BPY_python_start().

const char* PyC_UnicodeAsByte ( PyObject *  py_str,
PyObject **  coerce 
)

Definition at line 371 of file py_capi_utils.c.

References NULL.

Referenced by BPy_IDProperty_Map_ValidateAndCreate(), and pyrna_py_to_prop().

PyObject* PyC_UnicodeFromByte ( const char *  str)
PyObject* PyC_UnicodeFromByteAndSize ( const char *  str,
Py_ssize_t  size 
)