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