From: Sven Verdoolaege Date: Sat, 16 Apr 2011 17:34:25 +0000 (+0200) Subject: add *_list_get_ctx X-Git-Tag: isl-0.07~128 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a2cf69b577640926186fbf62c0d9c2759236270;p=platform%2Fupstream%2Fisl.git add *_list_get_ctx Signed-off-by: Sven Verdoolaege --- diff --git a/doc/user.pod b/doc/user.pod index c2b394e..370bc9c 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 89fca4b..ddedaf3 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 c3a8b4f..4fb8965 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;