isl 0.27
[isl.git] / print_yaml_field_templ.c
blob088e701d96942a83c9e8a6ca1f55f4a0cb87ef56
1 #define xCAT(A,B) A ## B
2 #define CAT(A,B) xCAT(A,B)
3 #undef TYPE
4 #define TYPE CAT(isl_,BASE)
5 #define xFN(TYPE,NAME) TYPE ## _ ## NAME
6 #define FN(TYPE,NAME) xFN(TYPE,NAME)
8 /* Print a key-value pair of a YAML mapping to "p",
9 * with key "name" and value "val".
11 static __isl_give isl_printer *FN(print_yaml_field,BASE)(
12 __isl_take isl_printer *p, const char *name, __isl_keep TYPE *val)
14 p = isl_printer_print_str(p, name);
15 p = isl_printer_yaml_next(p);
16 p = isl_printer_print_str(p, "\"");
17 p = FN(isl_printer_print,BASE)(p, val);
18 p = isl_printer_print_str(p, "\"");
19 p = isl_printer_yaml_next(p);
21 return p;