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