Update integer encoding
[babeltrace.git] / formats / ctf / metadata / ctf-visitor-xml.c
index d1c0751c51e3c8c548144c087cd1834c05d6fa52..7115126f980d6a6b0a8021e203fd4d1b4fa0228d 100644 (file)
@@ -24,6 +24,7 @@
 #include <glib.h>
 #include <inttypes.h>
 #include <errno.h>
+#include <babeltrace/babeltrace.h>
 #include <babeltrace/list.h>
 #include "ctf-scanner.h"
 #include "ctf-parser.h"
@@ -308,12 +309,15 @@ int ctf_visitor_print_type_declarator(FILE *fd, int depth, struct ctf_node *node
                        print_tabs(fd, depth);
                        fprintf(fd, "</type_declarator>\n");
                }
-               if (node->u.type_declarator.u.nested.length) {
+               if (!cds_list_empty(&node->u.type_declarator.u.nested.length)) {
                        print_tabs(fd, depth);
                        fprintf(fd, "<length>\n");
-                       ret = ctf_visitor_print_xml(fd, depth + 1, node->u.type_declarator.u.nested.length);
-                       if (ret)
-                               return ret;
+                       cds_list_for_each_entry(iter, &node->u.type_declarator.u.nested.length,
+                                               siblings) {
+                               ret = ctf_visitor_print_xml(fd, depth + 1, iter);
+                               if (ret)
+                                       return ret;
+                       }
                        print_tabs(fd, depth);
                        fprintf(fd, "</length>\n");
                }
@@ -609,12 +613,9 @@ int ctf_visitor_print_xml(FILE *fd, int depth, struct ctf_node *node)
                if (node->u._enum.container_type) {
                        print_tabs(fd, depth);
                        fprintf(fd, "<container_type>\n");
-               }
-
-               ret = ctf_visitor_print_xml(fd, depth + 1, node->u._enum.container_type);
-               if (ret)
-                       return ret;
-               if (node->u._enum.container_type) {
+                       ret = ctf_visitor_print_xml(fd, depth + 1, node->u._enum.container_type);
+                       if (ret)
+                               return ret;
                        print_tabs(fd, depth);
                        fprintf(fd, "</container_type>\n");
                }
@@ -679,6 +680,17 @@ int ctf_visitor_print_xml(FILE *fd, int depth, struct ctf_node *node)
                }
                print_tabs(fd, depth);
                fprintf(fd, "</struct>\n");
+               if (!cds_list_empty(&node->u._struct.min_align)) {
+                       print_tabs(fd, depth);
+                       fprintf(fd, "<align>\n");
+                       cds_list_for_each_entry(iter, &node->u._struct.min_align, siblings) {
+                               ret = ctf_visitor_print_xml(fd, depth + 1, iter);
+                               if (ret)
+                                       return ret;
+                       }
+                       print_tabs(fd, depth);
+                       fprintf(fd, "</align>\n");
+               }
                break;
 
        case NODE_UNKNOWN:
This page took 0.024979 seconds and 4 git commands to generate.