3 #include <isl/constraint.h>
6 struct _isl_constraint_list
{
10 typedef struct _isl_constraint_list _isl_constraint_list
;
12 int _isl_isl_basic_set_add_constraint_list(__isl_take isl_constraint
*c
,
14 _isl_constraint_list
*list
;
16 list
= (_isl_constraint_list
*) user
;
17 return PyList_SetItem(list
->constraints
, list
->cursor
++,
18 PyLong_FromVoidPtr(c
));
21 static PyObject
* _isl_isl_basic_set_constraints(PyObject
*self
,
26 PyObject
*constraints
;
27 _isl_constraint_list
*list
;
29 if (!PyArg_ParseTuple(args
, "l", &ptr
))
31 bset
= (isl_basic_set
*) ptr
;
32 n
= isl_basic_set_n_constraint(bset
);
33 constraints
= PyList_New(n
);
34 list
= malloc(sizeof(_isl_constraint_list
));
36 list
->constraints
= constraints
;
37 isl_basic_set_foreach_constraint(bset
,
38 _isl_isl_basic_set_add_constraint_list
, list
);
43 static PyMethodDef _isl_methods
[] = {
44 {"isl_basic_set_constraints", _isl_isl_basic_set_constraints
, METH_VARARGS
, NULL
},
48 static struct PyModuleDef _islmodule
= {
49 PyModuleDef_HEAD_INIT
,
56 PyMODINIT_FUNC
PyInit__isl(void) {
58 m
= PyModule_Create(&_islmodule
);
62 PyModule_AddObject(m
, "isl_dim_set", PyLong_FromLong(isl_dim_set
));