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