4 #include <isl/constraint.h>
7 struct _isl_constraint_list
{
11 typedef struct _isl_constraint_list _isl_constraint_list
;
13 int _isl_isl_basic_set_add_constraint_list(__isl_take isl_constraint
*c
,
15 _isl_constraint_list
*list
;
17 list
= (_isl_constraint_list
*) user
;
18 return PyList_SetItem(list
->constraints
, list
->cursor
++,
19 PyLong_FromVoidPtr(c
));
22 static PyObject
* _isl_isl_basic_set_constraints(PyObject
*self
,
27 PyObject
*constraints
;
28 _isl_constraint_list
*list
;
30 if (!PyArg_ParseTuple(args
, "l", &ptr
))
32 bset
= (isl_basic_set
*) ptr
;
33 n
= isl_basic_set_n_constraint(bset
);
34 constraints
= PyList_New(n
);
35 list
= malloc(sizeof(_isl_constraint_list
));
37 list
->constraints
= constraints
;
38 isl_basic_set_foreach_constraint(bset
,
39 _isl_isl_basic_set_add_constraint_list
, list
);
44 static PyMethodDef _isl_methods
[] = {
45 {"isl_basic_set_constraints", _isl_isl_basic_set_constraints
, METH_VARARGS
, NULL
},
49 static struct PyModuleDef _islmodule
= {
50 PyModuleDef_HEAD_INIT
,
57 PyMODINIT_FUNC
PyInit__isl(void) {
59 m
= PyModule_Create(&_islmodule
);
63 PyModule_AddObject(m
, "isl_dim_set", PyLong_FromLong(isl_dim_set
));