1 #ifndef BABELTRACE_PLUGIN_PLUGIN_DEV_H
2 #define BABELTRACE_PLUGIN_PLUGIN_DEV_H
5 * BabelTrace - Babeltrace Plug-in Development API
7 * This is the header that you need to include for the development of
8 * a Babeltrace plug-in.
10 * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
11 * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
13 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
15 * Permission is hereby granted, free of charge, to any person obtaining a copy
16 * of this software and associated documentation files (the "Software"), to deal
17 * in the Software without restriction, including without limitation the rights
18 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19 * copies of the Software, and to permit persons to whom the Software is
20 * furnished to do so, subject to the following conditions:
22 * The above copyright notice and this permission notice shall be included in
23 * all copies or substantial portions of the Software.
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35 #include <babeltrace/plugin/plugin.h>
36 #include <babeltrace/component/component-class.h>
37 #include <babeltrace/component/component-class-source.h>
38 #include <babeltrace/component/component-class-filter.h>
39 #include <babeltrace/component/component-class-sink.h>
46 * Plugin interface's version, not synced with Babeltrace's version
49 #define __BT_PLUGIN_VERSION_MAJOR 1
50 #define __BT_PLUGIN_VERSION_MINOR 0
52 /* Plugin initialization function type */
53 typedef enum bt_plugin_status (*bt_plugin_init_func
)(
54 struct bt_plugin
*plugin
);
56 /* Plugin exit function type */
57 typedef enum bt_plugin_status (*bt_plugin_exit_func
)(void);
60 * Function to call from a plugin's initialization function to add a
61 * component class to a plugin object.
63 extern enum bt_plugin_status
bt_plugin_add_component_class(
64 struct bt_plugin
*plugin
,
65 struct bt_component_class
*component_class
);
67 /* Plugin descriptor: describes a single plugin (internal use) */
68 struct __bt_plugin_descriptor
{
69 /* Plugin's interface major version number */
72 /* Plugin's interface minor version number */
77 } __attribute__((packed
));
79 /* Type of a plugin attribute (internal use) */
80 enum __bt_plugin_descriptor_attribute_type
{
81 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT
= 0,
82 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT
= 1,
83 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR
= 2,
84 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE
= 3,
85 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION
= 4,
86 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION
= 5,
89 /* Plugin (user) version */
90 struct __bt_plugin_descriptor_version
{
97 /* Plugin attribute (internal use) */
98 struct __bt_plugin_descriptor_attribute
{
99 /* Plugin descriptor to which to associate this attribute */
100 const struct __bt_plugin_descriptor
*plugin_descriptor
;
102 /* Name of the attribute's type for debug purposes */
103 const char *type_name
;
105 /* Attribute's type */
106 enum __bt_plugin_descriptor_attribute_type type
;
108 /* Attribute's value (depends on attribute's type) */
110 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT */
111 bt_plugin_init_func init
;
113 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT */
114 bt_plugin_exit_func exit
;
116 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR */
119 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE */
122 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
123 const char *description
;
125 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION */
126 struct __bt_plugin_descriptor_version version
;
128 } __attribute__((packed
));
130 /* Component class descriptor (internal use) */
131 struct __bt_plugin_component_class_descriptor
{
133 * Plugin descriptor to which to associate this component
136 const struct __bt_plugin_descriptor
*plugin_descriptor
;
138 /* Component class name */
141 /* Component class type */
142 enum bt_component_class_type type
;
144 /* Mandatory methods (depends on component class type) */
146 /* BT_COMPONENT_CLASS_TYPE_SOURCE */
148 bt_component_class_notification_iterator_get_method notif_iter_get
;
149 bt_component_class_notification_iterator_next_method notif_iter_next
;
152 /* BT_COMPONENT_CLASS_TYPE_FILTER */
154 bt_component_class_notification_iterator_get_method notif_iter_get
;
155 bt_component_class_notification_iterator_next_method notif_iter_next
;
158 /* BT_COMPONENT_CLASS_TYPE_SINK */
160 bt_component_class_sink_consume_method consume
;
163 } __attribute__((packed
));
165 /* Type of a component class attribute (internal use) */
166 enum __bt_plugin_component_class_descriptor_attribute_type
{
167 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION
= 0,
168 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD
= 1,
169 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESTROY_METHOD
= 2,
170 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FILTER_ADD_ITERATOR_METHOD
= 3,
171 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_SINK_ADD_ITERATOR_METHOD
= 4,
172 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD
= 5,
173 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_DESTROY_METHOD
= 6,
174 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_SEEK_TIME_METHOD
= 7,
177 /* Component class attribute (internal use) */
178 struct __bt_plugin_component_class_descriptor_attribute
{
180 * Component class plugin attribute to which to associate this
181 * component class attribute.
183 const struct __bt_plugin_component_class_descriptor
*comp_class_descriptor
;
185 /* Name of the attribute's type for debug purposes */
186 const char *type_name
;
188 /* Attribute's type */
189 enum __bt_plugin_component_class_descriptor_attribute_type type
;
191 /* Attribute's value (depends on attribute's type) */
193 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
194 const char *description
;
196 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD */
197 bt_component_class_init_method init_method
;
199 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESTROY_METHOD */
200 bt_component_class_destroy_method destroy_method
;
202 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FILTER_ADD_ITERATOR_METHOD */
203 bt_component_class_filter_add_iterator_method filter_add_iterator_method
;
205 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_SINK_ADD_ITERATOR_METHOD */
206 bt_component_class_sink_add_iterator_method sink_add_iterator_method
;
208 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD */
209 bt_component_class_notification_iterator_init_method notif_iter_init_method
;
211 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_DESTROY_METHOD */
212 bt_component_class_notification_iterator_destroy_method notif_iter_destroy_method
;
214 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_SEEK_TIME_METHOD */
215 bt_component_class_notification_iterator_seek_time_method notif_iter_seek_time_method
;
217 } __attribute__((packed
));
220 * Variable attributes for a plugin descriptor pointer to be added to
221 * the plugin descriptor section (internal use).
223 #define __BT_PLUGIN_DESCRIPTOR_ATTRS \
224 __attribute__((section("__bt_plugin_descriptors"), used))
227 * Variable attributes for a plugin attribute pointer to be added to
228 * the plugin attribute section (internal use).
230 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS \
231 __attribute__((section("__bt_plugin_descriptor_attributes"), used))
234 * Variable attributes for a component class descriptor pointer to be
235 * added to the component class descriptor section (internal use).
237 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS \
238 __attribute__((section("__bt_plugin_component_class_descriptors"), used))
241 * Variable attributes for a component class descriptor attribute
242 * pointer to be added to the component class descriptor attribute
243 * section (internal use).
245 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS \
246 __attribute__((section("__bt_plugin_component_class_descriptor_attributes"), used))
249 * Declares a plugin descriptor pointer variable with a custom ID.
251 * _id: ID (any valid C identifier except `auto`).
253 #define BT_PLUGIN_DECLARE(_id) extern struct __bt_plugin_descriptor __bt_plugin_descriptor_##_id
256 * Defines a plugin descriptor with a custom ID.
258 * _id: ID (any valid C identifier except `auto`).
259 * _name: Plugin's name (C string).
261 #define BT_PLUGIN_WITH_ID(_id, _name) \
262 struct __bt_plugin_descriptor __bt_plugin_descriptor_##_id = { \
263 .major = __BT_PLUGIN_VERSION_MAJOR, \
264 .minor = __BT_PLUGIN_VERSION_MINOR, \
267 static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_##_id##_ptr __BT_PLUGIN_DESCRIPTOR_ATTRS = &__bt_plugin_descriptor_##_id; \
268 extern struct __bt_plugin_descriptor const *__start___bt_plugin_descriptors; \
269 extern struct __bt_plugin_descriptor const *__stop___bt_plugin_descriptors
272 * Defines a plugin attribute (generic, internal use).
274 * _attr_name: Name of the attribute (C identifier).
275 * _attr_type: Type of the attribute (enum __bt_plugin_descriptor_attribute_type).
276 * _id: Plugin descriptor ID (C identifier).
279 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _x) \
280 static struct __bt_plugin_descriptor_attribute __bt_plugin_descriptor_attribute_##_id##_##_attr_name = { \
281 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
282 .type_name = #_attr_name, \
283 .type = _attr_type, \
284 .value._attr_name = _x, \
286 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; \
287 extern struct __bt_plugin_descriptor_attribute const *__start___bt_plugin_descriptor_attributes; \
288 extern struct __bt_plugin_descriptor_attribute const *__stop___bt_plugin_descriptor_attributes
291 * Defines a plugin initialization function attribute attached to a
292 * specific plugin descriptor.
294 * _id: Plugin descriptor ID (C identifier).
295 * _x: Initialization function (bt_plugin_init_func).
297 #define BT_PLUGIN_INIT_WITH_ID(_id, _x) \
298 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(init, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT, _id, _x)
301 * Defines a plugin exit function attribute attached to a specific
304 * _id: Plugin descriptor ID (C identifier).
305 * _x: Exit function (bt_plugin_exit_func).
307 #define BT_PLUGIN_EXIT_WITH_ID(_id, _x) \
308 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(exit, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT, _id, _x)
311 * Defines an author attribute attached to a specific plugin descriptor.
313 * _id: Plugin descriptor ID (C identifier).
314 * _x: Author (C string).
316 #define BT_PLUGIN_AUTHOR_WITH_ID(_id, _x) \
317 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(author, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR, _id, _x)
320 * Defines a license attribute attached to a specific plugin descriptor.
322 * _id: Plugin descriptor ID (C identifier).
323 * _x: License (C string).
325 #define BT_PLUGIN_LICENSE_WITH_ID(_id, _x) \
326 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(license, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE, _id, _x)
329 * Defines a description attribute attached to a specific plugin
332 * _id: Plugin descriptor ID (C identifier).
333 * _x: Description (C string).
335 #define BT_PLUGIN_DESCRIPTION_WITH_ID(_id, _x) \
336 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _x)
338 #define __BT_PLUGIN_VERSION_STRUCT_VALUE(_major, _minor, _patch, _extra) \
339 {.major = _major, .minor = _minor, .patch = _patch, .extra = _extra,}
342 * Defines a version attribute attached to a specific plugin descriptor.
344 * _id: Plugin descriptor ID (C identifier).
345 * _major: Plugin's major version (uint32_t).
346 * _minor: Plugin's minor version (uint32_t).
347 * _patch: Plugin's patch version (uint32_t).
348 * _extra: Plugin's version extra information (C string).
350 #define BT_PLUGIN_VERSION_WITH_ID(_id, _major, _minor, _patch, _extra) \
351 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(version, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION, _id, __BT_PLUGIN_VERSION_STRUCT_VALUE(_major, _minor, _patch, _extra))
354 * Declaration of start and stop symbols of component class descriptors
357 #define __BT_PLUGIN_DECL_COMPONENT_CLASS_DESCRIPTORS_SECTION_START_STOP \
358 extern struct __bt_plugin_component_class_descriptor const *__start___bt_plugin_component_class_descriptors; \
359 extern struct __bt_plugin_component_class_descriptor const *__stop___bt_plugin_component_class_descriptors
362 * Defines a source component class descriptor with a custom ID.
364 * _id: ID (any valid C identifier except `auto`).
365 * _comp_class_id: Component class ID (C identifier).
366 * _name: Component class name (C string).
367 * _notif_iter_get_method: Component class's iterator get method
368 * (bt_component_class_notification_iterator_get_method).
369 * _notif_iter_next_method: Component class's iterator next method
370 * (bt_component_class_notification_iterator_next_method).
372 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _notif_iter_get_method, _notif_iter_next_method) \
373 static struct __bt_plugin_component_class_descriptor __bt_plugin_source_component_class_descriptor_##_id##_##_comp_class_id = { \
374 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
376 .type = BT_COMPONENT_CLASS_TYPE_SOURCE, \
377 .methods.source = { \
378 .notif_iter_get = _notif_iter_get_method, \
379 .notif_iter_next = _notif_iter_next_method, \
382 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; \
383 __BT_PLUGIN_DECL_COMPONENT_CLASS_DESCRIPTORS_SECTION_START_STOP
386 * Defines a filter component class descriptor with a custom ID.
388 * _id: ID (any valid C identifier except `auto`).
389 * _comp_class_id: Component class ID (C identifier).
390 * _name: Component class name (C string).
391 * _notif_iter_get_method: Component class's iterator get method
392 * (bt_component_class_notification_iterator_get_method).
393 * _notif_iter_next_method: Component class's iterator next method
394 * (bt_component_class_notification_iterator_next_method).
396 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _notif_iter_get_method, _notif_iter_next_method) \
397 static struct __bt_plugin_component_class_descriptor __bt_plugin_filter_component_class_descriptor_##_id##_##_comp_class_id = { \
398 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
400 .type = BT_COMPONENT_CLASS_TYPE_FILTER, \
401 .methods.filter = { \
402 .notif_iter_get = _notif_iter_get_method, \
403 .notif_iter_next = _notif_iter_next_method, \
406 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; \
407 __BT_PLUGIN_DECL_COMPONENT_CLASS_DESCRIPTORS_SECTION_START_STOP
410 * Defines a sink component class descriptor with a custom ID.
412 * _id: ID (any valid C identifier except `auto`).
413 * _comp_class_id: Component class ID (C identifier).
414 * _name: Component class name (C string).
415 * _consume_method: Component class's iterator consume method
416 * (bt_component_class_sink_consume_method).
418 #define BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _consume_method) \
419 static struct __bt_plugin_component_class_descriptor __bt_plugin_sink_component_class_descriptor_##_id##_##_comp_class_id = { \
420 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
422 .type = BT_COMPONENT_CLASS_TYPE_SINK, \
424 .consume = _consume_method, \
427 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; \
428 __BT_PLUGIN_DECL_COMPONENT_CLASS_DESCRIPTORS_SECTION_START_STOP
431 * Defines a component class descriptor attribute (generic, internal
434 * _id: Plugin descriptor ID (C identifier).
435 * _comp_class_id: Component class ID (C identifier).
436 * _type: Component class type (`source`, `filter`, or `sink`).
437 * _attr_name: Name of the attribute (C identifier).
438 * _attr_type: Type of the attribute
439 * (enum __bt_plugin_descriptor_attribute_type).
442 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _comp_class_id, _type, _x) \
443 static struct __bt_plugin_component_class_descriptor_attribute __bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_comp_class_id##_##_attr_name = { \
444 .comp_class_descriptor = &__bt_plugin_##_type##_component_class_descriptor_##_id##_##_comp_class_id, \
445 .type_name = #_attr_name, \
446 .type = _attr_type, \
447 .value._attr_name = _x, \
449 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; \
450 extern struct __bt_plugin_component_class_descriptor_attribute const *__start___bt_plugin_component_class_descriptor_attributes; \
451 extern struct __bt_plugin_component_class_descriptor_attribute const *__stop___bt_plugin_component_class_descriptor_attributes
454 * Defines a description attribute attached to a specific source
455 * component class descriptor.
457 * _id: Plugin descriptor ID (C identifier).
458 * _comp_class_id: Component class descriptor ID (C identifier).
459 * _x: Description (C string).
461 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
462 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, source, _x)
465 * Defines a description attribute attached to a specific filter
466 * component class descriptor.
468 * _id: Plugin descriptor ID (C identifier).
469 * _comp_class_id: Component class descriptor ID (C identifier).
470 * _x: Description (C string).
472 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
473 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, filter, _x)
476 * Defines a description attribute attached to a specific sink
477 * component class descriptor.
479 * _id: Plugin descriptor ID (C identifier).
480 * _comp_class_id: Component class descriptor ID (C identifier).
481 * _x: Description (C string).
483 #define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
484 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, sink, _x)
487 * Defines an initialization method attribute attached to a specific
488 * source component class descriptor.
490 * _id: Plugin descriptor ID (C identifier).
491 * _comp_class_id: Component class descriptor ID (C identifier).
492 * _x: Initialization method (bt_component_class_init_method).
494 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
495 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, source, _x)
498 * Defines an initialization method attribute attached to a specific
499 * filter component class descriptor.
501 * _id: Plugin descriptor ID (C identifier).
502 * _comp_class_id: Component class descriptor ID (C identifier).
503 * _x: Initialization method (bt_component_class_init_method).
505 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
506 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, filter, _x)
509 * Defines an initialization method attribute attached to a specific
510 * sink component class descriptor.
512 * _id: Plugin descriptor ID (C identifier).
513 * _comp_class_id: Component class descriptor ID (C identifier).
514 * _x: Initialization method (bt_component_class_init_method).
516 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
517 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, sink, _x)
520 * Defines a destroy method attribute attached to a specific source
521 * component class descriptor.
523 * _id: Plugin descriptor ID (C identifier).
524 * _comp_class_id: Component class descriptor ID (C identifier).
525 * _x: Destroy method (bt_component_class_destroy_method).
527 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESTROY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
528 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(destroy_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESTROY_METHOD, _id, _comp_class_id, source, _x)
531 * Defines a destroy method attribute attached to a specific filter
532 * component class descriptor.
534 * _id: Plugin descriptor ID (C identifier).
535 * _comp_class_id: Component class descriptor ID (C identifier).
536 * _x: Destroy method (bt_component_class_destroy_method).
538 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESTROY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
539 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(destroy_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESTROY_METHOD, _id, _comp_class_id, filter, _x)
542 * Defines a destroy method attribute attached to a specific sink
543 * component class descriptor.
545 * _id: Plugin descriptor ID (C identifier).
546 * _comp_class_id: Component class descriptor ID (C identifier).
547 * _x: Destroy method (bt_component_class_destroy_method).
549 #define BT_PLUGIN_SINK_COMPONENT_CLASS_DESTROY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
550 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(destroy_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESTROY_METHOD, _id, _comp_class_id, sink, _x)
553 * Defines an add iterator method attribute attached to a specific
554 * filter component class descriptor.
556 * _id: Plugin descriptor ID (C identifier).
557 * _comp_class_id: Component class descriptor ID (C identifier).
558 * _x: Add iterator method
559 * (bt_component_class_filter_add_iterator_method).
561 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ADD_ITERATOR_METHOD_WITH_ID(_id, _comp_class_id, _x) \
562 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_add_iterator_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FILTER_ADD_ITERATOR_METHOD, _id, _comp_class_id, filter, _x)
565 * Defines an add iterator method attribute attached to a specific
566 * sink component class descriptor.
568 * _id: Plugin descriptor ID (C identifier).
569 * _comp_class_id: Component class descriptor ID (C identifier).
570 * _x: Add iterator method
571 * (bt_component_class_sink_add_iterator_method).
573 #define BT_PLUGIN_SINK_COMPONENT_CLASS_ADD_ITERATOR_METHOD_WITH_ID(_id, _comp_class_id, _x) \
574 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_add_iterator_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_SINK_ADD_ITERATOR_METHOD, _id, _comp_class_id, sink, _x)
577 * Defines an iterator initialization method attribute attached to a
578 * specific source component class descriptor.
580 * _id: Plugin descriptor ID (C identifier).
581 * _comp_class_id: Component class descriptor ID (C identifier).
582 * _x: Iterator initialization method
583 * (bt_component_class_notification_iterator_init_method).
585 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
586 __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)
589 * Defines an iterator destroy method attribute attached to a specific
590 * source component class descriptor.
592 * _id: Plugin descriptor ID (C identifier).
593 * _comp_class_id: Component class descriptor ID (C identifier).
594 * _x: Iterator destroy method
595 * (bt_component_class_notification_iterator_destroy_method).
597 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_DESTROY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
598 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(notif_iter_destroy_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_DESTROY_METHOD, _id, _comp_class_id, source, _x)
601 * Defines an iterator seek time method attribute attached to a specific
602 * source component class descriptor.
604 * _id: Plugin descriptor ID (C identifier).
605 * _comp_class_id: Component class descriptor ID (C identifier).
606 * _x: Iterator seek time method
607 * (bt_component_class_notification_iterator_seek_time_method).
609 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD_WITH_ID(_id, _comp_class_id, _x) \
610 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(notif_iter_seek_time_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_SEEK_TIME_METHOD, _id, _comp_class_id, source, _x)
613 * Defines an iterator initialization method attribute attached to a
614 * specific filter component class descriptor.
616 * _id: Plugin descriptor ID (C identifier).
617 * _comp_class_id: Component class descriptor ID (C identifier).
618 * _x: Iterator initialization method
619 * (bt_component_class_notification_iterator_init_method).
621 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
622 __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)
625 * Defines an iterator destroy method attribute attached to a specific
626 * filter component class descriptor.
628 * _id: Plugin descriptor ID (C identifier).
629 * _comp_class_id: Component class descriptor ID (C identifier).
630 * _x: Iterator destroy method
631 * (bt_component_class_notification_iterator_destroy_method).
633 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_DESTROY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
634 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(notif_iter_destroy_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_DESTROY_METHOD, _id, _comp_class_id, filter, _x)
637 * Defines an iterator seek time method attribute attached to a specific
638 * filter component class descriptor.
640 * _id: Plugin descriptor ID (C identifier).
641 * _comp_class_id: Component class descriptor ID (C identifier).
642 * _x: Iterator seek time method
643 * (bt_component_class_notification_iterator_seek_time_method).
645 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD_WITH_ID(_id, _comp_class_id, _x) \
646 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(notif_iter_seek_time_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_SEEK_TIME_METHOD, _id, _comp_class_id, filter, _x)
649 * Defines a plugin descriptor with an automatic ID.
651 * _name: Plugin's name (C string).
653 #define BT_PLUGIN(_name) static BT_PLUGIN_WITH_ID(auto, #_name)
656 * Defines a plugin initialization function attribute attached to the
657 * automatic plugin descriptor.
659 * _x: Initialization function (bt_plugin_init_func).
661 #define BT_PLUGIN_INIT(_x) BT_PLUGIN_INIT_WITH_ID(auto, _x)
664 * Defines a plugin exit function attribute attached to the automatic
667 * _x: Exit function (bt_plugin_exit_func).
669 #define BT_PLUGIN_EXIT(_x) BT_PLUGIN_EXIT_WITH_ID(auto, _x)
672 * Defines an author attribute attached to the automatic plugin
675 * _x: Author (C string).
677 #define BT_PLUGIN_AUTHOR(_x) BT_PLUGIN_AUTHOR_WITH_ID(auto, _x)
680 * Defines a license attribute attached to the automatic plugin
683 * _x: License (C string).
685 #define BT_PLUGIN_LICENSE(_x) BT_PLUGIN_LICENSE_WITH_ID(auto, _x)
688 * Defines a description attribute attached to the automatic plugin
691 * _x: Description (C string).
693 #define BT_PLUGIN_DESCRIPTION(_x) BT_PLUGIN_DESCRIPTION_WITH_ID(auto, _x)
696 * Defines a version attribute attached to the automatic plugin
699 * _major: Plugin's major version (uint32_t).
700 * _minor: Plugin's minor version (uint32_t).
701 * _patch: Plugin's patch version (uint32_t).
702 * _extra: Plugin's version extra information (C string).
704 #define BT_PLUGIN_VERSION(_major, _minor, _patch, _extra) BT_PLUGIN_VERSION_WITH_ID(auto, _major, _minor, _patch, _extra)
707 * Defines a source component class attached to the automatic plugin
708 * descriptor. Its ID is the same as its name, hence its name must be a
709 * C identifier in this version.
711 * _name: Component class name (C identifier).
712 * _notif_iter_get_method: Component class's iterator get method
713 * (bt_component_class_notification_iterator_get_method).
714 * _notif_iter_next_method: Component class's iterator next method
715 * (bt_component_class_notification_iterator_next_method).
717 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS(_name, _notif_iter_get_method, _notif_iter_next_method) \
718 BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _notif_iter_get_method, _notif_iter_next_method)
721 * Defines a filter component class attached to the automatic plugin
722 * descriptor. Its ID is the same as its name, hence its name must be a
723 * C identifier in this version.
725 * _name: Component class name (C identifier).
726 * _notif_iter_get_method: Component class's iterator get method
727 * (bt_component_class_notification_iterator_get_method).
728 * _notif_iter_next_method: Component class's iterator next method
729 * (bt_component_class_notification_iterator_next_method).
731 #define BT_PLUGIN_FILTER_COMPONENT_CLASS(_name, _notif_iter_get_method, _notif_iter_next_method) \
732 BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _notif_iter_get_method, _notif_iter_next_method)
735 * Defines a sink component class attached to the automatic plugin
736 * descriptor. Its ID is the same as its name, hence its name must be a
737 * C identifier in this version.
739 * _name: Component class name (C identifier).
740 * _consume_method: Component class's consume method
741 * (bt_component_class_sink_consume_method).
743 #define BT_PLUGIN_SINK_COMPONENT_CLASS(_name, _consume_method) \
744 BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _consume_method)
747 * Defines a description attribute attached to a source component class
748 * descriptor which is attached to the automatic plugin descriptor.
750 * _name: Component class name (C identifier).
751 * _x: Description (C string).
753 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
754 BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
757 * Defines a description attribute attached to a filter component class
758 * descriptor which is attached to the automatic plugin descriptor.
760 * _name: Component class name (C identifier).
761 * _x: Description (C string).
763 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
764 BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
767 * Defines a description attribute attached to a sink component class
768 * descriptor which is attached to the automatic plugin descriptor.
770 * _name: Component class name (C identifier).
771 * _x: Description (C string).
773 #define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
774 BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
777 * Defines an initialization method attribute attached to a source
778 * component class descriptor which is attached to the automatic plugin
781 * _name: Component class name (C identifier).
782 * _x: Initialization method (bt_component_class_init_method).
784 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
785 BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
788 * Defines an initialization method attribute attached to a filter
789 * component class descriptor which is attached to the automatic plugin
792 * _name: Component class name (C identifier).
793 * _x: Initialization method (bt_component_class_init_method).
795 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
796 BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
799 * Defines an initialization method attribute attached to a sink
800 * component class descriptor which is attached to the automatic plugin
803 * _name: Component class name (C identifier).
804 * _x: Initialization method (bt_component_class_init_method).
806 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
807 BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
810 * Defines a destroy method attribute attached to a source component
811 * class descriptor which is attached to the automatic plugin
814 * _name: Component class name (C identifier).
815 * _x: Initialization method (bt_component_class_destroy_method).
817 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESTROY_METHOD(_name, _x) \
818 BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESTROY_METHOD_WITH_ID(auto, _name, _x)
821 * Defines a destroy method attribute attached to a filter component
822 * class descriptor which is attached to the automatic plugin
825 * _name: Component class name (C identifier).
826 * _x: Initialization method (bt_component_class_destroy_method).
828 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESTROY_METHOD(_name, _x) \
829 BT_PLUGIN_FILTER_COMPONENT_CLASS_DESTROY_METHOD_WITH_ID(auto, _name, _x)
832 * Defines a destroy method attribute attached to a sink component class
833 * descriptor which is attached to the automatic plugin descriptor.
835 * _name: Component class name (C identifier).
836 * _x: Initialization method (bt_component_class_destroy_method).
838 #define BT_PLUGIN_SINK_COMPONENT_CLASS_DESTROY_METHOD(_name, _x) \
839 BT_PLUGIN_SINK_COMPONENT_CLASS_DESTROY_METHOD_WITH_ID(auto, _name, _x)
842 * Defines an add iterator method attribute attached to a filter
843 * component class descriptor which is attached to the automatic plugin
846 * _name: Component class name (C identifier).
847 * _x: Add iterator method (bt_component_class_filter_add_iterator_method).
849 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ADD_ITERATOR_METHOD(_name, _x) \
850 BT_PLUGIN_FILTER_COMPONENT_CLASS_ADD_ITERATOR_METHOD_WITH_ID(auto, _name, _x)
853 * Defines an add iterator method attribute attached to a sink
854 * component class descriptor which is attached to the automatic plugin
857 * _name: Component class name (C identifier).
858 * _x: Add iterator method (bt_component_class_sink_add_iterator_method).
860 #define BT_PLUGIN_SINK_COMPONENT_CLASS_ADD_ITERATOR_METHOD(_name, _x) \
861 BT_PLUGIN_SINK_COMPONENT_CLASS_ADD_ITERATOR_METHOD_WITH_ID(auto, _name, _x)
864 * Defines an iterator initialization method attribute attached to a
865 * source component class descriptor which is attached to the automatic
868 * _name: Component class name (C identifier).
869 * _x: Iterator initialization method
870 * (bt_component_class_notification_iterator_init_method).
872 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(_name, _x) \
873 BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
876 * Defines an iterator destroy method attribute attached to a source
877 * component class descriptor which is attached to the automatic plugin
880 * _name: Component class name (C identifier).
881 * _x: Iterator destroy method
882 * (bt_component_class_notification_iterator_destroy_method).
884 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_DESTROY_METHOD(_name, _x) \
885 BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_DESTROY_METHOD_WITH_ID(auto, _name, _x)
888 * Defines an iterator seek time method attribute attached to a source
889 * component class descriptor which is attached to the automatic plugin
892 * _name: Component class name (C identifier).
893 * _x: Iterator seek time method
894 * (bt_component_class_notification_iterator_seek_time_method).
896 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD(_name, _x) \
897 BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD_WITH_ID(auto, _name, _x)
900 * Defines an iterator initialization method attribute attached to a
901 * filter component class descriptor which is attached to the automatic
904 * _name: Component class name (C identifier).
905 * _x: Iterator initialization method
906 * (bt_component_class_notification_iterator_init_method).
908 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(_name, _x) \
909 BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
912 * Defines an iterator destroy method attribute attached to a filter
913 * component class descriptor which is attached to the automatic plugin
916 * _name: Component class name (C identifier).
917 * _x: Iterator destroy method
918 * (bt_component_class_notification_iterator_destroy_method).
920 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_DESTROY_METHOD(_name, _x) \
921 BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_DESTROY_METHOD_WITH_ID(auto, _name, _x)
924 * Defines an iterator seek time method attribute attached to a filter
925 * component class descriptor which is attached to the automatic plugin
928 * _name: Component class name (C identifier).
929 * _x: Iterator seek time method
930 * (bt_component_class_notification_iterator_seek_time_method).
932 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD(_name, _x) \
933 BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD_WITH_ID(auto, _name, _x)
939 #endif /* BABELTRACE_PLUGIN_PLUGIN_DEV_H */