Blender  V3.3
Classes | Macros | Typedefs | Functions
py_capi_utils.h File Reference
#include "BLI_sys_types.h"
#include "BLI_utildefines_variadic.h"

Go to the source code of this file.

Classes

struct  PyC_FlagSet
 
struct  PyC_StringEnumItems
 
struct  PyC_StringEnum
 

Macros

#define PyC_Tuple_Pack_F32(...)    PyC_Tuple_PackArray_F32(((const float[]){__VA_ARGS__}), VA_NARGS_COUNT(__VA_ARGS__))
 
#define PyC_Tuple_Pack_F64(...)    PyC_Tuple_PackArray_F64(((const double[]){__VA_ARGS__}), VA_NARGS_COUNT(__VA_ARGS__))
 
#define PyC_Tuple_Pack_I32(...)    PyC_Tuple_PackArray_I32(((const int[]){__VA_ARGS__}), VA_NARGS_COUNT(__VA_ARGS__))
 
#define PyC_Tuple_Pack_I32FromBool(...)    PyC_Tuple_PackArray_I32FromBool(((const int[]){__VA_ARGS__}), VA_NARGS_COUNT(__VA_ARGS__))
 
#define PyC_Tuple_Pack_Bool(...)    PyC_Tuple_PackArray_Bool(((const bool[]){__VA_ARGS__}), VA_NARGS_COUNT(__VA_ARGS__))
 

Typedefs

typedef struct PyC_FlagSet PyC_FlagSet
 

Functions

void PyC_ObSpit (const char *name, PyObject *var)
 
void PyC_ObSpitStr (char *result, size_t result_len, PyObject *var)
 
void PyC_LineSpit (void)
 
void PyC_StackSpit (void)
 
PyObject * PyC_ExceptionBuffer (void)
 
PyObject * PyC_ExceptionBuffer_Simple (void)
 
PyObject * PyC_Object_GetAttrStringArgs (PyObject *o, Py_ssize_t n,...)
 
PyObject * PyC_FrozenSetFromStrings (const char **strings)
 
PyObject * PyC_Err_Format_Prefix (PyObject *exception_type_prefix, const char *format,...)
 
PyObject * PyC_Err_SetString_Prefix (PyObject *exception_type_prefix, const char *str)
 
void PyC_Err_PrintWithFunc (PyObject *py_func)
 
void PyC_FileAndNum (const char **r_filename, int *r_lineno)
 
void PyC_FileAndNum_Safe (const char **r_filename, int *r_lineno)
 
int PyC_AsArray_FAST (void *array, size_t array_item_size, PyObject *value_fast, Py_ssize_t length, const PyTypeObject *type, const char *error_prefix)
 
int PyC_AsArray (void *array, size_t array_item_size, PyObject *value, Py_ssize_t length, const PyTypeObject *type, const char *error_prefix)
 
int PyC_AsArray_Multi_FAST (void *array, size_t array_item_size, PyObject *value_fast, const int *dims, int dims_len, const PyTypeObject *type, const char *error_prefix)
 
int PyC_AsArray_Multi (void *array, size_t array_item_size, PyObject *value, const int *dims, int dims_len, const PyTypeObject *type, const char *error_prefix)
 
PyObject * PyC_Tuple_PackArray_F32 (const float *array, uint len)
 
PyObject * PyC_Tuple_PackArray_F64 (const double *array, uint len)
 
PyObject * PyC_Tuple_PackArray_I32 (const int *array, uint len)
 
PyObject * PyC_Tuple_PackArray_I32FromBool (const int *array, uint len)
 
PyObject * PyC_Tuple_PackArray_Bool (const bool *array, uint len)
 
PyObject * PyC_Tuple_PackArray_Multi_F32 (const float *array, const int dims[], int dims_len)
 
PyObject * PyC_Tuple_PackArray_Multi_F64 (const double *array, const int dims[], int dims_len)
 
PyObject * PyC_Tuple_PackArray_Multi_I32 (const int *array, const int dims[], int dims_len)
 
PyObject * PyC_Tuple_PackArray_Multi_Bool (const bool *array, const int dims[], int dims_len)
 
void PyC_Tuple_Fill (PyObject *tuple, PyObject *value)
 
void PyC_List_Fill (PyObject *list, PyObject *value)
 
PyObject * PyC_UnicodeFromByte (const char *str)
 
PyObject * PyC_UnicodeFromByteAndSize (const char *str, Py_ssize_t size)
 
