X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fplugin%2Fplugin-internal.h;h=781c4ef3b5ba8955c835ae217048ae5c03c7973a;hb=7e69c04f557e46fb50e5a888a3bc3451afbd3b8e;hp=de1035c76f14ca6eaf9aa202c0e19856a4eb665e;hpb=db5504f973efded14c592f5404cce39c9b566329;p=babeltrace.git diff --git a/include/babeltrace/plugin/plugin-internal.h b/include/babeltrace/plugin/plugin-internal.h index de1035c7..781c4ef3 100644 --- a/include/babeltrace/plugin/plugin-internal.h +++ b/include/babeltrace/plugin/plugin-internal.h @@ -2,10 +2,9 @@ #define BABELTRACE_PLUGIN_PLUGIN_INTERNAL_H /* + * Copyright 2017-2018 Philippe Proulx * Copyright 2015 Jérémie Galarneau * - * Author: Jérémie Galarneau - * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -27,13 +26,13 @@ #include #include -#include +#include #include #include #include -#include #include #include +#include #include enum bt_plugin_type { @@ -41,6 +40,12 @@ enum bt_plugin_type { BT_PLUGIN_TYPE_PYTHON = 1, }; +enum bt_plugin_status { + BT_PLUGIN_STATUS_OK = 0, + BT_PLUGIN_STATUS_ERROR = -1, + BT_PLUGIN_STATUS_NOMEM = -12, +}; + struct bt_plugin { struct bt_object base; enum bt_plugin_type type; @@ -362,7 +367,8 @@ enum bt_plugin_status bt_plugin_add_component_class( } /* Add new component class */ - g_ptr_array_add(comp_classes, bt_object_get_ref(comp_class)); + bt_object_get_ref(comp_class); + g_ptr_array_add(comp_classes, comp_class); /* Special case for a shared object plugin */ if (plugin->type == BT_PLUGIN_TYPE_SO) { @@ -426,7 +432,8 @@ void bt_plugin_set_add_plugin(struct bt_plugin_set *plugin_set, { BT_ASSERT(plugin_set); BT_ASSERT(plugin); - g_ptr_array_add(plugin_set->plugins, bt_object_get_ref(plugin)); + bt_object_get_ref(plugin); + g_ptr_array_add(plugin_set->plugins, plugin); BT_LIB_LOGV("Added plugin to plugin set: " "plugin-set-addr=%p, %![plugin-]+l", plugin_set, plugin);