add *_list_get_ctx
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 16 Apr 2011 17:34:25 +0000 (19:34 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 4 Jun 2011 11:19:23 +0000 (13:19 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/list.h
isl_list_templ.c

index c2b394e..370bc9c 100644 (file)
@@ -2006,6 +2006,7 @@ In case of union relations, the optimum is computed per space.
 Lists are defined over several element types, including
 C<isl_basic_set> and C<isl_set>.
 Here we take lists of C<isl_set>s as an example.
+Lists can be created, copied and freed using the following functions.
 
        #include <isl/list.h>
        __isl_give isl_set_list *isl_set_list_alloc(
@@ -2020,6 +2021,11 @@ Here we take lists of C<isl_set>s as an example.
 C<isl_set_list_alloc> creates an empty list with a capacity for
 C<n> elements.
 
+Lists can be inspected using the following functions.
+
+       #include <isl/list.h>
+       isl_ctx *isl_set_list_get_ctx(__isl_keep isl_set_list *list);
+
 =head2 Matrices
 
 Matrices can be created, copied and freed using the following functions.
index 89fca4b..ddedaf3 100644 (file)
@@ -20,6 +20,7 @@ extern "C" {
 struct isl_##EL;                                                       \
 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_alloc(isl_ctx *ctx, int n);        \
 __isl_give isl_##EL##_list *isl_##EL##_list_copy(                      \
        __isl_keep isl_##EL##_list *list);                              \
index c3a8b4f..4fb8965 100644 (file)
 #define xLIST(EL) EL ## _list
 #define LIST(EL) xLIST(EL)
 
+isl_ctx *FN(LIST(EL),get_ctx)(__isl_keep LIST(EL) *list)
+{
+       return list ? list->ctx : NULL;
+}
+
 __isl_give LIST(EL) *FN(LIST(EL),alloc)(isl_ctx *ctx, int n)
 {
        LIST(EL) *list;