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