const char * PyC_UnicodeAsByte (PyObject *py_str, PyObject **coerce)
 
const char * PyC_UnicodeAsByteAndSize (PyObject *py_str, Py_ssize_t *size, PyObject **coerce)
 
PyObject * PyC_DefaultNameSpace (const char *filename)
 
void PyC_RunQuicky (const char *filepath, int n,...)
 
bool PyC_NameSpace_ImportArray (PyObject *py_dict, const char *imports[])
 
void PyC_MainModule_Backup (PyObject **r_main_mod)
 
void PyC_MainModule_Restore (PyObject *main_mod)
 
bool PyC_IsInterpreterActive (void)
 
voidPyC_RNA_AsPointer (PyObject *value, const char *type_name)
 
PyObject * PyC_FlagSet_AsString (const PyC_FlagSet *item)
 
int PyC_FlagSet_ValueFromID_int (const PyC_FlagSet *item, const char *identifier, int *r_value)
 
int PyC_FlagSet_ValueFromID (const PyC_FlagSet *item, const char *identifier, int *r_value, const char *error_prefix)
 
int PyC_FlagSet_ToBitfield (const PyC_FlagSet *items, PyObject *value, int *r_value, const char *error_prefix)
 
PyObject * PyC_FlagSet_FromBitfield (PyC_FlagSet *items, int flag)
 
bool PyC_RunString_AsNumber (const char **imports, const char *expr, const char *filename, double *r_value)
 
bool PyC_RunString_AsIntPtr (const char **imports, const char *expr, const char *filename, intptr_t *r_value)
 
bool PyC_RunString_AsStringAndSize (const char **imports, const char *expr, const char *filename, char **r_value, size_t *r_value_size)
 
bool PyC_RunString_AsString (const char **imports, const char *expr, const char *filename, char **r_value)
 
int PyC_ParseBool (PyObject *o, void *p)
 
int PyC_ParseStringEnum (PyObject *o, void *p)
 
const char * PyC_StringEnum_FindIDFromValue (const struct PyC_StringEnumItems *items, int value)
 
int PyC_CheckArgs_DeepCopy (PyObject *args)
 
int PyC_Long_AsBool (PyObject *value)
 
int8_t PyC_Long_AsI8 (PyObject *value)
 
int16_t PyC_Long_AsI16 (PyObject *value)
 
uint8_t PyC_Long_AsU8 (PyObject *value)
 
uint16_t PyC_Long_AsU16 (PyObject *value)
 
uint32_t PyC_Long_AsU32 (PyObject *value)
 
 Py_LOCAL_INLINE (int32_t) PyC_Long_AsI32(PyObject *value)
 
 Py_LOCAL_INLINE (int64_t) PyC_Long_AsI64(PyObject *value)
 
 Py_LOCAL_INLINE (uint64_t) PyC_Long_AsU64(PyObject *value)
 
char PyC_StructFmt_type_from_str (const char *typestr)
 
bool PyC_StructFmt_type_is_float_any (char format)
 
bool PyC_StructFmt_type_is_int_any (char format)
 
bool PyC_StructFmt_type_is_byte (char format)
 
bool PyC_StructFmt_type_is_bool (char format)
 

Macro Definition Documentation

◆ PyC_Tuple_Pack_Bool

#define PyC_Tuple_Pack_Bool (   ...)     PyC_Tuple_PackArray_Bool(((const bool[]){__VA_ARGS__}), VA_NARGS_COUNT(__VA_ARGS__))

Definition at line 92 of file py_capi_utils.h.

◆ PyC_Tuple_Pack_F32

#define PyC_Tuple_Pack_F32 (   ...)     PyC_Tuple_PackArray_F32(((const float[]){__VA_ARGS__}), VA_NARGS_COUNT(__VA_ARGS__))

Definition at line 84 of file py_capi_utils.h.

◆ PyC_Tuple_Pack_F64

#define PyC_Tuple_Pack_F64 (   ...)     PyC_Tuple_PackArray_F64(((const double[]){__VA_ARGS__}), VA_NARGS_COUNT(__VA_ARGS__))

Definition at line 86 of file py_capi_utils.h.

◆ PyC_Tuple_Pack_I32

#define PyC_Tuple_Pack_I32 (   ...)     PyC_Tuple_PackArray_I32(((const int[]){__VA_ARGS__}), VA_NARGS_COUNT(__VA_ARGS__))

Definition at line 88 of file py_capi_utils.h.

