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