c83449a85220fe3ac9e77b0b6c73d8ec969f9036
[babeltrace.git] / include / babeltrace / plugin / plugin-dev.h
1 #ifndef BABELTRACE_PLUGIN_PLUGIN_DEV_H
2 #define BABELTRACE_PLUGIN_PLUGIN_DEV_H
3
4 /*
5 * This is the header that you need to include for the development of
6 * a Babeltrace plug-in.
7 *
8 * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
10 *
11 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining a copy
14 * of this software and associated documentation files (the "Software"), to deal
15 * in the Software without restriction, including without limitation the rights
16 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 * copies of the Software, and to permit persons to whom the Software is
18 * furnished to do so, subject to the following conditions:
19 *
20 * The above copyright notice and this permission notice shall be included in
21 * all copies or substantial portions of the Software.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29 * SOFTWARE.
30 */
31
32 #include <stdint.h>
33
34 /* For enum bt_plugin_status */
35 #include <babeltrace/plugin/plugin-const.h>
36
37 /* For enum bt_component_class_type */
38 #include <babeltrace/graph/component-class-const.h>
39
40 /* For component class method type definitions */
41 #include <babeltrace/graph/component-class-source-const.h>
42 #include <babeltrace/graph/component-class-filter-const.h>
43 #include <babeltrace/graph/component-class-sink-const.h>
44
45 /*
46 * _BT_HIDDEN: set the hidden attribute for internal functions
47 * On Windows, symbols are local unless explicitly exported,
48 * see https://gcc.gnu.org/wiki/Visibility
49 */
50 #if defined(_WIN32) || defined(__CYGWIN__)
51 #define _BT_HIDDEN
52 #else
53 #define _BT_HIDDEN __attribute__((visibility("hidden")))
54 #endif
55
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59
60 /*
61 * Plugin interface's version, not synced with Babeltrace's version
62 * (internal use).
63 */
64 #define __BT_PLUGIN_VERSION_MAJOR 1
65 #define __BT_PLUGIN_VERSION_MINOR 0
66
67 /* Plugin initialization function type */
68 typedef enum bt_plugin_status (*bt_plugin_init_func)(
69 const struct bt_plugin *plugin);
70
71 /* Plugin exit function type */
72 typedef enum bt_plugin_status (*bt_plugin_exit_func)(void);
73
74 /* Plugin descriptor: describes a single plugin (internal use) */
75 struct __bt_plugin_descriptor {
76 /* Plugin's interface major version number */
77 uint32_t major;
78
79 /* Plugin's interface minor version number */
80 uint32_t minor;
81
82 /* Plugin's name */
83 const char *name;
84 } __attribute__((packed));
85
86 /* Type of a plugin attribute (internal use) */
87 enum __bt_plugin_descriptor_attribute_type {
88 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT = 0,
89 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT = 1,
90 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR = 2,
91 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE = 3,
92 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION = 4,
93 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION = 5,
94 };
95
96 /* Plugin (user) version */
97 struct __bt_plugin_descriptor_version {
98 uint32_t major;
99 uint32_t minor;
100 uint32_t patch;
101 const char *extra;
102 };
103
104 /* Plugin attribute (internal use) */
105 struct __bt_plugin_descriptor_attribute {
106 /* Plugin descriptor to which to associate this attribute */
107 const struct __bt_plugin_descriptor *plugin_descriptor;
108
109 /* Name of the attribute's type for debug purposes */
110 const char *type_name;
111
112 /* Attribute's type */
113 enum __bt_plugin_descriptor_attribute_type type;
114
115 /* Attribute's value (depends on attribute's type) */
116 union {
117 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT */
118 bt_plugin_init_func init;
119
120 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT */
121 bt_plugin_exit_func exit;
122
123 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR */
124 const char *author;
125
126 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE */
127 const char *license;
128
129 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
130 const char *description;
131
132 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION */
133 struct __bt_plugin_descriptor_version version;
134 } value;
135 } __attribute__((packed));
136
137 /* Component class descriptor (internal use) */
138 struct __bt_plugin_component_class_descriptor {
139 /*
140 * Plugin descriptor to which to associate this component
141 * class descriptor.
142 */
143 const struct __bt_plugin_descriptor *plugin_descriptor;
144
145 /* Component class name */
146 const char *name;
147
148 /* Component class type */
149 enum bt_component_class_type type;
150
151 /* Mandatory methods (depends on component class type) */
152 union {
153 /* BT_COMPONENT_CLASS_TYPE_SOURCE */
154 struct {
155 bt_component_class_source_notification_iterator_next_method notif_iter_next;
156 } source;
157
158 /* BT_COMPONENT_CLASS_TYPE_FILTER */
159 struct {
160 bt_component_class_filter_notification_iterator_next_method notif_iter_next;
161 } filter;
162
163 /* BT_COMPONENT_CLASS_TYPE_SINK */
164 struct {
165 bt_component_class_sink_consume_method consume;
166 } sink;
167 } methods;
168 } __attribute__((packed));
169
170 /* Type of a component class attribute (internal use) */
171 enum __bt_plugin_component_class_descriptor_attribute_type {
172 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION = 0,
173 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP = 1,
174 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD = 2,
175 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD = 3,
176 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD = 4,
177 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_INPUT_PORT_CONNECTION_METHOD = 5,
178 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD = 6,
179 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD = 7,
180 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD = 8,
181 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_DISCONNECTED_METHOD = 9,
182 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_DISCONNECTED_METHOD = 10,
183 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD = 11,
184 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD = 12,
185 };
186
187 /* Component class attribute (internal use) */
188 struct __bt_plugin_component_class_descriptor_attribute {
189 /*
190 * Component class plugin attribute to which to associate this
191 * component class attribute.
192 */
193 const struct __bt_plugin_component_class_descriptor *comp_class_descriptor;
194
195 /* Name of the attribute's type for debug purposes */
196 const char *type_name;
197
198 /* Attribute's type */
199 enum __bt_plugin_component_class_descriptor_attribute_type type;
200
201 /* Attribute's value (depends on attribute's type) */
202 union {
203 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
204 const char *description;
205
206 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP */
207 const char *help;
208
209 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD */
210 bt_component_class_source_init_method source_init_method;
211 bt_component_class_filter_init_method filter_init_method;
212 bt_component_class_sink_init_method sink_init_method;
213
214 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD */
215 bt_component_class_source_finalize_method source_finalize_method;
216 bt_component_class_filter_finalize_method filter_finalize_method;
217 bt_component_class_sink_finalize_method sink_finalize_method;
218
219 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD */
220 bt_component_class_source_query_method source_query_method;
221 bt_component_class_filter_query_method filter_query_method;
222 bt_component_class_sink_query_method sink_query_method;
223
224 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_INPUT_PORT_CONNECTION_METHOD */
225 bt_component_class_filter_accept_input_port_connection_method filter_accept_input_port_connection_method;
226 bt_component_class_sink_accept_input_port_connection_method sink_accept_input_port_connection_method;
227
228 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD */
229 bt_component_class_source_accept_output_port_connection_method source_accept_output_port_connection_method;
230 bt_component_class_filter_accept_output_port_connection_method filter_accept_output_port_connection_method;
231
232 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD */
233 bt_component_class_filter_input_port_connected_method filter_input_port_connected_method;
234 bt_component_class_sink_input_port_connected_method sink_input_port_connected_method;
235
236 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD */
237 bt_component_class_source_output_port_connected_method source_output_port_connected_method;
238 bt_component_class_filter_output_port_connected_method filter_output_port_connected_method;
239
240 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_DISCONNECTED_METHOD */
241 bt_component_class_filter_input_port_disconnected_method filter_input_port_disconnected_method;
242 bt_component_class_sink_input_port_disconnected_method sink_input_port_disconnected_method;
243
244 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_DISCONNECTED_METHOD */
245 bt_component_class_source_output_port_disconnected_method source_output_port_disconnected_method;
246 bt_component_class_filter_output_port_disconnected_method filter_output_port_disconnected_method;
247
248 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD */
249 bt_component_class_source_notification_iterator_init_method source_notif_iter_init_method;
250 bt_component_class_filter_notification_iterator_init_method filter_notif_iter_init_method;
251
252 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD */
253 bt_component_class_source_notification_iterator_finalize_method source_notif_iter_finalize_method;
254 bt_component_class_filter_notification_iterator_finalize_method filter_notif_iter_finalize_method;
255 } value;
256 } __attribute__((packed));
257
258 struct __bt_plugin_descriptor const * const *__bt_get_begin_section_plugin_descriptors(void);
259 struct __bt_plugin_descriptor const * const *__bt_get_end_section_plugin_descriptors(void);
260 struct __bt_plugin_descriptor_attribute const * const *__bt_get_begin_section_plugin_descriptor_attributes(void);
261 struct __bt_plugin_descriptor_attribute const * const *__bt_get_end_section_plugin_descriptor_attributes(void);
262 struct __bt_plugin_component_class_descriptor const * const *__bt_get_begin_section_component_class_descriptors(void);
263 struct __bt_plugin_component_class_descriptor const * const *__bt_get_end_section_component_class_descriptors(void);
264 struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_begin_section_component_class_descriptor_attributes(void);
265 struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_end_section_component_class_descriptor_attributes(void);
266
267 /*
268 * Variable attributes for a plugin descriptor pointer to be added to
269 * the plugin descriptor section (internal use).
270 */
271 #ifdef __APPLE__
272 #define __BT_PLUGIN_DESCRIPTOR_ATTRS \
273 __attribute__((section("__DATA,btp_desc"), used))
274
275 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL \
276 __start___bt_plugin_descriptors
277
278 #define __BT_PLUGIN_DESCRIPTOR_END_SYMBOL \
279 __stop___bt_plugin_descriptors
280
281 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA \
282 __asm("section$start$__DATA$btp_desc")
283
284 #define __BT_PLUGIN_DESCRIPTOR_END_EXTRA \
285 __asm("section$end$__DATA$btp_desc")
286
287 #else
288
289 #define __BT_PLUGIN_DESCRIPTOR_ATTRS \
290 __attribute__((section("__bt_plugin_descriptors"), used))
291
292 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL \
293 __start___bt_plugin_descriptors
294
295 #define __BT_PLUGIN_DESCRIPTOR_END_SYMBOL \
296 __stop___bt_plugin_descriptors
297
298 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA
299
300 #define __BT_PLUGIN_DESCRIPTOR_END_EXTRA
301 #endif
302
303 /*
304 * Variable attributes for a plugin attribute pointer to be added to
305 * the plugin attribute section (internal use).
306 */
307 #ifdef __APPLE__
308 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS \
309 __attribute__((section("__DATA,btp_desc_att"), used))
310
311 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
312 __start___bt_plugin_descriptor_attributes
313
314 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
315 __stop___bt_plugin_descriptor_attributes
316
317 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA \
318 __asm("section$start$__DATA$btp_desc_att")
319
320 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA \
321 __asm("section$end$__DATA$btp_desc_att")
322
323 #else
324
325 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS \
326 __attribute__((section("__bt_plugin_descriptor_attributes"), used))
327
328 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
329 __start___bt_plugin_descriptor_attributes
330
331 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
332 __stop___bt_plugin_descriptor_attributes
333
334 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA
335
336 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA
337 #endif
338
339 /*
340 * Variable attributes for a component class descriptor pointer to be
341 * added to the component class descriptor section (internal use).
342 */
343 #ifdef __APPLE__
344 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS \
345 __attribute__((section("__DATA,btp_cc_desc"), used))
346
347 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL \
348 __start___bt_plugin_component_class_descriptors
349
350 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL \
351 __stop___bt_plugin_component_class_descriptors
352
353 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA \
354 __asm("section$start$__DATA$btp_cc_desc")
355
356 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA \
357 __asm("section$end$__DATA$btp_cc_desc")
358
359 #else
360
361 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS \
362 __attribute__((section("__bt_plugin_component_class_descriptors"), used))
363
364 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL \
365 __start___bt_plugin_component_class_descriptors
366
367 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL \
368 __stop___bt_plugin_component_class_descriptors
369
370 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA
371
372 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA
373 #endif
374
375 /*
376 * Variable attributes for a component class descriptor attribute
377 * pointer to be added to the component class descriptor attribute
378 * section (internal use).
379 */
380 #ifdef __APPLE__
381 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS \
382 __attribute__((section("__DATA,btp_cc_desc_att"), used))
383
384 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
385 __start___bt_plugin_component_class_descriptor_attributes
386
387 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
388 __stop___bt_plugin_component_class_descriptor_attributes
389
390 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA \
391 __asm("section$start$__DATA$btp_cc_desc_att")
392
393 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_EXTRA \
394 __asm("section$end$__DATA$btp_cc_desc_att")
395
396 #else
397
398 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS \
399 __attribute__((section("__bt_plugin_component_class_descriptor_attributes"), used))
400
401 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
402 __start___bt_plugin_component_class_descriptor_attributes
403
404 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
405 __stop___bt_plugin_component_class_descriptor_attributes
406
407 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA
408
409 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_EXTRA
410 #endif
411
412 /*
413 * Declares a plugin descriptor pointer variable with a custom ID.
414 *
415 * _id: ID (any valid C identifier except `auto`).
416 */
417 #define BT_PLUGIN_DECLARE(_id) extern struct __bt_plugin_descriptor __bt_plugin_descriptor_##_id
418
419 /*
420 * Defines a plugin descriptor with a custom ID.
421 *
422 * _id: ID (any valid C identifier except `auto`).
423 * _name: Plugin's name (C string).
424 */
425 #define BT_PLUGIN_WITH_ID(_id, _name) \
426 struct __bt_plugin_descriptor __bt_plugin_descriptor_##_id = { \
427 .major = __BT_PLUGIN_VERSION_MAJOR, \
428 .minor = __BT_PLUGIN_VERSION_MINOR, \
429 .name = _name, \
430 }; \
431 static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_##_id##_ptr __BT_PLUGIN_DESCRIPTOR_ATTRS = &__bt_plugin_descriptor_##_id
432
433 /*
434 * Defines a plugin attribute (generic, internal use).
435 *
436 * _attr_name: Name of the attribute (C identifier).
437 * _attr_type: Type of the attribute (enum __bt_plugin_descriptor_attribute_type).
438 * _id: Plugin descriptor ID (C identifier).
439 * _x: Value.
440 */
441 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _x) \
442 static struct __bt_plugin_descriptor_attribute __bt_plugin_descriptor_attribute_##_id##_##_attr_name = { \
443 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
444 .type_name = #_attr_name, \
445 .type = _attr_type, \
446 .value._attr_name = _x, \
447 }; \
448 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
449
450 /*
451 * Defines a plugin initialization function attribute attached to a
452 * specific plugin descriptor.
453 *
454 * _id: Plugin descriptor ID (C identifier).
455 * _x: Initialization function (bt_plugin_init_func).
456 */
457 #define BT_PLUGIN_INIT_WITH_ID(_id, _x) \
458 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(init, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT, _id, _x)
459
460 /*
461 * Defines a plugin exit function attribute attached to a specific
462 * plugin descriptor.
463 *
464 * _id: Plugin descriptor ID (C identifier).
465 * _x: Exit function (bt_plugin_exit_func).
466 */
467 #define BT_PLUGIN_EXIT_WITH_ID(_id, _x) \
468 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(exit, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT, _id, _x)
469
470 /*
471 * Defines an author attribute attached to a specific plugin descriptor.
472 *
473 * _id: Plugin descriptor ID (C identifier).
474 * _x: Author (C string).
475 */
476 #define BT_PLUGIN_AUTHOR_WITH_ID(_id, _x) \
477 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(author, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR, _id, _x)
478
479 /*
480 * Defines a license attribute attached to a specific plugin descriptor.
481 *
482 * _id: Plugin descriptor ID (C identifier).
483 * _x: License (C string).
484 */
485 #define BT_PLUGIN_LICENSE_WITH_ID(_id, _x) \
486 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(license, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE, _id, _x)
487
488 /*
489 * Defines a description attribute attached to a specific plugin
490 * descriptor.
491 *
492 * _id: Plugin descriptor ID (C identifier).
493 * _x: Description (C string).
494 */
495 #define BT_PLUGIN_DESCRIPTION_WITH_ID(_id, _x) \
496 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _x)
497
498 #define __BT_PLUGIN_VERSION_STRUCT_VALUE(_major, _minor, _patch, _extra) \
499 {.major = _major, .minor = _minor, .patch = _patch, .extra = _extra,}
500
501 /*
502 * Defines a version attribute attached to a specific plugin descriptor.
503 *
504 * _id: Plugin descriptor ID (C identifier).
505 * _major: Plugin's major version (uint32_t).
506 * _minor: Plugin's minor version (uint32_t).
507 * _patch: Plugin's patch version (uint32_t).
508 * _extra: Plugin's version extra information (C string).
509 */
510 #define BT_PLUGIN_VERSION_WITH_ID(_id, _major, _minor, _patch, _extra) \
511 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(version, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION, _id, __BT_PLUGIN_VERSION_STRUCT_VALUE(_major, _minor, _patch, _extra))
512
513 /*
514 * Defines a source component class descriptor with a custom ID.
515 *
516 * _id: ID (any valid C identifier except `auto`).
517 * _comp_class_id: Component class ID (C identifier).
518 * _name: Component class name (C string).
519 * _notif_iter_next_method: Component class's iterator next method
520 * (bt_component_class_source_notification_iterator_next_method).
521 */
522 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _notif_iter_next_method) \
523 static struct __bt_plugin_component_class_descriptor __bt_plugin_source_component_class_descriptor_##_id##_##_comp_class_id = { \
524 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
525 .name = _name, \
526 .type = BT_COMPONENT_CLASS_TYPE_SOURCE, \
527 .methods.source = { \
528 .notif_iter_next = _notif_iter_next_method, \
529 }, \
530 }; \
531 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
532
533 /*
534 * Defines a filter component class descriptor with a custom ID.
535 *
536 * _id: ID (any valid C identifier except `auto`).
537 * _comp_class_id: Component class ID (C identifier).
538 * _name: Component class name (C string).
539 * _notif_iter_next_method: Component class's iterator next method
540 * (bt_component_class_filter_notification_iterator_next_method).
541 */
542 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _notif_iter_next_method) \
543 static struct __bt_plugin_component_class_descriptor __bt_plugin_filter_component_class_descriptor_##_id##_##_comp_class_id = { \
544 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
545 .name = _name, \
546 .type = BT_COMPONENT_CLASS_TYPE_FILTER, \
547 .methods.filter = { \
548 .notif_iter_next = _notif_iter_next_method, \
549 }, \
550 }; \
551 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
552
553 /*
554 * Defines a sink component class descriptor with a custom ID.
555 *
556 * _id: ID (any valid C identifier except `auto`).
557 * _comp_class_id: Component class ID (C identifier).
558 * _name: Component class name (C string).
559 * _consume_method: Component class's iterator consume method
560 * (bt_component_class_sink_consume_method).
561 */
562 #define BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _consume_method) \
563 static struct __bt_plugin_component_class_descriptor __bt_plugin_sink_component_class_descriptor_##_id##_##_comp_class_id = { \
564 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
565 .name = _name, \
566 .type = BT_COMPONENT_CLASS_TYPE_SINK, \
567 .methods.sink = { \
568 .consume = _consume_method, \
569 }, \
570 }; \
571 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
572
573 /*
574 * Defines a component class descriptor attribute (generic, internal
575 * use).
576 *
577 * _id: Plugin descriptor ID (C identifier).
578 * _comp_class_id: Component class ID (C identifier).
579 * _type: Component class type (`source`, `filter`, or `sink`).
580 * _attr_name: Name of the attribute (C identifier).
581 * _attr_type: Type of the attribute
582 * (enum __bt_plugin_descriptor_attribute_type).
583 * _x: Value.
584 */
585 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _comp_class_id, _type, _x) \
586 static struct __bt_plugin_component_class_descriptor_attribute __bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_comp_class_id##_##_attr_name = { \
587 .comp_class_descriptor = &__bt_plugin_##_type##_component_class_descriptor_##_id##_##_comp_class_id, \
588 .type_name = #_attr_name, \
589 .type = _attr_type, \
590 .value._attr_name = _x, \
591 }; \
592 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
593
594 /*
595 * Defines a description attribute attached to a specific source
596 * component class descriptor.
597 *
598 * _id: Plugin descriptor ID (C identifier).
599 * _comp_class_id: Component class descriptor ID (C identifier).
600 * _x: Description (C string).
601 */
602 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
603 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, source, _x)
604
605 /*
606 * Defines a description attribute attached to a specific filter
607 * component class descriptor.
608 *
609 * _id: Plugin descriptor ID (C identifier).
610 * _comp_class_id: Component class descriptor ID (C identifier).
611 * _x: Description (C string).
612 */
613 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
614 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, filter, _x)
615
616 /*
617 * Defines a description attribute attached to a specific sink
618 * component class descriptor.
619 *
620 * _id: Plugin descriptor ID (C identifier).
621 * _comp_class_id: Component class descriptor ID (C identifier).
622 * _x: Description (C string).
623 */
624 #define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
625 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, sink, _x)
626
627 /*
628 * Defines a help attribute attached to a specific source component
629 * class descriptor.
630 *
631 * _id: Plugin descriptor ID (C identifier).
632 * _comp_class_id: Component class descriptor ID (C identifier).
633 * _x: Help (C string).
634 */
635 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID(_id, _comp_class_id, _x) \
636 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _id, _comp_class_id, source, _x)
637
638 /*
639 * Defines a help attribute attached to a specific filter component
640 * class descriptor.
641 *
642 * _id: Plugin descriptor ID (C identifier).
643 * _comp_class_id: Component class descriptor ID (C identifier).
644 * _x: Help (C string).
645 */
646 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID(_id, _comp_class_id, _x) \
647 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _id, _comp_class_id, filter, _x)
648
649 /*
650 * Defines a help attribute attached to a specific sink component class
651 * descriptor.
652 *
653 * _id: Plugin descriptor ID (C identifier).
654 * _comp_class_id: Component class descriptor ID (C identifier).
655 * _x: Help (C string).
656 */
657 #define BT_PLUGIN_SINK_COMPONENT_CLASS_HELP_WITH_ID(_id, _comp_class_id, _x) \
658 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _id, _comp_class_id, sink, _x)
659
660 /*
661 * Defines an initialization method attribute attached to a specific
662 * source component class descriptor.
663 *
664 * _id: Plugin descriptor ID (C identifier).
665 * _comp_class_id: Component class descriptor ID (C identifier).
666 * _x: Initialization method (bt_component_class_source_init_method).
667 */
668 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
669 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, source, _x)
670
671 /*
672 * Defines an initialization method attribute attached to a specific
673 * filter component class descriptor.
674 *
675 * _id: Plugin descriptor ID (C identifier).
676 * _comp_class_id: Component class descriptor ID (C identifier).
677 * _x: Initialization method (bt_component_class_filter_init_method).
678 */
679 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
680 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, filter, _x)
681
682 /*
683 * Defines an initialization method attribute attached to a specific
684 * sink component class descriptor.
685 *
686 * _id: Plugin descriptor ID (C identifier).
687 * _comp_class_id: Component class descriptor ID (C identifier).
688 * _x: Initialization method (bt_component_class_sink_init_method).
689 */
690 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
691 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, sink, _x)
692
693 /*
694 * Defines a finalization method attribute attached to a specific source
695 * component class descriptor.
696 *
697 * _id: Plugin descriptor ID (C identifier).
698 * _comp_class_id: Component class descriptor ID (C identifier).
699 * _x: Finalize method (bt_component_class_source_finalize_method).
700 */
701 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
702 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, source, _x)
703
704 /*
705 * Defines a finalization method attribute attached to a specific filter
706 * component class descriptor.
707 *
708 * _id: Plugin descriptor ID (C identifier).
709 * _comp_class_id: Component class descriptor ID (C identifier).
710 * _x: Finalize method (bt_component_class_filter_finalize_method).
711 */
712 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
713 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, filter, _x)
714
715 /*
716 * Defines a finalization method attribute attached to a specific sink
717 * component class descriptor.
718 *
719 * _id: Plugin descriptor ID (C identifier).
720 * _comp_class_id: Component class descriptor ID (C identifier).
721 * _x: Finalize method (bt_component_class_sink_finalize_method).
722 */
723 #define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
724 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, sink, _x)
725
726 /*
727 * Defines a query method attribute attached to a specific source
728 * component class descriptor.
729 *
730 * _id: Plugin descriptor ID (C identifier).
731 * _comp_class_id: Component class descriptor ID (C identifier).
732 * _x: Finalize method (bt_component_class_source_query_method).
733 */
734 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
735 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, source, _x)
736
737 /*
738 * Defines a query method attribute attached to a specific filter
739 * component class descriptor.
740 *
741 * _id: Plugin descriptor ID (C identifier).
742 * _comp_class_id: Component class descriptor ID (C identifier).
743 * _x: Finalize method (bt_component_class_filter_query_method).
744 */
745 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
746 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, filter, _x)
747
748 /*
749 * Defines a query method attribute attached to a specific sink
750 * component class descriptor.
751 *
752 * _id: Plugin descriptor ID (C identifier).
753 * _comp_class_id: Component class descriptor ID (C identifier).
754 * _x: Finalize method (bt_component_class_sink_query_method).
755 */
756 #define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
757 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, sink, _x)
758
759 /*
760 * Defines an accept input port connection method attribute attached to
761 * a specific filter component class descriptor.
762 *
763 * _id: Plugin descriptor ID (C identifier).
764 * _comp_class_id: Component class descriptor ID (C identifier).
765 * _x: Accept port connection method
766 * (bt_component_class_filter_accept_input_port_connection_method).
767 */
768 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
769 __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)
770
771 /*
772 * Defines an accept input port connection method attribute attached to
773 * a specific sink component class descriptor.
774 *
775 * _id: Plugin descriptor ID (C identifier).
776 * _comp_class_id: Component class descriptor ID (C identifier).
777 * _x: Accept port connection method
778 * (bt_component_class_sink_accept_input_port_connection_method).
779 */
780 #define BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
781 __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)
782
783 /*
784 * Defines an accept output port connection method attribute attached to
785 * a specific source component class descriptor.
786 *
787 * _id: Plugin descriptor ID (C identifier).
788 * _comp_class_id: Component class descriptor ID (C identifier).
789 * _x: Accept port connection method
790 * (bt_component_class_source_accept_output_port_connection_method).
791 */
792 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
793 __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)
794
795 /*
796 * Defines an accept output port connection method attribute attached to
797 * a specific filter component class descriptor.
798 *
799 * _id: Plugin descriptor ID (C identifier).
800 * _comp_class_id: Component class descriptor ID (C identifier).
801 * _x: Accept port connection method
802 * (bt_component_class_filter_accept_output_port_connection_method).
803 */
804 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
805 __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)
806
807 /*
808 * Defines an input port connected method attribute attached to a
809 * specific filter component class descriptor.
810 *
811 * _id: Plugin descriptor ID (C identifier).
812 * _comp_class_id: Component class descriptor ID (C identifier).
813 * _x: Port connected method
814 * (bt_component_class_filter_input_port_connected_method).
815 */
816 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
817 __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)
818
819 /*
820 * Defines an input port connected method attribute attached to a
821 * specific sink component class descriptor.
822 *
823 * _id: Plugin descriptor ID (C identifier).
824 * _comp_class_id: Component class descriptor ID (C identifier).
825 * _x: Port connected method
826 * (bt_component_class_sink_input_port_connected_method).
827 */
828 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
829 __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)
830
831 /*
832 * Defines an output port connected method attribute attached to a
833 * specific source component class descriptor.
834 *
835 * _id: Plugin descriptor ID (C identifier).
836 * _comp_class_id: Component class descriptor ID (C identifier).
837 * _x: Port connected method
838 * (bt_component_class_source_output_port_connected_method).
839 */
840 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
841 __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)
842
843 /*
844 * Defines an output port connected method attribute attached to a
845 * specific filter component class descriptor.
846 *
847 * _id: Plugin descriptor ID (C identifier).
848 * _comp_class_id: Component class descriptor ID (C identifier).
849 * _x: Port connected method
850 * (bt_component_class_filter_output_port_connected_method).
851 */
852 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
853 __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)
854
855 /*
856 * Defines an input port disconnected method attribute attached to a
857 * specific filter component class descriptor.
858 *
859 * _id: Plugin descriptor ID (C identifier).
860 * _comp_class_id: Component class descriptor ID (C identifier).
861 * _x: Port disconnected method
862 * (bt_component_class_filter_input_port_disconnected_method).
863 */
864 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
865 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_input_port_disconnected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_DISCONNECTED_METHOD, _id, _comp_class_id, filter, _x)
866
867 /*
868 * Defines an input port disconnected method attribute attached to a
869 * specific sink component class descriptor.
870 *
871 * _id: Plugin descriptor ID (C identifier).
872 * _comp_class_id: Component class descriptor ID (C identifier).
873 * _x: Port disconnected method
874 * (bt_component_class_sink_input_port_disconnected_method).
875 */
876 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
877 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_input_port_disconnected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_DISCONNECTED_METHOD, _id, _comp_class_id, sink, _x)
878
879 /*
880 * Defines an output port disconnected method attribute attached to a
881 * specific source component class descriptor.
882 *
883 * _id: Plugin descriptor ID (C identifier).
884 * _comp_class_id: Component class descriptor ID (C identifier).
885 * _x: Port disconnected method
886 * (bt_component_class_source_output_port_disconnected_method).
887 */
888 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
889 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_output_port_disconnected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_DISCONNECTED_METHOD, _id, _comp_class_id, source, _x)
890
891 /*
892 * Defines an output port disconnected method attribute attached to a
893 * specific filter component class descriptor.
894 *
895 * _id: Plugin descriptor ID (C identifier).
896 * _comp_class_id: Component class descriptor ID (C identifier).
897 * _x: Port disconnected method
898 * (bt_component_class_filter_output_port_disconnected_method).
899 */
900 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
901 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_output_port_disconnected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_DISCONNECTED_METHOD, _id, _comp_class_id, filter, _x)
902
903 /*
904 * Defines an iterator initialization method attribute attached to a
905 * specific source component class descriptor.
906 *
907 * _id: Plugin descriptor ID (C identifier).
908 * _comp_class_id: Component class descriptor ID (C identifier).
909 * _x: Iterator initialization method
910 * (bt_component_class_source_notification_iterator_init_method).
911 */
912 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
913 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_notif_iter_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD, _id, _comp_class_id, source, _x)
914
915 /*
916 * Defines an iterator finalize method attribute attached to a specific
917 * source component class descriptor.
918 *
919 * _id: Plugin descriptor ID (C identifier).
920 * _comp_class_id: Component class descriptor ID (C identifier).
921 * _x: Iterator finalize method
922 * (bt_component_class_source_notification_iterator_finalize_method).
923 */
924 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
925 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_notif_iter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD, _id, _comp_class_id, source, _x)
926
927 /*
928 * Defines an iterator initialization method attribute attached to a
929 * specific filter component class descriptor.
930 *
931 * _id: Plugin descriptor ID (C identifier).
932 * _comp_class_id: Component class descriptor ID (C identifier).
933 * _x: Iterator initialization method
934 * (bt_component_class_filter_notification_iterator_init_method).
935 */
936 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
937 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_notif_iter_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD, _id, _comp_class_id, filter, _x)
938
939 /*
940 * Defines an iterator finalize method attribute attached to a specific
941 * filter component class descriptor.
942 *
943 * _id: Plugin descriptor ID (C identifier).
944 * _comp_class_id: Component class descriptor ID (C identifier).
945 * _x: Iterator finalize method
946 * (bt_component_class_filter_notification_iterator_finalize_method).
947 */
948 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
949 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_notif_iter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD, _id, _comp_class_id, filter, _x)
950
951 /*
952 * Defines a plugin descriptor with an automatic ID.
953 *
954 * _name: Plugin's name (C string).
955 */
956 #define BT_PLUGIN(_name) static BT_PLUGIN_WITH_ID(auto, #_name)
957
958 /*
959 * Defines a plugin initialization function attribute attached to the
960 * automatic plugin descriptor.
961 *
962 * _x: Initialization function (bt_plugin_init_func).
963 */
964 #define BT_PLUGIN_INIT(_x) BT_PLUGIN_INIT_WITH_ID(auto, _x)
965
966 /*
967 * Defines a plugin exit function attribute attached to the automatic
968 * plugin descriptor.
969 *
970 * _x: Exit function (bt_plugin_exit_func).
971 */
972 #define BT_PLUGIN_EXIT(_x) BT_PLUGIN_EXIT_WITH_ID(auto, _x)
973
974 /*
975 * Defines an author attribute attached to the automatic plugin
976 * descriptor.
977 *
978 * _x: Author (C string).
979 */
980 #define BT_PLUGIN_AUTHOR(_x) BT_PLUGIN_AUTHOR_WITH_ID(auto, _x)
981
982 /*
983 * Defines a license attribute attached to the automatic plugin
984 * descriptor.
985 *
986 * _x: License (C string).
987 */
988 #define BT_PLUGIN_LICENSE(_x) BT_PLUGIN_LICENSE_WITH_ID(auto, _x)
989
990 /*
991 * Defines a description attribute attached to the automatic plugin
992 * descriptor.
993 *
994 * _x: Description (C string).
995 */
996 #define BT_PLUGIN_DESCRIPTION(_x) BT_PLUGIN_DESCRIPTION_WITH_ID(auto, _x)
997
998 /*
999 * Defines a version attribute attached to the automatic plugin
1000 * descriptor.
1001 *
1002 * _major: Plugin's major version (uint32_t).
1003 * _minor: Plugin's minor version (uint32_t).
1004 * _patch: Plugin's patch version (uint32_t).
1005 * _extra: Plugin's version extra information (C string).
1006 */
1007 #define BT_PLUGIN_VERSION(_major, _minor, _patch, _extra) BT_PLUGIN_VERSION_WITH_ID(auto, _major, _minor, _patch, _extra)
1008
1009 /*
1010 * Defines a source component class attached to the automatic plugin
1011 * descriptor. Its ID is the same as its name, hence its name must be a
1012 * C identifier in this version.
1013 *
1014 * _name: Component class name (C identifier).
1015 * _notif_iter_next_method: Component class's iterator next method
1016 * (bt_component_class_source_notification_iterator_next_method).
1017 */
1018 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS(_name, _notif_iter_next_method) \
1019 BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _notif_iter_next_method)
1020
1021 /*
1022 * Defines a filter component class attached to the automatic plugin
1023 * descriptor. Its ID is the same as its name, hence its name must be a
1024 * C identifier in this version.
1025 *
1026 * _name: Component class name (C identifier).
1027 * _notif_iter_next_method: Component class's iterator next method
1028 * (bt_component_class_filter_notification_iterator_next_method).
1029 */
1030 #define BT_PLUGIN_FILTER_COMPONENT_CLASS(_name, _notif_iter_next_method) \
1031 BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _notif_iter_next_method)
1032
1033 /*
1034 * Defines a sink component class attached to the automatic plugin
1035 * descriptor. Its ID is the same as its name, hence its name must be a
1036 * C identifier in this version.
1037 *
1038 * _name: Component class name (C identifier).
1039 * _consume_method: Component class's consume method
1040 * (bt_component_class_sink_consume_method).
1041 */
1042 #define BT_PLUGIN_SINK_COMPONENT_CLASS(_name, _consume_method) \
1043 BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _consume_method)
1044
1045 /*
1046 * Defines a description attribute attached to a source component class
1047 * descriptor which is attached to the automatic plugin descriptor.
1048 *
1049 * _name: Component class name (C identifier).
1050 * _x: Description (C string).
1051 */
1052 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
1053 BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
1054
1055 /*
1056 * Defines a description attribute attached to a filter component class
1057 * descriptor which is attached to the automatic plugin descriptor.
1058 *
1059 * _name: Component class name (C identifier).
1060 * _x: Description (C string).
1061 */
1062 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
1063 BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
1064
1065 /*
1066 * Defines a description attribute attached to a sink component class
1067 * descriptor which is attached to the automatic plugin descriptor.
1068 *
1069 * _name: Component class name (C identifier).
1070 * _x: Description (C string).
1071 */
1072 #define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
1073 BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
1074
1075 /*
1076 * Defines a help attribute attached to a source component class
1077 * descriptor which is attached to the automatic plugin descriptor.
1078 *
1079 * _name: Component class name (C identifier).
1080 * _x: Help (C string).
1081 */
1082 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP(_name, _x) \
1083 BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
1084
1085 /*
1086 * Defines a help attribute attached to a filter component class
1087 * descriptor which is attached to the automatic plugin descriptor.
1088 *
1089 * _name: Component class name (C identifier).
1090 * _x: Help (C string).
1091 */
1092 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP(_name, _x) \
1093 BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
1094
1095 /*
1096 * Defines a help attribute attached to a sink component class
1097 * descriptor which is attached to the automatic plugin descriptor.
1098 *
1099 * _name: Component class name (C identifier).
1100 * _x: Help (C string).
1101 */
1102 #define BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(_name, _x) \
1103 BT_PLUGIN_SINK_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
1104
1105 /*
1106 * Defines an initialization method attribute attached to a source
1107 * component class descriptor which is attached to the automatic plugin
1108 * descriptor.
1109 *
1110 * _name: Component class name (C identifier).
1111 * _x: Initialization method (bt_component_class_source_init_method).
1112 */
1113 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
1114 BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
1115
1116 /*
1117 * Defines an initialization method attribute attached to a filter
1118 * component class descriptor which is attached to the automatic plugin
1119 * descriptor.
1120 *
1121 * _name: Component class name (C identifier).
1122 * _x: Initialization method (bt_component_class_filter_init_method).
1123 */
1124 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
1125 BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
1126
1127 /*
1128 * Defines an initialization method attribute attached to a sink
1129 * component class descriptor which is attached to the automatic plugin
1130 * descriptor.
1131 *
1132 * _name: Component class name (C identifier).
1133 * _x: Initialization method (bt_component_class_sink_init_method).
1134 */
1135 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
1136 BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
1137
1138 /*
1139 * Defines a finalization method attribute attached to a source component
1140 * class descriptor which is attached to the automatic plugin
1141 * descriptor.
1142 *
1143 * _name: Component class name (C identifier).
1144 * _x: Initialization method (bt_component_class_source_finalize_method).
1145 */
1146 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
1147 BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1148
1149 /*
1150 * Defines a finalization method attribute attached to a filter component
1151 * class descriptor which is attached to the automatic plugin
1152 * descriptor.
1153 *
1154 * _name: Component class name (C identifier).
1155 * _x: Initialization method (bt_component_class_filter_finalize_method).
1156 */
1157 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
1158 BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1159
1160 /*
1161 * Defines a finalization method attribute attached to a sink component class
1162 * descriptor which is attached to the automatic plugin descriptor.
1163 *
1164 * _name: Component class name (C identifier).
1165 * _x: Initialization method (bt_component_class_sink_finalize_method).
1166 */
1167 #define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
1168 BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1169
1170 /*
1171 * Defines a query method attribute attached to a source component
1172 * class descriptor which is attached to the automatic plugin
1173 * descriptor.
1174 *
1175 * _name: Component class name (C identifier).
1176 * _x: Initialization method (bt_component_class_source_query_method).
1177 */
1178 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1179 BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
1180
1181 /*
1182 * Defines a query method attribute attached to a filter component
1183 * class descriptor which is attached to the automatic plugin
1184 * descriptor.
1185 *
1186 * _name: Component class name (C identifier).
1187 * _x: Initialization method (bt_component_class_filter_query_method).
1188 */
1189 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1190 BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
1191
1192 /*
1193 * Defines a query method attribute attached to a sink component
1194 * class descriptor which is attached to the automatic plugin
1195 * descriptor.
1196 *
1197 * _name: Component class name (C identifier).
1198 * _x: Initialization method (bt_component_class_sink_query_method).
1199 */
1200 #define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1201 BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
1202
1203 /*
1204 * Defines an accept input port connection method attribute attached to
1205 * a filter component class descriptor which is attached to the
1206 * automatic plugin descriptor.
1207 *
1208 * _name: Component class name (C identifier).
1209 * _x: Accept port connection method
1210 * (bt_component_class_filter_accept_input_port_connection_method).
1211 */
1212 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD(_name, _x) \
1213 BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1214
1215 /*
1216 * Defines an accept input port connection method attribute attached to
1217 * a sink component class descriptor which is attached to the automatic
1218 * plugin descriptor.
1219 *
1220 * _name: Component class name (C identifier).
1221 * _x: Accept port connection method
1222 * (bt_component_class_sink_accept_input_port_connection_method).
1223 */
1224 #define BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD(_name, _x) \
1225 BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1226
1227 /*
1228 * Defines an accept output port connection method attribute attached to
1229 * a source component class descriptor which is attached to the
1230 * automatic plugin descriptor.
1231 *
1232 * _name: Component class name (C identifier).
1233 * _x: Accept port connection method
1234 * (bt_component_class_source_accept_output_port_connection_method).
1235 */
1236 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD(_name, _x) \
1237 BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1238
1239 /*
1240 * Defines an accept output port connection method attribute attached to
1241 * a filter component class descriptor which is attached to the
1242 * automatic plugin descriptor.
1243 *
1244 * _name: Component class name (C identifier).
1245 * _x: Accept port connection method
1246 * (bt_component_class_filter_accept_output_port_connection_method).
1247 */
1248 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD(_name, _x) \
1249 BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1250
1251 /*
1252 * Defines an input port connected method attribute attached to a filter
1253 * component class descriptor which is attached to the automatic plugin
1254 * descriptor.
1255 *
1256 * _name: Component class name (C identifier).
1257 * _x: Port connected (bt_component_class_filter_input_port_connected_method).
1258 */
1259 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD(_name, _x) \
1260 BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1261
1262 /*
1263 * Defines an input port connected method attribute attached to a sink
1264 * component class descriptor which is attached to the automatic plugin
1265 * descriptor.
1266 *
1267 * _name: Component class name (C identifier).
1268 * _x: Port connected (bt_component_class_sink_input_port_connected_method).
1269 */
1270 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD(_name, _x) \
1271 BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1272
1273 /*
1274 * Defines an output port connected method attribute attached to a source
1275 * component class descriptor which is attached to the automatic plugin
1276 * descriptor.
1277 *
1278 * _name: Component class name (C identifier).
1279 * _x: Port connected (bt_component_class_source_output_port_connected_method).
1280 */
1281 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD(_name, _x) \
1282 BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1283
1284 /*
1285 * Defines an output port connected method attribute attached to a filter
1286 * component class descriptor which is attached to the automatic plugin
1287 * descriptor.
1288 *
1289 * _name: Component class name (C identifier).
1290 * _x: Port connected (bt_component_class_filter_output_port_connected_method).
1291 */
1292 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD(_name, _x) \
1293 BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1294
1295 /*
1296 * Defines an input port disconnected method attribute attached to a
1297 * filter component class descriptor which is attached to the automatic
1298 * plugin descriptor.
1299 *
1300 * _name: Component class name (C identifier).
1301 * _x: Port disconnected (bt_component_class_filter_input_port_disconnected_method).
1302 */
1303 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_DISCONNECTED_METHOD(_name, _x) \
1304 BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
1305
1306 /*
1307 * Defines an input port disconnected method attribute attached to a
1308 * sink component class descriptor which is attached to the automatic
1309 * plugin descriptor.
1310 *
1311 * _name: Component class name (C identifier).
1312 * _x: Port disconnected (bt_component_class_sink_input_port_disconnected_method).
1313 */
1314 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_DISCONNECTED_METHOD(_name, _x) \
1315 BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
1316
1317 /*
1318 * Defines an output port disconnected method attribute attached to a
1319 * source component class descriptor which is attached to the automatic
1320 * plugin descriptor.
1321 *
1322 * _name: Component class name (C identifier).
1323 * _x: Port disconnected (bt_component_class_source_output_port_disconnected_method).
1324 */
1325 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_DISCONNECTED_METHOD(_name, _x) \
1326 BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
1327
1328 /*
1329 * Defines an output port disconnected method attribute attached to a
1330 * filter component class descriptor which is attached to the automatic
1331 * plugin descriptor.
1332 *
1333 * _name: Component class name (C identifier).
1334 * _x: Port disconnected (bt_component_class_filter_output_port_disconnected_method).
1335 */
1336 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_DISCONNECTED_METHOD(_name, _x) \
1337 BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
1338
1339 /*
1340 * Defines an iterator initialization method attribute attached to a
1341 * source component class descriptor which is attached to the automatic
1342 * plugin descriptor.
1343 *
1344 * _name: Component class name (C identifier).
1345 * _x: Iterator initialization method
1346 * (bt_component_class_source_notification_iterator_init_method).
1347 */
1348 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(_name, _x) \
1349 BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
1350
1351 /*
1352 * Defines an iterator finalize method attribute attached to a source
1353 * component class descriptor which is attached to the automatic plugin
1354 * descriptor.
1355 *
1356 * _name: Component class name (C identifier).
1357 * _x: Iterator finalize method
1358 * (bt_component_class_source_notification_iterator_finalize_method).
1359 */
1360 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(_name, _x) \
1361 BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1362
1363 /*
1364 * Defines an iterator initialization method attribute attached to a
1365 * filter component class descriptor which is attached to the automatic
1366 * plugin descriptor.
1367 *
1368 * _name: Component class name (C identifier).
1369 * _x: Iterator initialization method
1370 * (bt_component_class_filter_notification_iterator_init_method).
1371 */
1372 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(_name, _x) \
1373 BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
1374
1375 /*
1376 * Defines an iterator finalize method attribute attached to a filter
1377 * component class descriptor which is attached to the automatic plugin
1378 * descriptor.
1379 *
1380 * _name: Component class name (C identifier).
1381 * _x: Iterator finalize method
1382 * (bt_component_class_filter_notification_iterator_finalize_method).
1383 */
1384 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(_name, _x) \
1385 BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1386
1387 #define BT_PLUGIN_MODULE() \
1388 static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_dummy __BT_PLUGIN_DESCRIPTOR_ATTRS = NULL; \
1389 _BT_HIDDEN extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA; \
1390 _BT_HIDDEN extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_END_EXTRA; \
1391 \
1392 static struct __bt_plugin_descriptor_attribute const * const __bt_plugin_descriptor_attribute_dummy __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS = NULL; \
1393 _BT_HIDDEN extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA; \
1394 _BT_HIDDEN extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA; \
1395 \
1396 static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_component_class_descriptor_dummy __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = NULL; \
1397 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA; \
1398 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA; \
1399 \
1400 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; \
1401 _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; \
1402 _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; \
1403 \
1404 struct __bt_plugin_descriptor const * const *__bt_get_begin_section_plugin_descriptors(void) \
1405 { \
1406 return &__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL; \
1407 } \
1408 struct __bt_plugin_descriptor const * const *__bt_get_end_section_plugin_descriptors(void) \
1409 { \
1410 return &__BT_PLUGIN_DESCRIPTOR_END_SYMBOL; \
1411 } \
1412 struct __bt_plugin_descriptor_attribute const * const *__bt_get_begin_section_plugin_descriptor_attributes(void) \
1413 { \
1414 return &__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL; \
1415 } \
1416 struct __bt_plugin_descriptor_attribute const * const *__bt_get_end_section_plugin_descriptor_attributes(void) \
1417 { \
1418 return &__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL; \
1419 } \
1420 struct __bt_plugin_component_class_descriptor const * const *__bt_get_begin_section_component_class_descriptors(void) \
1421 { \
1422 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL; \
1423 } \
1424 struct __bt_plugin_component_class_descriptor const * const *__bt_get_end_section_component_class_descriptors(void) \
1425 { \
1426 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL; \
1427 } \
1428 struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_begin_section_component_class_descriptor_attributes(void) \
1429 { \
1430 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL; \
1431 } \
1432 struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_end_section_component_class_descriptor_attributes(void) \
1433 { \
1434 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL; \
1435 }
1436
1437 #ifdef __cplusplus
1438 }
1439 #endif
1440
1441 #endif /* BABELTRACE_PLUGIN_PLUGIN_DEV_H */
This page took 0.060292 seconds and 3 git commands to generate.