◆ PyC_Tuple_Pack_I32FromBool

#define PyC_Tuple_Pack_I32FromBool (   ...)     PyC_Tuple_PackArray_I32FromBool(((const int[]){__VA_ARGS__}), VA_NARGS_COUNT(__VA_ARGS__))

Definition at line 90 of file py_capi_utils.h.

Typedef Documentation

◆ PyC_FlagSet

typedef struct PyC_FlagSet PyC_FlagSet

Function Documentation

◆ Py_LOCAL_INLINE() [1/3]

Py_LOCAL_INLINE ( int32_t  )

Definition at line 259 of file py_capi_utils.h.

References PyC_StringEnumItems::value.

◆ Py_LOCAL_INLINE() [2/3]

Py_LOCAL_INLINE ( int64_t  )

Definition at line 263 of file py_capi_utils.h.

References PyC_StringEnumItems::value.

◆ Py_LOCAL_INLINE() [3/3]

Py_LOCAL_INLINE ( uint64_t  )

Definition at line 267 of file py_capi_utils.h.

References PyC_StringEnumItems::value.

◆ PyC_AsArray()

int PyC_AsArray ( void array,
size_t  array_item_size,
PyObject *  value,
Py_ssize_t  length,
const PyTypeObject *  type,
const char *  error_prefix 
)

◆ PyC_AsArray_FAST()

int PyC_AsArray_FAST ( void array,
size_t  array_item_size,
PyObject *  value_fast,
Py_ssize_t  length,
const PyTypeObject *  type,
const char *  error_prefix 
)

◆ PyC_AsArray_Multi()

int PyC_AsArray_Multi ( void array,
size_t  array_item_size,
PyObject *  value,
const int *  dims,
int  dims_len,
const PyTypeObject *  type,
const char *  error_prefix 
)

Definition at line 285 of file py_capi_utils.c.

References PyC_AsArray_Multi_impl(), and type.

Referenced by bpy_prop_array_from_py_with_dims().

◆ PyC_AsArray_Multi_FAST()

int PyC_AsArray_Multi_FAST ( void array,
size_t  array_item_size,
PyObject *  value_fast,
const int *  dims,
int  dims_len,
const PyTypeObject *  type,
const char *  error_prefix 
)

Definition at line 273 of file py_capi_utils.c.

References PyC_AsArray_Multi_FAST_impl(), and type.

◆ PyC_CheckArgs_DeepCopy()

int PyC_CheckArgs_DeepCopy ( PyObject *  args)

◆ PyC_DefaultNameSpace()

PyObject* PyC_DefaultNameSpace ( const char *  filename)

Description: This function creates a new Python dictionary object. NOTE: dict is owned by sys.modules["__main__"] module, reference is borrowed NOTE: important we use the dict from main, this is what python expects for 'pickle' to work as well as strings like this...

foo = 10 print(import("__main__").foo)

NOTE: this overwrites main which gives problems with nested calls. be sure to run PyC_MainModule_Backup & PyC_MainModule_Restore if there is any chance that python is in the call stack.

Definition at line 1093 of file py_capi_utils.c.

References PyC_UnicodeFromByte().

Referenced by bpy_rna_uilayout_introspect(), bpy_run_string_impl(), PyC_RunQuicky(), PyC_RunString_AsIntPtr(), PyC_RunString_AsNumber(), PyC_RunString_AsStringAndSize(), and python_script_exec().

◆ PyC_Err_Format_Prefix()

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

Similar to #PyErr_Format(),

Implementation - we can't actually prepend the existing exception, because it could have any arguments given to it, so instead we get its __str__ output and raise our own exception including it.

Definition at line 766 of file py_capi_utils.c.

References NULL.

Referenced by bpy_class_call(), PyC_Err_SetString_Prefix(), and pyrna_py_to_prop().

◆ PyC_Err_PrintWithFunc()

void PyC_Err_PrintWithFunc ( PyObject *  py_func)

◆ PyC_Err_SetString_Prefix()

PyObject* PyC_Err_SetString_Prefix ( PyObject *  exception_type_prefix,
const char *  str 
)

Definition at line 800 of file py_capi_utils.c.

References PyC_Err_Format_Prefix(), and str.

Referenced by bpy_app_debug_value_set().

◆ PyC_ExceptionBuffer()

PyObject* PyC_ExceptionBuffer ( void  )

◆ PyC_ExceptionBuffer_Simple()

PyObject* PyC_ExceptionBuffer_Simple ( void  )

