projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add bt_plugin_set object
[babeltrace.git]
/
python-plugin-provider
/
python-plugin-provider.c
diff --git
a/python-plugin-provider/python-plugin-provider.c
b/python-plugin-provider/python-plugin-provider.c
index c7727f21020cbfddc4977b4c93e9872ee0f78ad6..2b566adaa4273de540a706f6366674f3b017a5b7 100644
(file)
--- a/
python-plugin-provider/python-plugin-provider.c
+++ b/
python-plugin-provider/python-plugin-provider.c
@@
-345,9
+345,10
@@
end:
}
G_MODULE_EXPORT
}
G_MODULE_EXPORT
-struct bt_plugin
*
*bt_plugin_python_create_all_from_file(const char *path)
+struct bt_plugin
_set
*bt_plugin_python_create_all_from_file(const char *path)
{
{
- struct bt_plugin **plugins = NULL;
+ struct bt_plugin_set *plugin_set = NULL;
+ struct bt_plugin *plugin = NULL;
PyObject *py_plugin_info = NULL;
gchar *basename = NULL;
size_t path_len;
PyObject *py_plugin_info = NULL;
gchar *basename = NULL;
size_t path_len;
@@
-422,33
+423,27
@@
struct bt_plugin **bt_plugin_python_create_all_from_file(const char *path)
/*
* Get bt_plugin from plugin info object.
/*
* Get bt_plugin from plugin info object.
- *
- * calloc(2, ...) because a single Python plugin file always
- * provides a single Babeltrace plugin (second item is the
- * sentinel).
*/
*/
- plugin
s = calloc(2, sizeof(*plugins)
);
- if (!plugin
s
) {
+ plugin
= bt_plugin_from_python_plugin_info(py_plugin_info
);
+ if (!plugin) {
goto error;
}
goto error;
}
- plugins[0] = bt_plugin_from_python_plugin_info(py_plugin_info);
- if (!plugins[0]) {
+ bt_plugin_set_path(plugin, path);
+ plugin_set = bt_plugin_set_create();
+ if (!plugin_set) {
goto error;
}
goto error;
}
- bt_plugin_set_
path(plugins[0], path
);
+ bt_plugin_set_
add_plugin(plugin_set, plugin
);
goto end;
error:
goto end;
error:
- if (plugins) {
- BT_PUT(plugins[0]);
- free(plugins);
- plugins = NULL;
- }
+ BT_PUT(plugin_set);
end:
end:
+ bt_put(plugin);
Py_XDECREF(py_plugin_info);
g_free(basename);
Py_XDECREF(py_plugin_info);
g_free(basename);
- return plugin
s
;
+ return plugin
_set
;
}
}
This page took
0.025547 seconds
and
4
git commands to generate.