From: Sven Verdoolaege Date: Sun, 29 May 2011 15:20:36 +0000 (+0200) Subject: add isl_printer_indent X-Git-Tag: isl-0.07~121 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e6471054a536dfe234a91665e2e715660188d867;p=platform%2Fupstream%2Fisl.git add isl_printer_indent Signed-off-by: Sven Verdoolaege --- diff --git a/doc/user.pod b/doc/user.pod index cb826c0..4ae362c 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -724,6 +724,8 @@ The behavior of the printer can be modified in various ways __isl_take isl_printer *p, int output_format); __isl_give isl_printer *isl_printer_set_indent( __isl_take isl_printer *p, int indent); + __isl_give isl_printer *isl_printer_indent( + __isl_take isl_printer *p, int indent); __isl_give isl_printer *isl_printer_set_prefix( __isl_take isl_printer *p, const char *prefix); __isl_give isl_printer *isl_printer_set_suffix( @@ -732,12 +734,15 @@ The behavior of the printer can be modified in various ways The C may be either C, C, C, C or C and defaults to C. -Each line in the output is indented by C spaces +Each line in the output is indented by C (set by +C) spaces (default: 0), prefixed by C and suffixed by C. In the C format output, the coefficients of the existentially quantified variables appear between those of the set variables and those of the parameters. +The function C increases the indentation +by the specified amount (which may be negative). To actually print something, use diff --git a/include/isl/printer.h b/include/isl/printer.h index 1af408f..35df17d 100644 --- a/include/isl/printer.h +++ b/include/isl/printer.h @@ -19,6 +19,8 @@ __isl_give char *isl_printer_get_str(__isl_keep isl_printer *printer); __isl_give isl_printer *isl_printer_set_indent(__isl_take isl_printer *p, int indent); +__isl_give isl_printer *isl_printer_indent(__isl_take isl_printer *p, + int indent); #define ISL_FORMAT_ISL 0 #define ISL_FORMAT_POLYLIB 1 diff --git a/isl_printer.c b/isl_printer.c index 42130c1..15da209 100644 --- a/isl_printer.c +++ b/isl_printer.c @@ -257,6 +257,19 @@ __isl_give isl_printer *isl_printer_set_indent(__isl_take isl_printer *p, return p; } +__isl_give isl_printer *isl_printer_indent(__isl_take isl_printer *p, + int indent) +{ + if (!p) + return NULL; + + p->indent += indent; + if (p->indent < 0) + p->indent = 0; + + return p; +} + __isl_give isl_printer *isl_printer_set_prefix(__isl_take isl_printer *p, const char *prefix) {