2 * SPDX-License-Identifier: MIT
4 * Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
8 * Those bt_bt2_*() functions below ensure that when the API function
9 * fails, the output parameter is set to `NULL`. This is necessary
10 * because the epilogue of the `something **OUT` typemap will use that
11 * value to make a Python object. We can't rely on the initial value of
12 * `*OUT`; it could point to unreadable memory.
16 bt_property_availability
bt_bt2_plugin_get_version(
17 const bt_plugin
*plugin
, unsigned int *major
,
18 unsigned int *minor
, unsigned int *patch
, const char **extra
)
20 bt_property_availability ret
;
22 ret
= bt_plugin_get_version(plugin
, major
, minor
, patch
, extra
);
24 if (ret
== BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE
) {
32 bt_plugin_find_status
bt_bt2_plugin_find(const char *plugin_name
,
33 bt_bool find_in_std_env_var
, bt_bool find_in_user_dir
,
34 bt_bool find_in_sys_dir
, bt_bool find_in_static
,
35 bt_bool fail_on_load_error
, const bt_plugin
**plugin
)
37 bt_plugin_find_status status
;
39 status
= bt_plugin_find(plugin_name
, find_in_std_env_var
,
40 find_in_user_dir
, find_in_sys_dir
, find_in_static
,
41 fail_on_load_error
, plugin
);
42 if (status
!= __BT_FUNC_STATUS_OK
) {
50 bt_plugin_find_all_status
bt_bt2_plugin_find_all(bt_bool find_in_std_env_var
,
51 bt_bool find_in_user_dir
, bt_bool find_in_sys_dir
,
52 bt_bool find_in_static
, bt_bool fail_on_load_error
,
53 const bt_plugin_set
**plugin_set
)
55 bt_plugin_find_all_status status
;
57 status
= bt_plugin_find_all(find_in_std_env_var
,
58 find_in_user_dir
, find_in_sys_dir
, find_in_static
,
59 fail_on_load_error
, plugin_set
);
60 if (status
!= __BT_FUNC_STATUS_OK
) {
68 bt_plugin_find_all_from_file_status
bt_bt2_plugin_find_all_from_file(
69 const char *path
, bt_bool fail_on_load_error
,
70 const bt_plugin_set
**plugin_set
)
72 bt_plugin_find_all_from_file_status status
;
74 status
= bt_plugin_find_all_from_file(path
, fail_on_load_error
,
76 if (status
!= __BT_FUNC_STATUS_OK
) {
84 bt_plugin_find_all_from_dir_status
bt_bt2_plugin_find_all_from_dir(
85 const char *path
, bt_bool recurse
, bt_bool fail_on_load_error
,
86 const bt_plugin_set
**plugin_set
)
88 bt_plugin_find_all_from_dir_status status
;
90 status
= bt_plugin_find_all_from_dir(path
, recurse
, fail_on_load_error
,
92 if (status
!= __BT_FUNC_STATUS_OK
) {