◆ PyC_FileAndNum()

void PyC_FileAndNum ( const char **  r_filename,
int *  r_lineno 
)

Definition at line 641 of file py_capi_utils.c.

References mod(), and NULL.

Referenced by BPy_errors_to_report_ex(), PyC_FileAndNum_Safe(), PyC_LineSpit(), and pyrna_func_call().

◆ PyC_FileAndNum_Safe()

void PyC_FileAndNum_Safe ( const char **  r_filename,
int *  r_lineno 
)

Definition at line 695 of file py_capi_utils.c.

References PyC_FileAndNum(), and PyC_IsInterpreterActive().

◆ PyC_FlagSet_AsString()

PyObject* PyC_FlagSet_AsString ( const PyC_FlagSet item)

Definition at line 1349 of file py_capi_utils.c.

References PyC_FlagSet::identifier.

Referenced by PyC_FlagSet_ValueFromID().

◆ PyC_FlagSet_FromBitfield()

PyObject* PyC_FlagSet_FromBitfield ( PyC_FlagSet items,
int  flag 
)

Definition at line 1433 of file py_capi_utils.c.

References PyC_StringEnum::items, NULL, ret, and PyC_StringEnumItems::value.

Referenced by bpy_bmesh_select_mode_get().

◆ PyC_FlagSet_ToBitfield()

int PyC_FlagSet_ToBitfield ( const PyC_FlagSet items,
PyObject *  value,
int *  r_value,
const char *  error_prefix 
)

◆ PyC_FlagSet_ValueFromID()

int PyC_FlagSet_ValueFromID ( const PyC_FlagSet item,
const char *  identifier,
int *  r_value,
const char *  error_prefix 
)

◆ PyC_FlagSet_ValueFromID_int()

int PyC_FlagSet_ValueFromID_int ( const PyC_FlagSet item,
const char *  identifier,
int *  r_value 
)

Definition at line 1360 of file py_capi_utils.c.

References PyC_FlagSet::identifier, STREQ, and PyC_FlagSet::value.

Referenced by PyC_FlagSet_ValueFromID().

◆ PyC_FrozenSetFromStrings()

PyObject* PyC_FrozenSetFromStrings ( const char **  strings)

Definition at line 744 of file py_capi_utils.c.

References NULL, ret, and str.

Referenced by BPyInit__bpy_path().

◆ PyC_IsInterpreterActive()

bool PyC_IsInterpreterActive ( void  )

◆ PyC_LineSpit()

void PyC_LineSpit ( void  )

Definition at line 603 of file py_capi_utils.c.

References PyC_FileAndNum(), and PyC_IsInterpreterActive().

Referenced by _RNA_warning().

◆ PyC_List_Fill()

void PyC_List_Fill ( PyObject *  list,
PyObject *  value 
)

Definition at line 470 of file py_capi_utils.c.

◆ PyC_Long_AsBool()

int PyC_Long_AsBool ( PyObject *  value)

Comparison with #PyObject_IsTrue

Even though Python provides a way to retrieve the boolean value for an object, in many cases it's far too relaxed, with the following examples coercing values.

data.value = "Text" # True.
data.value = "" # False.
data.value = {1, 2} # True
data.value = {} # False.
data.value = None # False.

In practice this is often a mistake by the script author that doesn't behave as they expect. So it's better to be more strict for attribute assignment and function arguments, only accepting True/False 0/1.

If coercing a value is desired, it can be done explicitly: data.value = bool(value)

See also
PyC_ParseBool for use with #PyArg_ParseTuple and related functions.
Note
Don't use bool return type, so -1 can be used as an error value.

Definition at line 1630 of file py_capi_utils.c.

References UNLIKELY.

Referenced by bpy_bm_elem_hflag_set(), bpy_bm_elem_hide_set(), bpy_bm_elem_select_set(), bpy_bmesh_select_flush(), bpy_bmloopuv_flag_set(), bpy_bmvertskin_flag_set(), bpy_prop_boolean_get_fn(), bpy_slot_from_py(), pyrna_array_contains_py(), and pyrna_py_to_prop_array_index().

◆ PyC_Long_AsI16()

int16_t PyC_Long_AsI16 ( PyObject *  value)

Definition at line 1656 of file py_capi_utils.c.

References INT16_MAX, and UNLIKELY.

Referenced by bpy_app_debug_value_set(), and PyC_AsArray_FAST().

◆ PyC_Long_AsI8()

