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