lib: add "get supported MIP versions" method support
[babeltrace.git] / include / babeltrace2 / plugin / plugin-dev.h
index 5f7d2826917ac49ffcc0b4f45cd4c7fe6c6171ad..cf47d00ef6a07624a5cbe8aa89638176ec052f95 100644 (file)
@@ -1,12 +1,8 @@
-#ifndef BABELTRACE_PLUGIN_PLUGIN_DEV_H
-#define BABELTRACE_PLUGIN_PLUGIN_DEV_H
+#ifndef BABELTRACE2_PLUGIN_PLUGIN_DEV_H
+#define BABELTRACE2_PLUGIN_PLUGIN_DEV_H
 
 /*
- * This is the header that you need to include for the development of
- * a Babeltrace plug-in.
- *
- * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
  * SOFTWARE.
  */
 
-#include <stdint.h>
+#ifndef __BT_IN_BABELTRACE_H
+# error "Please include <babeltrace2/babeltrace.h> instead."
+#endif
 
-/* For enum bt_plugin_status */
-#include <babeltrace2/plugin/plugin-const.h>
+#include <stdint.h>
 
-/* For bt_component_class_type */
 #include <babeltrace2/graph/component-class-const.h>
-
-/* For component class method type definitions */
 #include <babeltrace2/graph/component-class-source.h>
 #include <babeltrace2/graph/component-class-filter.h>
 #include <babeltrace2/graph/component-class-sink.h>
+#include <babeltrace2/types.h>
 
 /*
  * _BT_HIDDEN: set the hidden attribute for internal functions
@@ -63,15 +58,13 @@ extern "C" {
 #define __BT_PLUGIN_VERSION_MINOR      0
 
 /* Plugin initialization function type */
-typedef enum bt_self_plugin_status {
-       BT_SELF_PLUGIN_STATUS_OK = 0,
-       BT_SELF_PLUGIN_STATUS_NOMEM = -12,
-       BT_SELF_PLUGIN_STATUS_ERROR = -1,
-} bt_self_plugin_status;
-
-typedef struct bt_self_plugin bt_self_plugin;
+typedef enum bt_plugin_init_func_status {
+       BT_PLUGIN_INIT_FUNC_STATUS_OK           = __BT_FUNC_STATUS_OK,
+       BT_PLUGIN_INIT_FUNC_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
+       BT_PLUGIN_INIT_FUNC_STATUS_ERROR        = __BT_FUNC_STATUS_ERROR,
+} bt_plugin_init_func_status;
 
