Rename ctf_event to ctf_event_declaration
[babeltrace.git] / formats / ctf / events.c
index ebc4f1b057143d046ccee603b11e5da2eafabdd7..71665ce01442aeadf3af2d276014eb797faf1b46 100644 (file)
@@ -140,8 +140,8 @@ const struct definition *bt_ctf_get_index(const struct bt_ctf_event *event,
 
 const char *bt_ctf_event_name(const struct bt_ctf_event *event)
 {
-       struct ctf_event *event_class;
-       struct ctf_stream_class *stream_class;
+       struct ctf_event_declaration *event_class;
+       struct ctf_stream_declaration *stream_class;
 
        if (!event)
                return NULL;
@@ -251,6 +251,36 @@ error:
        return -1;
 }
 
+struct bt_context *bt_ctf_event_get_context(const struct bt_ctf_event *event)
+{
+       struct bt_context *ret = NULL;
+       struct ctf_file_stream *cfs;
+       struct ctf_trace *trace;
+
+       cfs = container_of(event->stream, struct ctf_file_stream,
+                       parent);
+       trace = cfs->parent.stream_class->trace;
+       if (trace->ctx)
+               ret = trace->ctx;
+
+       return ret;
+}
+
+int bt_ctf_event_get_handle_id(const struct bt_ctf_event *event)
+{
+       int ret = -1;
+       struct ctf_file_stream *cfs;
+       struct ctf_trace *trace;
+
+       cfs = container_of(event->stream, struct ctf_file_stream,
+                       parent);
+       trace = cfs->parent.stream_class->trace;
+       if (trace->handle)
+               ret = trace->handle->id;
+
+       return ret;
+}
+
 uint64_t bt_ctf_get_timestamp_raw(const struct bt_ctf_event *event)
 {
        if (event && event->stream->has_timestamp)
This page took 0.023876 seconds and 4 git commands to generate.