lib: update copyrights
[babeltrace.git] / lib / graph / notification / event.c
index 09dece0bc58234af9a8712d15b82d817b290d2a3..038da740f46a3cc8a1ceaa6764e3123907ec3600 100644 (file)
@@ -1,8 +1,7 @@
 /*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
  * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
  * in the Software without restriction, including without limitation the rights
@@ -33,7 +32,8 @@
 #include <babeltrace/trace-ir/stream-class-internal.h>
 #include <babeltrace/trace-ir/trace.h>
 #include <babeltrace/graph/graph-internal.h>
-#include <babeltrace/graph/private-notification-event.h>
+#include <babeltrace/graph/notification-event-const.h>
+#include <babeltrace/graph/notification-event.h>
 #include <babeltrace/graph/notification-event-internal.h>
 #include <babeltrace/types.h>
 #include <babeltrace/assert-internal.h>
@@ -49,7 +49,7 @@ static inline bool event_class_has_trace(struct bt_event_class *event_class)
 
        stream_class = bt_event_class_borrow_stream_class(event_class);
        BT_ASSERT(stream_class);
-       return bt_stream_class_borrow_trace(stream_class) != NULL;
+       return bt_stream_class_borrow_trace_class(stream_class) != NULL;
 }
 
 BT_HIDDEN
@@ -75,15 +75,13 @@ end:
        return (void *) notification;
 }
 
-struct bt_private_notification *bt_private_notification_event_create(
+struct bt_notification *bt_notification_event_create(
                struct bt_self_notification_iterator *self_notif_iter,
-               struct bt_private_event_class *priv_event_class,
-               struct bt_private_packet *priv_packet)
+               struct bt_event_class *event_class,
+               struct bt_packet *packet)
 {
        struct bt_self_component_port_input_notification_iterator *notif_iter =
                (void *) self_notif_iter;
-       struct bt_event_class *event_class = (void *) priv_event_class;
-       struct bt_packet *packet = (void *) priv_packet;
        struct bt_notification_event *notification = NULL;
        struct bt_event *event;
 
@@ -179,8 +177,8 @@ void bt_notification_event_recycle(struct bt_notification *notif)
        bt_object_pool_recycle_object(&graph->event_notif_pool, notif);
 }
 
-struct bt_event *bt_notification_event_borrow_event(
-               struct bt_notification *notification)
+static inline
+struct bt_event *borrow_event(struct bt_notification *notification)
 {
        struct bt_notification_event *event_notification;
 
@@ -191,9 +189,14 @@ struct bt_event *bt_notification_event_borrow_event(
        return event_notification->event;
 }
 
-struct bt_private_event *bt_private_notification_event_borrow_event(
-               struct bt_private_notification *notification)
+struct bt_event *bt_notification_event_borrow_event(
+               struct bt_notification *notification)
+{
+       return borrow_event(notification);
+}
+
+const struct bt_event *bt_notification_event_borrow_event_const(
+               const struct bt_notification *notification)
 {
-       return (void *) bt_notification_event_borrow_event(
-               (void *) notification);
+       return borrow_event((void *) notification);
 }
This page took 0.030942 seconds and 4 git commands to generate.