From 0a2cf69b577640926186fbf62c0d9c2759236270 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sat, 16 Apr 2011 19:34:25 +0200 Subject: [PATCH] add *_list_get_ctx Signed-off-by: Sven Verdoolaege --- doc/user.pod | 6 ++++++ include/isl/list.h | 1 + isl_list_templ.c | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/doc/user.pod b/doc/user.pod index c2b394ee..370bc9c0 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -2006,6 +2006,7 @@ In case of union relations, the optimum is computed per space. Lists are defined over several element types, including C and C. Here we take lists of Cs as an example. +Lists can be created, copied and freed using the following functions. #include __isl_give isl_set_list *isl_set_list_alloc( @@ -2020,6 +2021,11 @@ Here we take lists of Cs as an example. C creates an empty list with a capacity for C elements. +Lists can be inspected using the following functions. + + #include + 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. diff --git a/include/isl/list.h b/include/isl/list.h index 89fca4bd..ddedaf33 100644 --- a/include/isl/list.h +++ b/include/isl/list.h @@ -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); \ diff --git a/isl_list_templ.c b/isl_list_templ.c index c3a8b4f1..4fb89659 100644 --- a/isl_list_templ.c +++ b/isl_list_templ.c @@ -19,6 +19,11 @@ #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; -- 2.11.4.GIT