From c41c7bb47f31adc5ae742322aa68b03d34c6fc61 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sat, 8 May 2010 12:19:49 +0200 Subject: [PATCH] add isl_stream_read_pw_qpolynomial --- include/isl_stream.h | 2 ++ isl_input.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/include/isl_stream.h b/include/isl_stream.h index b566ae54..efedee19 100644 --- a/include/isl_stream.h +++ b/include/isl_stream.h @@ -85,6 +85,8 @@ enum isl_token_type isl_stream_register_keyword(struct isl_stream *s, struct isl_obj isl_stream_read_obj(struct isl_stream *s); __isl_give isl_map *isl_stream_read_map(struct isl_stream *s, int nparam); +__isl_give isl_pw_qpolynomial *isl_stream_read_pw_qpolynomial( + struct isl_stream *s); #if defined(__cplusplus) } diff --git a/isl_input.c b/isl_input.c index 01d3cf84..e2a7ebf1 100644 --- a/isl_input.c +++ b/isl_input.c @@ -1583,3 +1583,20 @@ struct isl_vec *isl_vec_read_from_file(struct isl_ctx *ctx, else isl_assert(ctx, 0, return NULL); } + +__isl_give isl_pw_qpolynomial *isl_stream_read_pw_qpolynomial( + struct isl_stream *s) +{ + struct isl_obj obj; + struct isl_pw_qpolynomial *pwqp; + + obj = obj_read(s, -1); + if (obj.v) + isl_assert(s->ctx, obj.type == isl_obj_pw_qpolynomial, + goto error); + + return obj.v; +error: + obj.type->free(obj.v); + return NULL; +} -- 2.11.4.GIT