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