Babeltrace 2 C API 2.1.0
Open-source trace manipulation framework
Loading...
Searching...
No Matches
plugin-loading.h
1/*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
5 */
6
7#ifndef BABELTRACE2_PLUGIN_PLUGIN_LOADING_H
8#define BABELTRACE2_PLUGIN_PLUGIN_LOADING_H
9
10/* IWYU pragma: private, include <babeltrace2/babeltrace.h> */
11
12#ifndef __BT_IN_BABELTRACE_H
13# error "Please include <babeltrace2/babeltrace.h> instead."
14#endif
15
16#include <stdint.h>
17#include <stddef.h>
18
19#include <babeltrace2/types.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
263 BT_PLUGIN_FIND_STATUS_OK = __BT_FUNC_STATUS_OK,
264
269 BT_PLUGIN_FIND_STATUS_NOT_FOUND = __BT_FUNC_STATUS_NOT_FOUND,
270
275 BT_PLUGIN_FIND_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
276
281 BT_PLUGIN_FIND_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
283
377extern bt_plugin_find_status bt_plugin_find(const char *plugin_name,
378 bt_bool find_in_std_env_var, bt_bool find_in_user_dir,
379 bt_bool find_in_sys_dir, bt_bool find_in_static,
380 bt_bool fail_on_load_error, const bt_plugin **plugin)
381 __BT_NOEXCEPT;
382
392 BT_PLUGIN_FIND_ALL_STATUS_OK = __BT_FUNC_STATUS_OK,
393
398 BT_PLUGIN_FIND_ALL_STATUS_NOT_FOUND = __BT_FUNC_STATUS_NOT_FOUND,
399
404 BT_PLUGIN_FIND_ALL_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
405
410 BT_PLUGIN_FIND_ALL_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
412
503 bt_bool find_in_user_dir, bt_bool find_in_sys_dir,
504 bt_bool find_in_static, bt_bool fail_on_load_error,
505 const bt_plugin_set **plugins) __BT_NOEXCEPT;
506
536
591 const char *path, bt_bool fail_on_load_error,
592 const bt_plugin_set **plugins) __BT_NOEXCEPT;
593
623
686 const char *path, bt_bool recurse, bt_bool fail_on_load_error,
687 const bt_plugin_set **plugins) __BT_NOEXCEPT;
688
718
763 bt_bool fail_on_load_error, const bt_plugin_set **plugins)
764 __BT_NOEXCEPT;
765
791extern const char *bt_plugin_get_name(const bt_plugin *plugin) __BT_NOEXCEPT;
792
811extern const char *bt_plugin_get_description(const bt_plugin *plugin)
812 __BT_NOEXCEPT;
813
832extern const char *bt_plugin_get_author(const bt_plugin *plugin) __BT_NOEXCEPT;
833
853extern const char *bt_plugin_get_license(const bt_plugin *plugin) __BT_NOEXCEPT;
854
878extern const char *bt_plugin_get_path(const bt_plugin *plugin) __BT_NOEXCEPT;
879
920 const bt_plugin *plugin, unsigned int *major,
921 unsigned int *minor, unsigned int *patch, const char **extra)
922 __BT_NOEXCEPT;
923
946 const bt_plugin *plugin) __BT_NOEXCEPT;
947
963 const bt_plugin *plugin) __BT_NOEXCEPT;
964
980 const bt_plugin *plugin) __BT_NOEXCEPT;
981
1010extern const bt_component_class_source *
1012 const bt_plugin *plugin, uint64_t index) __BT_NOEXCEPT;
1013
1042extern const bt_component_class_filter *
1044 const bt_plugin *plugin, uint64_t index) __BT_NOEXCEPT;
1045
1074extern const bt_component_class_sink *
1076 const bt_plugin *plugin, uint64_t index) __BT_NOEXCEPT;
1077
1107extern const bt_component_class_source *
1109 const bt_plugin *plugin, const char *name) __BT_NOEXCEPT;
1110
1140extern const bt_component_class_filter *
1142 const bt_plugin *plugin, const char *name) __BT_NOEXCEPT;
1143
1173extern const bt_component_class_sink *
1175 const bt_plugin *plugin, const char *name) __BT_NOEXCEPT;
1176
1199extern void bt_plugin_get_ref(const bt_plugin *plugin) __BT_NOEXCEPT;
1200
1216extern void bt_plugin_put_ref(const bt_plugin *plugin) __BT_NOEXCEPT;
1217
1232#define BT_PLUGIN_PUT_REF_AND_RESET(_plugin) \
1233 do { \
1234 bt_plugin_put_ref(_plugin); \
1235 (_plugin) = NULL; \
1236 } while (0)
1237
1263#define BT_PLUGIN_MOVE_REF(_dst, _src) \
1264 do { \
1265 bt_plugin_put_ref(_dst); \
1266 (_dst) = (_src); \
1267 (_src) = NULL; \
1268 } while (0)
1269
1291 const bt_plugin_set *plugin_set) __BT_NOEXCEPT;
1292
1318 const bt_plugin_set *plugin_set, uint64_t index) __BT_NOEXCEPT;
1319
1342extern void bt_plugin_set_get_ref(const bt_plugin_set *plugin_set)
1343 __BT_NOEXCEPT;
1344
1360extern void bt_plugin_set_put_ref(const bt_plugin_set *plugin_set)
1361 __BT_NOEXCEPT;
1362
1377#define BT_PLUGIN_SET_PUT_REF_AND_RESET(_plugin_set) \
1378 do { \
1379 bt_plugin_set_put_ref(_plugin_set); \
1380 (_plugin_set) = NULL; \
1381 } while (0)
1382
1408#define BT_PLUGIN_SET_MOVE_REF(_dst, _src) \
1409 do { \
1410 bt_plugin_set_put_ref(_dst); \
1411 (_dst) = (_src); \
1412 (_src) = NULL; \
1413 } while (0)
1414
1419#ifdef __cplusplus
1420}
1421#endif
1422
1423#endif /* BABELTRACE2_PLUGIN_PLUGIN_LOADING_H */
bt_property_availability
Availability of an object property.
Definition types.h:159
int bt_bool
Babeltrace&#160;2 boolean type.
Definition types.h:126
struct bt_component_class_sink bt_component_class_sink
Sink component class.
Definition types.h:27
struct bt_component_class_source bt_component_class_source
Source component class.
Definition types.h:28
struct bt_component_class_filter bt_component_class_filter
Filter component class.
Definition types.h:26
bt_plugin_find_all_from_static_status bt_plugin_find_all_from_static(bt_bool fail_on_load_error, const bt_plugin_set **plugins)
Finds and loads all the static plugins, setting *plugins to the result.
const char * bt_plugin_get_author(const bt_plugin *plugin)
Returns the name(s) of the author(s) of the plugin plugin.
bt_plugin_find_all_from_dir_status bt_plugin_find_all_from_dir(const char *path, bt_bool recurse, bt_bool fail_on_load_error, const bt_plugin_set **plugins)
Finds and loads all the plugins from the directory with path path, setting *plugins to the result.
bt_plugin_find_all_status bt_plugin_find_all(bt_bool find_in_std_env_var, bt_bool find_in_user_dir, bt_bool find_in_sys_dir, bt_bool find_in_static, bt_bool fail_on_load_error, const bt_plugin_set **plugins)
Finds and loads all the plugins from the default plugin search directories and static plugins,...
uint64_t bt_plugin_get_sink_component_class_count(const bt_plugin *plugin)
Returns the number of sink component classes contained in the plugin plugin.
bt_plugin_find_status bt_plugin_find(const char *plugin_name, bt_bool find_in_std_env_var, bt_bool find_in_user_dir, bt_bool find_in_sys_dir, bt_bool find_in_static, bt_bool fail_on_load_error, const bt_plugin **plugin)
Finds and loads a single plugin which has the name plugin_name from the default plugin search directo...
bt_plugin_find_all_from_file_status
Status codes for bt_plugin_find_all_from_file().
Definition plugin-loading.h:511
const char * bt_plugin_get_path(const bt_plugin *plugin)
Returns the path of the file which contains the plugin plugin.
const char * bt_plugin_get_license(const bt_plugin *plugin)
Returns the license text or the license name of the plugin plugin.
void bt_plugin_put_ref(const bt_plugin *plugin)
Decrements the reference count of the plugin plugin.
bt_plugin_find_all_from_file_status bt_plugin_find_all_from_file(const char *path, bt_bool fail_on_load_error, const bt_plugin_set **plugins)
Finds and loads all the plugins from the file with path path, setting *plugins to the result.
void bt_plugin_get_ref(const bt_plugin *plugin)
Increments the reference count of the plugin plugin.
uint64_t bt_plugin_get_filter_component_class_count(const bt_plugin *plugin)
Returns the number of filter component classes contained in the plugin plugin.
const bt_component_class_sink * bt_plugin_borrow_sink_component_class_by_name_const(const bt_plugin *plugin, const char *name)
Borrows the sink component class named name from the plugin plugin.
const bt_component_class_filter * bt_plugin_borrow_filter_component_class_by_index_const(const bt_plugin *plugin, uint64_t index)
Borrows the filter component class at index index from the plugin plugin.
void bt_plugin_set_put_ref(const bt_plugin_set *plugin_set)
Decrements the reference count of the plugin set plugin_set.
const bt_component_class_sink * bt_plugin_borrow_sink_component_class_by_index_const(const bt_plugin *plugin, uint64_t index)
Borrows the sink component class at index index from the plugin plugin.
const char * bt_plugin_get_description(const bt_plugin *plugin)
Returns the description of the plugin plugin.
struct bt_plugin bt_plugin
Plugin.
Definition types.h:63
const bt_component_class_source * bt_plugin_borrow_source_component_class_by_index_const(const bt_plugin *plugin, uint64_t index)
Borrows the source component class at index index from the plugin plugin.
uint64_t bt_plugin_get_source_component_class_count(const bt_plugin *plugin)
Returns the number of source component classes contained in the plugin plugin.
struct bt_plugin_set bt_plugin_set
Set of plugins.
Definition types.h:64
const char * bt_plugin_get_name(const bt_plugin *plugin)
Returns the name of the plugin plugin.
bt_plugin_find_all_from_static_status
Status codes for bt_plugin_find_all_from_static().
Definition plugin-loading.h:693
uint64_t bt_plugin_set_get_plugin_count(const bt_plugin_set *plugin_set)
Returns the number of plugins contained in the plugin set plugin_set.
bt_plugin_find_all_status
Status codes for bt_plugin_find_all().
Definition plugin-loading.h:387
void bt_plugin_set_get_ref(const bt_plugin_set *plugin_set)
Increments the reference count of the plugin set plugin_set.
const bt_component_class_source * bt_plugin_borrow_source_component_class_by_name_const(const bt_plugin *plugin, const char *name)
Borrows the source component class named name from the plugin plugin.
const bt_component_class_filter * bt_plugin_borrow_filter_component_class_by_name_const(const bt_plugin *plugin, const char *name)
Borrows the filter component class named name from the plugin plugin.
bt_property_availability bt_plugin_get_version(const bt_plugin *plugin, unsigned int *major, unsigned int *minor, unsigned int *patch, const char **extra)
Returns the version of the plugin plugin.
bt_plugin_find_status
Status codes for bt_plugin_find().
Definition plugin-loading.h:258
const bt_plugin * bt_plugin_set_borrow_plugin_by_index_const(const bt_plugin_set *plugin_set, uint64_t index)
Borrows the plugin at index index from the plugin set plugin_set.
bt_plugin_find_all_from_dir_status
Status codes for bt_plugin_find_all_from_dir().
Definition plugin-loading.h:598
@ BT_PLUGIN_FIND_ALL_FROM_FILE_STATUS_OK
Success.
Definition plugin-loading.h:516
@ BT_PLUGIN_FIND_ALL_FROM_FILE_STATUS_ERROR
Error.
Definition plugin-loading.h:534
@ BT_PLUGIN_FIND_ALL_FROM_FILE_STATUS_MEMORY_ERROR
Out of memory.
Definition plugin-loading.h:528
@ BT_PLUGIN_FIND_ALL_FROM_FILE_STATUS_NOT_FOUND
No plugins found.
Definition plugin-loading.h:522
@ BT_PLUGIN_FIND_ALL_FROM_STATIC_STATUS_ERROR
Error.
Definition plugin-loading.h:716
@ BT_PLUGIN_FIND_ALL_FROM_STATIC_STATUS_NOT_FOUND
No static plugins found.
Definition plugin-loading.h:704
@ BT_PLUGIN_FIND_ALL_FROM_STATIC_STATUS_MEMORY_ERROR
Out of memory.
Definition plugin-loading.h:710
@ BT_PLUGIN_FIND_ALL_FROM_STATIC_STATUS_OK
Success.
Definition plugin-loading.h:698
@ BT_PLUGIN_FIND_ALL_STATUS_NOT_FOUND
No plugins found.
Definition plugin-loading.h:398
@ BT_PLUGIN_FIND_ALL_STATUS_OK
Success.
Definition plugin-loading.h:392
@ BT_PLUGIN_FIND_ALL_STATUS_ERROR
Error.
Definition plugin-loading.h:410
@ BT_PLUGIN_FIND_ALL_STATUS_MEMORY_ERROR
Out of memory.
Definition plugin-loading.h:404
@ BT_PLUGIN_FIND_STATUS_MEMORY_ERROR
Out of memory.
Definition plugin-loading.h:275
@ BT_PLUGIN_FIND_STATUS_NOT_FOUND
Plugin not found.
Definition plugin-loading.h:269
@ BT_PLUGIN_FIND_STATUS_OK
Success.
Definition plugin-loading.h:263
@ BT_PLUGIN_FIND_STATUS_ERROR
Error.
Definition plugin-loading.h:281
@ BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_ERROR
Error.
Definition plugin-loading.h:621
@ BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_MEMORY_ERROR
Out of memory.
Definition plugin-loading.h:615
@ BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_NOT_FOUND
No plugins found.
Definition plugin-loading.h:609
@ BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_OK
Success.
Definition plugin-loading.h:603