Add missing _Imaginary type
[babeltrace.git] / formats / ctf / metadata / ctf-visitor-xml.c
index 54b5feb84d552e0e70cfb4fa11e2884723a64a86..68a2e55436eb78cef033073399d3814cc739747d 100644 (file)
 #include "ctf-parser.h"
 #include "ctf-ast.h"
 
-#define printf_dbg(fmt, args...)       fprintf(stderr, "%s: " fmt, __func__, ## args)
+#define fprintf_dbg(fd, fmt, args...)  fprintf(fd, "%s: " fmt, __func__, ## args)
 
-static void print_tabs(FILE *fd, int depth)
+static
+void print_tabs(FILE *fd, int depth)
 {
        int i;
 
@@ -39,6 +40,7 @@ static void print_tabs(FILE *fd, int depth)
                fprintf(fd, "\t");
 }
 
+static
 int ctf_visitor_print_unary_expression(FILE *fd, int depth, struct ctf_node *node)
 {
        int ret = 0;
@@ -85,23 +87,23 @@ int ctf_visitor_print_unary_expression(FILE *fd, int depth, struct ctf_node *nod
                break;
        case UNARY_SBRAC:
                print_tabs(fd, depth);
-               fprintf(fd, "<unary_expression_sbrac>");
+               fprintf(fd, "<unary_expression_sbrac>\n");
                ret = ctf_visitor_print_unary_expression(fd, depth + 1,
                        node->u.unary_expression.u.sbrac_exp);
                if (ret)
                        return ret;
                print_tabs(fd, depth);
-               fprintf(fd, "</unary_expression_sbrac>");
+               fprintf(fd, "</unary_expression_sbrac>\n");
                break;
        case UNARY_NESTED:
                print_tabs(fd, depth);
-               fprintf(fd, "<unary_expression_nested>");
+               fprintf(fd, "<unary_expression_nested>\n");
                ret = ctf_visitor_print_unary_expression(fd, depth + 1,
                        node->u.unary_expression.u.nested_exp);
                if (ret)
                        return ret;
                print_tabs(fd, depth);
-               fprintf(fd, "</unary_expression_nested>");
+               fprintf(fd, "</unary_expression_nested>\n");
                break;
 
        case UNARY_UNKNOWN:
@@ -113,6 +115,7 @@ int ctf_visitor_print_unary_expression(FILE *fd, int depth, struct ctf_node *nod
        return 0;
 }
 
+static
 int ctf_visitor_print_type_specifier(FILE *fd, int depth, struct ctf_node *node)
 {
        print_tabs(fd, depth);
@@ -150,7 +153,10 @@ int ctf_visitor_print_type_specifier(FILE *fd, int depth, struct ctf_node *node)
                fprintf(fd, "bool");
                break;
        case TYPESPEC_COMPLEX:
-               fprintf(fd, "complex");
+               fprintf(fd, "_Complex");
+               break;
+       case TYPESPEC_IMAGINARY:
+               fprintf(fd, "_Imaginary");
                break;
        case TYPESPEC_CONST:
                fprintf(fd, "const");
@@ -169,6 +175,7 @@ int ctf_visitor_print_type_specifier(FILE *fd, int depth, struct ctf_node *node)
        return 0;
 }
 
+static
 int ctf_visitor_print_type_declarator(FILE *fd, int depth, struct ctf_node *node)
 {
        int ret = 0;
This page took 0.023866 seconds and 4 git commands to generate.