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