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