Rename <babeltrace/component/...> -> <babeltrace/graph/...>
[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_DISCONNECTED_METHOD = 6,
172 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD = 7,
173 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD = 8,
174 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_SEEK_TIME_METHOD = 9,
175 };
176
177 /* Component class attribute (internal use) */
178 struct __bt_plugin_component_class_descriptor_attribute {
179 /*
180 * Component class plugin attribute to which to associate this
181 * component class attribute.
182 */
183 const struct __bt_plugin_component_class_descriptor *comp_class_descriptor;
184
185 /* Name of the attribute's type for debug purposes */
186 const char *type_name;
187
188 /* Attribute's type */
189 enum __bt_plugin_component_class_descriptor_attribute_type type;
190
191 /* Attribute's value (depends on attribute's type) */
192 union {
193 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
194 const char *description;
195
196 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP */
197 const char *help;
198
199 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD */
200 bt_component_class_init_method init_method;
201
202 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD */
203 bt_component_class_finalize_method finalize_method;
204
205 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD */
206 bt_component_class_query_method query_method;
207
208 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_PORT_CONNECTION_METHOD */
209 bt_component_class_accept_port_connection_method accept_port_connection_method;
210
211 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_DISCONNECTED_METHOD */
212 bt_component_class_port_disconnected_method port_disconnected_method;
213
214 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD */
215 bt_component_class_notification_iterator_init_method notif_iter_init_method;
216
217 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD */
218 bt_component_class_notification_iterator_finalize_method notif_iter_finalize_method;
219
220 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_SEEK_TIME_METHOD */
221 bt_component_class_notification_iterator_seek_time_method notif_iter_seek_time_method;
222 } value;
223 } __attribute__((packed));
224
225 /*
226 * Variable attributes for a plugin descriptor pointer to be added to
227 * the plugin descriptor section (internal use).
228 */
229 #define __BT_PLUGIN_DESCRIPTOR_ATTRS \
230 __attribute__((section("__bt_plugin_descriptors"), used))
231
232 /*
233 * Variable attributes for a plugin attribute pointer to be added to
234 * the plugin attribute section (internal use).
235 */
236 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS \
237 __attribute__((section("__bt_plugin_descriptor_attributes"), used))
238
239 /*
240 * Variable attributes for a component class descriptor pointer to be
241 * added to the component class descriptor section (internal use).
242 */
243 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS \
244 __attribute__((section("__bt_plugin_component_class_descriptors"), used))
245
246 /*
247 * Variable attributes for a component class descriptor attribute
248 * pointer to be added to the component class descriptor attribute
249 * section (internal use).
250 */
251 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS \
252 __attribute__((section("__bt_plugin_component_class_descriptor_attributes"), used))
253
254 /*
255 * Declares a plugin descriptor pointer variable with a custom ID.
256 *
257 * _id: ID (any valid C identifier except `auto`).
258 */
259 #define BT_PLUGIN_DECLARE(_id) extern struct __bt_plugin_descriptor __bt_plugin_descriptor_##_id
260
261 /*
262 * Defines a plugin descriptor with a custom ID.
263 *
264 * _id: ID (any valid C identifier except `auto`).
265 * _name: Plugin's name (C string).
266 */
267 #define BT_PLUGIN_WITH_ID(_id, _name) \
268 struct __bt_plugin_descriptor __bt_plugin_descriptor_##_id = { \
269 .major = __BT_PLUGIN_VERSION_MAJOR, \
270 .minor = __BT_PLUGIN_VERSION_MINOR, \
271 .name = _name, \
272 }; \
273 static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_##_id##_ptr __BT_PLUGIN_DESCRIPTOR_ATTRS = &__bt_plugin_descriptor_##_id; \
274 extern struct __bt_plugin_descriptor const *__start___bt_plugin_descriptors; \
275 extern struct __bt_plugin_descriptor const *__stop___bt_plugin_descriptors
276
277 /*
278 * Defines a plugin attribute (generic, internal use).
279 *
280 * _attr_name: Name of the attribute (C identifier).
281 * _attr_type: Type of the attribute (enum __bt_plugin_descriptor_attribute_type).
282 * _id: Plugin descriptor ID (C identifier).
283 * _x: Value.
284 */
285 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _x) \
286 static struct __bt_plugin_descriptor_attribute __bt_plugin_descriptor_attribute_##_id##_##_attr_name = { \
287 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
288 .type_name = #_attr_name, \
289 .type = _attr_type, \
290 .value._attr_name = _x, \
291 }; \
292 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; \
293 extern struct __bt_plugin_descriptor_attribute const *__start___bt_plugin_descriptor_attributes; \
294 extern struct __bt_plugin_descriptor_attribute const *__stop___bt_plugin_descriptor_attributes
295
296 /*
297 * Defines a plugin initialization function attribute attached to a
298 * specific plugin descriptor.
299 *
300 * _id: Plugin descriptor ID (C identifier).
301 * _x: Initialization function (bt_plugin_init_func).
302 */
303 #define BT_PLUGIN_INIT_WITH_ID(_id, _x) \
304 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(init, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT, _id, _x)
305
306 /*
307 * Defines a plugin exit function attribute attached to a specific
308 * plugin descriptor.
309 *
310 * _id: Plugin descriptor ID (C identifier).
311 * _x: Exit function (bt_plugin_exit_func).
312 */
313 #define BT_PLUGIN_EXIT_WITH_ID(_id, _x) \
314 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(exit, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT, _id, _x)
315
316 /*
317 * Defines an author attribute attached to a specific plugin descriptor.
318 *
319 * _id: Plugin descriptor ID (C identifier).
320 * _x: Author (C string).
321 */
322 #define BT_PLUGIN_AUTHOR_WITH_ID(_id, _x) \
323 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(author, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR, _id, _x)
324
325 /*
326 * Defines a license attribute attached to a specific plugin descriptor.
327 *
328 * _id: Plugin descriptor ID (C identifier).
329 * _x: License (C string).
330 */
331 #define BT_PLUGIN_LICENSE_WITH_ID(_id, _x) \
332 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(license, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE, _id, _x)
333
334 /*
335 * Defines a description attribute attached to a specific plugin
336 * descriptor.
337 *
338 * _id: Plugin descriptor ID (C identifier).
339 * _x: Description (C string).
340 */
341 #define BT_PLUGIN_DESCRIPTION_WITH_ID(_id, _x) \
342 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _x)
343
344 #define __BT_PLUGIN_VERSION_STRUCT_VALUE(_major, _minor, _patch, _extra) \
345 {.major = _major, .minor = _minor, .patch = _patch, .extra = _extra,}
346
347 /*
348 * Defines a version attribute attached to a specific plugin descriptor.
349 *
350 * _id: Plugin descriptor ID (C identifier).
351 * _major: Plugin's major version (uint32_t).
352 * _minor: Plugin's minor version (uint32_t).
353 * _patch: Plugin's patch version (uint32_t).
354 * _extra: Plugin's version extra information (C string).
355 */
356 #define BT_PLUGIN_VERSION_WITH_ID(_id, _major, _minor, _patch, _extra) \
357 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(version, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION, _id, __BT_PLUGIN_VERSION_STRUCT_VALUE(_major, _minor, _patch, _extra))
358
359 /*
360 * Declaration of start and stop symbols of component class descriptors
361 * section.
362 */
363 #define __BT_PLUGIN_DECL_COMPONENT_CLASS_DESCRIPTORS_SECTION_START_STOP \
364 extern struct __bt_plugin_component_class_descriptor const *__start___bt_plugin_component_class_descriptors; \
365 extern struct __bt_plugin_component_class_descriptor const *__stop___bt_plugin_component_class_descriptors
366
367 /*
368 * Defines a source component class descriptor with a custom ID.
369 *
370 * _id: ID (any valid C identifier except `auto`).
371 * _comp_class_id: Component class ID (C identifier).
372 * _name: Component class name (C string).
373 * _notif_iter_next_method: Component class's iterator next method
374 * (bt_component_class_notification_iterator_next_method).
375 */
376 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _notif_iter_next_method) \
377 static struct __bt_plugin_component_class_descriptor __bt_plugin_source_component_class_descriptor_##_id##_##_comp_class_id = { \
378 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
379 .name = _name, \
380 .type = BT_COMPONENT_CLASS_TYPE_SOURCE, \
381 .methods.source = { \
382 .notif_iter_next = _notif_iter_next_method, \
383 }, \
384 }; \
385 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; \
386 __BT_PLUGIN_DECL_COMPONENT_CLASS_DESCRIPTORS_SECTION_START_STOP
387
388 /*
389 * Defines a filter component class descriptor with a custom ID.
390 *
391 * _id: ID (any valid C identifier except `auto`).
392 * _comp_class_id: Component class ID (C identifier).
393 * _name: Component class name (C string).
394 * _notif_iter_next_method: Component class's iterator next method
395 * (bt_component_class_notification_iterator_next_method).
396 */
397 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _notif_iter_next_method) \
398 static struct __bt_plugin_component_class_descriptor __bt_plugin_filter_component_class_descriptor_##_id##_##_comp_class_id = { \
399 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
400 .name = _name, \
401 .type = BT_COMPONENT_CLASS_TYPE_FILTER, \
402 .methods.filter = { \
403 .notif_iter_next = _notif_iter_next_method, \
404 }, \
405 }; \
406 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; \
407 __BT_PLUGIN_DECL_COMPONENT_CLASS_DESCRIPTORS_SECTION_START_STOP
408
409 /*
410 * Defines a sink component class descriptor with a custom ID.
411 *
412 * _id: ID (any valid C identifier except `auto`).
413 * _comp_class_id: Component class ID (C identifier).
414 * _name: Component class name (C string).
415 * _consume_method: Component class's iterator consume method
416 * (bt_component_class_sink_consume_method).
417 */
418 #define BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _consume_method) \
419 static struct __bt_plugin_component_class_descriptor __bt_plugin_sink_component_class_descriptor_##_id##_##_comp_class_id = { \
420 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
421 .name = _name, \
422 .type = BT_COMPONENT_CLASS_TYPE_SINK, \
423 .methods.sink = { \
424 .consume = _consume_method, \
425 }, \
426 }; \
427 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; \
428 __BT_PLUGIN_DECL_COMPONENT_CLASS_DESCRIPTORS_SECTION_START_STOP
429
430 /*
431 * Defines a component class descriptor attribute (generic, internal
432 * use).
433 *
434 * _id: Plugin descriptor ID (C identifier).
435 * _comp_class_id: Component class ID (C identifier).
436 * _type: Component class type (`source`, `filter`, or `sink`).
437 * _attr_name: Name of the attribute (C identifier).
438 * _attr_type: Type of the attribute
439 * (enum __bt_plugin_descriptor_attribute_type).
440 * _x: Value.
441 */
442 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _comp_class_id, _type, _x) \
443 static struct __bt_plugin_component_class_descriptor_attribute __bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_comp_class_id##_##_attr_name = { \
444 .comp_class_descriptor = &__bt_plugin_##_type##_component_class_descriptor_##_id##_##_comp_class_id, \
445 .type_name = #_attr_name, \
446 .type = _attr_type, \
447 .value._attr_name = _x, \
448 }; \
449 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; \
450 extern struct __bt_plugin_component_class_descriptor_attribute const *__start___bt_plugin_component_class_descriptor_attributes; \
451 extern struct __bt_plugin_component_class_descriptor_attribute const *__stop___bt_plugin_component_class_descriptor_attributes
452
453 /*
454 * Defines a description attribute attached to a specific source
455 * component class descriptor.
456 *
457 * _id: Plugin descriptor ID (C identifier).
458 * _comp_class_id: Component class descriptor ID (C identifier).
459 * _x: Description (C string).
460 */
461 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
462 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, source, _x)
463
464 /*
465 * Defines a description attribute attached to a specific filter
466 * component class descriptor.
467 *
468 * _id: Plugin descriptor ID (C identifier).
469 * _comp_class_id: Component class descriptor ID (C identifier).
470 * _x: Description (C string).
471 */
472 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
473 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, filter, _x)
474
475 /*
476 * Defines a description attribute attached to a specific sink
477 * component class descriptor.
478 *
479 * _id: Plugin descriptor ID (C identifier).
480 * _comp_class_id: Component class descriptor ID (C identifier).
481 * _x: Description (C string).
482 */
483 #define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_id, _comp_class_id, _x) \
484 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _comp_class_id, sink, _x)
485
486 /*
487 * Defines a help attribute attached to a specific source component
488 * class descriptor.
489 *
490 * _id: Plugin descriptor ID (C identifier).
491 * _comp_class_id: Component class descriptor ID (C identifier).
492 * _x: Help (C string).
493 */
494 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID(_id, _comp_class_id, _x) \
495 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _id, _comp_class_id, source, _x)
496
497 /*
498 * Defines a help attribute attached to a specific filter component
499 * class descriptor.
500 *
501 * _id: Plugin descriptor ID (C identifier).
502 * _comp_class_id: Component class descriptor ID (C identifier).
503 * _x: Help (C string).
504 */
505 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID(_id, _comp_class_id, _x) \
506 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _id, _comp_class_id, filter, _x)
507
508 /*
509 * Defines a help attribute attached to a specific sink component class
510 * descriptor.
511 *
512 * _id: Plugin descriptor ID (C identifier).
513 * _comp_class_id: Component class descriptor ID (C identifier).
514 * _x: Help (C string).
515 */
516 #define BT_PLUGIN_SINK_COMPONENT_CLASS_HELP_WITH_ID(_id, _comp_class_id, _x) \
517 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _id, _comp_class_id, sink, _x)
518
519 /*
520 * Defines an initialization method attribute attached to a specific
521 * source component class descriptor.
522 *
523 * _id: Plugin descriptor ID (C identifier).
524 * _comp_class_id: Component class descriptor ID (C identifier).
525 * _x: Initialization method (bt_component_class_init_method).
526 */
527 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
528 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, source, _x)
529
530 /*
531 * Defines an initialization method attribute attached to a specific
532 * filter component class descriptor.
533 *
534 * _id: Plugin descriptor ID (C identifier).
535 * _comp_class_id: Component class descriptor ID (C identifier).
536 * _x: Initialization method (bt_component_class_init_method).
537 */
538 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
539 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, filter, _x)
540
541 /*
542 * Defines an initialization method attribute attached to a specific
543 * sink component class descriptor.
544 *
545 * _id: Plugin descriptor ID (C identifier).
546 * _comp_class_id: Component class descriptor ID (C identifier).
547 * _x: Initialization method (bt_component_class_init_method).
548 */
549 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
550 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, sink, _x)
551
552 /*
553 * Defines a finalize method attribute attached to a specific source
554 * component class descriptor.
555 *
556 * _id: Plugin descriptor ID (C identifier).
557 * _comp_class_id: Component class descriptor ID (C identifier).
558 * _x: Finalize method (bt_component_class_finalize_method).
559 */
560 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
561 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, source, _x)
562
563 /*
564 * Defines a finalize method attribute attached to a specific filter
565 * component class descriptor.
566 *
567 * _id: Plugin descriptor ID (C identifier).
568 * _comp_class_id: Component class descriptor ID (C identifier).
569 * _x: Finalize method (bt_component_class_finalize_method).
570 */
571 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
572 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, filter, _x)
573
574 /*
575 * Defines a finalize method attribute attached to a specific sink
576 * component class descriptor.
577 *
578 * _id: Plugin descriptor ID (C identifier).
579 * _comp_class_id: Component class descriptor ID (C identifier).
580 * _x: Finalize method (bt_component_class_finalize_method).
581 */
582 #define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
583 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, sink, _x)
584
585 /*
586 * Defines a query method attribute attached to a specific source
587 * component class descriptor.
588 *
589 * _id: Plugin descriptor ID (C identifier).
590 * _comp_class_id: Component class descriptor ID (C identifier).
591 * _x: Finalize method (bt_component_class_query_method).
592 */
593 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
594 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, source, _x)
595
596 /*
597 * Defines a query method attribute attached to a specific filter
598 * component class descriptor.
599 *
600 * _id: Plugin descriptor ID (C identifier).
601 * _comp_class_id: Component class descriptor ID (C identifier).
602 * _x: Finalize method (bt_component_class_query_method).
603 */
604 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
605 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, filter, _x)
606
607 /*
608 * Defines a query method attribute attached to a specific sink
609 * component class descriptor.
610 *
611 * _id: Plugin descriptor ID (C identifier).
612 * _comp_class_id: Component class descriptor ID (C identifier).
613 * _x: Finalize method (bt_component_class_query_method).
614 */
615 #define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
616 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, sink, _x)
617
618 /*
619 * Defines an accept port connection method attribute attached to a
620 * specific source component class descriptor.
621 *
622 * _id: Plugin descriptor ID (C identifier).
623 * _comp_class_id: Component class descriptor ID (C identifier).
624 * _x: Accept port connection method
625 * (bt_component_class_accept_port_connection_method).
626 */
627 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
628 __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)
629
630 /*
631 * Defines an accept port connection method attribute attached to a
632 * specific filter component class descriptor.
633 *
634 * _id: Plugin descriptor ID (C identifier).
635 * _comp_class_id: Component class descriptor ID (C identifier).
636 * _x: Accept port connection method
637 * (bt_component_class_accept_port_connection_method).
638 */
639 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
640 __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)
641
642 /*
643 * Defines an accept port connection method attribute attached to a
644 * specific sink component class descriptor.
645 *
646 * _id: Plugin descriptor ID (C identifier).
647 * _comp_class_id: Component class descriptor ID (C identifier).
648 * _x: Accept port connection method
649 * (bt_component_class_accept_port_connection_method).
650 */
651 #define BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
652 __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)
653
654 /*
655 * Defines a port disconnected method attribute attached to a specific
656 * source component class descriptor.
657 *
658 * _id: Plugin descriptor ID (C identifier).
659 * _comp_class_id: Component class descriptor ID (C identifier).
660 * _x: Port disconnected method
661 * (bt_component_class_port_disconnected_method).
662 */
663 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
664 __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)
665
666 /*
667 * Defines a port disconnected method attribute attached to a specific
668 * filter component class descriptor.
669 *
670 * _id: Plugin descriptor ID (C identifier).
671 * _comp_class_id: Component class descriptor ID (C identifier).
672 * _x: Port disconnected method
673 * (bt_component_class_port_disconnected_method).
674 */
675 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
676 __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)
677
678 /*
679 * Defines a port disconnected method attribute attached to a specific
680 * sink component class descriptor.
681 *
682 * _id: Plugin descriptor ID (C identifier).
683 * _comp_class_id: Component class descriptor ID (C identifier).
684 * _x: Port disconnected method
685 * (bt_component_class_port_disconnected_method).
686 */
687 #define BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
688 __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)
689
690 /*
691 * Defines an iterator initialization method attribute attached to a
692 * specific source component class descriptor.
693 *
694 * _id: Plugin descriptor ID (C identifier).
695 * _comp_class_id: Component class descriptor ID (C identifier).
696 * _x: Iterator initialization method
697 * (bt_component_class_notification_iterator_init_method).
698 */
699 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
700 __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)
701
702 /*
703 * Defines an iterator finalize method attribute attached to a specific
704 * source component class descriptor.
705 *
706 * _id: Plugin descriptor ID (C identifier).
707 * _comp_class_id: Component class descriptor ID (C identifier).
708 * _x: Iterator finalize method
709 * (bt_component_class_notification_iterator_finalize_method).
710 */
711 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
712 __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)
713
714 /*
715 * Defines an iterator seek time method attribute attached to a specific
716 * source component class descriptor.
717 *
718 * _id: Plugin descriptor ID (C identifier).
719 * _comp_class_id: Component class descriptor ID (C identifier).
720 * _x: Iterator seek time method
721 * (bt_component_class_notification_iterator_seek_time_method).
722 */
723 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD_WITH_ID(_id, _comp_class_id, _x) \
724 __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)
725
726 /*
727 * Defines an iterator initialization method attribute attached to a
728 * specific filter component class descriptor.
729 *
730 * _id: Plugin descriptor ID (C identifier).
731 * _comp_class_id: Component class descriptor ID (C identifier).
732 * _x: Iterator initialization method
733 * (bt_component_class_notification_iterator_init_method).
734 */
735 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
736 __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)
737
738 /*
739 * Defines an iterator finalize method attribute attached to a specific
740 * filter component class descriptor.
741 *
742 * _id: Plugin descriptor ID (C identifier).
743 * _comp_class_id: Component class descriptor ID (C identifier).
744 * _x: Iterator finalize method
745 * (bt_component_class_notification_iterator_finalize_method).
746 */
747 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
748 __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)
749
750 /*
751 * Defines an iterator seek time method attribute attached to a specific
752 * filter component class descriptor.
753 *
754 * _id: Plugin descriptor ID (C identifier).
755 * _comp_class_id: Component class descriptor ID (C identifier).
756 * _x: Iterator seek time method
757 * (bt_component_class_notification_iterator_seek_time_method).
758 */
759 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD_WITH_ID(_id, _comp_class_id, _x) \
760 __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)
761
762 /*
763 * Defines a plugin descriptor with an automatic ID.
764 *
765 * _name: Plugin's name (C string).
766 */
767 #define BT_PLUGIN(_name) static BT_PLUGIN_WITH_ID(auto, #_name)
768
769 /*
770 * Defines a plugin initialization function attribute attached to the
771 * automatic plugin descriptor.
772 *
773 * _x: Initialization function (bt_plugin_init_func).
774 */
775 #define BT_PLUGIN_INIT(_x) BT_PLUGIN_INIT_WITH_ID(auto, _x)
776
777 /*
778 * Defines a plugin exit function attribute attached to the automatic
779 * plugin descriptor.
780 *
781 * _x: Exit function (bt_plugin_exit_func).
782 */
783 #define BT_PLUGIN_EXIT(_x) BT_PLUGIN_EXIT_WITH_ID(auto, _x)
784
785 /*
786 * Defines an author attribute attached to the automatic plugin
787 * descriptor.
788 *
789 * _x: Author (C string).
790 */
791 #define BT_PLUGIN_AUTHOR(_x) BT_PLUGIN_AUTHOR_WITH_ID(auto, _x)
792
793 /*
794 * Defines a license attribute attached to the automatic plugin
795 * descriptor.
796 *
797 * _x: License (C string).
798 */
799 #define BT_PLUGIN_LICENSE(_x) BT_PLUGIN_LICENSE_WITH_ID(auto, _x)
800
801 /*
802 * Defines a description attribute attached to the automatic plugin
803 * descriptor.
804 *
805 * _x: Description (C string).
806 */
807 #define BT_PLUGIN_DESCRIPTION(_x) BT_PLUGIN_DESCRIPTION_WITH_ID(auto, _x)
808
809 /*
810 * Defines a version attribute attached to the automatic plugin
811 * descriptor.
812 *
813 * _major: Plugin's major version (uint32_t).
814 * _minor: Plugin's minor version (uint32_t).
815 * _patch: Plugin's patch version (uint32_t).
816 * _extra: Plugin's version extra information (C string).
817 */
818 #define BT_PLUGIN_VERSION(_major, _minor, _patch, _extra) BT_PLUGIN_VERSION_WITH_ID(auto, _major, _minor, _patch, _extra)
819
820 /*
821 * Defines a source component class attached to the automatic plugin
822 * descriptor. Its ID is the same as its name, hence its name must be a
823 * C identifier in this version.
824 *
825 * _name: Component class name (C identifier).
826 * _notif_iter_next_method: Component class's iterator next method
827 * (bt_component_class_notification_iterator_next_method).
828 */
829 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS(_name, _notif_iter_next_method) \
830 BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _notif_iter_next_method)
831
832 /*
833 * Defines a filter component class attached to the automatic plugin
834 * descriptor. Its ID is the same as its name, hence its name must be a
835 * C identifier in this version.
836 *
837 * _name: Component class name (C identifier).
838 * _notif_iter_next_method: Component class's iterator next method
839 * (bt_component_class_notification_iterator_next_method).
840 */
841 #define BT_PLUGIN_FILTER_COMPONENT_CLASS(_name, _notif_iter_next_method) \
842 BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _notif_iter_next_method)
843
844 /*
845 * Defines a sink component class attached to the automatic plugin
846 * descriptor. Its ID is the same as its name, hence its name must be a
847 * C identifier in this version.
848 *
849 * _name: Component class name (C identifier).
850 * _consume_method: Component class's consume method
851 * (bt_component_class_sink_consume_method).
852 */
853 #define BT_PLUGIN_SINK_COMPONENT_CLASS(_name, _consume_method) \
854 BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _consume_method)
855
856 /*
857 * Defines a description attribute attached to a source component class
858 * descriptor which is attached to the automatic plugin descriptor.
859 *
860 * _name: Component class name (C identifier).
861 * _x: Description (C string).
862 */
863 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
864 BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
865
866 /*
867 * Defines a description attribute attached to a filter component class
868 * descriptor which is attached to the automatic plugin descriptor.
869 *
870 * _name: Component class name (C identifier).
871 * _x: Description (C string).
872 */
873 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
874 BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
875
876 /*
877 * Defines a description attribute attached to a sink component class
878 * descriptor which is attached to the automatic plugin descriptor.
879 *
880 * _name: Component class name (C identifier).
881 * _x: Description (C string).
882 */
883 #define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(_name, _x) \
884 BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _x)
885
886 /*
887 * Defines a help attribute attached to a source component class
888 * descriptor which is attached to the automatic plugin descriptor.
889 *
890 * _name: Component class name (C identifier).
891 * _x: Help (C string).
892 */
893 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP(_name, _x) \
894 BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
895
896 /*
897 * Defines a help attribute attached to a filter component class
898 * descriptor which is attached to the automatic plugin descriptor.
899 *
900 * _name: Component class name (C identifier).
901 * _x: Help (C string).
902 */
903 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP(_name, _x) \
904 BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
905
906 /*
907 * Defines a help attribute attached to a sink component class
908 * descriptor which is attached to the automatic plugin descriptor.
909 *
910 * _name: Component class name (C identifier).
911 * _x: Help (C string).
912 */
913 #define BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(_name, _x) \
914 BT_PLUGIN_SINK_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _x)
915
916 /*
917 * Defines an initialization method attribute attached to a source
918 * component class descriptor which is attached to the automatic plugin
919 * descriptor.
920 *
921 * _name: Component class name (C identifier).
922 * _x: Initialization method (bt_component_class_init_method).
923 */
924 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
925 BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
926
927 /*
928 * Defines an initialization method attribute attached to a filter
929 * component class descriptor which is attached to the automatic plugin
930 * descriptor.
931 *
932 * _name: Component class name (C identifier).
933 * _x: Initialization method (bt_component_class_init_method).
934 */
935 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
936 BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
937
938 /*
939 * Defines an initialization method attribute attached to a sink
940 * component class descriptor which is attached to the automatic plugin
941 * descriptor.
942 *
943 * _name: Component class name (C identifier).
944 * _x: Initialization method (bt_component_class_init_method).
945 */
946 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
947 BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
948
949 /*
950 * Defines a finalize method attribute attached to a source component
951 * class descriptor which is attached to the automatic plugin
952 * descriptor.
953 *
954 * _name: Component class name (C identifier).
955 * _x: Initialization method (bt_component_class_finalize_method).
956 */
957 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
958 BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
959
960 /*
961 * Defines a finalize method attribute attached to a filter component
962 * class descriptor which is attached to the automatic plugin
963 * descriptor.
964 *
965 * _name: Component class name (C identifier).
966 * _x: Initialization method (bt_component_class_finalize_method).
967 */
968 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
969 BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
970
971 /*
972 * Defines a finalize method attribute attached to a sink component class
973 * descriptor which is attached to the automatic plugin descriptor.
974 *
975 * _name: Component class name (C identifier).
976 * _x: Initialization method (bt_component_class_finalize_method).
977 */
978 #define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
979 BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
980
981 /*
982 * Defines a query method attribute attached to a source component
983 * class descriptor which is attached to the automatic plugin
984 * descriptor.
985 *
986 * _name: Component class name (C identifier).
987 * _x: Initialization method (bt_component_class_query_method).
988 */
989 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
990 BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
991
992 /*
993 * Defines a query method attribute attached to a filter component
994 * class descriptor which is attached to the automatic plugin
995 * descriptor.
996 *
997 * _name: Component class name (C identifier).
998 * _x: Initialization method (bt_component_class_query_method).
999 */
1000 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1001 BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
1002
1003 /*
1004 * Defines a query method attribute attached to a sink component
1005 * class descriptor which is attached to the automatic plugin
1006 * descriptor.
1007 *
1008 * _name: Component class name (C identifier).
1009 * _x: Initialization method (bt_component_class_query_method).
1010 */
1011 #define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
1012 BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
1013
1014 /*
1015 * Defines an accept port connection method attribute attached to a
1016 * source component class descriptor which is attached to the automatic
1017 * plugin descriptor.
1018 *
1019 * _name: Component class name (C identifier).
1020 * _x: Accept port connection method
1021 * (bt_component_class_accept_port_connection_method).
1022 */
1023 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD(_name, _x) \
1024 BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1025
1026 /*
1027 * Defines an accept port connection method attribute attached to a
1028 * filter component class descriptor which is attached to the automatic
1029 * plugin descriptor.
1030 *
1031 * _name: Component class name (C identifier).
1032 * _x: Accept port connection method
1033 * (bt_component_class_accept_port_connection_method).
1034 */
1035 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD(_name, _x) \
1036 BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1037
1038 /*
1039 * Defines an accept port connection method attribute attached to a sink
1040 * component class descriptor which is attached to the automatic plugin
1041 * descriptor.
1042 *
1043 * _name: Component class name (C identifier).
1044 * _x: Accept port connection method
1045 * (bt_component_class_accept_port_connection_method).
1046 */
1047 #define BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD(_name, _x) \
1048 BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
1049
1050 /*
1051 * Defines a port disconnected method attribute attached to a source
1052 * component class descriptor which is attached to the automatic plugin
1053 * descriptor.
1054 *
1055 * _name: Component class name (C identifier).
1056 * _x: Port disconnected (bt_component_class_port_disconnected_method).
1057 */
1058 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD(_name, _x) \
1059 BT_PLUGIN_SOURCE_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
1060
1061 /*
1062 * Defines a port disconnected method attribute attached to a filter
1063 * component class descriptor which is attached to the automatic plugin
1064 * descriptor.
1065 *
1066 * _name: Component class name (C identifier).
1067 * _x: Port disconnected (bt_component_class_port_disconnected_method).
1068 */
1069 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD(_name, _x) \
1070 BT_PLUGIN_FILTER_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
1071
1072 /*
1073 * Defines a port disconnected method attribute attached to a sink
1074 * component class descriptor which is attached to the automatic plugin
1075 * descriptor.
1076 *
1077 * _name: Component class name (C identifier).
1078 * _x: Port disconnected (bt_component_class_port_disconnected_method).
1079 */
1080 #define BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD(_name, _x) \
1081 BT_PLUGIN_SINK_COMPONENT_CLASS_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
1082
1083 /*
1084 * Defines an iterator initialization method attribute attached to a
1085 * source component class descriptor which is attached to the automatic
1086 * plugin descriptor.
1087 *
1088 * _name: Component class name (C identifier).
1089 * _x: Iterator initialization method
1090 * (bt_component_class_notification_iterator_init_method).
1091 */
1092 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(_name, _x) \
1093 BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
1094
1095 /*
1096 * Defines an iterator finalize method attribute attached to a source
1097 * component class descriptor which is attached to the automatic plugin
1098 * descriptor.
1099 *
1100 * _name: Component class name (C identifier).
1101 * _x: Iterator finalize method
1102 * (bt_component_class_notification_iterator_finalize_method).
1103 */
1104 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(_name, _x) \
1105 BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1106
1107 /*
1108 * Defines an iterator seek time method attribute attached to a source
1109 * component class descriptor which is attached to the automatic plugin
1110 * descriptor.
1111 *
1112 * _name: Component class name (C identifier).
1113 * _x: Iterator seek time method
1114 * (bt_component_class_notification_iterator_seek_time_method).
1115 */
1116 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD(_name, _x) \
1117 BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD_WITH_ID(auto, _name, _x)
1118
1119 /*
1120 * Defines an iterator initialization method attribute attached to a
1121 * filter component class descriptor which is attached to the automatic
1122 * plugin descriptor.
1123 *
1124 * _name: Component class name (C identifier).
1125 * _x: Iterator initialization method
1126 * (bt_component_class_notification_iterator_init_method).
1127 */
1128 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(_name, _x) \
1129 BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
1130
1131 /*
1132 * Defines an iterator finalize method attribute attached to a filter
1133 * component class descriptor which is attached to the automatic plugin
1134 * descriptor.
1135 *
1136 * _name: Component class name (C identifier).
1137 * _x: Iterator finalize method
1138 * (bt_component_class_notification_iterator_finalize_method).
1139 */
1140 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(_name, _x) \
1141 BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
1142
1143 /*
1144 * Defines an iterator seek time method attribute attached to a filter
1145 * component class descriptor which is attached to the automatic plugin
1146 * descriptor.
1147 *
1148 * _name: Component class name (C identifier).
1149 * _x: Iterator seek time method
1150 * (bt_component_class_notification_iterator_seek_time_method).
1151 */
1152 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD(_name, _x) \
1153 BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD_WITH_ID(auto, _name, _x)
1154
1155 #ifdef __cplusplus
1156 }
1157 #endif
1158
1159 #endif /* BABELTRACE_PLUGIN_PLUGIN_DEV_H */
This page took 0.082911 seconds and 4 git commands to generate.