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