1 #ifndef BABELTRACE_PLUGIN_PLUGIN_DEV_H
2 #define BABELTRACE_PLUGIN_PLUGIN_DEV_H
5 * BabelTrace - Babeltrace Plug-in Development API
7 * This is the header that you need to include for the development of
8 * a Babeltrace plug-in.
10 * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
11 * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
13 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
15 * Permission is hereby granted, free of charge, to any person obtaining a copy
16 * of this software and associated documentation files (the "Software"), to deal
17 * in the Software without restriction, including without limitation the rights
18 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19 * copies of the Software, and to permit persons to whom the Software is
20 * furnished to do so, subject to the following conditions:
22 * The above copyright notice and this permission notice shall be included in
23 * all copies or substantial portions of the Software.
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35 #include <babeltrace/plugin/plugin.h>
36 #include <babeltrace/graph/component-class.h>
37 #include <babeltrace/graph/component-class-source.h>
38 #include <babeltrace/graph/component-class-filter.h>
39 #include <babeltrace/graph/component-class-sink.h>
42 * _BT_HIDDEN: set the hidden attribute for internal functions
43 * On Windows, symbols are local unless explicitly exported,
44 * see https://gcc.gnu.org/wiki/Visibility
46 #if defined(_WIN32) || defined(__CYGWIN__)
49 #define _BT_HIDDEN __attribute__((visibility("hidden")))
57 * Plugin interface's version, not synced with Babeltrace's version
60 #define __BT_PLUGIN_VERSION_MAJOR 1
61 #define __BT_PLUGIN_VERSION_MINOR 0
63 /* Plugin initialization function type */
64 typedef enum bt_plugin_status (*bt_plugin_init_func
)(
65 struct bt_plugin
*plugin
);
67 /* Plugin exit function type */
68 typedef enum bt_plugin_status (*bt_plugin_exit_func
)(void);
71 * Function to call from a plugin's initialization function to add a
72 * component class to a plugin object.
74 extern enum bt_plugin_status
bt_plugin_add_component_class(
75 struct bt_plugin
*plugin
,
76 struct bt_component_class
*component_class
);
78 /* Plugin descriptor: describes a single plugin (internal use) */
79 struct __bt_plugin_descriptor
{
80 /* Plugin's interface major version number */
83 /* Plugin's interface minor version number */
88 } __attribute__((packed
));
90 /* Type of a plugin attribute (internal use) */
91 enum __bt_plugin_descriptor_attribute_type
{
92 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT
= 0,
93 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT
= 1,
94 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR
= 2,
95 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE
= 3,
96 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION
= 4,
97 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION
= 5,
100 /* Plugin (user) version */
101 struct __bt_plugin_descriptor_version
{
108 /* Plugin attribute (internal use) */
109 struct __bt_plugin_descriptor_attribute
{
110 /* Plugin descriptor to which to associate this attribute */
111 const struct __bt_plugin_descriptor
*plugin_descriptor
;
113 /* Name of the attribute's type for debug purposes */
114 const char *type_name
;
116 /* Attribute's type */
117 enum __bt_plugin_descriptor_attribute_type type
;
119 /* Attribute's value (depends on attribute's type) */
121 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT */
122 bt_plugin_init_func init
;
124 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT */
125 bt_plugin_exit_func exit
;
127 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR */
130 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE */
133 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
134 const char *description
;
136 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION */
137 struct __bt_plugin_descriptor_version version
;
139 } __attribute__((packed
));
141 /* Component class descriptor (internal use) */
142 struct __bt_plugin_component_class_descriptor
{
144 * Plugin descriptor to which to associate this component
147 const struct __bt_plugin_descriptor
*plugin_descriptor
;
149 /* Component class name */
152 /* Component class type */
153 enum bt_component_class_type type
;
155 /* Mandatory methods (depends on component class type) */
157 /* BT_COMPONENT_CLASS_TYPE_SOURCE */
159 bt_component_class_notification_iterator_next_method notif_iter_next
;
162 /* BT_COMPONENT_CLASS_TYPE_FILTER */
164 bt_component_class_notification_iterator_next_method notif_iter_next
;
167 /* BT_COMPONENT_CLASS_TYPE_SINK */
169 bt_component_class_sink_consume_method consume
;
172 } __attribute__((packed
));
174 /* Type of a component class attribute (internal use) */
175 enum __bt_plugin_component_class_descriptor_attribute_type
{
176 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION
= 0,
177 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP
= 1,
178 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD
= 2,
179 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD
= 3,
180 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD
= 4,
181 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_PORT_CONNECTION_METHOD
= 5,
182 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_CONNECTED_METHOD
= 7,
183 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_DISCONNECTED_METHOD
= 8,
184 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD
= 9,
185 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD
= 10,
188 /* Component class attribute (internal use) */
189 struct __bt_plugin_component_class_descriptor_attribute
{
191 * Component class plugin attribute to which to associate this
192 * component class attribute.
194 const struct __bt_plugin_component_class_descriptor
*comp_class_descriptor
;
196 /* Name of the attribute's type for debug purposes */
197 const char *type_name
;
199 /* Attribute's type */
200 enum __bt_plugin_component_class_descriptor_attribute_type type
;
202 /* Attribute's value (depends on attribute's type) */
204 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
205 const char *description
;
207 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP */
210 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD */
211 bt_component_class_init_method init_method
;
213 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD */
214 bt_component_class_finalize_method finalize_method
;
216 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD */
217 bt_component_class_query_method query_method
;
219 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_PORT_CONNECTION_METHOD */
220 bt_component_class_accept_port_connection_method accept_port_connection_method
;
222 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_CONNECTED_METHOD */
223 bt_component_class_port_connected_method port_connected_method
;
225 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_DISCONNECTED_METHOD */
226 bt_component_class_port_disconnected_method port_disconnected_method
;
228 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD */
229 bt_component_class_notification_iterator_init_method notif_iter_init_method
;
231 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD */
232 bt_component_class_notification_iterator_finalize_method notif_iter_finalize_method
;
234 } __attribute__((packed
));
236 struct __bt_plugin_descriptor
const * const *__bt_get_begin_section_plugin_descriptors(void);
237 struct __bt_plugin_descriptor
const * const *__bt_get_end_section_plugin_descriptors(void);
238 struct __bt_plugin_descriptor_attribute
const * const *__bt_get_begin_section_plugin_descriptor_attributes(void);
239 struct __bt_plugin_descriptor_attribute
const * const *__bt_get_end_section_plugin_descriptor_attributes(void);
240 struct __bt_plugin_component_class_descriptor
const * const *__bt_get_begin_section_component_class_descriptors(void);
241 struct __bt_plugin_component_class_descriptor
const * const *__bt_get_end_section_component_class_descriptors(void);
242 struct __bt_plugin_component_class_descriptor_attribute
const * const *__bt_get_begin_section_component_class_descriptor_attributes(void);
243 struct __bt_plugin_component_class_descriptor_attribute
const * const *__bt_get_end_section_component_class_descriptor_attributes(void);
246 * Variable attributes for a plugin descriptor pointer to be added to
247 * the plugin descriptor section (internal use).
250 #define __BT_PLUGIN_DESCRIPTOR_ATTRS \
251 __attribute__((section("__DATA,btp_desc"), used))
253 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL \
254 __start___bt_plugin_descriptors
256 #define __BT_PLUGIN_DESCRIPTOR_END_SYMBOL \
257 __stop___bt_plugin_descriptors
259 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA \
260 __asm("section$start$__DATA$btp_desc")
262 #define __BT_PLUGIN_DESCRIPTOR_END_EXTRA \
263 __asm("section$end$__DATA$btp_desc")
267 #define __BT_PLUGIN_DESCRIPTOR_ATTRS \
268 __attribute__((section("__bt_plugin_descriptors"), used))
270 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL \
271 __start___bt_plugin_descriptors
273 #define __BT_PLUGIN_DESCRIPTOR_END_SYMBOL \
274 __stop___bt_plugin_descriptors
276 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA
278 #define __BT_PLUGIN_DESCRIPTOR_END_EXTRA
282 * Variable attributes for a plugin attribute pointer to be added to
283 * the plugin attribute section (internal use).
286 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS \
287 __attribute__((section("__DATA,btp_desc_att"), used))
289 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
290 __start___bt_plugin_descriptor_attributes
292 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
293 __stop___bt_plugin_descriptor_attributes
295 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA \
296 __asm("section$start$__DATA$btp_desc_att")
298 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA \
299 __asm("section$end$__DATA$btp_desc_att")
303 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS \
304 __attribute__((section("__bt_plugin_descriptor_attributes"), used))
306 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
307 __start___bt_plugin_descriptor_attributes
309 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
310 __stop___bt_plugin_descriptor_attributes
312 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA
314 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA
318 * Variable attributes for a component class descriptor pointer to be
319 * added to the component class descriptor section (internal use).
322 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS \
323 __attribute__((section("__DATA,btp_cc_desc"), used))
325 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL \
326 __start___bt_plugin_component_class_descriptors
328 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL \
329 __stop___bt_plugin_component_class_descriptors
331 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA \
332 __asm("section$start$__DATA$btp_cc_desc")
334 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA \
335 __asm("section$end$__DATA$btp_cc_desc")
339 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS \
340 __attribute__((section("__bt_plugin_component_class_descriptors"), used))
342 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL \
343 __start___bt_plugin_component_class_descriptors
345 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL \
346 __stop___bt_plugin_component_class_descriptors
348 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA
350 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA
354 * Variable attributes for a component class descriptor attribute
355 * pointer to be added to the component class descriptor attribute
356 * section (internal use).
359 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS \
360 __attribute__((section("__DATA,btp_cc_desc_att"), used))
362 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
363 __start___bt_plugin_component_class_descriptor_attributes
365 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
366 __stop___bt_plugin_component_class_descriptor_attributes
368 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA \
369 __asm("section$start$__DATA$btp_cc_desc_att")
371 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_EXTRA \
372 __asm("section$end$__DATA$btp_cc_desc_att")
376 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS \
377 __attribute__((section("__bt_plugin_component_class_descriptor_attributes"), used))
379 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
380 __start___bt_plugin_component_class_descriptor_attributes
382 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
383 __stop___bt_plugin_component_class_descriptor_attributes
385 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA
387 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_EXTRA
391 * Declares a plugin descriptor pointer variable with a custom ID.
393 * _id: ID (any valid C identifier except `auto`).
395 #define BT_PLUGIN_DECLARE(_id) extern struct __bt_plugin_descriptor __bt_plugin_descriptor_##_id
398 * Defines a plugin descriptor with a custom ID.
400 * _id: ID (any valid C identifier except `auto`).
401 * _name: Plugin's name (C string).
403 #define BT_PLUGIN_WITH_ID(_id, _name) \
404 struct __bt_plugin_descriptor __bt_plugin_descriptor_##_id = { \
405 .major = __BT_PLUGIN_VERSION_MAJOR, \
406 .minor = __BT_PLUGIN_VERSION_MINOR, \
409 static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_##_id##_ptr __BT_PLUGIN_DESCRIPTOR_ATTRS = &__bt_plugin_descriptor_##_id
412 * Defines a plugin attribute (generic, internal use).
414 * _attr_name: Name of the attribute (C identifier).
415 * _attr_type: Type of the attribute (enum __bt_plugin_descriptor_attribute_type).
416 * _id: Plugin descriptor ID (C identifier).
419 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _x) \
420 static struct __bt_plugin_descriptor_attribute __bt_plugin_descriptor_attribute_##_id##_##_attr_name = { \
421 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
422 .type_name = #_attr_name, \
423 .type = _attr_type, \
424 .value._attr_name = _x, \
426 static struct __bt_plugin_descriptor_attribute const * const __bt_plugin_descriptor_attribute_##_id##_##_attr_name##_ptr __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS = &__bt_plugin_descriptor_attribute_##_id##_##_attr_name
429 * Defines a plugin initialization function attribute attached to a
430 * specific plugin descriptor.
432 * _id: Plugin descriptor ID (C identifier).
433 * _x: Initialization function (bt_plugin_init_func).
435 #define BT_PLUGIN_INIT_WITH_ID(_id, _x) \
436 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(init, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT, _id, _x)
439 * Defines a plugin exit function attribute attached to a specific
442 * _id: Plugin descriptor ID (C identifier).
443 * _x: Exit function (bt_plugin_exit_func).
445 #define BT_PLUGIN_EXIT_WITH_ID(_id, _x) \
446 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(exit, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT, _id, _x)
449 * Defines an author attribute attached to a specific plugin descriptor.
451 * _id: Plugin descriptor ID (C identifier).
452 * _x: Author (C string).
454 #define BT_PLUGIN_AUTHOR_WITH_ID(_id, _x) \
455 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(author, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR, _id, _x)
458 * Defines a license attribute attached to a specific plugin descriptor.
460 * _id: Plugin descriptor ID (C identifier).
461 * _x: License (C string).
463 #define BT_PLUGIN_LICENSE_WITH_ID(_id, _x) \
464 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(license, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE, _id, _x)
467 * Defines a description attribute attached to a specific plugin
470 * _id: Plugin descriptor ID (C identifier).
471 * _x: Description (C string).
473 #define BT_PLUGIN_DESCRIPTION_WITH_ID(_id, _x) \
474 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _x)
476 #define __BT_PLUGIN_VERSION_STRUCT_VALUE(_major, _minor, _patch, _extra) \
477 {.major = _major, .minor = _minor, .patch = _patch, .extra = _extra,}
480 * Defines a version attribute attached to a specific plugin descriptor.
482 * _id: Plugin descriptor ID (C identifier).
483 * _major: Plugin's major version (uint32_t).
484 * _minor: Plugin's minor version (uint32_t).
485 * _patch: Plugin's patch version (uint32_t).
486 * _extra: Plugin's version extra information (C string).
488 #define BT_PLUGIN_VERSION_WITH_ID(_id, _major, _minor, _patch, _extra) \
489 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(version, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION, _id, __BT_PLUGIN_VERSION_STRUCT_VALUE(_major, _minor, _patch, _extra))
492 * Defines a source component class descriptor with a custom ID.
494 * _id: ID (any valid C identifier except `auto`).
495 * _comp_class_id: Component class ID (C identifier).
496 * _name: Component class name (C string).
497 * _notif_iter_next_method: Component class's iterator next method
498 * (bt_component_class_notification_iterator_next_method).
500 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _notif_iter_next_method) \
501 static struct __bt_plugin_component_class_descriptor __bt_plugin_source_component_class_descriptor_##_id##_##_comp_class_id = { \
502 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
504 .type = BT_COMPONENT_CLASS_TYPE_SOURCE, \
505 .methods.source = { \
506 .notif_iter_next = _notif_iter_next_method, \
509 static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_source_component_class_descriptor_##_id##_##_comp_class_id##_ptr __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = &__bt_plugin_source_component_class_descriptor_##_id##_##_comp_class_id
512 * Defines a filter component class descriptor with a custom ID.
514 * _id: ID (any valid C identifier except `auto`).
515 * _comp_class_id: Component class ID (C identifier).
516 * _name: Component class name (C string).
517 * _notif_iter_next_method: Component class's iterator next method
518 * (bt_component_class_notification_iterator_next_method).
520 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _notif_iter_next_method) \
521 static struct __bt_plugin_component_class_descriptor __bt_plugin_filter_component_class_descriptor_##_id##_##_comp_class_id = { \
522 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
524 .type = BT_COMPONENT_CLASS_TYPE_FILTER, \
525 .methods.filter = { \
526 .notif_iter_next = _notif_iter_next_method, \
529 static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_filter_component_class_descriptor_##_id##_##_comp_class_id##_ptr __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = &__bt_plugin_filter_component_class_descriptor_##_id##_##_comp_class_id
532 * Defines a sink component class descriptor with a custom ID.
534 * _id: ID (any valid C identifier except `auto`).
535 * _comp_class_id: Component class ID (C identifier).
536 * _name: Component class name (C string).
537 * _consume_method: Component class's iterator consume method
538 * (bt_component_class_sink_consume_method).
540 #define BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _consume_method) \
541 static struct __bt_plugin_component_class_descriptor __bt_plugin_sink_component_class_descriptor_##_id##_##_comp_class_id = { \
542 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
544 .type = BT_COMPONENT_CLASS_TYPE_SINK, \
546 .consume = _consume_method, \
549 static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_sink_component_class_descriptor_##_id##_##_comp_class_id##_ptr __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = &__bt_plugin_sink_component_class_descriptor_##_id##_##_comp_class_id
552 * Defines a component class descriptor attribute (generic, internal
555 * _id: Plugin descriptor ID (C identifier).
556 * _comp_class_id: Component class ID (C identifier).
557 * _type: Component class type (`source`, `filter`, or `sink`).
558 * _attr_name: Name of the attribute (C identifier).
559 * _attr_type: Type of the attribute
560 * (enum __bt_plugin_descriptor_attribute_type).
563 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _comp_class_id, _type, _x) \
564 static struct __bt_plugin_component_class_descriptor_attribute __bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_comp_class_id##_##_attr_name = { \
565 .comp_class_descriptor = &__bt_plugin_##_type##_component_class_descriptor_##_id##_##_comp_class_id, \
566 .type_name = #_attr_name, \
567 .type = _attr_type, \
568 .value._attr_name = _x, \
570 static struct __bt_plugin_component_class_descriptor_attribute const * const __bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_comp_class_id##_##_attr_name##_ptr __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS = &__bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_comp_class_id##_##_attr_name
573 * Defines a description attribute attached to a specific source
574 * component class descriptor.
576 * _id: Plugin descriptor ID (C identifier).
577 * _comp_class_id: Component class descriptor ID (C identifier).
578 * _x: Description (C string).
580 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
581 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, source, _x)
584 * Defines a description attribute attached to a specific filter
585 * component class descriptor.
587 * _id: Plugin descriptor ID (C identifier).
588 * _comp_class_id: Component class descriptor ID (C identifier).
589 * _x: Description (C string).
591 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
592 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, filter, _x)
595 * Defines a description attribute attached to a specific sink
596 * component class descriptor.
598 * _id: Plugin descriptor ID (C identifier).
599 * _comp_class_id: Component class descriptor ID (C identifier).
600 * _x: Description (C string).
602 #define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
603 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, sink, _x)
606 * Defines a help attribute attached to a specific source component
609 * _id: Plugin descriptor ID (C identifier).
610 * _comp_class_id: Component class descriptor ID (C identifier).
611 * _x: Help (C string).
613 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID(_id, _comp_class_id, _x) \
614 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _id, _comp_class_id, source, _x)
617 * Defines a help attribute attached to a specific filter component
620 * _id: Plugin descriptor ID (C identifier).
621 * _comp_class_id: Component class descriptor ID (C identifier).
622 * _x: Help (C string).
624 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID(_id, _comp_class_id, _x) \
625 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _id, _comp_class_id, filter, _x)
628 * Defines a help attribute attached to a specific sink component class
631 * _id: Plugin descriptor ID (C identifier).
632 * _comp_class_id: Component class descriptor ID (C identifier).
633 * _x: Help (C string).
635 #define BT_PLUGIN_SINK_COMPONENT_CLASS_HELP_WITH_ID(_id, _comp_class_id, _x) \
636 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _id, _comp_class_id, sink, _x)
639 * Defines an initialization method attribute attached to a specific
640 * source component class descriptor.
642 * _id: Plugin descriptor ID (C identifier).
643 * _comp_class_id: Component class descriptor ID (C identifier).
644 * _x: Initialization method (bt_component_class_init_method).
646 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
647 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, source, _x)
650 * Defines an initialization method attribute attached to a specific
651 * filter component class descriptor.
653 * _id: Plugin descriptor ID (C identifier).
654 * _comp_class_id: Component class descriptor ID (C identifier).
655 * _x: Initialization method (bt_component_class_init_method).
657 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
658 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, filter, _x)
661 * Defines an initialization method attribute attached to a specific
662 * sink component class descriptor.
664 * _id: Plugin descriptor ID (C identifier).
665 * _comp_class_id: Component class descriptor ID (C identifier).
666 * _x: Initialization method (bt_component_class_init_method).
668 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
669 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, sink, _x)
672 * Defines a finalize method attribute attached to a specific source
673 * component class descriptor.
675 * _id: Plugin descriptor ID (C identifier).
676 * _comp_class_id: Component class descriptor ID (C identifier).
677 * _x: Finalize method (bt_component_class_finalize_method).
679 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
680 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, source, _x)
683 * Defines a finalize method attribute attached to a specific filter
684 * component class descriptor.
686 * _id: Plugin descriptor ID (C identifier).
687 * _comp_class_id: Component class descriptor ID (C identifier).
688 * _x: Finalize method (bt_component_class_finalize_method).
690 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
691 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, filter, _x)
694 * Defines a finalize method attribute attached to a specific sink
695 * component class descriptor.
697 * _id: Plugin descriptor ID (C identifier).
698 * _comp_class_id: Component class descriptor ID (C identifier).
699 * _x: Finalize method (bt_component_class_finalize_method).
701 #define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
702 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, sink, _x)
705 * Defines a query method attribute attached to a specific source
706 * component class descriptor.
708 * _id: Plugin descriptor ID (C identifier).
709 * _comp_class_id: Component class descriptor ID (C identifier).
710 * _x: Finalize method (bt_component_class_query_method).
712 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
713 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, source, _x)
716 * Defines a query method attribute attached to a specific filter
717 * component class descriptor.
719 * _id: Plugin descriptor ID (C identifier).
720 * _comp_class_id: Component class descriptor ID (C identifier).
721 * _x: Finalize method (bt_component_class_query_method).
723 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
724 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, filter, _x)
727 * Defines a query method attribute attached to a specific sink
728 * component class descriptor.
730 * _id: Plugin descriptor ID (C identifier).
731 * _comp_class_id: Component class descriptor ID (C identifier).
732 * _x: Finalize method (bt_component_class_query_method).
734 #define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
735 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, sink, _x)
738 * Defines an accept port connection method attribute attached to a
739 * specific source component class descriptor.
741 * _id: Plugin descriptor ID (C identifier).
742 * _comp_class_id: Component class descriptor ID (C identifier).
743 * _x: Accept port connection method
744 * (bt_component_class_accept_port_connection_method).
746 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
747 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(accept_port_connection_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_PORT_CONNECTION_METHOD, _id, _comp_class_id, source, _x)
750 * Defines an accept port connection method attribute attached to a
751 * specific filter component class descriptor.
753 * _id: Plugin descriptor ID (C identifier).
754 * _comp_class_id: Component class descriptor ID (C identifier).
755 * _x: Accept port connection method
756 * (bt_component_class_accept_port_connection_method).
758 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
759 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(accept_port_connection_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_PORT_CONNECTION_METHOD, _id, _comp_class_id, filter, _x)
762 * Defines an accept port connection method attribute attached to a
763 * specific sink component class descriptor.
765 * _id: Plugin descriptor ID (C identifier).
766 * _comp_class_id: Component class descriptor ID (C identifier).
767 * _x: Accept port connection method
768 * (bt_component_class_accept_port_connection_method).
770 #define BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
771 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(accept_port_connection_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_PORT_CONNECTION_METHOD, _id, _comp_class_id, sink, _x)
774 * Defines a port connected method attribute attached to a specific
775 * source component class descriptor.
777 * _id: Plugin descriptor ID (C identifier).
778 * _comp_class_id: Component class descriptor ID (C identifier).
779 * _x: Port connected method
780 * (bt_component_class_port_connected_method).
782 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
783 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_CONNECTED_METHOD, _id, _comp_class_id, source, _x)
786 * Defines a port connected method attribute attached to a specific
787 * filter component class descriptor.
789 * _id: Plugin descriptor ID (C identifier).
790 * _comp_class_id: Component class descriptor ID (C identifier).
791 * _x: Port connected method
792 * (bt_component_class_port_connected_method).
794 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
795 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_CONNECTED_METHOD, _id, _comp_class_id, filter, _x)
798 * Defines a port connected method attribute attached to a specific
799 * sink component class descriptor.
801 * _id: Plugin descriptor ID (C identifier).
802 * _comp_class_id: Component class descriptor ID (C identifier).
803 * _x: Port connected method
804 * (bt_component_class_port_connected_method).
806 #define BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
807 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_CONNECTED_METHOD, _id, _comp_class_id, sink, _x)
810 * Defines a port disconnected method attribute attached to a specific
811 * source component class descriptor.
813 * _id: Plugin descriptor ID (C identifier).
814 * _comp_class_id: Component class descriptor ID (C identifier).
815 * _x: Port disconnected method
816 * (bt_component_class_port_disconnected_method).
818 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
819 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(port_disconnected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_DISCONNECTED_METHOD, _id, _comp_class_id, source, _x)
822 * Defines a port disconnected method attribute attached to a specific
823 * filter component class descriptor.
825 * _id: Plugin descriptor ID (C identifier).
826 * _comp_class_id: Component class descriptor ID (C identifier).
827 * _x: Port disconnected method
828 * (bt_component_class_port_disconnected_method).
830 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
831 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(port_disconnected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_DISCONNECTED_METHOD, _id, _comp_class_id, filter, _x)
834 * Defines a port disconnected method attribute attached to a specific
835 * sink component class descriptor.
837 * _id: Plugin descriptor ID (C identifier).
838 * _comp_class_id: Component class descriptor ID (C identifier).
839 * _x: Port disconnected method
840 * (bt_component_class_port_disconnected_method).
842 #define BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
843 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(port_disconnected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_DISCONNECTED_METHOD, _id, _comp_class_id, sink, _x)
846 * Defines an iterator initialization method attribute attached to a
847 * specific source component class descriptor.
849 * _id: Plugin descriptor ID (C identifier).
850 * _comp_class_id: Component class descriptor ID (C identifier).
851 * _x: Iterator initialization method
852 * (bt_component_class_notification_iterator_init_method).
854 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
855 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(notif_iter_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD, _id, _comp_class_id, source, _x)
858 * Defines an iterator finalize method attribute attached to a specific
859 * source component class descriptor.
861 * _id: Plugin descriptor ID (C identifier).
862 * _comp_class_id: Component class descriptor ID (C identifier).
863 * _x: Iterator finalize method
864 * (bt_component_class_notification_iterator_finalize_method).
866 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
867 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(notif_iter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD, _id, _comp_class_id, source, _x)
870 * Defines an iterator initialization method attribute attached to a
871 * specific filter component class descriptor.
873 * _id: Plugin descriptor ID (C identifier).
874 * _comp_class_id: Component class descriptor ID (C identifier).
875 * _x: Iterator initialization method
876 * (bt_component_class_notification_iterator_init_method).
878 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
879 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(notif_iter_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD, _id, _comp_class_id, filter, _x)
882 * Defines an iterator finalize method attribute attached to a specific
883 * filter component class descriptor.
885 * _id: Plugin descriptor ID (C identifier).
886 * _comp_class_id: Component class descriptor ID (C identifier).
887 * _x: Iterator finalize method
888 * (bt_component_class_notification_iterator_finalize_method).
890 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
891 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(notif_iter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD, _id, _comp_class_id, filter, _x)
894 * Defines a plugin descriptor with an automatic ID.
896 * _name: Plugin's name (C string).
898 #define BT_PLUGIN(_name) static BT_PLUGIN_WITH_ID(auto, #_name)
901 * Defines a plugin initialization function attribute attached to the
902 * automatic plugin descriptor.
904 * _x: Initialization function (bt_plugin_init_func).
906 #define BT_PLUGIN_INIT(_x) BT_PLUGIN_INIT_WITH_ID(auto, _x)
909 * Defines a plugin exit function attribute attached to the automatic
912 * _x: Exit function (bt_plugin_exit_func).
914 #define BT_PLUGIN_EXIT(_x) BT_PLUGIN_EXIT_WITH_ID(auto, _x)
917 * Defines an author attribute attached to the automatic plugin
920 * _x: Author (C string).
922 #define BT_PLUGIN_AUTHOR(_x) BT_PLUGIN_AUTHOR_WITH_ID(auto, _x)
925 * Defines a license attribute attached to the automatic plugin
928 * _x: License (C string).
930 #define BT_PLUGIN_LICENSE(_x) BT_PLUGIN_LICENSE_WITH_ID(auto, _x)
933 * Defines a description attribute attached to the automatic plugin
936 * _x: Description (C string).
938 #define BT_PLUGIN_DESCRIPTION(_x) BT_PLUGIN_DESCRIPTION_WITH_ID(auto, _x)
941 * Defines a version attribute attached to the automatic plugin
944 * _major: Plugin's major version (uint32_t).
945 * _minor: Plugin's minor version (uint32_t).
946 * _patch: Plugin's patch version (uint32_t).
947 * _extra: Plugin's version extra information (C string).
949 #define BT_PLUGIN_VERSION(_major, _minor, _patch, _extra) BT_PLUGIN_VERSION_WITH_ID(auto, _major, _minor, _patch, _extra)
952 * Defines a source component class attached to the automatic plugin
953 * descriptor. Its ID is the same as its name, hence its name must be a
954 * C identifier in this version.
956 * _name: Component class name (C identifier).
957 * _notif_iter_next_method: Component class's iterator next method
958 * (bt_component_class_notification_iterator_next_method).
960 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS(_name, _notif_iter_next_method) \
961 BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _notif_iter_next_method)
964 * Defines a filter component class attached to the automatic plugin
965 * descriptor. Its ID is the same as its name, hence its name must be a
966 * C identifier in this version.
968 * _name: Component class name (C identifier).
969 * _notif_iter_next_method: Component class's iterator next method
970 * (bt_component_class_notification_iterator_next_method).
972 #define BT_PLUGIN_FILTER_COMPONENT_CLASS(_name, _notif_iter_next_method) \
973 BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _notif_iter_next_method)
976 * Defines a sink component class attached to the automatic plugin
977 * descriptor. Its ID is the same as its name, hence its name must be a
978 * C identifier in this version.
980 * _name: Component class name (C identifier).
981 * _consume_method: Component class's consume method
982 * (bt_component_class_sink_consume_method).
984 #define BT_PLUGIN_SINK_COMPONENT_CLASS(_name, _consume_method) \
985 BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _consume_method)
988 * Defines a description attribute attached to a source component class
989 * descriptor which is attached to the automatic plugin descriptor.
991 * _name: Component class name (C identifier).
992 * _x: Description (C string).
994 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
995 BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
998 * Defines a description attribute attached to a filter component class
999 * descriptor which is attached to the automatic plugin descriptor.
1001 * _name: Component class name (C identifier).
1002 * _x: Description (C string).
1004 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
1005 BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
1008 * Defines a description attribute attached to a sink component class
1009 * descriptor which is attached to the automatic plugin descriptor.
1011 * _name: Component class name (C identifier).
1012 * _x: Description (C string).
1014 #define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
1015 BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
1018 * Defines a help attribute attached to a source component class
1019 * descriptor which is attached to the automatic plugin descriptor.
1021 * _name: Component class name (C identifier).
1022 * _x: Help (C string).
1024 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP(_name, _x) \
1025 BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
1028 * Defines a help attribute attached to a filter component class
1029 * descriptor which is attached to the automatic plugin descriptor.
1031 * _name: Component class name (C identifier).
1032 * _x: Help (C string).
1034 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP(_name, _x) \
1035 BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
1038 * Defines a help attribute attached to a sink component class
1039 * descriptor which is attached to the automatic plugin descriptor.
1041 * _name: Component class name (C identifier).
1042 * _x: Help (C string).
1044 #define BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(_name, _x) \
1045 BT_PLUGIN_SINK_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
1048 * Defines an initialization method attribute attached to a source
1049 * component class descriptor which is attached to the automatic plugin
1052 * _name: Component class name (C identifier).
1053 * _x: Initialization method (bt_component_class_init_method).
1055 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
1056 BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
1059 * Defines an initialization method attribute attached to a filter
1060 * component class descriptor which is attached to the automatic plugin
1063 * _name: Component class name (C identifier).
1064 * _x: Initialization method (bt_component_class_init_method).
1066 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
1067 BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
1070 * Defines an initialization method attribute attached to a sink
1071 * component class descriptor which is attached to the automatic plugin
1074 * _name: Component class name (C identifier).
1075 * _x: Initialization method (bt_component_class_init_method).
1077 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
1078 BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
1081 * Defines a finalize method attribute attached to a source component
1082 * class descriptor which is attached to the automatic plugin
1085 * _name: Component class name (C identifier).
1086 * _x: Initialization method (bt_component_class_finalize_method).
1088 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
1089 BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1092 * Defines a finalize method attribute attached to a filter component
1093 * class descriptor which is attached to the automatic plugin
1096 * _name: Component class name (C identifier).
1097 * _x: Initialization method (bt_component_class_finalize_method).
1099 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
1100 BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1103 * Defines a finalize method attribute attached to a sink component class
1104 * descriptor which is attached to the automatic plugin descriptor.
1106 * _name: Component class name (C identifier).
1107 * _x: Initialization method (bt_component_class_finalize_method).
1109 #define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
1110 BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1113 * Defines a query method attribute attached to a source component
1114 * class descriptor which is attached to the automatic plugin
1117 * _name: Component class name (C identifier).
1118 * _x: Initialization method (bt_component_class_query_method).
1120 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1121 BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
1124 * Defines a query method attribute attached to a filter component
1125 * class descriptor which is attached to the automatic plugin
1128 * _name: Component class name (C identifier).
1129 * _x: Initialization method (bt_component_class_query_method).
1131 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1132 BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
1135 * Defines a query method attribute attached to a sink component
1136 * class descriptor which is attached to the automatic plugin
1139 * _name: Component class name (C identifier).
1140 * _x: Initialization method (bt_component_class_query_method).
1142 #define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1143 BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
1146 * Defines an accept port connection method attribute attached to a
1147 * source component class descriptor which is attached to the automatic
1148 * plugin descriptor.
1150 * _name: Component class name (C identifier).
1151 * _x: Accept port connection method
1152 * (bt_component_class_accept_port_connection_method).
1154 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD(_name, _x) \
1155 BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1158 * Defines an accept port connection method attribute attached to a
1159 * filter component class descriptor which is attached to the automatic
1160 * plugin descriptor.
1162 * _name: Component class name (C identifier).
1163 * _x: Accept port connection method
1164 * (bt_component_class_accept_port_connection_method).
1166 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD(_name, _x) \
1167 BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1170 * Defines an accept port connection method attribute attached to a sink
1171 * component class descriptor which is attached to the automatic plugin
1174 * _name: Component class name (C identifier).
1175 * _x: Accept port connection method
1176 * (bt_component_class_accept_port_connection_method).
1178 #define BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD(_name, _x) \
1179 BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1182 * Defines a port connected method attribute attached to a source
1183 * component class descriptor which is attached to the automatic plugin
1186 * _name: Component class name (C identifier).
1187 * _x: Port connected (bt_component_class_port_connected_method).
1189 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_CONNECTED_METHOD(_name, _x) \
1190 BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1193 * Defines a port connected method attribute attached to a filter
1194 * component class descriptor which is attached to the automatic plugin
1197 * _name: Component class name (C identifier).
1198 * _x: Port connected (bt_component_class_port_connected_method).
1200 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_CONNECTED_METHOD(_name, _x) \
1201 BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1204 * Defines a port connected method attribute attached to a sink
1205 * component class descriptor which is attached to the automatic plugin
1208 * _name: Component class name (C identifier).
1209 * _x: Port connected (bt_component_class_port_connected_method).
1211 #define BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_CONNECTED_METHOD(_name, _x) \
1212 BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1215 * Defines a port disconnected method attribute attached to a source
1216 * component class descriptor which is attached to the automatic plugin
1219 * _name: Component class name (C identifier).
1220 * _x: Port disconnected (bt_component_class_port_disconnected_method).
1222 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD(_name, _x) \
1223 BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
1226 * Defines a port disconnected method attribute attached to a filter
1227 * component class descriptor which is attached to the automatic plugin
1230 * _name: Component class name (C identifier).
1231 * _x: Port disconnected (bt_component_class_port_disconnected_method).
1233 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD(_name, _x) \
1234 BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
1237 * Defines a port disconnected method attribute attached to a sink
1238 * component class descriptor which is attached to the automatic plugin
1241 * _name: Component class name (C identifier).
1242 * _x: Port disconnected (bt_component_class_port_disconnected_method).
1244 #define BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD(_name, _x) \
1245 BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
1248 * Defines an iterator initialization method attribute attached to a
1249 * source component class descriptor which is attached to the automatic
1250 * plugin descriptor.
1252 * _name: Component class name (C identifier).
1253 * _x: Iterator initialization method
1254 * (bt_component_class_notification_iterator_init_method).
1256 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(_name, _x) \
1257 BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
1260 * Defines an iterator finalize method attribute attached to a source
1261 * component class descriptor which is attached to the automatic plugin
1264 * _name: Component class name (C identifier).
1265 * _x: Iterator finalize method
1266 * (bt_component_class_notification_iterator_finalize_method).
1268 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(_name, _x) \
1269 BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1272 * Defines an iterator initialization method attribute attached to a
1273 * filter component class descriptor which is attached to the automatic
1274 * plugin descriptor.
1276 * _name: Component class name (C identifier).
1277 * _x: Iterator initialization method
1278 * (bt_component_class_notification_iterator_init_method).
1280 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(_name, _x) \
1281 BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
1284 * Defines an iterator finalize method attribute attached to a filter
1285 * component class descriptor which is attached to the automatic plugin
1288 * _name: Component class name (C identifier).
1289 * _x: Iterator finalize method
1290 * (bt_component_class_notification_iterator_finalize_method).
1292 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(_name, _x) \
1293 BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1295 #define BT_PLUGIN_MODULE() \
1296 static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_dummy __BT_PLUGIN_DESCRIPTOR_ATTRS = NULL; \
1297 _BT_HIDDEN extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA; \
1298 _BT_HIDDEN extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_END_EXTRA; \
1300 static struct __bt_plugin_descriptor_attribute const * const __bt_plugin_descriptor_attribute_dummy __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS = NULL; \
1301 _BT_HIDDEN extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA; \
1302 _BT_HIDDEN extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA; \
1304 static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_component_class_descriptor_dummy __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = NULL; \
1305 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA; \
1306 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA; \
1308 static struct __bt_plugin_component_class_descriptor_attribute const * const __bt_plugin_component_class_descriptor_attribute_dummy __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS = NULL; \
1309 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor_attribute const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA; \
1310 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor_attribute const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_EXTRA; \
1312 struct __bt_plugin_descriptor const * const *__bt_get_begin_section_plugin_descriptors(void) \
1314 return &__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL; \
1316 struct __bt_plugin_descriptor const * const *__bt_get_end_section_plugin_descriptors(void) \
1318 return &__BT_PLUGIN_DESCRIPTOR_END_SYMBOL; \
1320 struct __bt_plugin_descriptor_attribute const * const *__bt_get_begin_section_plugin_descriptor_attributes(void) \
1322 return &__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL; \
1324 struct __bt_plugin_descriptor_attribute const * const *__bt_get_end_section_plugin_descriptor_attributes(void) \
1326 return &__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL; \
1328 struct __bt_plugin_component_class_descriptor const * const *__bt_get_begin_section_component_class_descriptors(void) \
1330 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL; \
1332 struct __bt_plugin_component_class_descriptor const * const *__bt_get_end_section_component_class_descriptors(void) \
1334 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL; \
1336 struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_begin_section_component_class_descriptor_attributes(void) \
1338 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL; \
1340 struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_end_section_component_class_descriptor_attributes(void) \
1342 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL; \
1349 #endif /* BABELTRACE_PLUGIN_PLUGIN_DEV_H */