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