Clean-up: Use memset() to initialize packet_index
[babeltrace.git] / formats / ctf / events.c
index 8174293b28e85b80b2038ecec808c3490488636f..eff707239af3dbc124ca7b81a6d4aa85eb031ea0 100644 (file)
@@ -255,7 +255,7 @@ int bt_ctf_get_field_list(const struct bt_ctf_event *ctf_event,
                        goto error;
                if (def_sequence->elems->pdata) {
                        *list = (struct bt_definition const* const*) def_sequence->elems->pdata;
-                       *count = def_sequence->elems->len;
+                       *count = (unsigned int) def_sequence->length->value._unsigned;
                        goto end;
                } else {
                        goto error;
@@ -712,6 +712,14 @@ const char *bt_ctf_get_decl_event_name(const struct bt_ctf_event_decl *event)
        return g_quark_to_string(event->parent.name);
 }
 
+uint64_t bt_ctf_get_decl_event_id(const struct bt_ctf_event_decl *event)
+{
+       if (!event)
+               return (uint64_t)(-1);
+
+       return event->parent.id;
+}
+
 int bt_ctf_get_decl_fields(struct bt_ctf_event_decl *event_decl,
                enum bt_ctf_scope scope,
                struct bt_ctf_field_decl const * const **list,
This page took 0.024409 seconds and 4 git commands to generate.