36
37
struct EnumPropertyItem;
39
void PyObSpit(char *name, PyObject *var);
40
void PyLineSpit(void);
41
void BPY_getFileAndNum(char **filename, int *lineno);
43
PyObject *BPY_exception_buffer(void);
45
/* own python like utility function */
46
PyObject *PyObject_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...);
50
/* Class type checking, use for checking classes can be added as operators, panels etc */
51
typedef struct BPY_class_attr_check {
52
const char *name; /* name of the class attribute */
53
char type; /* 's' = string, 'f' = function, 'l' = list, (add as needed) */
54
int arg_count; /* only for function types, -1 for undefined, includes self arg */
55
int len; /* only for string types currently */
56
int flag; /* other options */
57
} BPY_class_attr_check;
59
/* BPY_class_attr_check, flag */
60
#define BPY_CLASS_ATTR_OPTIONAL 1
61
#define BPY_CLASS_ATTR_NONE_OK 2
63
int BPY_class_validate(const char *class_type, PyObject *class, PyObject *base_class, BPY_class_attr_check* class_attrs, PyObject **py_class_attrs);
65
40
char *BPy_enum_as_string(struct EnumPropertyItem *item);
68
#define BLANK_PYTHON_TYPE {PyVarObject_HEAD_INIT(NULL, 0) 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
42
#define BLANK_PYTHON_TYPE {PyVarObject_HEAD_INIT(NULL, 0) NULL}
70
44
/* error reporting */
71
int BPy_reports_to_error(struct ReportList *reports);
72
int BPy_errors_to_report(struct ReportList *reports);
45
short BPy_reports_to_error(struct ReportList *reports, PyObject *exception, const short clear);
46
short BPy_errors_to_report(struct ReportList *reports);
74
48
/* TODO - find a better solution! */
75
49
struct bContext *BPy_GetContext(void);
76
50
void BPy_SetContext(struct bContext *C);
52
extern void bpy_context_update(struct bContext *C);
78
53
extern void bpy_context_set(struct bContext *C, PyGILState_STATE *gilstate);
79
54
extern void bpy_context_clear(struct bContext *C, PyGILState_STATE *gilstate);
81
int BPyAsPrimitiveArray(void *array, PyObject *value, int length, PyTypeObject *type, char *error_prefix);