From 56f51e650eb5ad1461f613d3dcc35cdaebb5ba75 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 11 Apr 2012 12:48:09 +0200 Subject: [PATCH] add isl_printer_get_file Signed-off-by: Sven Verdoolaege --- doc/user.pod | 5 +++++ include/isl/printer.h | 1 + isl_printer.c | 10 ++++++++++ 3 files changed, 16 insertions(+) diff --git a/doc/user.pod b/doc/user.pod index 1914704..4988f64 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -976,6 +976,11 @@ be created. __isl_give char *isl_printer_get_str( __isl_keep isl_printer *printer); +The printer can be inspected using the following function. + + FILE *isl_printer_get_file( + __isl_keep isl_printer *printer); + The behavior of the printer can be modified in various ways __isl_give isl_printer *isl_printer_set_output_format( diff --git a/include/isl/printer.h b/include/isl/printer.h index da2f043..04b4d59 100644 --- a/include/isl/printer.h +++ b/include/isl/printer.h @@ -16,6 +16,7 @@ __isl_give isl_printer *isl_printer_to_str(isl_ctx *ctx); void isl_printer_free(__isl_take isl_printer *printer); isl_ctx *isl_printer_get_ctx(__isl_keep isl_printer *printer); +FILE *isl_printer_get_file(__isl_keep isl_printer *printer); __isl_give char *isl_printer_get_str(__isl_keep isl_printer *printer); diff --git a/isl_printer.c b/isl_printer.c index ae7596d..5318d2a 100644 --- a/isl_printer.c +++ b/isl_printer.c @@ -241,6 +241,16 @@ isl_ctx *isl_printer_get_ctx(__isl_keep isl_printer *printer) return printer ? printer->ctx : NULL; } +FILE *isl_printer_get_file(__isl_keep isl_printer *printer) +{ + if (!printer) + return NULL; + if (!printer->file) + isl_die(isl_printer_get_ctx(printer), isl_error_invalid, + "not a file printer", return NULL); + return printer->file; +} + __isl_give isl_printer *isl_printer_set_isl_int_width(__isl_take isl_printer *p, int width) { -- 2.7.4