Remove underscore prefix from field names (pretty-print)
[babeltrace.git] / include / babeltrace / ctf-text / types.h
index bb837bcd5e671bbd5c4d30164cd5d22dd53fce41..7d9b5bfb70b8a7da34ad88ff7c3b0566e9f1be44 100644 (file)
@@ -24,7 +24,7 @@
 #include <stdint.h>
 #include <unistd.h>
 #include <glib.h>
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/types.h>
 #include <babeltrace/format.h>
 
@@ -38,6 +38,8 @@ struct ctf_text_stream_pos {
        int depth;
        int dummy;              /* disable output */
        int print_names;        /* print field names */
+       int field_nr;
+       GString *string;        /* Current string */
 };
 
 static inline
@@ -67,4 +69,18 @@ void print_pos_tabs(struct ctf_text_stream_pos *pos)
                fprintf(pos->fp, "\t");
 }
 
+/*
+ * Check if the field must be printed.
+ */
+int print_field(struct definition *definition);
+
+static inline
+const char *rem_(const char *str)
+{
+       if (str[0] == '_')
+               return &str[1];
+       else
+               return str;
+}
+
 #endif /* _BABELTRACE_CTF_TEXT_TYPES_H */
This page took 0.02414 seconds and 4 git commands to generate.