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
36 /* For enum bt_plugin_status */
37 #include <babeltrace/plugin/plugin.h>
39 /* For component class method type definitions */
40 #include <babeltrace/graph/component-class.h>
41 #include <babeltrace/graph/component-class-source.h>
42 #include <babeltrace/graph/component-class-filter.h>
43 #include <babeltrace/graph/component-class-sink.h>
46 * _BT_HIDDEN: set the hidden attribute for internal functions
47 * On Windows, symbols are local unless explicitly exported,
48 * see https://gcc.gnu.org/wiki/Visibility
50 #if defined(_WIN32) || defined(__CYGWIN__)
53 #define _BT_HIDDEN __attribute__((visibility("hidden")))
61 * Plugin interface's version, not synced with Babeltrace's version
64 #define __BT_PLUGIN_VERSION_MAJOR 1
65 #define __BT_PLUGIN_VERSION_MINOR 0
67 /* Plugin initialization function type */
68 typedef enum bt_plugin_status (*bt_plugin_init_func
)(
69 struct bt_plugin
*plugin
);
71 /* Plugin exit function type */
72 typedef enum bt_plugin_status (*bt_plugin_exit_func
)(void);
75 * Function to call from a plugin's initialization function to add a
76 * component class to a plugin object.
78 extern enum bt_plugin_status
bt_plugin_add_component_class(
79 struct bt_plugin
*plugin
,
80 struct bt_component_class
*component_class
);
82 /* Plugin descriptor: describes a single plugin (internal use) */
83 struct __bt_plugin_descriptor
{
84 /* Plugin's interface major version number */
87 /* Plugin's interface minor version number */
92 } __attribute__((packed
));
94 /* Type of a plugin attribute (internal use) */
95 enum __bt_plugin_descriptor_attribute_type
{
96 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT
= 0,
97 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT
= 1,
98 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR
= 2,
99 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE
= 3,
100 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION
= 4,
101 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION
= 5,
104 /* Plugin (user) version */
105 struct __bt_plugin_descriptor_version
{
112 /* Plugin attribute (internal use) */
113 struct __bt_plugin_descriptor_attribute
{
114 /* Plugin descriptor to which to associate this attribute */
115 const struct __bt_plugin_descriptor
*plugin_descriptor
;
117 /* Name of the attribute's type for debug purposes */
118 const char *type_name
;
120 /* Attribute's type */
121 enum __bt_plugin_descriptor_attribute_type type
;
123 /* Attribute's value (depends on attribute's type) */
125 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT */
126 bt_plugin_init_func init
;
128 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT */
129 bt_plugin_exit_func exit
;
131 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR */
134 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE */
137 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
138 const char *description
;
140 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION */
141 struct __bt_plugin_descriptor_version version
;
143 } __attribute__((packed
));
145 /* Component class descriptor (internal use) */
146 struct __bt_plugin_component_class_descriptor
{
148 * Plugin descriptor to which to associate this component
151 const struct __bt_plugin_descriptor
*plugin_descriptor
;
153 /* Component class name */
156 /* Component class type */
157 enum bt_component_class_type type
;
159 /* Mandatory methods (depends on component class type) */
161 /* BT_COMPONENT_CLASS_TYPE_SOURCE */
163 bt_component_class_notification_iterator_next_method notif_iter_next
;
166 /* BT_COMPONENT_CLASS_TYPE_FILTER */
168 bt_component_class_notification_iterator_next_method notif_iter_next
;
171 /* BT_COMPONENT_CLASS_TYPE_SINK */
173 bt_component_class_sink_consume_method consume
;
176 } __attribute__((packed
));
178 /* Type of a component class attribute (internal use) */
179 enum __bt_plugin_component_class_descriptor_attribute_type
{
180 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION
= 0,
181 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP
= 1,
182 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD
= 2,
183 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD
= 3,
184 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD
= 4,
185 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_PORT_CONNECTION_METHOD
= 5,
186 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_CONNECTED_METHOD
= 7,
187 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_DISCONNECTED_METHOD
= 8,
188 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD
= 9,
189 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD
= 10,
192 /* Component class attribute (internal use) */
193 struct __bt_plugin_component_class_descriptor_attribute
{
195 * Component class plugin attribute to which to associate this
196 * component class attribute.
198 const struct __bt_plugin_component_class_descriptor
*comp_class_descriptor
;
200 /* Name of the attribute's type for debug purposes */
201 const char *type_name
;
203 /* Attribute's type */
204 enum __bt_plugin_component_class_descriptor_attribute_type type
;
206 /* Attribute's value (depends on attribute's type) */
208 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
209 const char *description
;
211 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP */
214 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD */
215 bt_component_class_init_method init_method
;
217 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD */
218 bt_component_class_finalize_method finalize_method
;
220 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD */
221 bt_component_class_query_method query_method
;
223 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_PORT_CONNECTION_METHOD */
224 bt_component_class_accept_port_connection_method accept_port_connection_method
;
226 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_CONNECTED_METHOD */
227 bt_component_class_port_connected_method port_connected_method
;
229 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_DISCONNECTED_METHOD */
230 bt_component_class_port_disconnected_method port_disconnected_method
;
232 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD */
233 bt_component_class_notification_iterator_init_method notif_iter_init_method
;
235 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD */
236 bt_component_class_notification_iterator_finalize_method notif_iter_finalize_method
;
238 } __attribute__((packed
));
240 struct __bt_plugin_descriptor
const * const *__bt_get_begin_section_plugin_descriptors(void);
241 struct __bt_plugin_descriptor
const * const *__bt_get_end_section_plugin_descriptors(void);
242 struct __bt_plugin_descriptor_attribute
const * const *__bt_get_begin_section_plugin_descriptor_attributes(void);
243 struct __bt_plugin_descriptor_attribute
const * const *__bt_get_end_section_plugin_descriptor_attributes(void);
244 struct __bt_plugin_component_class_descriptor
const * const *__bt_get_begin_section_component_class_descriptors(void);
245 struct __bt_plugin_component_class_descriptor
const * const *__bt_get_end_section_component_class_descriptors(void);
246 struct __bt_plugin_component_class_descriptor_attribute
const * const *__bt_get_begin_section_component_class_descriptor_attributes(void);
247 struct __bt_plugin_component_class_descriptor_attribute
const * const *__bt_get_end_section_component_class_descriptor_attributes(void);
250 * Variable attributes for a plugin descriptor pointer to be added to
251 * the plugin descriptor section (internal use).
254 #define __BT_PLUGIN_DESCRIPTOR_ATTRS \
255 __attribute__((section("__DATA,btp_desc"), used))
257 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL \
258 __start___bt_plugin_descriptors
260 #define __BT_PLUGIN_DESCRIPTOR_END_SYMBOL \
261 __stop___bt_plugin_descriptors
263 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA \
264 __asm("section$start$__DATA$btp_desc")
266 #define __BT_PLUGIN_DESCRIPTOR_END_EXTRA \
267 __asm("section$end$__DATA$btp_desc")
271 #define __BT_PLUGIN_DESCRIPTOR_ATTRS \
272 __attribute__((section("__bt_plugin_descriptors"), used))
274 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL \
275 __start___bt_plugin_descriptors
277 #define __BT_PLUGIN_DESCRIPTOR_END_SYMBOL \
278 __stop___bt_plugin_descriptors
280 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA
282 #define __BT_PLUGIN_DESCRIPTOR_END_EXTRA
286 * Variable attributes for a plugin attribute pointer to be added to
287 * the plugin attribute section (internal use).
290 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS \
291 __attribute__((section("__DATA,btp_desc_att"), used))
293 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
294 __start___bt_plugin_descriptor_attributes
296 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
297 __stop___bt_plugin_descriptor_attributes
299 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA \
300 __asm("section$start$__DATA$btp_desc_att")
302 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA \
303 __asm("section$end$__DATA$btp_desc_att")
307 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS \
308 __attribute__((section("__bt_plugin_descriptor_attributes"), used))
310 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
311 __start___bt_plugin_descriptor_attributes
313 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
314 __stop___bt_plugin_descriptor_attributes
316 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA
318 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA
322 * Variable attributes for a component class descriptor pointer to be
323 * added to the component class descriptor section (internal use).
326 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS \
327 __attribute__((section("__DATA,btp_cc_desc"), used))
329 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL \
330 __start___bt_plugin_component_class_descriptors
332 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL \
333 __stop___bt_plugin_component_class_descriptors
335 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA \
336 __asm("section$start$__DATA$btp_cc_desc")
338 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA \
339 __asm("section$end$__DATA$btp_cc_desc")
343 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS \
344 __attribute__((section("__bt_plugin_component_class_descriptors"), used))
346 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL \
347 __start___bt_plugin_component_class_descriptors
349 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL \
350 __stop___bt_plugin_component_class_descriptors
352 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA
354 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA
358 * Variable attributes for a component class descriptor attribute
359 * pointer to be added to the component class descriptor attribute
360 * section (internal use).
363 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS \
364 __attribute__((section("__DATA,btp_cc_desc_att"), used))
366 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
367 __start___bt_plugin_component_class_descriptor_attributes
369 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
370 __stop___bt_plugin_component_class_descriptor_attributes
372 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA \
373 __asm("section$start$__DATA$btp_cc_desc_att")
375 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_EXTRA \
376 __asm("section$end$__DATA$btp_cc_desc_att")
380 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS \
381 __attribute__((section("__bt_plugin_component_class_descriptor_attributes"), used))
383 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
384 __start___bt_plugin_component_class_descriptor_attributes
386 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
387 __stop___bt_plugin_component_class_descriptor_attributes
389 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA
391 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_EXTRA
395 * Declares a plugin descriptor pointer variable with a custom ID.
397 * _id: ID (any valid C identifier except `auto`).
399 #define BT_PLUGIN_DECLARE(_id) extern struct __bt_plugin_descriptor __bt_plugin_descriptor_##_id
402 * Defines a plugin descriptor with a custom ID.
404 * _id: ID (any valid C identifier except `auto`).
405 * _name: Plugin's name (C string).
407 #define BT_PLUGIN_WITH_ID(_id, _name) \
408 struct __bt_plugin_descriptor __bt_plugin_descriptor_##_id = { \
409 .major = __BT_PLUGIN_VERSION_MAJOR, \
410 .minor = __BT_PLUGIN_VERSION_MINOR, \
413 static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_##_id##_ptr __BT_PLUGIN_DESCRIPTOR_ATTRS = &__bt_plugin_descriptor_##_id
416 * Defines a plugin attribute (generic, internal use).
418 * _attr_name: Name of the attribute (C identifier).
419 * _attr_type: Type of the attribute (enum __bt_plugin_descriptor_attribute_type).
420 * _id: Plugin descriptor ID (C identifier).
423 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _x) \
424 static struct __bt_plugin_descriptor_attribute __bt_plugin_descriptor_attribute_##_id##_##_attr_name = { \
425 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
426 .type_name = #_attr_name, \
427 .type = _attr_type, \
428 .value._attr_name = _x, \
430 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
433 * Defines a plugin initialization function attribute attached to a
434 * specific plugin descriptor.
436 * _id: Plugin descriptor ID (C identifier).
437 * _x: Initialization function (bt_plugin_init_func).
439 #define BT_PLUGIN_INIT_WITH_ID(_id, _x) \
440 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(init, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT, _id, _x)
443 * Defines a plugin exit function attribute attached to a specific
446 * _id: Plugin descriptor ID (C identifier).
447 * _x: Exit function (bt_plugin_exit_func).
449 #define BT_PLUGIN_EXIT_WITH_ID(_id, _x) \
450 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(exit, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT, _id, _x)
453 * Defines an author attribute attached to a specific plugin descriptor.
455 * _id: Plugin descriptor ID (C identifier).
456 * _x: Author (C string).
458 #define BT_PLUGIN_AUTHOR_WITH_ID(_id, _x) \
459 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(author, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR, _id, _x)
462 * Defines a license attribute attached to a specific plugin descriptor.
464 * _id: Plugin descriptor ID (C identifier).
465 * _x: License (C string).
467 #define BT_PLUGIN_LICENSE_WITH_ID(_id, _x) \
468 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(license, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE, _id, _x)
471 * Defines a description attribute attached to a specific plugin
474 * _id: Plugin descriptor ID (C identifier).
475 * _x: Description (C string).
477 #define BT_PLUGIN_DESCRIPTION_WITH_ID(_id, _x) \
478 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _x)
480 #define __BT_PLUGIN_VERSION_STRUCT_VALUE(_major, _minor, _patch, _extra) \
481 {.major = _major, .minor = _minor, .patch = _patch, .extra = _extra,}
484 * Defines a version attribute attached to a specific plugin descriptor.
486 * _id: Plugin descriptor ID (C identifier).
487 * _major: Plugin's major version (uint32_t).
488 * _minor: Plugin's minor version (uint32_t).
489 * _patch: Plugin's patch version (uint32_t).
490 * _extra: Plugin's version extra information (C string).
492 #define BT_PLUGIN_VERSION_WITH_ID(_id, _major, _minor, _patch, _extra) \
493 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(version, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION, _id, __BT_PLUGIN_VERSION_STRUCT_VALUE(_major, _minor, _patch, _extra))
496 * Defines a source component class descriptor with a custom ID.
498 * _id: ID (any valid C identifier except `auto`).
499 * _comp_class_id: Component class ID (C identifier).
500 * _name: Component class name (C string).
501 * _notif_iter_next_method: Component class's iterator next method
502 * (bt_component_class_notification_iterator_next_method).
504 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _notif_iter_next_method) \
505 static struct __bt_plugin_component_class_descriptor __bt_plugin_source_component_class_descriptor_##_id##_##_comp_class_id = { \
506 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
508 .type = BT_COMPONENT_CLASS_TYPE_SOURCE, \
509 .methods.source = { \
510 .notif_iter_next = _notif_iter_next_method, \
513 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
516 * Defines a filter component class descriptor with a custom ID.
518 * _id: ID (any valid C identifier except `auto`).
519 * _comp_class_id: Component class ID (C identifier).
520 * _name: Component class name (C string).
521 * _notif_iter_next_method: Component class's iterator next method
522 * (bt_component_class_notification_iterator_next_method).
524 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _notif_iter_next_method) \
525 static struct __bt_plugin_component_class_descriptor __bt_plugin_filter_component_class_descriptor_##_id##_##_comp_class_id = { \
526 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
528 .type = BT_COMPONENT_CLASS_TYPE_FILTER, \
529 .methods.filter = { \
530 .notif_iter_next = _notif_iter_next_method, \
533 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
536 * Defines a sink component class descriptor with a custom ID.
538 * _id: ID (any valid C identifier except `auto`).
539 * _comp_class_id: Component class ID (C identifier).
540 * _name: Component class name (C string).
541 * _consume_method: Component class's iterator consume method
542 * (bt_component_class_sink_consume_method).
544 #define BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _consume_method) \
545 static struct __bt_plugin_component_class_descriptor __bt_plugin_sink_component_class_descriptor_##_id##_##_comp_class_id = { \
546 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
548 .type = BT_COMPONENT_CLASS_TYPE_SINK, \
550 .consume = _consume_method, \
553 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
556 * Defines a component class descriptor attribute (generic, internal
559 * _id: Plugin descriptor ID (C identifier).
560 * _comp_class_id: Component class ID (C identifier).
561 * _type: Component class type (`source`, `filter`, or `sink`).
562 * _attr_name: Name of the attribute (C identifier).
563 * _attr_type: Type of the attribute
564 * (enum __bt_plugin_descriptor_attribute_type).
567 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _comp_class_id, _type, _x) \
568 static struct __bt_plugin_component_class_descriptor_attribute __bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_comp_class_id##_##_attr_name = { \
569 .comp_class_descriptor = &__bt_plugin_##_type##_component_class_descriptor_##_id##_##_comp_class_id, \
570 .type_name = #_attr_name, \
571 .type = _attr_type, \
572 .value._attr_name = _x, \
574 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
577 * Defines a description attribute attached to a specific source
578 * component class descriptor.
580 * _id: Plugin descriptor ID (C identifier).
581 * _comp_class_id: Component class descriptor ID (C identifier).
582 * _x: Description (C string).
584 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
585 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, source, _x)
588 * Defines a description attribute attached to a specific filter
589 * component class descriptor.
591 * _id: Plugin descriptor ID (C identifier).
592 * _comp_class_id: Component class descriptor ID (C identifier).
593 * _x: Description (C string).
595 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
596 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, filter, _x)
599 * Defines a description attribute attached to a specific sink
600 * component class descriptor.
602 * _id: Plugin descriptor ID (C identifier).
603 * _comp_class_id: Component class descriptor ID (C identifier).
604 * _x: Description (C string).
606 #define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
607 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, sink, _x)
610 * Defines a help attribute attached to a specific source component
613 * _id: Plugin descriptor ID (C identifier).
614 * _comp_class_id: Component class descriptor ID (C identifier).
615 * _x: Help (C string).
617 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID(_id, _comp_class_id, _x) \
618 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _id, _comp_class_id, source, _x)
621 * Defines a help attribute attached to a specific filter component
624 * _id: Plugin descriptor ID (C identifier).
625 * _comp_class_id: Component class descriptor ID (C identifier).
626 * _x: Help (C string).
628 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID(_id, _comp_class_id, _x) \
629 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _id, _comp_class_id, filter, _x)
632 * Defines a help attribute attached to a specific sink component class
635 * _id: Plugin descriptor ID (C identifier).
636 * _comp_class_id: Component class descriptor ID (C identifier).
637 * _x: Help (C string).
639 #define BT_PLUGIN_SINK_COMPONENT_CLASS_HELP_WITH_ID(_id, _comp_class_id, _x) \
640 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _id, _comp_class_id, sink, _x)
643 * Defines an initialization method attribute attached to a specific
644 * source component class descriptor.
646 * _id: Plugin descriptor ID (C identifier).
647 * _comp_class_id: Component class descriptor ID (C identifier).
648 * _x: Initialization method (bt_component_class_init_method).
650 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
651 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, source, _x)
654 * Defines an initialization method attribute attached to a specific
655 * filter component class descriptor.
657 * _id: Plugin descriptor ID (C identifier).
658 * _comp_class_id: Component class descriptor ID (C identifier).
659 * _x: Initialization method (bt_component_class_init_method).
661 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
662 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, filter, _x)
665 * Defines an initialization method attribute attached to a specific
666 * sink component class descriptor.
668 * _id: Plugin descriptor ID (C identifier).
669 * _comp_class_id: Component class descriptor ID (C identifier).
670 * _x: Initialization method (bt_component_class_init_method).
672 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
673 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, sink, _x)
676 * Defines a finalize method attribute attached to a specific source
677 * component class descriptor.
679 * _id: Plugin descriptor ID (C identifier).
680 * _comp_class_id: Component class descriptor ID (C identifier).
681 * _x: Finalize method (bt_component_class_finalize_method).
683 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
684 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, source, _x)
687 * Defines a finalize method attribute attached to a specific filter
688 * component class descriptor.
690 * _id: Plugin descriptor ID (C identifier).
691 * _comp_class_id: Component class descriptor ID (C identifier).
692 * _x: Finalize method (bt_component_class_finalize_method).
694 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
695 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, filter, _x)
698 * Defines a finalize method attribute attached to a specific sink
699 * component class descriptor.
701 * _id: Plugin descriptor ID (C identifier).
702 * _comp_class_id: Component class descriptor ID (C identifier).
703 * _x: Finalize method (bt_component_class_finalize_method).
705 #define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
706 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, sink, _x)
709 * Defines a query method attribute attached to a specific source
710 * component class descriptor.
712 * _id: Plugin descriptor ID (C identifier).
713 * _comp_class_id: Component class descriptor ID (C identifier).
714 * _x: Finalize method (bt_component_class_query_method).
716 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
717 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, source, _x)
720 * Defines a query method attribute attached to a specific filter
721 * component class descriptor.
723 * _id: Plugin descriptor ID (C identifier).
724 * _comp_class_id: Component class descriptor ID (C identifier).
725 * _x: Finalize method (bt_component_class_query_method).
727 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
728 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, filter, _x)
731 * Defines a query method attribute attached to a specific sink
732 * component class descriptor.
734 * _id: Plugin descriptor ID (C identifier).
735 * _comp_class_id: Component class descriptor ID (C identifier).
736 * _x: Finalize method (bt_component_class_query_method).
738 #define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
739 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, sink, _x)
742 * Defines an accept port connection method attribute attached to a
743 * specific source component class descriptor.
745 * _id: Plugin descriptor ID (C identifier).
746 * _comp_class_id: Component class descriptor ID (C identifier).
747 * _x: Accept port connection method
748 * (bt_component_class_accept_port_connection_method).
750 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
751 __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)
754 * Defines an accept port connection method attribute attached to a
755 * specific filter component class descriptor.
757 * _id: Plugin descriptor ID (C identifier).
758 * _comp_class_id: Component class descriptor ID (C identifier).
759 * _x: Accept port connection method
760 * (bt_component_class_accept_port_connection_method).
762 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
763 __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)
766 * Defines an accept port connection method attribute attached to a
767 * specific sink component class descriptor.
769 * _id: Plugin descriptor ID (C identifier).
770 * _comp_class_id: Component class descriptor ID (C identifier).
771 * _x: Accept port connection method
772 * (bt_component_class_accept_port_connection_method).
774 #define BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
775 __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)
778 * Defines a port connected method attribute attached to a specific
779 * source component class descriptor.
781 * _id: Plugin descriptor ID (C identifier).
782 * _comp_class_id: Component class descriptor ID (C identifier).
783 * _x: Port connected method
784 * (bt_component_class_port_connected_method).
786 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
787 __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)
790 * Defines a port connected method attribute attached to a specific
791 * filter component class descriptor.
793 * _id: Plugin descriptor ID (C identifier).
794 * _comp_class_id: Component class descriptor ID (C identifier).
795 * _x: Port connected method
796 * (bt_component_class_port_connected_method).
798 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
799 __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)
802 * Defines a port connected method attribute attached to a specific
803 * sink component class descriptor.
805 * _id: Plugin descriptor ID (C identifier).
806 * _comp_class_id: Component class descriptor ID (C identifier).
807 * _x: Port connected method
808 * (bt_component_class_port_connected_method).
810 #define BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
811 __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)
814 * Defines a port disconnected method attribute attached to a specific
815 * source component class descriptor.
817 * _id: Plugin descriptor ID (C identifier).
818 * _comp_class_id: Component class descriptor ID (C identifier).
819 * _x: Port disconnected method
820 * (bt_component_class_port_disconnected_method).
822 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
823 __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)
826 * Defines a port disconnected method attribute attached to a specific
827 * filter component class descriptor.
829 * _id: Plugin descriptor ID (C identifier).
830 * _comp_class_id: Component class descriptor ID (C identifier).
831 * _x: Port disconnected method
832 * (bt_component_class_port_disconnected_method).
834 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
835 __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)
838 * Defines a port disconnected method attribute attached to a specific
839 * sink component class descriptor.
841 * _id: Plugin descriptor ID (C identifier).
842 * _comp_class_id: Component class descriptor ID (C identifier).
843 * _x: Port disconnected method
844 * (bt_component_class_port_disconnected_method).
846 #define BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
847 __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)
850 * Defines an iterator initialization method attribute attached to a
851 * specific source component class descriptor.
853 * _id: Plugin descriptor ID (C identifier).
854 * _comp_class_id: Component class descriptor ID (C identifier).
855 * _x: Iterator initialization method
856 * (bt_component_class_notification_iterator_init_method).
858 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
859 __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)
862 * Defines an iterator finalize method attribute attached to a specific
863 * source component class descriptor.
865 * _id: Plugin descriptor ID (C identifier).
866 * _comp_class_id: Component class descriptor ID (C identifier).
867 * _x: Iterator finalize method
868 * (bt_component_class_notification_iterator_finalize_method).
870 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
871 __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)
874 * Defines an iterator initialization method attribute attached to a
875 * specific filter component class descriptor.
877 * _id: Plugin descriptor ID (C identifier).
878 * _comp_class_id: Component class descriptor ID (C identifier).
879 * _x: Iterator initialization method
880 * (bt_component_class_notification_iterator_init_method).
882 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
883 __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)
886 * Defines an iterator finalize method attribute attached to a specific
887 * filter component class descriptor.
889 * _id: Plugin descriptor ID (C identifier).
890 * _comp_class_id: Component class descriptor ID (C identifier).
891 * _x: Iterator finalize method
892 * (bt_component_class_notification_iterator_finalize_method).
894 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
895 __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)
898 * Defines a plugin descriptor with an automatic ID.
900 * _name: Plugin's name (C string).
902 #define BT_PLUGIN(_name) static BT_PLUGIN_WITH_ID(auto, #_name)
905 * Defines a plugin initialization function attribute attached to the
906 * automatic plugin descriptor.
908 * _x: Initialization function (bt_plugin_init_func).
910 #define BT_PLUGIN_INIT(_x) BT_PLUGIN_INIT_WITH_ID(auto, _x)
913 * Defines a plugin exit function attribute attached to the automatic
916 * _x: Exit function (bt_plugin_exit_func).
918 #define BT_PLUGIN_EXIT(_x) BT_PLUGIN_EXIT_WITH_ID(auto, _x)
921 * Defines an author attribute attached to the automatic plugin
924 * _x: Author (C string).
926 #define BT_PLUGIN_AUTHOR(_x) BT_PLUGIN_AUTHOR_WITH_ID(auto, _x)
929 * Defines a license attribute attached to the automatic plugin
932 * _x: License (C string).
934 #define BT_PLUGIN_LICENSE(_x) BT_PLUGIN_LICENSE_WITH_ID(auto, _x)
937 * Defines a description attribute attached to the automatic plugin
940 * _x: Description (C string).
942 #define BT_PLUGIN_DESCRIPTION(_x) BT_PLUGIN_DESCRIPTION_WITH_ID(auto, _x)
945 * Defines a version attribute attached to the automatic plugin
948 * _major: Plugin's major version (uint32_t).
949 * _minor: Plugin's minor version (uint32_t).
950 * _patch: Plugin's patch version (uint32_t).
951 * _extra: Plugin's version extra information (C string).
953 #define BT_PLUGIN_VERSION(_major, _minor, _patch, _extra) BT_PLUGIN_VERSION_WITH_ID(auto, _major, _minor, _patch, _extra)
956 * Defines a source component class attached to the automatic plugin
957 * descriptor. Its ID is the same as its name, hence its name must be a
958 * C identifier in this version.
960 * _name: Component class name (C identifier).
961 * _notif_iter_next_method: Component class's iterator next method
962 * (bt_component_class_notification_iterator_next_method).
964 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS(_name, _notif_iter_next_method) \
965 BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _notif_iter_next_method)
968 * Defines a filter component class attached to the automatic plugin
969 * descriptor. Its ID is the same as its name, hence its name must be a
970 * C identifier in this version.
972 * _name: Component class name (C identifier).
973 * _notif_iter_next_method: Component class's iterator next method
974 * (bt_component_class_notification_iterator_next_method).
976 #define BT_PLUGIN_FILTER_COMPONENT_CLASS(_name, _notif_iter_next_method) \
977 BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _notif_iter_next_method)
980 * Defines a sink component class attached to the automatic plugin
981 * descriptor. Its ID is the same as its name, hence its name must be a
982 * C identifier in this version.
984 * _name: Component class name (C identifier).
985 * _consume_method: Component class's consume method
986 * (bt_component_class_sink_consume_method).
988 #define BT_PLUGIN_SINK_COMPONENT_CLASS(_name, _consume_method) \
989 BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _consume_method)
992 * Defines a description attribute attached to a source component class
993 * descriptor which is attached to the automatic plugin descriptor.
995 * _name: Component class name (C identifier).
996 * _x: Description (C string).
998 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
999 BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
1002 * Defines a description attribute attached to a filter component class
1003 * descriptor which is attached to the automatic plugin descriptor.
1005 * _name: Component class name (C identifier).
1006 * _x: Description (C string).
1008 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
1009 BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
1012 * Defines a description attribute attached to a sink component class
1013 * descriptor which is attached to the automatic plugin descriptor.
1015 * _name: Component class name (C identifier).
1016 * _x: Description (C string).
1018 #define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
1019 BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
1022 * Defines a help attribute attached to a source component class
1023 * descriptor which is attached to the automatic plugin descriptor.
1025 * _name: Component class name (C identifier).
1026 * _x: Help (C string).
1028 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP(_name, _x) \
1029 BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
1032 * Defines a help attribute attached to a filter component class
1033 * descriptor which is attached to the automatic plugin descriptor.
1035 * _name: Component class name (C identifier).
1036 * _x: Help (C string).
1038 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP(_name, _x) \
1039 BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
1042 * Defines a help attribute attached to a sink component class
1043 * descriptor which is attached to the automatic plugin descriptor.
1045 * _name: Component class name (C identifier).
1046 * _x: Help (C string).
1048 #define BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(_name, _x) \
1049 BT_PLUGIN_SINK_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
1052 * Defines an initialization method attribute attached to a source
1053 * component class descriptor which is attached to the automatic plugin
1056 * _name: Component class name (C identifier).
1057 * _x: Initialization method (bt_component_class_init_method).
1059 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
1060 BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
1063 * Defines an initialization method attribute attached to a filter
1064 * component class descriptor which is attached to the automatic plugin
1067 * _name: Component class name (C identifier).
1068 * _x: Initialization method (bt_component_class_init_method).
1070 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
1071 BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
1074 * Defines an initialization method attribute attached to a sink
1075 * component class descriptor which is attached to the automatic plugin
1078 * _name: Component class name (C identifier).
1079 * _x: Initialization method (bt_component_class_init_method).
1081 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
1082 BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
1085 * Defines a finalize method attribute attached to a source component
1086 * class descriptor which is attached to the automatic plugin
1089 * _name: Component class name (C identifier).
1090 * _x: Initialization method (bt_component_class_finalize_method).
1092 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
1093 BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1096 * Defines a finalize method attribute attached to a filter component
1097 * class descriptor which is attached to the automatic plugin
1100 * _name: Component class name (C identifier).
1101 * _x: Initialization method (bt_component_class_finalize_method).
1103 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
1104 BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1107 * Defines a finalize method attribute attached to a sink component class
1108 * descriptor which is attached to the automatic plugin descriptor.
1110 * _name: Component class name (C identifier).
1111 * _x: Initialization method (bt_component_class_finalize_method).
1113 #define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
1114 BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1117 * Defines a query method attribute attached to a source component
1118 * class descriptor which is attached to the automatic plugin
1121 * _name: Component class name (C identifier).
1122 * _x: Initialization method (bt_component_class_query_method).
1124 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1125 BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
1128 * Defines a query method attribute attached to a filter component
1129 * class descriptor which is attached to the automatic plugin
1132 * _name: Component class name (C identifier).
1133 * _x: Initialization method (bt_component_class_query_method).
1135 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1136 BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
1139 * Defines a query method attribute attached to a sink component
1140 * class descriptor which is attached to the automatic plugin
1143 * _name: Component class name (C identifier).
1144 * _x: Initialization method (bt_component_class_query_method).
1146 #define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1147 BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
1150 * Defines an accept port connection method attribute attached to a
1151 * source component class descriptor which is attached to the automatic
1152 * plugin descriptor.
1154 * _name: Component class name (C identifier).
1155 * _x: Accept port connection method
1156 * (bt_component_class_accept_port_connection_method).
1158 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD(_name, _x) \
1159 BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1162 * Defines an accept port connection method attribute attached to a
1163 * filter component class descriptor which is attached to the automatic
1164 * plugin descriptor.
1166 * _name: Component class name (C identifier).
1167 * _x: Accept port connection method
1168 * (bt_component_class_accept_port_connection_method).
1170 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD(_name, _x) \
1171 BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1174 * Defines an accept port connection method attribute attached to a sink
1175 * component class descriptor which is attached to the automatic plugin
1178 * _name: Component class name (C identifier).
1179 * _x: Accept port connection method
1180 * (bt_component_class_accept_port_connection_method).
1182 #define BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD(_name, _x) \
1183 BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1186 * Defines a port connected method attribute attached to a source
1187 * component class descriptor which is attached to the automatic plugin
1190 * _name: Component class name (C identifier).
1191 * _x: Port connected (bt_component_class_port_connected_method).
1193 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_CONNECTED_METHOD(_name, _x) \
1194 BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1197 * Defines a port connected method attribute attached to a filter
1198 * component class descriptor which is attached to the automatic plugin
1201 * _name: Component class name (C identifier).
1202 * _x: Port connected (bt_component_class_port_connected_method).
1204 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_CONNECTED_METHOD(_name, _x) \
1205 BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1208 * Defines a port connected method attribute attached to a sink
1209 * component class descriptor which is attached to the automatic plugin
1212 * _name: Component class name (C identifier).
1213 * _x: Port connected (bt_component_class_port_connected_method).
1215 #define BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_CONNECTED_METHOD(_name, _x) \
1216 BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1219 * Defines a port disconnected method attribute attached to a source
1220 * component class descriptor which is attached to the automatic plugin
1223 * _name: Component class name (C identifier).
1224 * _x: Port disconnected (bt_component_class_port_disconnected_method).
1226 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD(_name, _x) \
1227 BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
1230 * Defines a port disconnected method attribute attached to a filter
1231 * component class descriptor which is attached to the automatic plugin
1234 * _name: Component class name (C identifier).
1235 * _x: Port disconnected (bt_component_class_port_disconnected_method).
1237 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD(_name, _x) \
1238 BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
1241 * Defines a port disconnected method attribute attached to a sink
1242 * component class descriptor which is attached to the automatic plugin
1245 * _name: Component class name (C identifier).
1246 * _x: Port disconnected (bt_component_class_port_disconnected_method).
1248 #define BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD(_name, _x) \
1249 BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
1252 * Defines an iterator initialization method attribute attached to a
1253 * source component class descriptor which is attached to the automatic
1254 * plugin descriptor.
1256 * _name: Component class name (C identifier).
1257 * _x: Iterator initialization method
1258 * (bt_component_class_notification_iterator_init_method).
1260 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(_name, _x) \
1261 BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
1264 * Defines an iterator finalize method attribute attached to a source
1265 * component class descriptor which is attached to the automatic plugin
1268 * _name: Component class name (C identifier).
1269 * _x: Iterator finalize method
1270 * (bt_component_class_notification_iterator_finalize_method).
1272 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(_name, _x) \
1273 BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1276 * Defines an iterator initialization method attribute attached to a
1277 * filter component class descriptor which is attached to the automatic
1278 * plugin descriptor.
1280 * _name: Component class name (C identifier).
1281 * _x: Iterator initialization method
1282 * (bt_component_class_notification_iterator_init_method).
1284 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(_name, _x) \
1285 BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
1288 * Defines an iterator finalize method attribute attached to a filter
1289 * component class descriptor which is attached to the automatic plugin
1292 * _name: Component class name (C identifier).
1293 * _x: Iterator finalize method
1294 * (bt_component_class_notification_iterator_finalize_method).
1296 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(_name, _x) \
1297 BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1299 #define BT_PLUGIN_MODULE() \
1300 static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_dummy __BT_PLUGIN_DESCRIPTOR_ATTRS = NULL; \
1301 _BT_HIDDEN extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA; \
1302 _BT_HIDDEN extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_END_EXTRA; \
1304 static struct __bt_plugin_descriptor_attribute const * const __bt_plugin_descriptor_attribute_dummy __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS = NULL; \
1305 _BT_HIDDEN extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA; \
1306 _BT_HIDDEN extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA; \
1308 static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_component_class_descriptor_dummy __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = NULL; \
1309 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA; \
1310 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA; \
1312 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; \
1313 _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; \
1314 _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; \
1316 struct __bt_plugin_descriptor const * const *__bt_get_begin_section_plugin_descriptors(void) \
1318 return &__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL; \
1320 struct __bt_plugin_descriptor const * const *__bt_get_end_section_plugin_descriptors(void) \
1322 return &__BT_PLUGIN_DESCRIPTOR_END_SYMBOL; \
1324 struct __bt_plugin_descriptor_attribute const * const *__bt_get_begin_section_plugin_descriptor_attributes(void) \
1326 return &__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL; \
1328 struct __bt_plugin_descriptor_attribute const * const *__bt_get_end_section_plugin_descriptor_attributes(void) \
1330 return &__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL; \
1332 struct __bt_plugin_component_class_descriptor const * const *__bt_get_begin_section_component_class_descriptors(void) \
1334 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL; \
1336 struct __bt_plugin_component_class_descriptor const * const *__bt_get_end_section_component_class_descriptors(void) \
1338 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL; \
1340 struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_begin_section_component_class_descriptor_attributes(void) \
1342 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL; \
1344 struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_end_section_component_class_descriptor_attributes(void) \
1346 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL; \
1353 #endif /* BABELTRACE_PLUGIN_PLUGIN_DEV_H */