RAVE
pyraveattributetable.h
1/*
2 * pyraveattributetable.h
3 *
4 * Created on: Mar 30, 2022
5 * Author: anders
6 */
7
8#ifndef PYRAVEATTRIBUTETABLE_H
9#define PYRAVEATTRIBUTETABLE_H
10
11
13
17typedef struct {
18 PyObject_HEAD /*Always has to be on top*/
21
22#define PyRaveAttributeTable_Type_NUM 0
24#define PyRaveAttributeTable_GetNative_NUM 1
25#define PyRaveAttributeTable_GetNative_RETURN RaveAttributeTable_t*
26#define PyRaveAttributeTable_GetNative_PROTO (PyRaveAttributeTable*)
28#define PyRaveAttributeTable_New_NUM 2
29#define PyRaveAttributeTable_New_RETURN PyRaveAttributeTable*
30#define PyRaveAttributeTable_New_PROTO (RaveAttributeTable_t*)
32#define PyRaveAttributeTable_API_pointers 3
34#define PyRaveAttributeTable_CAPSULE_NAME "_raveattributetable._C_API"
35
36#ifdef PY_RAVE_ATTRIBUTE_TABLE_MODULE
38extern PyTypeObject PyRaveAttributeTable_Type;
39
41#define PyRaveAttributeTable_Check(op) ((op)->ob_type == &PyRaveAttributeTable_Type)
42
44static PyRaveAttributeTable_GetNative_RETURN PyRaveAttributeTable_GetNative PyRaveAttributeTable_GetNative_PROTO;
45
47static PyRaveAttributeTable_New_RETURN PyRaveAttributeTable_New PyRaveAttributeTable_New_PROTO;
48
49#else
51static void **PyRaveAttributeTable_API;
52
57#define PyRaveAttributeTable_GetNative \
58 (*(PyRaveAttributeTable_GetNative_RETURN (*)PyRaveAttributeTable_GetNative_PROTO) PyRaveAttributeTable_API[PyRaveAttributeTable_GetNative_NUM])
59
67#define PyRaveAttributeTable_New \
68 (*(PyRaveAttributeTable_New_RETURN (*)PyRaveAttributeTable_New_PROTO) PyRaveAttributeTable_API[PyRaveAttributeTable_New_NUM])
69
73#define PyRaveAttributeTable_Check(op) \
74 (Py_TYPE(op) == &PyRaveAttributeTable_Type)
75
76#define PyRaveAttributeTable_Type (*(PyTypeObject*)PyRaveAttributeTable_API[PyRaveAttributeTable_Type_NUM])
77
81#define import_pyraveattributetabley() \
82 PyRaveAttributeTable_API = (void **)PyCapsule_Import(PyRaveAttributeTable_CAPSULE_NAME, 1);
83
84#endif
85
86
87#endif /* PYRAVEATTRIBUTETABLE_H */
Used for managing attributes and handle different versions.
A rave attribute table.
Definition pyraveattributetable.h:17
PyObject_HEAD RaveAttributeTable_t * table
the attributes
Definition pyraveattributetable.h:19
Represents one scan in a volume.
Definition rave_attribute_table.c:39