int8_t PyC_Long_AsI8 ( PyObject *  value)

Definition at line 1643 of file py_capi_utils.c.

References INT8_MAX, and UNLIKELY.

Referenced by PyC_AsArray_FAST().

◆ PyC_Long_AsU16()

uint16_t PyC_Long_AsU16 ( PyObject *  value)

Definition at line 1687 of file py_capi_utils.c.

References UINT16_MAX, and UNLIKELY.

◆ PyC_Long_AsU32()

uint32_t PyC_Long_AsU32 ( PyObject *  value)

Definition at line 1700 of file py_capi_utils.c.

References UINT32_MAX, and UNLIKELY.

Referenced by C_BVHTree_FromPolygons(), pygpu_framebuffer_clear(), and pygpu_IndexBuf__tp_new().

◆ PyC_Long_AsU8()

uint8_t PyC_Long_AsU8 ( PyObject *  value)

Definition at line 1674 of file py_capi_utils.c.

References UINT8_MAX, and UNLIKELY.

◆ PyC_MainModule_Backup()

void PyC_MainModule_Backup ( PyObject **  r_main_mod)

◆ PyC_MainModule_Restore()

void PyC_MainModule_Restore ( PyObject *  main_mod)

◆ PyC_NameSpace_ImportArray()

bool PyC_NameSpace_ImportArray ( PyObject *  py_dict,
const char *  imports[] 
)

Import imports into py_dict.

Parameters
py_dictA Python dictionary, typically used as a name-space for script execution.
importsA NULL terminated array of strings.
Returns
true when all modules import without errors, otherwise return false. The caller is expected to handle the exception.

Definition at line 1111 of file py_capi_utils.c.

References mod(), and NULL.

Referenced by bpy_run_string_impl(), PyC_RunString_AsIntPtr(), PyC_RunString_AsNumber(), and PyC_RunString_AsStringAndSize().

◆ PyC_Object_GetAttrStringArgs()

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

Definition at line 711 of file py_capi_utils.c.

◆ PyC_ObSpit()

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

Definition at line 557 of file py_capi_utils.c.

References NULL, and type.

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

◆ PyC_ObSpitStr()

void PyC_ObSpitStr ( char *  result,
size_t  result_len,
PyObject *  var 
)

