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