lib: private functions: do not repeat `private` word
[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>
9d408fca
PP
35
36/* For enum bt_plugin_status */
33b34c43 37#include <babeltrace/plugin/plugin.h>
9d408fca
PP
38
39/* For component class method type definitions */
b2e0c907
PP
40#include <babeltrace/graph/component-class.h>
41#include <babeltrace/graph/component-class-source.h>
42#include <babeltrace/graph/component-class-filter.h>
43#include <babeltrace/graph/component-class-sink.h>
33b34c43 44
4581096d
PP
45/*
46 * _BT_HIDDEN: set the hidden attribute for internal functions
47 * On Windows, symbols are local unless explicitly exported,
48 * see https://gcc.gnu.org/wiki/Visibility
49 */
50#if defined(_WIN32) || defined(__CYGWIN__)
51#define _BT_HIDDEN
52#else
53#define _BT_HIDDEN __attribute__((visibility("hidden")))
54#endif
55
33b34c43
PP
56#ifdef __cplusplus
57extern "C" {
58#endif
59
6ba0b073
PP
60/*
61 * Plugin interface's version, not synced with Babeltrace's version
62 * (internal use).
63 */
64#define __BT_PLUGIN_VERSION_MAJOR 1
65#define __BT_PLUGIN_VERSION_MINOR 0
66
67/* Plugin initialization function type */
33b34c43
PP
68typedef enum bt_plugin_status (*bt_plugin_init_func)(
69 struct bt_plugin *plugin);
70
6ba0b073 71/* Plugin exit function type */
33b34c43
PP
72typedef enum bt_plugin_status (*bt_plugin_exit_func)(void);
73
6ba0b073
PP
74/*
75 * Function to call from a plugin's initialization function to add a
76 * component class to a plugin object.
77 */
33b34c43
PP
78extern enum bt_plugin_status bt_plugin_add_component_class(
79 struct bt_plugin *plugin,
80 struct bt_component_class *component_class);
81
6ba0b073
PP
82/* Plugin descriptor: describes a single plugin (internal use) */
83struct __bt_plugin_descriptor {
84 /* Plugin's interface major version number */
85 uint32_t major;
86
87 /* Plugin's interface minor version number */
88 uint32_t minor;
89
90 /* Plugin's name */
91 const char *name;
92} __attribute__((packed));
93
94/* Type of a plugin attribute (internal use) */
95enum __bt_plugin_descriptor_attribute_type {
96 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT = 0,
97 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT = 1,
98 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR = 2,
99 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE = 3,
100 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION = 4,
b6de043b
PP
101 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION = 5,
102};
103
104/* Plugin (user) version */
105struct __bt_plugin_descriptor_version {
106 uint32_t major;
107 uint32_t minor;
108 uint32_t patch;
109 const char *extra;
6ba0b073
PP
110};
111
112/* Plugin attribute (internal use) */
113struct __bt_plugin_descriptor_attribute {
114 /* Plugin descriptor to which to associate this attribute */
115 const struct __bt_plugin_descriptor *plugin_descriptor;
116
6ba0b073
PP
117 /* Name of the attribute's type for debug purposes */
118 const char *type_name;
119
857f4dce
PP
120 /* Attribute's type */
121 enum __bt_plugin_descriptor_attribute_type type;
122
d3e4dcd8 123 /* Attribute's value (depends on attribute's type) */
6ba0b073
PP
124 union {
125 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT */
126 bt_plugin_init_func init;
127
128 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT */
129 bt_plugin_exit_func exit;
130
131 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR */
132 const char *author;
133
134 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE */
135 const char *license;
136
137 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
138 const char *description;
b6de043b
PP
139
140 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION */
141 struct __bt_plugin_descriptor_version version;
6ba0b073
PP
142 } value;
143} __attribute__((packed));
144
145/* Component class descriptor (internal use) */
146struct __bt_plugin_component_class_descriptor {
147 /*
148 * Plugin descriptor to which to associate this component
149 * class descriptor.
150 */
151 const struct __bt_plugin_descriptor *plugin_descriptor;
152
6ba0b073
PP
153 /* Component class name */
154 const char *name;
155
857f4dce
PP
156 /* Component class type */
157 enum bt_component_class_type type;
158
d3e4dcd8
PP
159 /* Mandatory methods (depends on component class type) */
160 union {
161 /* BT_COMPONENT_CLASS_TYPE_SOURCE */
162 struct {
d3eb6e8f 163 bt_component_class_notification_iterator_next_method notif_iter_next;
d3e4dcd8
PP
164 } source;
165
166 /* BT_COMPONENT_CLASS_TYPE_FILTER */
167 struct {
d3eb6e8f 168 bt_component_class_notification_iterator_next_method notif_iter_next;
d3e4dcd8
PP
169 } filter;
170
171 /* BT_COMPONENT_CLASS_TYPE_SINK */
172 struct {
173 bt_component_class_sink_consume_method consume;
174 } sink;
175 } methods;
6ba0b073
PP
176} __attribute__((packed));
177
178/* Type of a component class attribute (internal use) */
179enum __bt_plugin_component_class_descriptor_attribute_type {
72b913fb
PP
180 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION = 0,
181 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP = 1,
182 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD = 2,
64cadc66 183 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD = 3,
72b913fb
PP
184 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD = 4,
185 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_PORT_CONNECTION_METHOD = 5,
0d8b4d8e
PP
186 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_CONNECTED_METHOD = 7,
187 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_DISCONNECTED_METHOD = 8,
188 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD = 9,
189 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD = 10,
6ba0b073
PP
190};
191
192/* Component class attribute (internal use) */
193struct __bt_plugin_component_class_descriptor_attribute {
194 /*
195 * Component class plugin attribute to which to associate this
196 * component class attribute.
197 */
198 const struct __bt_plugin_component_class_descriptor *comp_class_descriptor;
199
6ba0b073
PP
200 /* Name of the attribute's type for debug purposes */
201 const char *type_name;
202
857f4dce
PP
203 /* Attribute's type */
204 enum __bt_plugin_component_class_descriptor_attribute_type type;
205
d3e4dcd8 206 /* Attribute's value (depends on attribute's type) */
6ba0b073 207 union {
d3e4dcd8 208 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
6ba0b073 209 const char *description;
d3e4dcd8 210
279b3f15
PP
211 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP */
212 const char *help;
213
d3e4dcd8
PP
214 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD */
215 bt_component_class_init_method init_method;
216
64cadc66
PP
217 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD */
218 bt_component_class_finalize_method finalize_method;
d3e4dcd8 219
a67681c1
PP
220 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD */
221 bt_component_class_query_method query_method;
8463eac2 222
72b913fb
PP
223 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_PORT_CONNECTION_METHOD */
224 bt_component_class_accept_port_connection_method accept_port_connection_method;
225
0d8b4d8e
PP
226 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_CONNECTED_METHOD */
227 bt_component_class_port_connected_method port_connected_method;
228
72b913fb
PP
229 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_DISCONNECTED_METHOD */
230 bt_component_class_port_disconnected_method port_disconnected_method;
d3eb6e8f
PP
231
232 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD */
233 bt_component_class_notification_iterator_init_method notif_iter_init_method;
234
64cadc66
PP
235 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD */
236 bt_component_class_notification_iterator_finalize_method notif_iter_finalize_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 872
d3eb6e8f
PP
873/*
874 * Defines an iterator initialization method attribute attached to a
875 * specific filter component class descriptor.
876 *
877 * _id: Plugin descriptor ID (C identifier).
878 * _comp_class_id: Component class descriptor ID (C identifier).
879 * _x: Iterator initialization method
880 * (bt_component_class_notification_iterator_init_method).
881 */
882#define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
883 __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)
884
885/*
64cadc66 886 * Defines an iterator finalize method attribute attached to a specific
d3eb6e8f
PP
887 * filter component class descriptor.
888 *
889 * _id: Plugin descriptor ID (C identifier).
890 * _comp_class_id: Component class descriptor ID (C identifier).
64cadc66
PP
891 * _x: Iterator finalize method
892 * (bt_component_class_notification_iterator_finalize_method).
d3eb6e8f 893 */
64cadc66
PP
894#define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
895 __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 896
6ba0b073
PP
897/*
898 * Defines a plugin descriptor with an automatic ID.
899 *
900 * _name: Plugin's name (C string).
901 */
902#define BT_PLUGIN(_name) static BT_PLUGIN_WITH_ID(auto, #_name)
903
904/*
905 * Defines a plugin initialization function attribute attached to the
906 * automatic plugin descriptor.
907 *
908 * _x: Initialization function (bt_plugin_init_func).
909 */
910#define BT_PLUGIN_INIT(_x) BT_PLUGIN_INIT_WITH_ID(auto, _x)
911
912 /*
913 * Defines a plugin exit function attribute attached to the automatic
914 * plugin descriptor.
915 *
916 * _x: Exit function (bt_plugin_exit_func).
917 */
918#define BT_PLUGIN_EXIT(_x) BT_PLUGIN_EXIT_WITH_ID(auto, _x)
919
920/*
921 * Defines an author attribute attached to the automatic plugin
922 * descriptor.
923 *
924 * _x: Author (C string).
925 */
926#define BT_PLUGIN_AUTHOR(_x) BT_PLUGIN_AUTHOR_WITH_ID(auto, _x)
927
928/*
929 * Defines a license attribute attached to the automatic plugin
930 * descriptor.
931 *
932 * _x: License (C string).
933 */
934#define BT_PLUGIN_LICENSE(_x) BT_PLUGIN_LICENSE_WITH_ID(auto, _x)
935
936/*
937 * Defines a description attribute attached to the automatic plugin
938 * descriptor.
939 *
940 * _x: Description (C string).
941 */
942#define BT_PLUGIN_DESCRIPTION(_x) BT_PLUGIN_DESCRIPTION_WITH_ID(auto, _x)
b6de043b
PP
943
944/*
945 * Defines a version attribute attached to the automatic plugin
946 * descriptor.
947 *
948 * _major: Plugin's major version (uint32_t).
949 * _minor: Plugin's minor version (uint32_t).
950 * _patch: Plugin's patch version (uint32_t).
951 * _extra: Plugin's version extra information (C string).
952 */
953#define BT_PLUGIN_VERSION(_major, _minor, _patch, _extra) BT_PLUGIN_VERSION_WITH_ID(auto, _major, _minor, _patch, _extra)
6ba0b073
PP
954
955/*
d3e4dcd8
PP
956 * Defines a source component class attached to the automatic plugin
957 * descriptor. Its ID is the same as its name, hence its name must be a
958 * C identifier in this version.
959 *
d3eb6e8f 960 * _name: Component class name (C identifier).
d3eb6e8f
PP
961 * _notif_iter_next_method: Component class's iterator next method
962 * (bt_component_class_notification_iterator_next_method).
d3e4dcd8 963 */
41a2b7ae
PP
964#define BT_PLUGIN_SOURCE_COMPONENT_CLASS(_name, _notif_iter_next_method) \
965 BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _notif_iter_next_method)
d3e4dcd8
PP
966
967/*
968 * Defines a filter component class attached to the automatic plugin
6ba0b073
PP
969 * descriptor. Its ID is the same as its name, hence its name must be a
970 * C identifier in this version.
971 *
d3eb6e8f 972 * _name: Component class name (C identifier).
d3eb6e8f
PP
973 * _notif_iter_next_method: Component class's iterator next method
974 * (bt_component_class_notification_iterator_next_method).
6ba0b073 975 */
41a2b7ae
PP
976#define BT_PLUGIN_FILTER_COMPONENT_CLASS(_name, _notif_iter_next_method) \
977 BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _notif_iter_next_method)
6ba0b073
PP
978
979/*
d3e4dcd8
PP
980 * Defines a sink 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 *
984 * _name: Component class name (C identifier).
985 * _consume_method: Component class's consume method
986 * (bt_component_class_sink_consume_method).
987 */
988#define BT_PLUGIN_SINK_COMPONENT_CLASS(_name, _consume_method) \
989 BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _consume_method)
990
991/*
992 * Defines a description attribute attached to a source component class
6ba0b073
PP
993 * descriptor which is attached to the automatic plugin descriptor.
994 *
d3e4dcd8
PP
995 * _name: Component class name (C identifier).
996 * _x: Description (C string).
997 */
998#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
999 BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
1000
1001/*
1002 * Defines a description attribute attached to a filter component class
1003 * descriptor which is attached to the automatic plugin descriptor.
1004 *
1005 * _name: Component class name (C identifier).
1006 * _x: Description (C string).
1007 */
1008#define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
1009 BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
1010
1011/*
1012 * Defines a description attribute attached to a sink component class
1013 * descriptor which is attached to the automatic plugin descriptor.
1014 *
1015 * _name: Component class name (C identifier).
1016 * _x: Description (C string).
1017 */
1018#define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
1019 BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
1020
279b3f15
PP
1021/*
1022 * Defines a help attribute attached to a source component class
1023 * descriptor which is attached to the automatic plugin descriptor.
1024 *
1025 * _name: Component class name (C identifier).
1026 * _x: Help (C string).
1027 */
1028#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP(_name, _x) \
1029 BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
1030
1031/*
1032 * Defines a help attribute attached to a filter component class
1033 * descriptor which is attached to the automatic plugin descriptor.
1034 *
1035 * _name: Component class name (C identifier).
1036 * _x: Help (C string).
1037 */
1038#define BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP(_name, _x) \
1039 BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
1040
1041/*
1042 * Defines a help attribute attached to a sink component class
1043 * descriptor which is attached to the automatic plugin descriptor.
1044 *
1045 * _name: Component class name (C identifier).
1046 * _x: Help (C string).
1047 */
1048#define BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(_name, _x) \
1049 BT_PLUGIN_SINK_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
1050
d3e4dcd8
PP
1051/*
1052 * Defines an initialization method attribute attached to a source
1053 * component class descriptor which is attached to the automatic plugin
1054 * descriptor.
1055 *
1056 * _name: Component class name (C identifier).
1057 * _x: Initialization method (bt_component_class_init_method).
1058 */
1059#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
1060 BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
1061
1062/*
1063 * Defines an initialization method attribute attached to a filter
1064 * component class descriptor which is attached to the automatic plugin
1065 * descriptor.
1066 *
1067 * _name: Component class name (C identifier).
1068 * _x: Initialization method (bt_component_class_init_method).
1069 */
1070#define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
1071 BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
1072
1073/*
1074 * Defines an initialization method attribute attached to a sink
1075 * component class descriptor which is attached to the automatic plugin
1076 * descriptor.
1077 *
1078 * _name: Component class name (C identifier).
1079 * _x: Initialization method (bt_component_class_init_method).
1080 */
1081#define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
1082 BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
1083
1084/*
64cadc66 1085 * Defines a finalize method attribute attached to a source component
d3e4dcd8
PP
1086 * class descriptor which is attached to the automatic plugin
1087 * descriptor.
1088 *
1089 * _name: Component class name (C identifier).
64cadc66 1090 * _x: Initialization method (bt_component_class_finalize_method).
d3e4dcd8 1091 */
64cadc66
PP
1092#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
1093 BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
d3e4dcd8
PP
1094
1095/*
64cadc66 1096 * Defines a finalize method attribute attached to a filter component
d3e4dcd8
PP
1097 * class descriptor which is attached to the automatic plugin
1098 * descriptor.
1099 *
1100 * _name: Component class name (C identifier).
64cadc66 1101 * _x: Initialization method (bt_component_class_finalize_method).
d3e4dcd8 1102 */
64cadc66
PP
1103#define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
1104 BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
d3e4dcd8
PP
1105
1106/*
64cadc66 1107 * Defines a finalize method attribute attached to a sink component class
d3e4dcd8
PP
1108 * descriptor which is attached to the automatic plugin descriptor.
1109 *
1110 * _name: Component class name (C identifier).
64cadc66 1111 * _x: Initialization method (bt_component_class_finalize_method).
d3e4dcd8 1112 */
64cadc66
PP
1113#define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
1114 BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
d3e4dcd8 1115
8463eac2 1116/*
a67681c1 1117 * Defines a query method attribute attached to a source component
8463eac2
PP
1118 * class descriptor which is attached to the automatic plugin
1119 * descriptor.
1120 *
1121 * _name: Component class name (C identifier).
a67681c1 1122 * _x: Initialization method (bt_component_class_query_method).
8463eac2 1123 */
a67681c1
PP
1124#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1125 BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
8463eac2
PP
1126
1127/*
a67681c1 1128 * Defines a query method attribute attached to a filter component
8463eac2
PP
1129 * class descriptor which is attached to the automatic plugin
1130 * descriptor.
1131 *
1132 * _name: Component class name (C identifier).
a67681c1 1133 * _x: Initialization method (bt_component_class_query_method).
8463eac2 1134 */
a67681c1
PP
1135#define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1136 BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
8463eac2
PP
1137
1138/*
a67681c1 1139 * Defines a query method attribute attached to a sink component
8463eac2
PP
1140 * class descriptor which is attached to the automatic plugin
1141 * descriptor.
1142 *
1143 * _name: Component class name (C identifier).
a67681c1 1144 * _x: Initialization method (bt_component_class_query_method).
8463eac2 1145 */
a67681c1
PP
1146#define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1147 BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
8463eac2 1148
d3e4dcd8 1149/*
72b913fb
PP
1150 * Defines an accept port connection method attribute attached to a
1151 * source component class descriptor which is attached to the automatic
1152 * plugin descriptor.
1153 *
1154 * _name: Component class name (C identifier).
1155 * _x: Accept port connection method
1156 * (bt_component_class_accept_port_connection_method).
1157 */
1158#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD(_name, _x) \
1159 BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1160
1161/*
1162 * Defines an accept port connection method attribute attached to a
1163 * filter component class descriptor which is attached to the automatic
1164 * plugin descriptor.
d3e4dcd8
PP
1165 *
1166 * _name: Component class name (C identifier).
72b913fb
PP
1167 * _x: Accept port connection method
1168 * (bt_component_class_accept_port_connection_method).
d3e4dcd8 1169 */
72b913fb
PP
1170#define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD(_name, _x) \
1171 BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
d3e4dcd8
PP
1172
1173/*
72b913fb
PP
1174 * Defines an accept port connection method attribute attached to a sink
1175 * component class descriptor which is attached to the automatic plugin
1176 * descriptor.
2d41b99e
JG
1177 *
1178 * _name: Component class name (C identifier).
72b913fb
PP
1179 * _x: Accept port connection method
1180 * (bt_component_class_accept_port_connection_method).
2d41b99e 1181 */
72b913fb
PP
1182#define BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD(_name, _x) \
1183 BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
2d41b99e 1184
0d8b4d8e
PP
1185/*
1186 * Defines a port connected method attribute attached to a source
1187 * component class descriptor which is attached to the automatic plugin
1188 * descriptor.
1189 *
1190 * _name: Component class name (C identifier).
1191 * _x: Port connected (bt_component_class_port_connected_method).
1192 */
1193#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_CONNECTED_METHOD(_name, _x) \
1194 BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1195
1196/*
1197 * Defines a port connected method attribute attached to a filter
1198 * component class descriptor which is attached to the automatic plugin
1199 * descriptor.
1200 *
1201 * _name: Component class name (C identifier).
1202 * _x: Port connected (bt_component_class_port_connected_method).
1203 */
1204#define BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_CONNECTED_METHOD(_name, _x) \
1205 BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1206
1207/*
1208 * Defines a port connected method attribute attached to a sink
1209 * component class descriptor which is attached to the automatic plugin
1210 * descriptor.
1211 *
1212 * _name: Component class name (C identifier).
1213 * _x: Port connected (bt_component_class_port_connected_method).
1214 */
1215#define BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_CONNECTED_METHOD(_name, _x) \
1216 BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
1217
2d41b99e 1218/*
72b913fb
PP
1219 * Defines a port disconnected method attribute attached to a source
1220 * component class descriptor which is attached to the automatic plugin
1221 * descriptor.
1222 *
1223 * _name: Component class name (C identifier).
1224 * _x: Port disconnected (bt_component_class_port_disconnected_method).
1225 */
1226#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD(_name, _x) \
1227 BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
1228
1229/*
1230 * Defines a port disconnected method attribute attached to a filter
1231 * component class descriptor which is attached to the automatic plugin
1232 * descriptor.
1233 *
1234 * _name: Component class name (C identifier).
1235 * _x: Port disconnected (bt_component_class_port_disconnected_method).
1236 */
1237#define BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD(_name, _x) \
1238 BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
1239
1240/*
1241 * Defines a port disconnected method attribute attached to a sink
1242 * component class descriptor which is attached to the automatic plugin
1243 * descriptor.
d3e4dcd8
PP
1244 *
1245 * _name: Component class name (C identifier).
72b913fb 1246 * _x: Port disconnected (bt_component_class_port_disconnected_method).
6ba0b073 1247 */
72b913fb
PP
1248#define BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD(_name, _x) \
1249 BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
33b34c43 1250
d3eb6e8f
PP
1251/*
1252 * Defines an iterator initialization method attribute attached to a
1253 * source component class descriptor which is attached to the automatic
1254 * plugin descriptor.
1255 *
1256 * _name: Component class name (C identifier).
1257 * _x: Iterator initialization method
1258 * (bt_component_class_notification_iterator_init_method).
1259 */
1260#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(_name, _x) \
1261 BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
1262
1263/*
64cadc66 1264 * Defines an iterator finalize method attribute attached to a source
d3eb6e8f
PP
1265 * component class descriptor which is attached to the automatic plugin
1266 * descriptor.
1267 *
1268 * _name: Component class name (C identifier).
64cadc66
PP
1269 * _x: Iterator finalize method
1270 * (bt_component_class_notification_iterator_finalize_method).
d3eb6e8f 1271 */
64cadc66
PP
1272#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(_name, _x) \
1273 BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
d3eb6e8f 1274
d3eb6e8f
PP
1275/*
1276 * Defines an iterator initialization method attribute attached to a
1277 * filter 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_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(_name, _x) \
1285 BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
1286
1287/*
64cadc66 1288 * Defines an iterator finalize method attribute attached to a filter
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_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(_name, _x) \
1297 BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
d3eb6e8f 1298
52238017
MJ
1299#define BT_PLUGIN_MODULE() \
1300 static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_dummy __BT_PLUGIN_DESCRIPTOR_ATTRS = NULL; \
4581096d
PP
1301 _BT_HIDDEN extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA; \
1302 _BT_HIDDEN extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_END_EXTRA; \
52238017
MJ
1303 \
1304 static struct __bt_plugin_descriptor_attribute const * const __bt_plugin_descriptor_attribute_dummy __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS = NULL; \
4581096d
PP
1305 _BT_HIDDEN extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA; \
1306 _BT_HIDDEN extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA; \
52238017
MJ
1307 \
1308 static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_component_class_descriptor_dummy __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = NULL; \
4581096d
PP
1309 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA; \
1310 _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
1311 \
1312 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
1313 _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; \
1314 _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
1315 \
1316 struct __bt_plugin_descriptor const * const *__bt_get_begin_section_plugin_descriptors(void) \
1317 { \
1318 return &__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL; \
1319 } \
1320 struct __bt_plugin_descriptor const * const *__bt_get_end_section_plugin_descriptors(void) \
1321 { \
1322 return &__BT_PLUGIN_DESCRIPTOR_END_SYMBOL; \
1323 } \
1324 struct __bt_plugin_descriptor_attribute const * const *__bt_get_begin_section_plugin_descriptor_attributes(void) \
1325 { \
1326 return &__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL; \
1327 } \
1328 struct __bt_plugin_descriptor_attribute const * const *__bt_get_end_section_plugin_descriptor_attributes(void) \
1329 { \
1330 return &__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL; \
1331 } \
1332 struct __bt_plugin_component_class_descriptor const * const *__bt_get_begin_section_component_class_descriptors(void) \
1333 { \
1334 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL; \
1335 } \
1336 struct __bt_plugin_component_class_descriptor const * const *__bt_get_end_section_component_class_descriptors(void) \
1337 { \
1338 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL; \
1339 } \
1340 struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_begin_section_component_class_descriptor_attributes(void) \
1341 { \
1342 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL; \
1343 } \
1344 struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_end_section_component_class_descriptor_attributes(void) \
1345 { \
1346 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL; \
1347 }
1348
33b34c43
PP
1349#ifdef __cplusplus
1350}
1351#endif
1352
1353#endif /* BABELTRACE_PLUGIN_PLUGIN_DEV_H */
This page took 0.12196 seconds and 4 git commands to generate.