14#define PY_SSIZE_T_CLEAN
37 for (
bool is_first =
true; item->
identifier; item++) {
56 const char *identifier,
58 const char *error_prefix)
63 PyExc_ValueError,
"%s: '%.200s' not found in (%s)", error_prefix, identifier, enum_str);
74 bool type_convert_sign,
76 const char *error_prefix)
85 while (_PySet_NextEntry(value, &
pos, &key, &
hash)) {
86 const char *param = PyUnicode_AsUTF8(key);
87 if (param ==
nullptr) {
88 PyErr_Format(PyExc_TypeError,
89 "%.200s expected a string, not %.200s",
91 Py_TYPE(key)->tp_name);
102 if (type_convert_sign) {
103 if (type_size == 2) {
105 signed short as_signed;
108 ret_convert.as_signed = (
signed short)
ret;
109 index =
int(ret_convert.as_unsigned);
111 else if (type_size == 1) {
113 signed char as_signed;
116 ret_convert.as_signed = (
signed char)
ret;
117 index =
int(ret_convert.as_unsigned);
137 const char *error_prefix)
149 while (_PySet_NextEntry(value, &
pos, &key, &
hash)) {
150 const char *param = PyUnicode_AsUTF8(key);
152 if (param ==
nullptr) {
153 PyErr_Format(PyExc_TypeError,
154 "%.200s expected a string, not %.200s",
156 Py_TYPE(key)->tp_name);
173 PyObject *
ret = PySet_New(
nullptr);
179 for (index = 0; identifier[index]; index++) {
180 item = PyUnicode_FromString(identifier[index]);
181 PySet_Add(
ret, item);
197 const char *identifier = PyUnicode_AsUTF8(o);
198 if (identifier ==
nullptr) {
199 PyErr_Format(PyExc_TypeError,
"expected a string enum, not %.200s", Py_TYPE(o)->tp_name);
204 parse_data->
items, identifier, &parse_data->
value,
"enum identifier") == -1)
210 parse_data->
is_set =
true;
216 if (!PySet_Check(o)) {
217 PyErr_Format(PyExc_TypeError,
"expected a set, not %.200s", Py_TYPE(o)->tp_name);
223 parse_data->
items, o, &parse_data->
value,
"enum identifier set") == -1)
228 parse_data->
is_set =
true;
#define BLI_assert_unreachable()
#define BLI_BITMAP_NEW(_num, _alloc_string)
#define BLI_BITMAP_ENABLE(_bitmap, _index)
A dynamically sized string ADT.
char * BLI_dynstr_get_cstring(const DynStr *ds) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
DynStr * BLI_dynstr_new(void) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_dynstr_free(DynStr *ds) ATTR_NONNULL()
void BLI_dynstr_appendf(DynStr *__restrict ds, const char *__restrict format,...) ATTR_PRINTF_FORMAT(2
Read Guarded memory(de)allocation.
#define RNA_ENUM_BITFLAG_SIZE
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void MEM_freeN(void *vmemh)
static void error(const char *str)
int pyrna_enum_value_from_id(const EnumPropertyItem *item, const char *identifier, int *r_value, const char *error_prefix)
int pyrna_enum_bitfield_parse_set(PyObject *o, void *p)
int pyrna_enum_bitfield_from_set(const EnumPropertyItem *items, PyObject *value, int *r_value, const char *error_prefix)
PyObject * pyrna_enum_bitfield_as_set(const EnumPropertyItem *items, int value)
BLI_bitmap * pyrna_enum_bitmap_from_set(const EnumPropertyItem *items, PyObject *value, int type_size, bool type_convert_sign, int bitmap_size, const char *error_prefix)
char * pyrna_enum_repr(const EnumPropertyItem *item)
int pyrna_enum_value_parse_string(PyObject *o, void *p)
int RNA_enum_bitflag_identifiers(const EnumPropertyItem *item, const int value, const char **r_identifier)
bool RNA_enum_value_from_id(const EnumPropertyItem *item, const char *identifier, int *r_value)
const EnumPropertyItem * items