Blender  V3.3
python_utildefines.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
9 #pragma once
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 #define PyTuple_SET_ITEMS(op_arg, ...) \
16  { \
17  PyTupleObject *op = (PyTupleObject *)op_arg; \
18  PyObject **ob_items = op->ob_item; \
19  CHECK_TYPE_ANY(op_arg, PyObject *, PyTupleObject *); \
20  BLI_assert(VA_NARGS_COUNT(__VA_ARGS__) == PyTuple_GET_SIZE(op)); \
21  ARRAY_SET_ITEMS(ob_items, __VA_ARGS__); \
22  } \
23  (void)0
24 
29 Py_LOCAL_INLINE(PyObject *) Py_INCREF_RET(PyObject *op)
30 {
31  Py_INCREF(op);
32  return op;
33 }
34 
39 Py_LOCAL_INLINE(int) PyList_APPEND(PyObject *op, PyObject *v)
40 {
41  int ret = PyList_Append(op, v);
43  return ret;
44 }
45 
46 #ifdef __cplusplus
47 }
48 #endif
return ret
PyObject * v
Py_LOCAL_INLINE(PyObject *) Py_INCREF_RET(PyObject *op)
Py_DecRef(v)