25#ifndef PYCARTESIANPARAM_H
26#define PYCARTESIANPARAM_H
37#define PyCartesianParam_Type_NUM 0
39#define PyCartesianParam_GetNative_NUM 1
40#define PyCartesianParam_GetNative_RETURN CartesianParam_t*
41#define PyCartesianParam_GetNative_PROTO (PyCartesianParam*)
43#define PyCartesianParam_New_NUM 2
44#define PyCartesianParam_New_RETURN PyCartesianParam*
45#define PyCartesianParam_New_PROTO (CartesianParam_t*)
47#define PyCartesianParam_API_pointers 3
49#define PyCartesianParam_CAPSULE_NAME "_cartesianparam._C_API"
51#ifdef PYCARTESIANPARAM_MODULE
53extern PyTypeObject PyCartesianParam_Type;
56#define PyCartesianParam_Check(op) ((op)->ob_type == &PyCartesianParam_Type)
66static void **PyCartesianParam_API;
72#define PyCartesianParam_GetNative \
73 (*(PyCartesianParam_GetNative_RETURN (*)PyCartesianParam_GetNative_PROTO) PyCartesianParam_API[PyCartesianParam_GetNative_NUM])
82#define PyCartesianParam_New \
83 (*(PyCartesianParam_New_RETURN (*)PyCartesianParam_New_PROTO) PyCartesianParam_API[PyCartesianParam_New_NUM])
89#define PyCartesianParam_Check(op) \
90 (Py_TYPE(op) == &PyCartesianParam_Type)
92#define PyCartesianParam_Type (*(PyTypeObject*)PyCartesianParam_API[PyCartesianParam_Type_NUM])
97#define import_pycartesianparam() \
98 PyCartesianParam_API = (void **)PyCapsule_Import(PyCartesianParam_CAPSULE_NAME, 1);
104#define PyCartesianParam_Check(op) \
105 ((op)->ob_type == (PyTypeObject *)PyCartesianParam_API[PyCartesianParam_Type_NUM])
114 PyObject *c_api_object;
116 module = PyImport_ImportModule("_cartesianparam");
117 if (module == NULL) {
121 c_api_object = PyObject_GetAttrString(module,
"_C_API");
122 if (c_api_object == NULL) {
126 if (PyCObject_Check(c_api_object)) {
127 PyCartesianParam_API = (
void **)PyCObject_AsVoidPtr(c_api_object);
129 Py_DECREF(c_api_object);
Defines the functions available when working with a cartesian field.
#define PyCartesianParam_GetNative_RETURN
return type for GetNative
Definition pycartesianparam.h:40
#define PyCartesianParam_GetNative_PROTO
arguments for GetNative
Definition pycartesianparam.h:41
#define PyCartesianParam_New_RETURN
return type for New
Definition pycartesianparam.h:44
#define PyCartesianParam_New_PROTO
arguments for New
Definition pycartesianparam.h:45
#define import_pycartesianparam()
Imports the PyCartesianParam module (like import _area in python).
Definition pycartesianparam.h:97
#define PyCartesianParam_New
Creates a new cartesian instance.
Definition pycartesianparam.h:82
#define PyCartesianParam_GetNative
Returns a pointer to the internal cartesian, remember to release the reference when done with the obj...
Definition pycartesianparam.h:72
A cartesian product.
Definition pycartesianparam.h:32
PyObject_HEAD CartesianParam_t * param
the cartesian parameter
Definition pycartesianparam.h:34
Represents the cartesian field product.
Definition cartesianparam.c:40