Strip babeltrace.c
[babeltrace.git] / plugins / source.c
index b722059bd0823273cbee62b6c86fc1ebde804dc6..ed3b1642b56c2d76e5b8032771acdfa0a67009c0 100644 (file)
@@ -26,6 +26,7 @@
  * SOFTWARE.
  */
 
+#include <babeltrace/ref.h>
 #include <babeltrace/compiler.h>
 #include <babeltrace/plugin/source-internal.h>
 #include <babeltrace/plugin/component-internal.h>
 static
 void bt_component_source_destroy(struct bt_component *component)
 {
-       struct bt_component_source *source;
-
-       if (!component) {
-               return;
-       }
+       return;
+}
 
-       source = container_of(component, struct bt_component_source, parent);
-       g_free(source);
+BT_HIDDEN
+enum bt_component_status bt_component_source_validate(
+               struct bt_component *component)
+{
+       return BT_COMPONENT_STATUS_OK;
 }
 
-struct bt_component *bt_component_source_create(const char *name,
-               void *private_data, bt_component_destroy_cb destroy_func,
-               bt_component_source_iterator_init_cb iterator_init_cb)
+BT_HIDDEN
+struct bt_component *bt_component_source_create(
+               struct bt_component_class *class, struct bt_value *params)
 {
        struct bt_component_source *source = NULL;
        enum bt_component_status ret;
 
-       if (!iterator_init_cb) {
-               goto end;
-       }
-
        source = g_new0(struct bt_component_source, 1);
        if (!source) {
                goto end;
        }
 
-       ret = bt_component_init(&source->parent, name, private_data,
-               destroy_func, BT_COMPONENT_TYPE_SOURCE,
-               bt_component_source_destroy);
+       ret = bt_component_init(&source->parent, bt_component_source_destroy);
        if (ret != BT_COMPONENT_STATUS_OK) {
-               g_free(source);
-               source = NULL;
+               BT_PUT(source);
                goto end;
        }
-
-       source->init_iterator = iterator_init_cb;
 end:
        return source ? &source->parent : NULL;
 }
 
-struct bt_notification_iterator *bt_plugin_source_create_iterator(
+struct bt_notification_iterator *bt_component_source_create_iterator(
                struct bt_component *component)
 {
        enum bt_component_status ret_component;
@@ -110,6 +102,6 @@ struct bt_notification_iterator *bt_plugin_source_create_iterator(
 end:
        return iterator;
 error:
-       bt_notification_iterator_put(iterator);
-       return NULL;
+       BT_PUT(iterator);
+       return iterator;
 }
This page took 0.024455 seconds and 4 git commands to generate.