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