lib: make graph API const-correct
[babeltrace.git] / lib / graph / notification / notification.c
index e6b6af52995be9174177c65c278bf6a17e83ae5f..3a6090b9265cabc453e38c7629b7c1d9b78702e4 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * Babeltrace Plug-in Notification
- *
  * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
  * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
@@ -27,7 +25,7 @@
 #define BT_LOG_TAG "NOTIF"
 #include <babeltrace/lib-logging-internal.h>
 
-#include <babeltrace/graph/private-notification.h>
+#include <babeltrace/graph/notification-const.h>
 #include <babeltrace/graph/notification-internal.h>
 #include <babeltrace/graph/graph-internal.h>
 #include <babeltrace/assert-internal.h>
@@ -51,7 +49,8 @@ void bt_notification_init(struct bt_notification *notification,
                bt_object_release_func release,
                struct bt_graph *graph)
 {
-       BT_ASSERT(type >= 0 && type < BT_NOTIFICATION_TYPE_NR);
+       BT_ASSERT(type >= 0 &&
+               type <= BT_NOTIFICATION_TYPE_PACKET_END);
        notification->type = type;
        init_seq_num(notification);
        bt_object_init_shared(&notification->base, release);
@@ -63,7 +62,7 @@ void bt_notification_init(struct bt_notification *notification,
 }
 
 enum bt_notification_type bt_notification_get_type(
-               struct bt_notification *notification)
+               const struct bt_notification *notification)
 {
        BT_ASSERT_PRE_NON_NULL(notification, "Notification");
        return notification->type;
@@ -75,9 +74,3 @@ void bt_notification_unlink_graph(struct bt_notification *notif)
        BT_ASSERT(notif);
        notif->graph = NULL;
 }
-
-struct bt_notification *bt_notification_borrow_from_private(
-               struct bt_private_notification *priv_notif)
-{
-       return (void *) priv_notif;
-}
This page took 0.023509 seconds and 4 git commands to generate.