2 * Copyright 2013 Ecole Normale Superieure
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege,
7 * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France
10 #include <isl/stream.h>
12 #include <isl_list_macro.h>
14 /* Read a sequence of EL objects and return them as a list.
16 static __isl_give
LIST(EL
) *FN(isl_stream_yaml_read
,LIST(EL_BASE
))(
23 ctx
= isl_stream_get_ctx(s
);
25 if (isl_stream_yaml_read_start_sequence(s
) < 0)
28 list
= FN(LIST(EL
),alloc
)(ctx
, 0);
29 while ((more
= isl_stream_yaml_next(s
)) == isl_bool_true
) {
32 el
= FN(isl_stream_read
,EL_BASE
)(s
);
33 list
= FN(LIST(EL
),add
)(list
, el
);
36 if (more
< 0 || isl_stream_yaml_read_end_sequence(s
) < 0)
37 return FN(LIST(EL
),free
)(list
);