Lists can be created, copied and freed using the following functions.
#include <isl/list.h>
+ __isl_give isl_set_list *isl_set_list_from_set(
+ __isl_take struct isl_set *el);
__isl_give isl_set_list *isl_set_list_alloc(
isl_ctx *ctx, int n);
__isl_give isl_set_list *isl_set_list_copy(
void *isl_set_list_free(__isl_take isl_set_list *list);
C<isl_set_list_alloc> creates an empty list with a capacity for
-C<n> elements.
+C<n> elements. C<isl_set_list_from_set> creates a list with a single
+element.
Lists can be inspected using the following functions.
struct isl_##EL##_list; \
typedef struct isl_##EL##_list isl_##EL##_list; \
isl_ctx *isl_##EL##_list_get_ctx(__isl_keep isl_##EL##_list *list); \
+__isl_give isl_##EL##_list *isl_##EL##_list_from_##EL( \
+ __isl_take struct isl_##EL *el); \
__isl_give isl_##EL##_list *isl_##EL##_list_alloc(isl_ctx *ctx, int n); \
__isl_give isl_##EL##_list *isl_##EL##_list_copy( \
__isl_keep isl_##EL##_list *list); \
return 0;
}
+__isl_give LIST(EL) *FN(FN(LIST(EL),from),BASE)(__isl_take EL *el)
+{
+ isl_ctx *ctx;
+ LIST(EL) *list;
+
+ if (!el)
+ return NULL;
+ ctx = FN(EL,get_ctx)(el);
+ list = FN(LIST(EL),alloc)(ctx, 1);
+ if (!list)
+ goto error;
+ list = FN(LIST(EL),add)(list, el);
+ return list;
+error:
+ FN(EL,free)(el);
+ return NULL;
+}
+
__isl_give isl_printer *CAT(isl_printer_print_,LIST(BASE))(
__isl_take isl_printer *p, __isl_keep LIST(EL) *list)
{