add isl_union_map_read_from_file
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 16 Feb 2011 18:47:17 +0000 (19:47 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 17 Feb 2011 18:50:23 +0000 (19:50 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/union_map.h
include/isl/union_set.h
isl_input.c

index ac5b6bf..ceb179a 100644 (file)
@@ -613,10 +613,14 @@ dimensions is zero.
                const char *str, int nparam);
 
        #include <isl/union_set.h>
+       __isl_give isl_union_set *isl_union_set_read_from_file(
+               isl_ctx *ctx, FILE *input);
        __isl_give isl_union_set *isl_union_set_read_from_str(
                struct isl_ctx *ctx, const char *str);
 
        #include <isl/union_map.h>
+       __isl_give isl_union_map *isl_union_map_read_from_file(
+               isl_ctx *ctx, FILE *input);
        __isl_give isl_union_map *isl_union_map_read_from_str(
                struct isl_ctx *ctx, const char *str);
 
index dad469d..a0f7a74 100644 (file)
@@ -110,6 +110,8 @@ __isl_give isl_union_map *isl_union_map_lex_gt_union_map(
 __isl_give isl_union_map *isl_union_map_lex_ge_union_map(
        __isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2);
 
+__isl_give isl_union_map *isl_union_map_read_from_file(isl_ctx *ctx,
+       FILE *input);
 __isl_give isl_union_map *isl_union_map_read_from_str(struct isl_ctx *ctx,
        const char *str);
 __isl_give isl_printer *isl_printer_print_union_map(__isl_take isl_printer *p,
index 4f08664..1be5c27 100644 (file)
@@ -75,6 +75,8 @@ __isl_give isl_union_map *isl_union_set_lex_gt_union_set(
 __isl_give isl_union_map *isl_union_set_lex_ge_union_set(
        __isl_take isl_union_set *uset1, __isl_take isl_union_set *uset2);
 
+__isl_give isl_union_set *isl_union_set_read_from_file(isl_ctx *ctx,
+       FILE *input);
 __isl_give isl_union_set *isl_union_set_read_from_str(struct isl_ctx *ctx,
        const char *str);
 __isl_give isl_printer *isl_printer_print_union_set(__isl_take isl_printer *p,
index ed21140..387647a 100644 (file)
@@ -2079,6 +2079,18 @@ error:
        return NULL;
 }
 
+__isl_give isl_union_map *isl_union_map_read_from_file(isl_ctx *ctx,
+       FILE *input)
+{
+       isl_union_map *umap;
+       struct isl_stream *s = isl_stream_new_file(ctx, input);
+       if (!s)
+               return NULL;
+       umap = isl_stream_read_union_map(s);
+       isl_stream_free(s);
+       return umap;
+}
+
 __isl_give isl_union_map *isl_union_map_read_from_str(struct isl_ctx *ctx,
                const char *str)
 {
@@ -2091,6 +2103,18 @@ __isl_give isl_union_map *isl_union_map_read_from_str(struct isl_ctx *ctx,
        return umap;
 }
 
+__isl_give isl_union_set *isl_union_set_read_from_file(isl_ctx *ctx,
+       FILE *input)
+{
+       isl_union_set *uset;
+       struct isl_stream *s = isl_stream_new_file(ctx, input);
+       if (!s)
+               return NULL;
+       uset = isl_stream_read_union_set(s);
+       isl_stream_free(s);
+       return uset;
+}
+
 __isl_give isl_union_set *isl_union_set_read_from_str(struct isl_ctx *ctx,
                const char *str)
 {