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