-typedef bt_self_plugin_status (*bt_plugin_init_func)(
+typedef bt_plugin_init_func_status (*bt_plugin_init_func)(
                bt_self_plugin *plugin);
 
 /* Plugin exit function type */
@@ -177,20 +170,19 @@ struct __bt_plugin_component_class_descriptor {
 enum __bt_plugin_component_class_descriptor_attribute_type {
        BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION                                 = 0,
        BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP                                        = 1,
-       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD                                 = 2,
-       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD                             = 3,
-       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD                                = 4,
-       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_INPUT_PORT_CONNECTION_METHOD         = 5,
-       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD        = 6,
-       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD                 = 7,
-       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD                = 8,
-       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GRAPH_IS_CONFIGURED_METHOD                  = 9,
-       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD                        = 10,
-       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD                    = 11,
-       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD         = 12,
-       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD              = 13,
-       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD     = 14,
-       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD          = 15,
+       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD           = 2,
+       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD                                 = 3,
+       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD                             = 4,
+       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD                                = 5,
+       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD                 = 6,
+       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD                = 7,
+       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GRAPH_IS_CONFIGURED_METHOD                  = 8,
+       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD                        = 9,
+       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD                    = 10,
+       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD         = 11,
+       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD              = 12,
+       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD     = 13,
+       BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD          = 14,
 };
 
 /* Component class attribute (internal use) */
@@ -215,6 +207,11 @@ struct __bt_plugin_component_class_descriptor_attribute {
                /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP */
                const char *help;
 
+               /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD */
+               bt_component_class_source_get_supported_mip_versions_method source_get_supported_mip_versions_method;
+               bt_component_class_filter_get_supported_mip_versions_method filter_get_supported_mip_versions_method;
+               bt_component_class_sink_get_supported_mip_versions_method sink_get_supported_mip_versions_method;
+
                /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD */
                bt_component_class_source_init_method source_init_method;
                bt_component_class_filter_init_method filter_init_method;
@@ -230,14 +227,6 @@ struct __bt_plugin_component_class_descriptor_attribute {
                bt_component_class_filter_query_method filter_query_method;
                bt_component_class_sink_query_method sink_query_method;
 
-               /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_INPUT_PORT_CONNECTION_METHOD */
-               bt_component_class_filter_accept_input_port_connection_method filter_accept_input_port_connection_method;
-               bt_component_class_sink_accept_input_port_connection_method sink_accept_input_port_connection_method;
-
-               /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD */
-               bt_component_class_source_accept_output_port_connection_method source_accept_output_port_connection_method;
-               bt_component_class_filter_accept_output_port_connection_method filter_accept_output_port_connection_method;
-
                /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD */
                bt_component_class_filter_input_port_connected_method filter_input_port_connected_method;
                bt_component_class_sink_input_port_connected_method sink_input_port_connected_method;
@@ -710,6 +699,39 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, sink, _x)
 
+/*
+ * Defines a "get supported MIP versions" attribute attached to a
+ * specific source component class descriptor.
+ *
+ * _id:            Plugin descriptor ID (C identifier).
+ * _comp_class_id: Component class descriptor ID (C identifier).
+ * _x:             "Get supported MIP versions" method (bt_component_class_source_get_supported_mip_versions_method).
+ */
+#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_WITH_ID(_id, _comp_class_id, _x) \
+       __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_get_supported_mip_versions_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS, _id, _comp_class_id, source, _x)
+
+/*
+ * Defines a "get supported MIP versions" attribute attached to a
+ * specific filter component class descriptor.
+ *
+ * _id:            Plugin descriptor ID (C identifier).
+ * _comp_class_id: Component class descriptor ID (C identifier).
+ * _x:             "Get supported MIP versions" method (bt_component_class_filter_get_supported_mip_versions_method).
+ */
+#define BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_WITH_ID(_id, _comp_class_id, _x) \
+       __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_get_supported_mip_versions_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS, _id, _comp_class_id, filter, _x)
+
+/*
+ * Defines a "get supported MIP versions" attribute attached to a
+ * specific sink component class descriptor.
+ *
+ * _id:            Plugin descriptor ID (C identifier).
+ * _comp_class_id: Component class descriptor ID (C identifier).
+ * _x:             "Get supported MIP versions" method (bt_component_class_sink_get_supported_mip_versions_method).
+ */
+#define BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_WITH_ID(_id, _comp_class_id, _x) \
+       __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_get_supported_mip_versions_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS, _id, _comp_class_id, sink, _x)
+
 /*
  * Defines a finalization method attribute attached to a specific source
  * component class descriptor.
@@ -776,54 +798,6 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, sink, _x)
 
-/*
- * Defines an accept input port connection method attribute attached to
- * a specific filter component class descriptor.
- *
- * _id:            Plugin descriptor ID (C identifier).
- * _comp_class_id: Component class descriptor ID (C identifier).
- * _x:             Accept port connection method
- *                 (bt_component_class_filter_accept_input_port_connection_method).
- */
-#define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
-       __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_accept_input_port_connection_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_INPUT_PORT_CONNECTION_METHOD, _id, _comp_class_id, filter, _x)
-
-/*
- * Defines an accept input port connection method attribute attached to
- * a specific sink component class descriptor.
- *
- * _id:            Plugin descriptor ID (C identifier).
- * _comp_class_id: Component class descriptor ID (C identifier).
- * _x:             Accept port connection method
- *                 (bt_component_class_sink_accept_input_port_connection_method).
- */
-#define BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
-       __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_accept_input_port_connection_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_INPUT_PORT_CONNECTION_METHOD, _id, _comp_class_id, sink, _x)
-
-/*
- * Defines an accept output port connection method attribute attached to
- * a specific source component class descriptor.
- *
- * _id:            Plugin descriptor ID (C identifier).
- * _comp_class_id: Component class descriptor ID (C identifier).
- * _x:             Accept port connection method
- *                 (bt_component_class_source_accept_output_port_connection_method).
- */
-#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
-       __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_accept_output_port_connection_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD, _id, _comp_class_id, source, _x)
-
-/*
- * Defines an accept output port connection method attribute attached to
- * a specific filter component class descriptor.
- *
- * _id:            Plugin descriptor ID (C identifier).
- * _comp_class_id: Component class descriptor ID (C identifier).
- * _x:             Accept port connection method
- *                 (bt_component_class_filter_accept_output_port_connection_method).
- */
-#define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
-       __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_accept_output_port_connection_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD, _id, _comp_class_id, filter, _x)
-
 /*
  * Defines an input port connected method attribute attached to a
  * specific filter component class descriptor.
@@ -1215,6 +1189,39 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
        BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
 
+/*
+ * Defines a "get supported MIP versions" method attribute attached to a
+ * source component class descriptor which is attached to the automatic
+ * plugin descriptor.
+ *
+ * _name: Component class name (C identifier).
+ * _x:    Initialization method (bt_component_class_source_get_supported_mip_versions_method).
+ */
+#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(_name, _x) \
+       BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(auto, _name, _x)
+
+/*
+ * Defines a "get supported MIP versions" method attribute attached to a
+ * filter component class descriptor which is attached to the automatic
+ * plugin descriptor.
+ *
+ * _name: Component class name (C identifier).
+ * _x:    Initialization method (bt_component_class_filter_get_supported_mip_versions_method).
+ */
+#define BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(_name, _x) \
+       BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(auto, _name, _x)
+
+/*
+ * Defines a "get supported MIP versions" method attribute attached to a
+ * sink component class descriptor which is attached to the automatic
+ * plugin descriptor.
+ *
+ * _name: Component class name (C identifier).
+ * _x:    Initialization method (bt_component_class_sink_get_supported_mip_versions_method).
+ */
+#define BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(_name, _x) \
+       BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(auto, _name, _x)
+
 /*
  * Defines a finalization method attribute attached to a source component
  * class descriptor which is attached to the automatic plugin
@@ -1280,54 +1287,6 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
        BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
 
-/*
- * Defines an accept input port connection method attribute attached to
- * a filter component class descriptor which is attached to the
- * automatic plugin descriptor.
- *
- * _name: Component class name (C identifier).
- * _x:    Accept port connection method
- *        (bt_component_class_filter_accept_input_port_connection_method).
- */
-#define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD(_name, _x) \
-       BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
-
-/*
- * Defines an accept input port connection method attribute attached to
- * a sink component class descriptor which is attached to the automatic
- * plugin descriptor.
- *
- * _name: Component class name (C identifier).
- * _x:    Accept port connection method
- *        (bt_component_class_sink_accept_input_port_connection_method).
- */
-#define BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD(_name, _x) \
-       BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
-
-/*
- * Defines an accept output port connection method attribute attached to
- * a source component class descriptor which is attached to the
- * automatic plugin descriptor.
- *
- * _name: Component class name (C identifier).
- * _x:    Accept port connection method
- *        (bt_component_class_source_accept_output_port_connection_method).
- */
-#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD(_name, _x) \
-       BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
-
-/*
- * Defines an accept output port connection method attribute attached to
- * a filter component class descriptor which is attached to the
- * automatic plugin descriptor.
- *
- * _name: Component class name (C identifier).
- * _x:    Accept port connection method
- *        (bt_component_class_filter_accept_output_port_connection_method).
- */
-#define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD(_name, _x) \
-       BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
-
 /*
  * Defines an input port connected method attribute attached to a filter
  * component class descriptor which is attached to the automatic plugin
@@ -1582,4 +1541,4 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
 }
 #endif
 
-#endif /* BABELTRACE_PLUGIN_PLUGIN_DEV_H */
+#endif /* BABELTRACE2_PLUGIN_PLUGIN_DEV_H */
This page took 0.026962 seconds and 4 git commands to generate.