X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=python-plugin-provider%2Fpython-plugin-provider.c;h=d32ff8290e929fbe6f066e4d28b2d31a94599092;hb=41c019a5ce98ae3531411670fde94ceb701d4093;hp=11fae9329e12172c668838d112bb6ccbe3b36d8f;hpb=3a2cb327fd24e53a9b163372b9079003dd422655;p=babeltrace.git diff --git a/python-plugin-provider/python-plugin-provider.c b/python-plugin-provider/python-plugin-provider.c index 11fae932..d32ff829 100644 --- a/python-plugin-provider/python-plugin-provider.c +++ b/python-plugin-provider/python-plugin-provider.c @@ -25,11 +25,9 @@ */ #define BT_LOG_TAG "PLUGIN-PY" -#include "logging.h" #include #include -#include #include #include #include @@ -158,9 +156,9 @@ void fini_python(void) { } static -const struct bt_plugin *bt_plugin_from_python_plugin_info(PyObject *plugin_info) +bt_plugin *bt_plugin_from_python_plugin_info(PyObject *plugin_info) { - const struct bt_plugin *plugin = NULL; + bt_plugin *plugin = NULL; PyObject *py_name = NULL; PyObject *py_author = NULL; PyObject *py_description = NULL; @@ -333,15 +331,14 @@ const struct bt_plugin *bt_plugin_from_python_plugin_info(PyObject *plugin_info) size_t i; for (i = 0; i < PyList_Size(py_comp_class_addrs); i++) { - struct bt_component_class *comp_class; + bt_component_class *comp_class; PyObject *py_comp_class_addr; py_comp_class_addr = PyList_GetItem(py_comp_class_addrs, i); BT_ASSERT(py_comp_class_addr); if (PyLong_Check(py_comp_class_addr)) { - comp_class = (struct bt_component_class *) - PyLong_AsUnsignedLongLong(py_comp_class_addr); + comp_class = PyLong_AsVoidPtr(py_comp_class_addr); } else { BT_LOGW("Component class address is not an integer in Python plugin info object: " "py-plugin-info-addr=%p, index=%zu", @@ -368,8 +365,6 @@ const struct bt_plugin *bt_plugin_from_python_plugin_info(PyObject *plugin_info) } } - bt_plugin_freeze(plugin); - goto end; error: @@ -388,10 +383,10 @@ end: } G_MODULE_EXPORT -struct bt_plugin_set *bt_plugin_python_create_all_from_file(const char *path) +bt_plugin_set *bt_plugin_python_create_all_from_file(const char *path) { - struct bt_plugin_set *plugin_set = NULL; - const struct bt_plugin *plugin = NULL; + bt_plugin_set *plugin_set = NULL; + bt_plugin *plugin = NULL; PyObject *py_plugin_info = NULL; gchar *basename = NULL; size_t path_len; @@ -495,7 +490,7 @@ error: BT_OBJECT_PUT_REF_AND_RESET(plugin_set); end: - bt_object_put_ref(plugin); + bt_plugin_put_ref(plugin); Py_XDECREF(py_plugin_info); g_free(basename); return plugin_set;