From 08995411d613fcb9b12aff15cdc3ec0d9a0b4525 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 21 Jul 2010 10:00:38 +0200 Subject: [PATCH] add isl_*_to_str Signed-off-by: Sven Verdoolaege --- include/isl/set.h | 2 ++ print_templ.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/isl/set.h b/include/isl/set.h index 111ccb0..9b3c959 100644 --- a/include/isl/set.h +++ b/include/isl/set.h @@ -432,6 +432,8 @@ __isl_give isl_basic_set *isl_set_solutions(__isl_take isl_set *set); __isl_give isl_pw_aff *isl_set_dim_max(__isl_take isl_set *set, int pos); __isl_give isl_pw_aff *isl_set_dim_min(__isl_take isl_set *set, int pos); +__isl_give char *isl_set_to_str(__isl_keep isl_set *set); + #if defined(__cplusplus) } #endif diff --git a/print_templ.c b/print_templ.c index 9dd9b86..f147fdc 100644 --- a/print_templ.c +++ b/print_templ.c @@ -16,3 +16,18 @@ void FN(TYPE,dump)(__isl_keep TYPE *obj) p = isl_printer_end_line(p); isl_printer_free(p); } + +__isl_give char *FN(TYPE,to_str)(__isl_keep TYPE *obj) +{ + isl_printer *p; + char *s; + + if (!obj) + return NULL; + p = isl_printer_to_str(FN(TYPE,get_ctx)(obj)); + p = FN(isl_printer_print,BASE)(p, obj); + s = isl_printer_get_str(p); + isl_printer_free(p); + + return s; +} -- 2.7.4