Add initial plug-in stubs
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 21 May 2015 19:10:48 +0000 (15:10 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 16:54:31 +0000 (12:54 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/ctf/ctf-live/live.c [new file with mode: 0644]
plugins/ctf/ctf-reader/reader-internal.h [new file with mode: 0644]
plugins/ctf/ctf-reader/reader.c [new file with mode: 0644]
plugins/ctf/ctf-text/text.c [new file with mode: 0644]
plugins/ctf/reader.c [deleted file]

diff --git a/plugins/ctf/ctf-live/live.c b/plugins/ctf/ctf-live/live.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/plugins/ctf/ctf-reader/reader-internal.h b/plugins/ctf/ctf-reader/reader-internal.h
new file mode 100644 (file)
index 0000000..cab8edb
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef BABELTRACE_PLUGIN_CTF_READER_INTERNAL_H
+#define BABELTRACE_PLUGIN_CTF_READER_INTERNAL_H
+
+/*
+ * BabelTrace - CTF Reader plug-in internal
+ *
+ * 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
+ * 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.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_PLUGIN_CTF_READER_INTERNAL_H */
diff --git a/plugins/ctf/ctf-reader/reader.c b/plugins/ctf/ctf-reader/reader.c
new file mode 100644 (file)
index 0000000..f839f9b
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * reader.c
+ *
+ * Babeltrace CTF Reader Plugin
+ *
+ * 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
+ * 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/plugin-lib.h>
+#include <babeltrace/plugin/plugin-system.h>
+#include <glib.h>
+#include <stdio.h>
+
+const char *plugin_name = "ctf";
+
+struct ctf_reader {
+       int a;
+};
+
+enum bt_plugin_type bt_plugin_lib_get_type(void)
+{
+       return BT_PLUGIN_TYPE_SOURCE;
+}
+
+const char *bt_plugin_lib_get_format_name(void)
+{
+       return plugin_name;
+}
+
+static
+void ctf_reader_destroy(struct bt_plugin *plugin)
+{
+       struct ctf_reader *reader;
+
+       if (!plugin) {
+               return;
+       }
+
+       reader = bt_plugin_get_private_data(plugin);
+       if (!reader) {
+               return;
+       }
+
+       g_free(reader);
+}
+
+static
+struct bt_notification_iterator *ctf_reader_iterator_create(
+               struct bt_plugin *plugin)
+{
+       return NULL;
+}
+
+struct bt_plugin *bt_plugin_lib_create(struct bt_object *params)
+{
+       enum bt_plugin_status ret;
+       struct bt_plugin *plugin = NULL;
+       struct ctf_reader *reader = g_new0(struct ctf_reader, 1);
+
+       if (!reader) {
+               goto error;
+       }
+
+       plugin = bt_plugin_source_create(plugin_name, reader,
+               ctf_reader_destroy, ctf_reader_iterator_create);
+       if (!plugin) {
+               goto error;
+       }
+       reader = NULL;
+
+       ret = bt_plugin_set_error_stream_cb(plugin,
+               ctf_reader_set_error_stream);
+       if (ret != BT_PLUGIN_STATUS_OK) {
+               goto error;
+       }
+end:
+       return plugin;
+error:
+       if (reader) {
+               ctf_reader_destroy(reader);
+       }
+       if (plugin) {
+               bt_plugin_put(plugin);
+               plugin = NULL;
+       }
+       goto end;
+}
diff --git a/plugins/ctf/ctf-text/text.c b/plugins/ctf/ctf-text/text.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/plugins/ctf/reader.c b/plugins/ctf/reader.c
deleted file mode 100644 (file)
index f839f9b..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * reader.c
- *
- * Babeltrace CTF Reader Plugin
- *
- * 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
- * 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/plugin-lib.h>
-#include <babeltrace/plugin/plugin-system.h>
-#include <glib.h>
-#include <stdio.h>
-
-const char *plugin_name = "ctf";
-
-struct ctf_reader {
-       int a;
-};
-
-enum bt_plugin_type bt_plugin_lib_get_type(void)
-{
-       return BT_PLUGIN_TYPE_SOURCE;
-}
-
-const char *bt_plugin_lib_get_format_name(void)
-{
-       return plugin_name;
-}
-
-static
-void ctf_reader_destroy(struct bt_plugin *plugin)
-{
-       struct ctf_reader *reader;
-
-       if (!plugin) {
-               return;
-       }
-
-       reader = bt_plugin_get_private_data(plugin);
-       if (!reader) {
-               return;
-       }
-
-       g_free(reader);
-}
-
-static
-struct bt_notification_iterator *ctf_reader_iterator_create(
-               struct bt_plugin *plugin)
-{
-       return NULL;
-}
-
-struct bt_plugin *bt_plugin_lib_create(struct bt_object *params)
-{
-       enum bt_plugin_status ret;
-       struct bt_plugin *plugin = NULL;
-       struct ctf_reader *reader = g_new0(struct ctf_reader, 1);
-
-       if (!reader) {
-               goto error;
-       }
-
-       plugin = bt_plugin_source_create(plugin_name, reader,
-               ctf_reader_destroy, ctf_reader_iterator_create);
-       if (!plugin) {
-               goto error;
-       }
-       reader = NULL;
-
-       ret = bt_plugin_set_error_stream_cb(plugin,
-               ctf_reader_set_error_stream);
-       if (ret != BT_PLUGIN_STATUS_OK) {
-               goto error;
-       }
-end:
-       return plugin;
-error:
-       if (reader) {
-               ctf_reader_destroy(reader);
-       }
-       if (plugin) {
-               bt_plugin_put(plugin);
-               plugin = NULL;
-       }
-       goto end;
-}
This page took 0.029756 seconds and 4 git commands to generate.