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