lib: rename bt_plugin_create_all_*() -> bt_plugin_find_all_*()
[babeltrace.git] / include / babeltrace / graph / notification-const.h
index 4ab0bb91dff24cebdb8d8ebc6415915d43861104..8754088999ce269f7cf350b9e29aa6480c0b218d 100644 (file)
@@ -2,10 +2,9 @@
 #define BABELTRACE_GRAPH_NOTIFICATION_CONST_H
 
 /*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
  * Copyright 2015 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
  * SOFTWARE.
  */
 
+/* For bt_notification */
+#include <babeltrace/types.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-struct bt_notification;
-
-typedef const struct bt_notification **bt_notification_array_const;
-
 /**
  * Notification types. Unhandled notification types should be ignored.
  */
 enum bt_notification_type {
        BT_NOTIFICATION_TYPE_EVENT =                    0,
        BT_NOTIFICATION_TYPE_INACTIVITY =               1,
-       BT_NOTIFICATION_TYPE_STREAM_BEGIN =             2,
+       BT_NOTIFICATION_TYPE_STREAM_BEGINNING =         2,
        BT_NOTIFICATION_TYPE_STREAM_END =               3,
-       BT_NOTIFICATION_TYPE_PACKET_BEGIN =             4,
+       BT_NOTIFICATION_TYPE_PACKET_BEGINNING =         4,
        BT_NOTIFICATION_TYPE_PACKET_END =               5,
 };
 
@@ -52,7 +50,24 @@ enum bt_notification_type {
  * @returns            One of #bt_notification_type
  */
 extern enum bt_notification_type bt_notification_get_type(
-               const struct bt_notification *notification);
+               const bt_notification *notification);
+
+extern void bt_notification_get_ref(const bt_notification *notification);
+
+extern void bt_notification_put_ref(const bt_notification *notification);
+
+#define BT_NOTIFICATION_PUT_REF_AND_RESET(_var)                \
+       do {                                            \
+               bt_notification_put_ref(_var);          \
+               (_var) = NULL;                          \
+       } while (0)
+
+#define BT_NOTIFICATION_MOVE_REF(_var_dst, _var_src)   \
+       do {                                            \
+               bt_notification_put_ref(_var_dst);      \
+               (_var_dst) = (_var_src);                \
+               (_var_src) = NULL;                      \
+       } while (0)
 
 #ifdef __cplusplus
 }
This page took 0.027032 seconds and 4 git commands to generate.