Standardise spelling of debug info
[babeltrace.git] / include / babeltrace / types.h
index 22c6876d5e34195ae14c67f167975637381d6d19..b4198c8f8b7c01017c79a4ab27c38899c64a89ba 100644 (file)
@@ -34,7 +34,7 @@
 #include <babeltrace/ctf/events.h>
 #include <stdbool.h>
 #include <stdint.h>
-#include <limits.h>
+#include <babeltrace/compat/limits.h>
 #include <string.h>
 #include <glib.h>
 #include <assert.h>
@@ -79,7 +79,7 @@ struct definition_scope {
 };
 
 struct bt_declaration {
-       enum ctf_type_id id;
+       enum bt_ctf_type_id id;
        size_t alignment;       /* type alignment, in bits */
        int ref;                /* number of references to the type */
        /*
@@ -115,12 +115,17 @@ struct bt_stream_pos {
        rw_dispatch *rw_table;  /* rw dispatch table */
        int (*event_cb)(struct bt_stream_pos *pos,
                        struct ctf_stream_definition *stream);
+       int (*pre_trace_cb)(struct bt_stream_pos *pos,
+                       struct bt_trace_descriptor *trace);
+       int (*post_trace_cb)(struct bt_stream_pos *pos,
+                       struct bt_trace_descriptor *trace);
+       struct bt_trace_descriptor *trace;
 };
 
 static inline
 int generic_rw(struct bt_stream_pos *pos, struct bt_definition *definition)
 {
-       enum ctf_type_id dispatch_id = definition->declaration->id;
+       enum bt_ctf_type_id dispatch_id = definition->declaration->id;
        rw_dispatch call;
 
        assert(pos->rw_table[dispatch_id] != NULL);
@@ -136,13 +141,17 @@ int generic_rw(struct bt_stream_pos *pos, struct bt_definition *definition)
 struct declaration_integer {
        struct bt_declaration p;
        size_t len;             /* length, in bits. */
-       int byte_order;         /* byte order */
+       int byte_order;         /* LITTLE_ENDIAN/BIG_ENDIAN, 0 == "Native" */
        int signedness;
        int base;               /* Base for pretty-printing: 2, 8, 10, 16 */
        enum ctf_string_encoding encoding;
        struct ctf_clock *clock;
 };
 
+#ifdef ENABLE_DEBUG_INFO
+struct debug_info_source;
+#endif
+
 struct definition_integer {
        struct bt_definition p;
        struct declaration_integer *declaration;
@@ -151,6 +160,17 @@ struct definition_integer {
                uint64_t _unsigned;
                int64_t _signed;
        } value;
+
+#ifdef ENABLE_DEBUG_INFO
+       /*
+        * Debug infos (NULL if not set).
+        *
+        * This is extended debug informations set by the CTF input plugin
+        * itself when available. If it's set, then this integer definition
+        * is the "_ip" field of the stream event context.
+        */
+       struct debug_info_source *debug_info_src;
+#endif
 };
 
 struct declaration_float {
@@ -158,7 +178,7 @@ struct declaration_float {
        struct declaration_integer *sign;
        struct declaration_integer *mantissa;
        struct declaration_integer *exp;
-       int byte_order;
+       int byte_order;         /* LITTLE_ENDIAN/BIG_ENDIAN, 0 == "Native" */
        /* TODO: we might want to express more info about NaN, +inf and -inf */
 };
 
@@ -430,6 +450,10 @@ struct declaration_string *
 char *bt_get_string(const struct bt_definition *field);
 enum ctf_string_encoding bt_get_string_encoding(const struct bt_definition *field);
 
+double bt_get_float(const struct bt_definition *field);
+
+const struct bt_definition *bt_get_variant_field(struct bt_definition *definition);
+
 struct declaration_struct *
        bt_struct_declaration_new(struct declaration_scope *parent_scope,
                               uint64_t min_align);
@@ -448,10 +472,10 @@ struct declaration_field *
 bt_struct_declaration_get_field_from_index(struct declaration_struct *struct_declaration,
                                        int index);
 struct bt_definition *
-bt_struct_definition_get_field_from_index(struct definition_struct *struct_definition,
+bt_struct_definition_get_field_from_index(const struct definition_struct *struct_definition,
                                       int index);
 int bt_struct_rw(struct bt_stream_pos *pos, struct bt_definition *definition);
-uint64_t bt_struct_declaration_len(struct declaration_struct *struct_declaration);
+uint64_t bt_struct_declaration_len(const struct declaration_struct *struct_declaration);
 
 /*
  * The tag enumeration is validated to ensure that it contains only mappings
@@ -518,6 +542,8 @@ void bt_append_scope_path(const char *path, GArray *q);
  */
 struct bt_definition *bt_lookup_definition(const struct bt_definition *definition,
                                     const char *field_name);
+struct bt_definition *bt_lookup_definition_by_quark(const struct bt_definition *definition,
+                                    GQuark quark);
 struct definition_integer *bt_lookup_integer(const struct bt_definition *definition,
                                          const char *field_name,
                                          int signedness);
This page took 0.026089 seconds and 4 git commands to generate.