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