1 #ifndef BABELTRACE_PLUGIN_PLUGIN_DEV_H
2 #define BABELTRACE_PLUGIN_PLUGIN_DEV_H
5 * This is the header that you need to include for the development of
6 * a Babeltrace plug-in.
8 * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
9 * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
11 * Permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 /* For enum bt_plugin_status */
33 #include <babeltrace/plugin/plugin-const.h>
35 /* For bt_component_class_type */
36 #include <babeltrace/graph/component-class-const.h>
38 /* For component class method type definitions */
39 #include <babeltrace/graph/component-class-source.h>
40 #include <babeltrace/graph/component-class-filter.h>
41 #include <babeltrace/graph/component-class-sink.h>
44 * _BT_HIDDEN: set the hidden attribute for internal functions
45 * On Windows, symbols are local unless explicitly exported,
46 * see https://gcc.gnu.org/wiki/Visibility
48 #if defined(_WIN32) || defined(__CYGWIN__)
51 #define _BT_HIDDEN __attribute__((visibility("hidden")))
59 * Plugin interface's version, not synced with Babeltrace's version
62 #define __BT_PLUGIN_VERSION_MAJOR 1
63 #define __BT_PLUGIN_VERSION_MINOR 0
65 /* Plugin initialization function type */
66 typedef enum bt_self_plugin_status
{
67 BT_SELF_PLUGIN_STATUS_OK
= 0,
68 BT_SELF_PLUGIN_STATUS_NOMEM
= -12,
69 BT_SELF_PLUGIN_STATUS_ERROR
= -1,
70 } bt_self_plugin_status
;
72 typedef struct bt_self_plugin bt_self_plugin
;
74 typedef bt_self_plugin_status (*bt_plugin_init_func
)(
75 bt_self_plugin
*plugin
);
77 /* Plugin exit function type */
78 typedef void (*bt_plugin_exit_func
)(void);
80 /* Plugin descriptor: describes a single plugin (internal use) */
81 struct __bt_plugin_descriptor
{
82 /* Plugin's interface major version number */
85 /* Plugin's interface minor version number */
90 } __attribute__((packed
));
92 /* Type of a plugin attribute (internal use) */
93 enum __bt_plugin_descriptor_attribute_type
{
94 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT
= 0,
95 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT
= 1,
96 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR
= 2,
97 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE
= 3,
98 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION
= 4,
99 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION
= 5,
102 /* Plugin (user) version */
103 struct __bt_plugin_descriptor_version
{
110 /* Plugin attribute (internal use) */
111 struct __bt_plugin_descriptor_attribute
{
112 /* Plugin descriptor to which to associate this attribute */
113 const struct __bt_plugin_descriptor
*plugin_descriptor
;
115 /* Name of the attribute's type for debug purposes */
116 const char *type_name
;
118 /* Attribute's type */
119 enum __bt_plugin_descriptor_attribute_type type
;
121 /* Attribute's value (depends on attribute's type) */
123 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT */
124 bt_plugin_init_func init
;
126 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT */
127 bt_plugin_exit_func exit
;
129 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR */
132 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE */
135 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
136 const char *description
;
138 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION */
139 struct __bt_plugin_descriptor_version version
;
141 } __attribute__((packed
));
143 /* Component class descriptor (internal use) */
144 struct __bt_plugin_component_class_descriptor
{
146 * Plugin descriptor to which to associate this component
149 const struct __bt_plugin_descriptor
*plugin_descriptor
;
151 /* Component class name */
154 /* Component class type */
155 bt_component_class_type type
;
157 /* Mandatory methods (depends on component class type) */
159 /* BT_COMPONENT_CLASS_TYPE_SOURCE */
161 bt_component_class_source_message_iterator_next_method msg_iter_next
;
164 /* BT_COMPONENT_CLASS_TYPE_FILTER */
166 bt_component_class_filter_message_iterator_next_method msg_iter_next
;
169 /* BT_COMPONENT_CLASS_TYPE_SINK */
171 bt_component_class_sink_consume_method consume
;
174 } __attribute__((packed
));
176 /* Type of a component class attribute (internal use) */
177 enum __bt_plugin_component_class_descriptor_attribute_type
{
178 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION
= 0,
179 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP
= 1,
180 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD
= 2,
181 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD
= 3,
182 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD
= 4,
183 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_INPUT_PORT_CONNECTION_METHOD
= 5,
184 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD
= 6,
185 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD
= 7,
186 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD
= 8,
187 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD
= 11,
188 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD
= 12,
191 /* Component class attribute (internal use) */
192 struct __bt_plugin_component_class_descriptor_attribute
{
194 * Component class plugin attribute to which to associate this
195 * component class attribute.
197 const struct __bt_plugin_component_class_descriptor
*comp_class_descriptor
;
199 /* Name of the attribute's type for debug purposes */
200 const char *type_name
;
202 /* Attribute's type */
203 enum __bt_plugin_component_class_descriptor_attribute_type type
;
205 /* Attribute's value (depends on attribute's type) */
207 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
208 const char *description
;
210 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP */
213 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD */
214 bt_component_class_source_init_method source_init_method
;
215 bt_component_class_filter_init_method filter_init_method
;
216 bt_component_class_sink_init_method sink_init_method
;
218 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD */
219 bt_component_class_source_finalize_method source_finalize_method
;
220 bt_component_class_filter_finalize_method filter_finalize_method
;
221 bt_component_class_sink_finalize_method sink_finalize_method
;
223 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD */
224 bt_component_class_source_query_method source_query_method
;
225 bt_component_class_filter_query_method filter_query_method
;
226 bt_component_class_sink_query_method sink_query_method
;
228 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_INPUT_PORT_CONNECTION_METHOD */
229 bt_component_class_filter_accept_input_port_connection_method filter_accept_input_port_connection_method
;
230 bt_component_class_sink_accept_input_port_connection_method sink_accept_input_port_connection_method
;
232 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD */
233 bt_component_class_source_accept_output_port_connection_method source_accept_output_port_connection_method
;
234 bt_component_class_filter_accept_output_port_connection_method filter_accept_output_port_connection_method
;
236 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD */
237 bt_component_class_filter_input_port_connected_method filter_input_port_connected_method
;
238 bt_component_class_sink_input_port_connected_method sink_input_port_connected_method
;
240 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD */
241 bt_component_class_source_output_port_connected_method source_output_port_connected_method
;
242 bt_component_class_filter_output_port_connected_method filter_output_port_connected_method
;
244 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD */
245 bt_component_class_source_message_iterator_init_method source_msg_iter_init_method
;
246 bt_component_class_filter_message_iterator_init_method filter_msg_iter_init_method
;
248 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD */
249 bt_component_class_source_message_iterator_finalize_method source_msg_iter_finalize_method
;
250 bt_component_class_filter_message_iterator_finalize_method filter_msg_iter_finalize_method
;
252 } __attribute__((packed
));
254 struct __bt_plugin_descriptor
const * const *__bt_get_begin_section_plugin_descriptors(void);
255 struct __bt_plugin_descriptor
const * const *__bt_get_end_section_plugin_descriptors(void);
256 struct __bt_plugin_descriptor_attribute
const * const *__bt_get_begin_section_plugin_descriptor_attributes(void);
257 struct __bt_plugin_descriptor_attribute
const * const *__bt_get_end_section_plugin_descriptor_attributes(void);
258 struct __bt_plugin_component_class_descriptor
const * const *__bt_get_begin_section_component_class_descriptors(void);
259 struct __bt_plugin_component_class_descriptor
const * const *__bt_get_end_section_component_class_descriptors(void);
260 struct __bt_plugin_component_class_descriptor_attribute
const * const *__bt_get_begin_section_component_class_descriptor_attributes(void);
261 struct __bt_plugin_component_class_descriptor_attribute
const * const *__bt_get_end_section_component_class_descriptor_attributes(void);
264 * Variable attributes for a plugin descriptor pointer to be added to
265 * the plugin descriptor section (internal use).
268 #define __BT_PLUGIN_DESCRIPTOR_ATTRS \
269 __attribute__((section("__DATA,btp_desc"), used))
271 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL \
272 __start___bt_plugin_descriptors
274 #define __BT_PLUGIN_DESCRIPTOR_END_SYMBOL \
275 __stop___bt_plugin_descriptors
277 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA \
278 __asm("section$start$__DATA$btp_desc")
280 #define __BT_PLUGIN_DESCRIPTOR_END_EXTRA \
281 __asm("section$end$__DATA$btp_desc")
285 #define __BT_PLUGIN_DESCRIPTOR_ATTRS \
286 __attribute__((section("__bt_plugin_descriptors"), used))
288 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL \
289 __start___bt_plugin_descriptors
291 #define __BT_PLUGIN_DESCRIPTOR_END_SYMBOL \
292 __stop___bt_plugin_descriptors
294 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA
296 #define __BT_PLUGIN_DESCRIPTOR_END_EXTRA
300 * Variable attributes for a plugin attribute pointer to be added to
301 * the plugin attribute section (internal use).
304 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS \
305 __attribute__((section("__DATA,btp_desc_att"), used))
307 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
308 __start___bt_plugin_descriptor_attributes
310 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
311 __stop___bt_plugin_descriptor_attributes
313 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA \
314 __asm("section$start$__DATA$btp_desc_att")
316 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA \
317 __asm("section$end$__DATA$btp_desc_att")
321 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS \
322 __attribute__((section("__bt_plugin_descriptor_attributes"), used))
324 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
325 __start___bt_plugin_descriptor_attributes
327 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
328 __stop___bt_plugin_descriptor_attributes
330 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA
332 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA
336 * Variable attributes for a component class descriptor pointer to be
337 * added to the component class descriptor section (internal use).
340 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS \
341 __attribute__((section("__DATA,btp_cc_desc"), used))
343 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL \
344 __start___bt_plugin_component_class_descriptors
346 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL \
347 __stop___bt_plugin_component_class_descriptors
349 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA \
350 __asm("section$start$__DATA$btp_cc_desc")
352 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA \
353 __asm("section$end$__DATA$btp_cc_desc")
357 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS \
358 __attribute__((section("__bt_plugin_component_class_descriptors"), used))
360 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL \
361 __start___bt_plugin_component_class_descriptors
363 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL \
364 __stop___bt_plugin_component_class_descriptors
366 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA
368 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA
372 * Variable attributes for a component class descriptor attribute
373 * pointer to be added to the component class descriptor attribute
374 * section (internal use).
377 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS \
378 __attribute__((section("__DATA,btp_cc_desc_att"), used))
380 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
381 __start___bt_plugin_component_class_descriptor_attributes
383 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
384 __stop___bt_plugin_component_class_descriptor_attributes
386 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA \
387 __asm("section$start$__DATA$btp_cc_desc_att")
389 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_EXTRA \
390 __asm("section$end$__DATA$btp_cc_desc_att")
394 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS \
395 __attribute__((section("__bt_plugin_component_class_descriptor_attributes"), used))
397 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
398 __start___bt_plugin_component_class_descriptor_attributes
400 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
401 __stop___bt_plugin_component_class_descriptor_attributes
403 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA
405 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_EXTRA
409 * Declares a plugin descriptor pointer variable with a custom ID.
411 * _id: ID (any valid C identifier except `auto`).
413 #define BT_PLUGIN_DECLARE(_id) extern struct __bt_plugin_descriptor __bt_plugin_descriptor_##_id
416 * Defines a plugin descriptor with a custom ID.
418 * _id: ID (any valid C identifier except `auto`).
419 * _name: Plugin's name (C string).
421 #define BT_PLUGIN_WITH_ID(_id, _name) \
422 struct __bt_plugin_descriptor __bt_plugin_descriptor_##_id = { \
423 .major = __BT_PLUGIN_VERSION_MAJOR, \
424 .minor = __BT_PLUGIN_VERSION_MINOR, \
427 static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_##_id##_ptr __BT_PLUGIN_DESCRIPTOR_ATTRS = &__bt_plugin_descriptor_##_id
430 * Defines a plugin attribute (generic, internal use).
432 * _attr_name: Name of the attribute (C identifier).
433 * _attr_type: Type of the attribute (enum __bt_plugin_descriptor_attribute_type).
434 * _id: Plugin descriptor ID (C identifier).
437 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _x) \
438 static struct __bt_plugin_descriptor_attribute __bt_plugin_descriptor_attribute_##_id##_##_attr_name = { \
439 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
440 .type_name = #_attr_name, \
441 .type = _attr_type, \
442 .value._attr_name = _x, \
444 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
447 * Defines a plugin initialization function attribute attached to a
448 * specific plugin descriptor.
450 * _id: Plugin descriptor ID (C identifier).
451 * _x: Initialization function (bt_plugin_init_func).
453 #define BT_PLUGIN_INIT_WITH_ID(_id, _x) \
454 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(init, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT, _id, _x)
457 * Defines a plugin exit function attribute attached to a specific
460 * _id: Plugin descriptor ID (C identifier).
461 * _x: Exit function (bt_plugin_exit_func).
463 #define BT_PLUGIN_EXIT_WITH_ID(_id, _x) \
464 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(exit, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT, _id, _x)
467 * Defines an author attribute attached to a specific plugin descriptor.
469 * _id: Plugin descriptor ID (C identifier).
470 * _x: Author (C string).
472 #define BT_PLUGIN_AUTHOR_WITH_ID(_id, _x) \
473 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(author, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR, _id, _x)
476 * Defines a license attribute attached to a specific plugin descriptor.
478 * _id: Plugin descriptor ID (C identifier).
479 * _x: License (C string).
481 #define BT_PLUGIN_LICENSE_WITH_ID(_id, _x) \
482 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(license, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE, _id, _x)
485 * Defines a description attribute attached to a specific plugin
488 * _id: Plugin descriptor ID (C identifier).
489 * _x: Description (C string).
491 #define BT_PLUGIN_DESCRIPTION_WITH_ID(_id, _x) \
492 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _x)
494 #define __BT_PLUGIN_VERSION_STRUCT_VALUE(_major, _minor, _patch, _extra) \
495 {.major = _major, .minor = _minor, .patch = _patch, .extra = _extra,}
498 * Defines a version attribute attached to a specific plugin descriptor.
500 * _id: Plugin descriptor ID (C identifier).
501 * _major: Plugin's major version (uint32_t).
502 * _minor: Plugin's minor version (uint32_t).
503 * _patch: Plugin's patch version (uint32_t).
504 * _extra: Plugin's version extra information (C string).
506 #define BT_PLUGIN_VERSION_WITH_ID(_id, _major, _minor, _patch, _extra) \
507 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(version, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION, _id, __BT_PLUGIN_VERSION_STRUCT_VALUE(_major, _minor, _patch, _extra))
510 * Defines a source component class descriptor with a custom ID.
512 * _id: ID (any valid C identifier except `auto`).
513 * _comp_class_id: Component class ID (C identifier).
514 * _name: Component class name (C string).
515 * _msg_iter_next_method: Component class's iterator next method
516 * (bt_component_class_source_message_iterator_next_method).
518 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _msg_iter_next_method) \
519 static struct __bt_plugin_component_class_descriptor __bt_plugin_source_component_class_descriptor_##_id##_##_comp_class_id = { \
520 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
522 .type = BT_COMPONENT_CLASS_TYPE_SOURCE, \
523 .methods.source = { \
524 .msg_iter_next = _msg_iter_next_method, \
527 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
530 * Defines a filter component class descriptor with a custom ID.
532 * _id: ID (any valid C identifier except `auto`).
533 * _comp_class_id: Component class ID (C identifier).
534 * _name: Component class name (C string).
535 * _msg_iter_next_method: Component class's iterator next method
536 * (bt_component_class_filter_message_iterator_next_method).
538 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _msg_iter_next_method) \
539 static struct __bt_plugin_component_class_descriptor __bt_plugin_filter_component_class_descriptor_##_id##_##_comp_class_id = { \
540 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
542 .type = BT_COMPONENT_CLASS_TYPE_FILTER, \
543 .methods.filter = { \
544 .msg_iter_next = _msg_iter_next_method, \
547 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
550 * Defines a sink component class descriptor with a custom ID.
552 * _id: ID (any valid C identifier except `auto`).
553 * _comp_class_id: Component class ID (C identifier).
554 * _name: Component class name (C string).
555 * _consume_method: Component class's iterator consume method
556 * (bt_component_class_sink_consume_method).
558 #define BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _consume_method) \
559 static struct __bt_plugin_component_class_descriptor __bt_plugin_sink_component_class_descriptor_##_id##_##_comp_class_id = { \
560 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
562 .type = BT_COMPONENT_CLASS_TYPE_SINK, \
564 .consume = _consume_method, \
567 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
570 * Defines a component class descriptor attribute (generic, internal
573 * _id: Plugin descriptor ID (C identifier).
574 * _comp_class_id: Component class ID (C identifier).
575 * _type: Component class type (`source`, `filter`, or `sink`).
576 * _attr_name: Name of the attribute (C identifier).
577 * _attr_type: Type of the attribute
578 * (enum __bt_plugin_descriptor_attribute_type).
581 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _comp_class_id, _type, _x) \
582 static struct __bt_plugin_component_class_descriptor_attribute __bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_comp_class_id##_##_attr_name = { \
583 .comp_class_descriptor = &__bt_plugin_##_type##_component_class_descriptor_##_id##_##_comp_class_id, \
584 .type_name = #_attr_name, \
585 .type = _attr_type, \
586 .value._attr_name = _x, \
588 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
591 * Defines a description attribute attached to a specific source
592 * component class descriptor.
594 * _id: Plugin descriptor ID (C identifier).
595 * _comp_class_id: Component class descriptor ID (C identifier).
596 * _x: Description (C string).
598 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
599 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, source, _x)
602 * Defines a description attribute attached to a specific filter
603 * component class descriptor.
605 * _id: Plugin descriptor ID (C identifier).
606 * _comp_class_id: Component class descriptor ID (C identifier).
607 * _x: Description (C string).
609 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
610 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, filter, _x)
613 * Defines a description attribute attached to a specific sink
614 * component class descriptor.
616 * _id: Plugin descriptor ID (C identifier).
617 * _comp_class_id: Component class descriptor ID (C identifier).
618 * _x: Description (C string).
620 #define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
621 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, sink, _x)
624 * Defines a help attribute attached to a specific source component
627 * _id: Plugin descriptor ID (C identifier).
628 * _comp_class_id: Component class descriptor ID (C identifier).
629 * _x: Help (C string).
631 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID(_id, _comp_class_id, _x) \
632 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _id, _comp_class_id, source, _x)
635 * Defines a help attribute attached to a specific filter component
638 * _id: Plugin descriptor ID (C identifier).
639 * _comp_class_id: Component class descriptor ID (C identifier).
640 * _x: Help (C string).
642 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID(_id, _comp_class_id, _x) \
643 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _id, _comp_class_id, filter, _x)
646 * Defines a help attribute attached to a specific sink component class
649 * _id: Plugin descriptor ID (C identifier).
650 * _comp_class_id: Component class descriptor ID (C identifier).
651 * _x: Help (C string).
653 #define BT_PLUGIN_SINK_COMPONENT_CLASS_HELP_WITH_ID(_id, _comp_class_id, _x) \
654 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _id, _comp_class_id, sink, _x)
657 * Defines an initialization method attribute attached to a specific
658 * source component class descriptor.
660 * _id: Plugin descriptor ID (C identifier).
661 * _comp_class_id: Component class descriptor ID (C identifier).
662 * _x: Initialization method (bt_component_class_source_init_method).
664 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
665 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, source, _x)
668 * Defines an initialization method attribute attached to a specific
669 * filter component class descriptor.
671 * _id: Plugin descriptor ID (C identifier).
672 * _comp_class_id: Component class descriptor ID (C identifier).
673 * _x: Initialization method (bt_component_class_filter_init_method).
675 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
676 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, filter, _x)
679 * Defines an initialization method attribute attached to a specific
680 * sink component class descriptor.
682 * _id: Plugin descriptor ID (C identifier).
683 * _comp_class_id: Component class descriptor ID (C identifier).
684 * _x: Initialization method (bt_component_class_sink_init_method).
686 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
687 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, sink, _x)
690 * Defines a finalization method attribute attached to a specific source
691 * component class descriptor.
693 * _id: Plugin descriptor ID (C identifier).
694 * _comp_class_id: Component class descriptor ID (C identifier).
695 * _x: Finalize method (bt_component_class_source_finalize_method).
697 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
698 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, source, _x)
701 * Defines a finalization method attribute attached to a specific filter
702 * component class descriptor.
704 * _id: Plugin descriptor ID (C identifier).
705 * _comp_class_id: Component class descriptor ID (C identifier).
706 * _x: Finalize method (bt_component_class_filter_finalize_method).
708 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
709 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, filter, _x)
712 * Defines a finalization method attribute attached to a specific sink
713 * component class descriptor.
715 * _id: Plugin descriptor ID (C identifier).
716 * _comp_class_id: Component class descriptor ID (C identifier).
717 * _x: Finalize method (bt_component_class_sink_finalize_method).
719 #define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
720 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, sink, _x)
723 * Defines a query method attribute attached to a specific source
724 * component class descriptor.
726 * _id: Plugin descriptor ID (C identifier).
727 * _comp_class_id: Component class descriptor ID (C identifier).
728 * _x: Finalize method (bt_component_class_source_query_method).
730 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
731 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, source, _x)
734 * Defines a query method attribute attached to a specific filter
735 * component class descriptor.
737 * _id: Plugin descriptor ID (C identifier).
738 * _comp_class_id: Component class descriptor ID (C identifier).
739 * _x: Finalize method (bt_component_class_filter_query_method).
741 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
742 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, filter, _x)
745 * Defines a query method attribute attached to a specific sink
746 * component class descriptor.
748 * _id: Plugin descriptor ID (C identifier).
749 * _comp_class_id: Component class descriptor ID (C identifier).
750 * _x: Finalize method (bt_component_class_sink_query_method).
752 #define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
753 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, sink, _x)
756 * Defines an accept input port connection method attribute attached to
757 * a specific filter component class descriptor.
759 * _id: Plugin descriptor ID (C identifier).
760 * _comp_class_id: Component class descriptor ID (C identifier).
761 * _x: Accept port connection method
762 * (bt_component_class_filter_accept_input_port_connection_method).
764 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
765 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_accept_input_port_connection_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_INPUT_PORT_CONNECTION_METHOD, _id, _comp_class_id, filter, _x)
768 * Defines an accept input port connection method attribute attached to
769 * a specific sink component class descriptor.
771 * _id: Plugin descriptor ID (C identifier).
772 * _comp_class_id: Component class descriptor ID (C identifier).
773 * _x: Accept port connection method
774 * (bt_component_class_sink_accept_input_port_connection_method).
776 #define BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
777 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_accept_input_port_connection_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_INPUT_PORT_CONNECTION_METHOD, _id, _comp_class_id, sink, _x)
780 * Defines an accept output port connection method attribute attached to
781 * a specific source component class descriptor.
783 * _id: Plugin descriptor ID (C identifier).
784 * _comp_class_id: Component class descriptor ID (C identifier).
785 * _x: Accept port connection method
786 * (bt_component_class_source_accept_output_port_connection_method).
788 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
789 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_accept_output_port_connection_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD, _id, _comp_class_id, source, _x)
792 * Defines an accept output port connection method attribute attached to
793 * a specific filter component class descriptor.
795 * _id: Plugin descriptor ID (C identifier).
796 * _comp_class_id: Component class descriptor ID (C identifier).
797 * _x: Accept port connection method
798 * (bt_component_class_filter_accept_output_port_connection_method).
800 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
801 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_accept_output_port_connection_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD, _id, _comp_class_id, filter, _x)
804 * Defines an input port connected method attribute attached to a
805 * specific filter component class descriptor.
807 * _id: Plugin descriptor ID (C identifier).
808 * _comp_class_id: Component class descriptor ID (C identifier).
809 * _x: Port connected method
810 * (bt_component_class_filter_input_port_connected_method).
812 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
813 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_input_port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD, _id, _comp_class_id, filter, _x)
816 * Defines an input port connected method attribute attached to a
817 * specific sink component class descriptor.
819 * _id: Plugin descriptor ID (C identifier).
820 * _comp_class_id: Component class descriptor ID (C identifier).
821 * _x: Port connected method
822 * (bt_component_class_sink_input_port_connected_method).
824 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
825 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_input_port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD, _id, _comp_class_id, sink, _x)
828 * Defines an output port connected method attribute attached to a
829 * specific source component class descriptor.
831 * _id: Plugin descriptor ID (C identifier).
832 * _comp_class_id: Component class descriptor ID (C identifier).
833 * _x: Port connected method
834 * (bt_component_class_source_output_port_connected_method).
836 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
837 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_output_port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD, _id, _comp_class_id, source, _x)
840 * Defines an output port connected method attribute attached to a
841 * specific filter component class descriptor.
843 * _id: Plugin descriptor ID (C identifier).
844 * _comp_class_id: Component class descriptor ID (C identifier).
845 * _x: Port connected method
846 * (bt_component_class_filter_output_port_connected_method).
848 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
849 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_output_port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD, _id, _comp_class_id, filter, _x)
852 * Defines an iterator initialization method attribute attached to a
853 * specific source component class descriptor.
855 * _id: Plugin descriptor ID (C identifier).
856 * _comp_class_id: Component class descriptor ID (C identifier).
857 * _x: Iterator initialization method
858 * (bt_component_class_source_message_iterator_init_method).
860 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
861 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_msg_iter_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD, _id, _comp_class_id, source, _x)
864 * Defines an iterator finalize method attribute attached to a specific
865 * source component class descriptor.
867 * _id: Plugin descriptor ID (C identifier).
868 * _comp_class_id: Component class descriptor ID (C identifier).
869 * _x: Iterator finalize method
870 * (bt_component_class_source_message_iterator_finalize_method).
872 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
873 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_msg_iter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD, _id, _comp_class_id, source, _x)
876 * Defines an iterator initialization method attribute attached to a
877 * specific filter component class descriptor.
879 * _id: Plugin descriptor ID (C identifier).
880 * _comp_class_id: Component class descriptor ID (C identifier).
881 * _x: Iterator initialization method
882 * (bt_component_class_filter_message_iterator_init_method).
884 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
885 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_msg_iter_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD, _id, _comp_class_id, filter, _x)
888 * Defines an iterator finalize method attribute attached to a specific
889 * filter component class descriptor.
891 * _id: Plugin descriptor ID (C identifier).
892 * _comp_class_id: Component class descriptor ID (C identifier).
893 * _x: Iterator finalize method
894 * (bt_component_class_filter_message_iterator_finalize_method).
896 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
897 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_msg_iter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD, _id, _comp_class_id, filter, _x)
900 * Defines a plugin descriptor with an automatic ID.
902 * _name: Plugin's name (C string).
904 #define BT_PLUGIN(_name) static BT_PLUGIN_WITH_ID(auto, #_name)
907 * Defines a plugin initialization function attribute attached to the
908 * automatic plugin descriptor.
910 * _x: Initialization function (bt_plugin_init_func).
912 #define BT_PLUGIN_INIT(_x) BT_PLUGIN_INIT_WITH_ID(auto, _x)
915 * Defines a plugin exit function attribute attached to the automatic
918 * _x: Exit function (bt_plugin_exit_func).
920 #define BT_PLUGIN_EXIT(_x) BT_PLUGIN_EXIT_WITH_ID(auto, _x)
923 * Defines an author attribute attached to the automatic plugin
926 * _x: Author (C string).
928 #define BT_PLUGIN_AUTHOR(_x) BT_PLUGIN_AUTHOR_WITH_ID(auto, _x)
931 * Defines a license attribute attached to the automatic plugin
934 * _x: License (C string).
936 #define BT_PLUGIN_LICENSE(_x) BT_PLUGIN_LICENSE_WITH_ID(auto, _x)
939 * Defines a description attribute attached to the automatic plugin
942 * _x: Description (C string).
944 #define BT_PLUGIN_DESCRIPTION(_x) BT_PLUGIN_DESCRIPTION_WITH_ID(auto, _x)
947 * Defines a version attribute attached to the automatic plugin
950 * _major: Plugin's major version (uint32_t).
951 * _minor: Plugin's minor version (uint32_t).
952 * _patch: Plugin's patch version (uint32_t).
953 * _extra: Plugin's version extra information (C string).
955 #define BT_PLUGIN_VERSION(_major, _minor, _patch, _extra) BT_PLUGIN_VERSION_WITH_ID(auto, _major, _minor, _patch, _extra)
958 * Defines a source component class attached to the automatic plugin
959 * descriptor. Its ID is the same as its name, hence its name must be a
960 * C identifier in this version.
962 * _name: Component class name (C identifier).
963 * _msg_iter_next_method: Component class's iterator next method
964 * (bt_component_class_source_message_iterator_next_method).
966 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS(_name, _msg_iter_next_method) \
967 BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _msg_iter_next_method)
970 * Defines a filter component class attached to the automatic plugin
971 * descriptor. Its ID is the same as its name, hence its name must be a
972 * C identifier in this version.
974 * _name: Component class name (C identifier).
975 * _msg_iter_next_method: Component class's iterator next method
976 * (bt_component_class_filter_message_iterator_next_method).
978 #define BT_PLUGIN_FILTER_COMPONENT_CLASS(_name, _msg_iter_next_method) \
979 BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _msg_iter_next_method)
982 * Defines a sink component class attached to the automatic plugin
983 * descriptor. Its ID is the same as its name, hence its name must be a
984 * C identifier in this version.
986 * _name: Component class name (C identifier).
987 * _consume_method: Component class's consume method
988 * (bt_component_class_sink_consume_method).
990 #define BT_PLUGIN_SINK_COMPONENT_CLASS(_name, _consume_method) \
991 BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _consume_method)
994 * Defines a description attribute attached to a source component class
995 * descriptor which is attached to the automatic plugin descriptor.
997 * _name: Component class name (C identifier).
998 * _x: Description (C string).
1000 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
1001 BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
1004 * Defines a description attribute attached to a filter component class
1005 * descriptor which is attached to the automatic plugin descriptor.
1007 * _name: Component class name (C identifier).
1008 * _x: Description (C string).
1010 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
1011 BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
1014 * Defines a description attribute attached to a sink component class
1015 * descriptor which is attached to the automatic plugin descriptor.
1017 * _name: Component class name (C identifier).
1018 * _x: Description (C string).
1020 #define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
1021 BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
1024 * Defines a help attribute attached to a source component class
1025 * descriptor which is attached to the automatic plugin descriptor.
1027 * _name: Component class name (C identifier).
1028 * _x: Help (C string).
1030 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP(_name, _x) \
1031 BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
1034 * Defines a help attribute attached to a filter component class
1035 * descriptor which is attached to the automatic plugin descriptor.
1037 * _name: Component class name (C identifier).
1038 * _x: Help (C string).
1040 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP(_name, _x) \
1041 BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
1044 * Defines a help attribute attached to a sink component class
1045 * descriptor which is attached to the automatic plugin descriptor.
1047 * _name: Component class name (C identifier).
1048 * _x: Help (C string).
1050 #define BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(_name, _x) \
1051 BT_PLUGIN_SINK_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
1054 * Defines an initialization method attribute attached to a source
1055 * component class descriptor which is attached to the automatic plugin
1058 * _name: Component class name (C identifier).
1059 * _x: Initialization method (bt_component_class_source_init_method).
1061 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
1062 BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
1065 * Defines an initialization method attribute attached to a filter
1066 * component class descriptor which is attached to the automatic plugin
1069 * _name: Component class name (C identifier).
1070 * _x: Initialization method (bt_component_class_filter_init_method).
1072 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
1073 BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
1076 * Defines an initialization method attribute attached to a sink
1077 * component class descriptor which is attached to the automatic plugin
1080 * _name: Component class name (C identifier).
1081 * _x: Initialization method (bt_component_class_sink_init_method).
1083 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
1084 BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
1087 * Defines a finalization method attribute attached to a source component
1088 * class descriptor which is attached to the automatic plugin
1091 * _name: Component class name (C identifier).
1092 * _x: Initialization method (bt_component_class_source_finalize_method).
1094 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
1095 BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1098 * Defines a finalization method attribute attached to a filter component
1099 * class descriptor which is attached to the automatic plugin
1102 * _name: Component class name (C identifier).
1103 * _x: Initialization method (bt_component_class_filter_finalize_method).
1105 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
1106 BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1109 * Defines a finalization method attribute attached to a sink component class
1110 * descriptor which is attached to the automatic plugin descriptor.
1112 * _name: Component class name (C identifier).
1113 * _x: Initialization method (bt_component_class_sink_finalize_method).
1115 #define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
1116 BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1119 * Defines a query method attribute attached to a source component
1120 * class descriptor which is attached to the automatic plugin
1123 * _name: Component class name (C identifier).
1124 * _x: Initialization method (bt_component_class_source_query_method).
1126 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1127 BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
1130 * Defines a query method attribute attached to a filter component
1131 * class descriptor which is attached to the automatic plugin
1134 * _name: Component class name (C identifier).
1135 * _x: Initialization method (bt_component_class_filter_query_method).
1137 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1138 BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
1141 * Defines a query method attribute attached to a sink component
1142 * class descriptor which is attached to the automatic plugin
1145 * _name: Component class name (C identifier).
1146 * _x: Initialization method (bt_component_class_sink_query_method).
1148 #define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1149 BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
1152 * Defines an accept input port connection method attribute attached to
1153 * a filter component class descriptor which is attached to the
1154 * automatic plugin descriptor.
1156 * _name: Component class name (C identifier).
1157 * _x: Accept port connection method
1158 * (bt_component_class_filter_accept_input_port_connection_method).
1160 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD(_name, _x) \
1161 BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1164 * Defines an accept input port connection method attribute attached to
1165 * a sink component class descriptor which is attached to the automatic
1166 * plugin descriptor.
1168 * _name: Component class name (C identifier).
1169 * _x: Accept port connection method
1170 * (bt_component_class_sink_accept_input_port_connection_method).
1172 #define BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD(_name, _x) \
1173 BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1176 * Defines an accept output port connection method attribute attached to
1177 * a source component class descriptor which is attached to the
1178 * automatic plugin descriptor.
1180 * _name: Component class name (C identifier).
1181 * _x: Accept port connection method
1182 * (bt_component_class_source_accept_output_port_connection_method).
1184 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD(_name, _x) \
1185 BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1188 * Defines an accept output port connection method attribute attached to
1189 * a filter component class descriptor which is attached to the
1190 * automatic plugin descriptor.
1192 * _name: Component class name (C identifier).
1193 * _x: Accept port connection method
1194 * (bt_component_class_filter_accept_output_port_connection_method).
1196 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD(_name, _x) \
1197 BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1200 * Defines an input port connected method attribute attached to a filter
1201 * component class descriptor which is attached to the automatic plugin
1204 * _name: Component class name (C identifier).
1205 * _x: Port connected (bt_component_class_filter_input_port_connected_method).
1207 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD(_name, _x) \
1208 BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1211 * Defines an input port connected method attribute attached to a sink
1212 * component class descriptor which is attached to the automatic plugin
1215 * _name: Component class name (C identifier).
1216 * _x: Port connected (bt_component_class_sink_input_port_connected_method).
1218 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD(_name, _x) \
1219 BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1222 * Defines an output port connected method attribute attached to a source
1223 * component class descriptor which is attached to the automatic plugin
1226 * _name: Component class name (C identifier).
1227 * _x: Port connected (bt_component_class_source_output_port_connected_method).
1229 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD(_name, _x) \
1230 BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1233 * Defines an output port connected method attribute attached to a filter
1234 * component class descriptor which is attached to the automatic plugin
1237 * _name: Component class name (C identifier).
1238 * _x: Port connected (bt_component_class_filter_output_port_connected_method).
1240 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD(_name, _x) \
1241 BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1244 * Defines an iterator initialization method attribute attached to a
1245 * source component class descriptor which is attached to the automatic
1246 * plugin descriptor.
1248 * _name: Component class name (C identifier).
1249 * _x: Iterator initialization method
1250 * (bt_component_class_source_message_iterator_init_method).
1252 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD(_name, _x) \
1253 BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
1256 * Defines an iterator finalize method attribute attached to a source
1257 * component class descriptor which is attached to the automatic plugin
1260 * _name: Component class name (C identifier).
1261 * _x: Iterator finalize method
1262 * (bt_component_class_source_message_iterator_finalize_method).
1264 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD(_name, _x) \
1265 BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1268 * Defines an iterator initialization method attribute attached to a
1269 * filter component class descriptor which is attached to the automatic
1270 * plugin descriptor.
1272 * _name: Component class name (C identifier).
1273 * _x: Iterator initialization method
1274 * (bt_component_class_filter_message_iterator_init_method).
1276 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD(_name, _x) \
1277 BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
1280 * Defines an iterator finalize method attribute attached to a filter
1281 * component class descriptor which is attached to the automatic plugin
1284 * _name: Component class name (C identifier).
1285 * _x: Iterator finalize method
1286 * (bt_component_class_filter_message_iterator_finalize_method).
1288 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD(_name, _x) \
1289 BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1291 #define BT_PLUGIN_MODULE() \
1292 static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_dummy __BT_PLUGIN_DESCRIPTOR_ATTRS = NULL; \
1293 _BT_HIDDEN extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA; \
1294 _BT_HIDDEN extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_END_EXTRA; \
1296 static struct __bt_plugin_descriptor_attribute const * const __bt_plugin_descriptor_attribute_dummy __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS = NULL; \
1297 _BT_HIDDEN extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA; \
1298 _BT_HIDDEN extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA; \
1300 static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_component_class_descriptor_dummy __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = NULL; \
1301 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA; \
1302 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA; \
1304 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; \
1305 _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; \
1306 _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; \
1308 struct __bt_plugin_descriptor const * const *__bt_get_begin_section_plugin_descriptors(void) \
1310 return &__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL; \
1312 struct __bt_plugin_descriptor const * const *__bt_get_end_section_plugin_descriptors(void) \
1314 return &__BT_PLUGIN_DESCRIPTOR_END_SYMBOL; \
1316 struct __bt_plugin_descriptor_attribute const * const *__bt_get_begin_section_plugin_descriptor_attributes(void) \
1318 return &__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL; \
1320 struct __bt_plugin_descriptor_attribute const * const *__bt_get_end_section_plugin_descriptor_attributes(void) \
1322 return &__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL; \
1324 struct __bt_plugin_component_class_descriptor const * const *__bt_get_begin_section_component_class_descriptors(void) \
1326 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL; \
1328 struct __bt_plugin_component_class_descriptor const * const *__bt_get_end_section_component_class_descriptors(void) \
1330 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL; \
1332 struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_begin_section_component_class_descriptor_attributes(void) \
1334 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL; \
1336 struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_end_section_component_class_descriptor_attributes(void) \
1338 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL; \
1345 #endif /* BABELTRACE_PLUGIN_PLUGIN_DEV_H */