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