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