From: Sven Verdoolaege Date: Sat, 23 Jan 2010 21:52:02 +0000 (+0100) Subject: add isl_map_read_from_str X-Git-Tag: isl-0.02~148 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db902f263ddf2397c1181d3c01561a7096f17ff4;p=platform%2Fupstream%2Fisl.git add isl_map_read_from_str --- diff --git a/doc/user.pod b/doc/user.pod index 67c5091..a4bc5b2 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -390,6 +390,8 @@ to foreign file formats. isl_ctx *ctx, const char *str, int nparam); __isl_give isl_map *isl_map_read_from_file( struct isl_ctx *ctx, FILE *input, int nparam); + __isl_give isl_map *isl_map_read_from_str(isl_ctx *ctx, + const char *str, int nparam); The input may be either in C format or in the C format, which is similar to the C format. diff --git a/include/isl_map.h b/include/isl_map.h index 3cc0492..e26c691 100644 --- a/include/isl_map.h +++ b/include/isl_map.h @@ -187,6 +187,8 @@ __isl_give isl_basic_map *isl_basic_map_read_from_str(isl_ctx *ctx, const char *str, int nparam); __isl_give isl_map *isl_map_read_from_file(struct isl_ctx *ctx, FILE *input, int nparam); +__isl_give isl_map *isl_map_read_from_str(isl_ctx *ctx, + const char *str, int nparam); struct isl_basic_map *isl_basic_map_fix_si(struct isl_basic_map *bmap, enum isl_dim_type type, unsigned pos, int value); diff --git a/isl_input.c b/isl_input.c index db3d619..43385e9 100644 --- a/isl_input.c +++ b/isl_input.c @@ -898,6 +898,18 @@ __isl_give isl_map *isl_map_read_from_file(struct isl_ctx *ctx, return map; } +__isl_give isl_map *isl_map_read_from_str(struct isl_ctx *ctx, + const char *str, int nparam) +{ + struct isl_map *map; + struct isl_stream *s = isl_stream_new_str(ctx, str); + if (!s) + return NULL; + map = map_read(s, nparam); + isl_stream_free(s); + return map; +} + __isl_give isl_set *isl_set_read_from_file(struct isl_ctx *ctx, FILE *input, int nparam) {