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