A version of PyC_ObSpit that writes into a string (and doesn't take a name argument). Use for logging.

Definition at line 575 of file py_capi_utils.c.

References BLI_snprintf(), NULL, result, and type.

Referenced by pyrna_srna_ExternalType().

◆ PyC_ParseBool()

int PyC_ParseBool ( PyObject *  o,
void p 
)

◆ PyC_ParseStringEnum()

int PyC_ParseStringEnum ( PyObject *  o,
void p 
)

◆ PyC_RNA_AsPointer()

void* PyC_RNA_AsPointer ( PyObject *  value,
const char *  type_name 
)

◆ PyC_RunQuicky()

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

Definition at line 1160 of file py_capi_utils.c.

References NULL, ptr, PyC_DefaultNameSpace(), PyC_ObSpit(), and ret.

◆ PyC_RunString_AsIntPtr()

bool PyC_RunString_AsIntPtr ( const char **  imports,
const char *  expr,
const char *  filename,
intptr_t r_value 
)

◆ PyC_RunString_AsNumber()

bool PyC_RunString_AsNumber ( const char **  imports,
const char *  expr,
const char *  filename,
double r_value 
)
Returns
success
Note
it is caller's responsibility to acquire & release GIL!

◆ PyC_RunString_AsString()

bool PyC_RunString_AsString ( const char **  imports,
const char *  expr,
const char *  filename,
char **  r_value 
)

◆ PyC_RunString_AsStringAndSize()

bool PyC_RunString_AsStringAndSize ( const char **  imports,
const char *  expr,
const char *  filename,
char **  r_value,
size_t *  r_value_size 
)

◆ PyC_StackSpit()

void PyC_StackSpit ( void  )

Definition at line 621 of file py_capi_utils.c.

References PyC_IsInterpreterActive().

◆ PyC_StringEnum_FindIDFromValue()

const char* PyC_StringEnum_FindIDFromValue ( const struct PyC_StringEnumItems items,
int  value 
)

◆ PyC_StructFmt_type_from_str()

char PyC_StructFmt_type_from_str ( const char *  typestr)

◆ PyC_StructFmt_type_is_bool()

bool PyC_StructFmt_type_is_bool ( char  format)

Definition at line 1787 of file py_capi_utils.c.

◆ PyC_StructFmt_type_is_byte()

bool PyC_StructFmt_type_is_byte ( char  format)

Definition at line 1775 of file py_capi_utils.c.

Referenced by gl_buffer_type_from_py_buffer().

◆ PyC_StructFmt_type_is_float_any()

bool PyC_StructFmt_type_is_float_any ( char  format)

◆ PyC_StructFmt_type_is_int_any()

bool PyC_StructFmt_type_is_int_any ( char  format)

◆ PyC_Tuple_Fill()

void PyC_Tuple_Fill ( PyObject *  tuple,
PyObject *  value 
)

Caller needs to ensure tuple is uninitialized. Handy for filling a tuple with None for eg.

Definition at line 459 of file py_capi_utils.c.

Referenced by kdtree_nearest_to_py_and_check(), py_bvhtree_nearest_to_py_none(), and py_bvhtree_raycast_to_py_none().

◆ PyC_Tuple_PackArray_Bool()

PyObject* PyC_Tuple_PackArray_Bool ( const bool array,
uint  len 
)

Definition at line 342 of file py_capi_utils.c.

References len.

Referenced by bpy_prop_boolean_array_set_fn(), and PyC_Tuple_PackArray_Multi_Bool_impl().

◆ PyC_Tuple_PackArray_F32()

PyObject* PyC_Tuple_PackArray_F32 ( const float array,
uint  len 
)

◆ PyC_Tuple_PackArray_F64()

PyObject* PyC_Tuple_PackArray_F64 ( const double array,
uint  len 
)

Definition at line 315 of file py_capi_utils.c.

References len.

Referenced by PyC_Tuple_PackArray_Multi_F64_impl().

◆ PyC_Tuple_PackArray_I32()

PyObject* PyC_Tuple_PackArray_I32 ( const int *  array,
uint  len 
)

Definition at line 324 of file py_capi_utils.c.

References len.

Referenced by bpy_prop_int_array_set_fn(), and PyC_Tuple_PackArray_Multi_I32_impl().

◆ PyC_Tuple_PackArray_I32FromBool()

PyObject* PyC_Tuple_PackArray_I32FromBool ( const int *  array,
uint  len 
)

Definition at line 333 of file py_capi_utils.c.

References len.

◆ PyC_Tuple_PackArray_Multi_Bool()

PyObject* PyC_Tuple_PackArray_Multi_Bool ( const bool array,
const int  dims[],
int  dims_len 
)

Definition at line 448 of file py_capi_utils.c.

References PyC_Tuple_PackArray_Multi_Bool_impl().

Referenced by bpy_prop_boolean_array_set_fn().

◆ PyC_Tuple_PackArray_Multi_F32()

PyObject* PyC_Tuple_PackArray_Multi_F32 ( const float array,
const int  dims[],
int  dims_len 
)

Definition at line 376 of file py_capi_utils.c.

References PyC_Tuple_PackArray_Multi_F32_impl().

Referenced by bpy_prop_float_array_set_fn().

◆ PyC_Tuple_PackArray_Multi_F64()

PyObject* PyC_Tuple_PackArray_Multi_F64 ( const double array,
const int  dims[],
int  dims_len 
)

Definition at line 400 of file py_capi_utils.c.

References PyC_Tuple_PackArray_Multi_F64_impl().

◆ PyC_Tuple_PackArray_Multi_I32()

PyObject* PyC_Tuple_PackArray_Multi_I32 ( const int *  array,
const int  dims[],
int  dims_len 
)

Definition at line 424 of file py_capi_utils.c.

References PyC_Tuple_PackArray_Multi_I32_impl().

Referenced by bpy_prop_int_array_set_fn().

◆ PyC_UnicodeAsByte()

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

Definition at line 1042 of file py_capi_utils.c.

References NULL, and result.

Referenced by pyrna_py_to_prop().

◆ PyC_UnicodeAsByteAndSize()

const char* PyC_UnicodeAsByteAndSize ( PyObject *  py_str,
Py_ssize_t *  size,
PyObject **  coerce 
)

String conversion, escape non-unicode chars

Parameters
coercemust be set to NULL.

Definition at line 1015 of file py_capi_utils.c.

References NULL, result, and size().

Referenced by idp_from_PyUnicode().

◆ PyC_UnicodeFromByte()

PyObject* PyC_UnicodeFromByte ( const char *  str)

◆ PyC_UnicodeFromByteAndSize()

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