Add notification utility library
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 30 Aug 2016 04:21:15 +0000 (00:21 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 18:09:05 +0000 (14:09 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac
include/babeltrace/plugin/notification/notification-internal.h
include/babeltrace/plugin/notification/notification.h
lib/plugin-system/Makefile.am
lib/plugin-system/notification/Makefile.am [new file with mode: 0644]
lib/plugin-system/notification/notification.c [new file with mode: 0644]

index 01043fbdcd7178ea870a669f91b04f3582c85eff..5ad18a0063cd7d7e9bc555733b597845e2fb0c84 100644 (file)
@@ -362,6 +362,7 @@ AC_CONFIG_FILES([
        lib/Makefile
        lib/prio_heap/Makefile
        lib/plugin-system/Makefile
+       lib/plugin-system/notification/Makefile
        include/Makefile
        bindings/Makefile
        bindings/python/Makefile
index a59d503500a94352573fc9c61d24ab0b0edc7e8d..2b5b291bb9432de727b7db931b5da7575aaf70d3 100644 (file)
@@ -27,7 +27,7 @@
  * SOFTWARE.
  */
 
-#include <babeltrace/ctf-writer/ref-internal.h>
+#include <babeltrace/ref-internal.h>
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/object-internal.h>
 #include <babeltrace/plugin/notification/notification.h>
index b8b87a4476fc8f541d7586e7836f3c2465ee91cc..487c737e8739d0b49d4b9a77d2d792c9d1555b3e 100644 (file)
@@ -66,7 +66,7 @@ enum bt_notification_type {
        /** End of trace notification, see eot.h */
        BT_NOTIFICATION_TYPE_END_OF_TRACE = 7,
 
-       BT_NOTIFICATION_TYPE_NR,
+       BT_NOTIFICATION_TYPE_NR, /* Not part of ABI. */
 };
 
 /**
index 9fa9d9337a8cd6edc7cf88c7f7d7a7c6bec1652b..e3f9614ec4f340dbaf307e9e0b04ddab9f9bc1d5 100644 (file)
@@ -1,5 +1,7 @@
 AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
 
+SUBDIRS = notification
+
 noinst_LTLIBRARIES = libplugin-system.la
 
 # Plug-in system library
diff --git a/lib/plugin-system/notification/Makefile.am b/lib/plugin-system/notification/Makefile.am
new file mode 100644 (file)
index 0000000..255659a
--- /dev/null
@@ -0,0 +1,7 @@
+AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
+
+noinst_LTLIBRARIES = libplugin-system-notification.la
+
+# Plug-in system library
+libplugin_system_notification_la_SOURCES = \
+       notification.c
diff --git a/lib/plugin-system/notification/notification.c b/lib/plugin-system/notification/notification.c
new file mode 100644 (file)
index 0000000..a8bb088
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Babeltrace Plug-in Notification
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/plugin/notification/notification-internal.h>
+
+enum bt_notification_type bt_notification_get_type(
+               struct bt_notification *notification)
+{
+       return notification ? notification->type : BT_NOTIFICATION_TYPE_UNKNOWN;
+}
This page took 0.029212 seconds and 4 git commands to generate.