2 * SPDX-License-Identifier: MIT
4 * Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
7 #ifndef BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_PLUGIN_I_H
8 #define BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_PLUGIN_I_H
11 * Those bt_bt2_*() functions below ensure that when the API function
12 * fails, the output parameter is set to `NULL`. This is necessary
13 * because the epilogue of the `something **OUT` typemap will use that
14 * value to make a Python object. We can't rely on the initial value of
15 * `*OUT`; it could point to unreadable memory.
19 bt_property_availability
bt_bt2_plugin_get_version(
20 const bt_plugin
*plugin
, unsigned int *major
,
21 unsigned int *minor
, unsigned int *patch
, const char **extra
)
23 bt_property_availability ret
;
25 ret
= bt_plugin_get_version(plugin
, major
, minor
, patch
, extra
);
27 if (ret
== BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE
) {
35 bt_plugin_find_status
bt_bt2_plugin_find(const char *plugin_name
,
36 bt_bool find_in_std_env_var
, bt_bool find_in_user_dir
,
37 bt_bool find_in_sys_dir
, bt_bool find_in_static
,
38 bt_bool fail_on_load_error
, const bt_plugin
**plugin
)
40 bt_plugin_find_status status
;
42 status
= bt_plugin_find(plugin_name
, find_in_std_env_var
,
43 find_in_user_dir
, find_in_sys_dir
, find_in_static
,
44 fail_on_load_error
, plugin
);
45 if (status
!= __BT_FUNC_STATUS_OK
) {
53 bt_plugin_find_all_status
bt_bt2_plugin_find_all(bt_bool find_in_std_env_var
,
54 bt_bool find_in_user_dir
, bt_bool find_in_sys_dir
,
55 bt_bool find_in_static
, bt_bool fail_on_load_error
,
56 const bt_plugin_set
**plugin_set
)
58 bt_plugin_find_all_status status
;
60 status
= bt_plugin_find_all(find_in_std_env_var
,
61 find_in_user_dir
, find_in_sys_dir
, find_in_static
,
62 fail_on_load_error
, plugin_set
);
63 if (status
!= __BT_FUNC_STATUS_OK
) {
71 bt_plugin_find_all_from_file_status
bt_bt2_plugin_find_all_from_file(
72 const char *path
, bt_bool fail_on_load_error
,
73 const bt_plugin_set
**plugin_set
)
75 bt_plugin_find_all_from_file_status status
;
77 status
= bt_plugin_find_all_from_file(path
, fail_on_load_error
,
79 if (status
!= __BT_FUNC_STATUS_OK
) {
87 bt_plugin_find_all_from_dir_status
bt_bt2_plugin_find_all_from_dir(
88 const char *path
, bt_bool recurse
, bt_bool fail_on_load_error
,
89 const bt_plugin_set
**plugin_set
)
91 bt_plugin_find_all_from_dir_status status
;
93 status
= bt_plugin_find_all_from_dir(path
, recurse
, fail_on_load_error
,
95 if (status
!= __BT_FUNC_STATUS_OK
) {
102 #endif /* BABELTRACE_BINDINGS_PYTHON_BT2_BT2_NATIVE_BT_PLUGIN_I_H */