add isl_stream_read_pw_qpolynomial
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 8 May 2010 10:19:49 +0000 (12:19 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 13 May 2010 16:53:54 +0000 (18:53 +0200)
include/isl_stream.h
isl_input.c

index b566ae5..efedee1 100644 (file)
@@ -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)
 }
index 01d3cf8..e2a7ebf 100644 (file)
@@ -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;
+}