Polly 19.0.0git
isl_list_read_yaml_templ.c
Go to the documentation of this file.
1/*
2 * Copyright 2013 Ecole Normale Superieure
3 *
4 * Use of this software is governed by the MIT license
5 *
6 * Written by Sven Verdoolaege,
7 * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France
8 */
9
10#include <isl/stream.h>
11
12#include <isl_list_macro.h>
13
14/* Read a sequence of EL objects and return them as a list.
15 */
16static __isl_give LIST(EL) *FN(isl_stream_yaml_read,LIST(EL_BASE))(
17 isl_stream *s)
18{
19 isl_ctx *ctx;
20 LIST(EL) *list;
21 isl_bool more;
22
23 ctx = isl_stream_get_ctx(s);
24
26 return NULL;
27
28 list = FN(LIST(EL),alloc)(ctx, 0);
29 while ((more = isl_stream_yaml_next(s)) == isl_bool_true) {
30 EL *el;
31
32 el = FN(isl_stream_read,EL_BASE)(s);
33 list = FN(LIST(EL),add)(list, el);
34 }
35
36 if (more < 0 || isl_stream_yaml_read_end_sequence(s) < 0)
37 return FN(LIST(EL),free)(list);
38
39 return list;
40}
#define FN(TYPE, NAME)
#define __isl_give
Definition: ctx.h:19
isl_bool
Definition: ctx.h:89
@ isl_bool_true
Definition: ctx.h:92
void GMPZAPI() add(mp_int rop, mp_int op1, mp_int op2)
#define EL_BASE
Definition: isl_aff.c:64
#define EL
#define LIST(EL)
Definition: isl_list_macro.h:8
isl_stat isl_stream_yaml_read_start_sequence(__isl_keep isl_stream *s)
Definition: isl_stream.c:1139
isl_bool isl_stream_yaml_next(__isl_keep isl_stream *s)
Definition: isl_stream.c:966
isl_ctx * isl_stream_get_ctx(__isl_keep isl_stream *s)
Definition: isl_stream.c:800
isl_stat isl_stream_yaml_read_end_sequence(__isl_keep isl_stream *s)
Definition: isl_stream.c:1172