babeltracepluginincludedir="${includedir}/babeltrace/plugin"
AC_SUBST(babeltracepluginincludedir)
-babeltracecomponentincludedir="${includedir}/babeltrace/component"
-AC_SUBST(babeltracecomponentincludedir)
-
-babeltracecomponentnotifincludedir="${includedir}/babeltrace/component/notification"
-AC_SUBST(babeltracecomponentnotifincludedir)
+babeltracegraphincludedir="${includedir}/babeltrace/graph"
+AC_SUBST(babeltracegraphincludedir)
program_transform_name="s&babeltrace\.bin&babeltrace&;$program_transform_name"
AC_SUBST(program_transform_name)
#include <babeltrace/ref.h>
#include <babeltrace/object-internal.h>
#include <babeltrace/compiler.h>
-#include <babeltrace/component/component-class.h>
+#include <babeltrace/graph/component-class.h>
#include <glib.h>
struct bt_config_component {
#include <babeltrace/babeltrace.h>
#include <babeltrace/plugin/plugin.h>
#include <babeltrace/common-internal.h>
-#include <babeltrace/component/component.h>
-#include <babeltrace/component/component-source.h>
-#include <babeltrace/component/component-sink.h>
-#include <babeltrace/component/component-filter.h>
-#include <babeltrace/component/component-class.h>
-#include <babeltrace/component/port.h>
-#include <babeltrace/component/graph.h>
-#include <babeltrace/component/connection.h>
-#include <babeltrace/component/notification/iterator.h>
+#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/component-source.h>
+#include <babeltrace/graph/component-sink.h>
+#include <babeltrace/graph/component-filter.h>
+#include <babeltrace/graph/component-class.h>
+#include <babeltrace/graph/port.h>
+#include <babeltrace/graph/graph.h>
+#include <babeltrace/graph/connection.h>
+#include <babeltrace/graph/notification-iterator.h>
#include <babeltrace/ref.h>
#include <babeltrace/values.h>
#include <stdlib.h>
#include <babeltrace/ctf-ir/validation-internal.h>
#include <babeltrace/ctf-ir/visitor-internal.h>
#include <babeltrace/ctf-ir/utils.h>
-#include <babeltrace/component/notification/schema.h>
+#include <babeltrace/graph/notification-schema.h>
#include <babeltrace/compiler.h>
#include <babeltrace/values.h>
#include <babeltrace/ref.h>
babeltrace/plugin/plugin.h \
babeltrace/plugin/plugin-dev.h
-babeltracecomponentnotifinclude_HEADERS = \
- babeltrace/component/notification/eot.h \
- babeltrace/component/notification/notification.h \
- babeltrace/component/notification/event.h \
- babeltrace/component/notification/iterator.h \
- babeltrace/component/notification/packet.h \
- babeltrace/component/notification/schema.h \
- babeltrace/component/notification/stream.h \
- babeltrace/component/notification/heap.h \
- babeltrace/component/notification/private-iterator.h
-
-babeltracecomponentinclude_HEADERS = \
- babeltrace/component/component.h \
- babeltrace/component/component-class.h \
- babeltrace/component/component-class-source.h \
- babeltrace/component/component-class-filter.h \
- babeltrace/component/component-class-sink.h \
- babeltrace/component/connection.h \
- babeltrace/component/port.h \
- babeltrace/component/graph.h \
- babeltrace/component/component-source.h \
- babeltrace/component/component-sink.h \
- babeltrace/component/component-filter.h \
- babeltrace/component/private-connection.h \
- babeltrace/component/private-port.h \
- babeltrace/component/private-component.h \
- babeltrace/component/private-component-source.h \
- babeltrace/component/private-component-sink.h \
- babeltrace/component/private-component-filter.h
+babeltracegraphinclude_HEADERS = \
+ babeltrace/graph/component-class-filter.h \
+ babeltrace/graph/component-class-sink.h \
+ babeltrace/graph/component-class-source.h \
+ babeltrace/graph/component-class.h \
+ babeltrace/graph/component-filter.h \
+ babeltrace/graph/component-sink.h \
+ babeltrace/graph/component-source.h \
+ babeltrace/graph/component.h \
+ babeltrace/graph/connection.h \
+ babeltrace/graph/graph.h \
+ babeltrace/graph/notification-eot.h \
+ babeltrace/graph/notification-event.h \
+ babeltrace/graph/notification-heap.h \
+ babeltrace/graph/notification-iterator.h \
+ babeltrace/graph/notification.h \
+ babeltrace/graph/notification-packet.h \
+ babeltrace/graph/notification-schema.h \
+ babeltrace/graph/notification-stream.h \
+ babeltrace/graph/port.h \
+ babeltrace/graph/private-component-filter.h \
+ babeltrace/graph/private-component-sink.h \
+ babeltrace/graph/private-component-source.h \
+ babeltrace/graph/private-component.h \
+ babeltrace/graph/private-connection.h \
+ babeltrace/graph/private-notification-iterator.h \
+ babeltrace/graph/private-port.h
noinst_HEADERS = \
babeltrace/align.h \
babeltrace/mmap-align.h \
babeltrace/plugin/plugin-internal.h \
babeltrace/plugin/plugin-so-internal.h \
- babeltrace/component/component-class-internal.h \
- babeltrace/component/connection-internal.h \
- babeltrace/component/port-internal.h \
- babeltrace/component/component-internal.h \
- babeltrace/component/graph-internal.h \
- babeltrace/component/component-filter-internal.h \
- babeltrace/component/component-sink-internal.h \
- babeltrace/component/component-source-internal.h \
- babeltrace/component/notification/eot-internal.h \
- babeltrace/component/notification/event-internal.h \
- babeltrace/component/notification/iterator-internal.h \
- babeltrace/component/notification/notification-internal.h \
- babeltrace/component/notification/packet-internal.h \
- babeltrace/component/notification/stream-internal.h \
- babeltrace/component/notification/heap-internal.h
+ babeltrace/graph/component-class-internal.h \
+ babeltrace/graph/connection-internal.h \
+ babeltrace/graph/port-internal.h \
+ babeltrace/graph/component-internal.h \
+ babeltrace/graph/graph-internal.h \
+ babeltrace/graph/component-filter-internal.h \
+ babeltrace/graph/component-sink-internal.h \
+ babeltrace/graph/component-source-internal.h \
+ babeltrace/graph/notification-eot-internal.h \
+ babeltrace/graph/notification-event-internal.h \
+ babeltrace/graph/notification-iterator-internal.h \
+ babeltrace/graph/notification-internal.h \
+ babeltrace/graph/notification-packet-internal.h \
+ babeltrace/graph/notification-stream-internal.h \
+ babeltrace/graph/notification-heap-internal.h
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_FILTER_H
-#define BABELTRACE_COMPONENT_COMPONENT_CLASS_FILTER_H
-
-/*
- * Babeltrace - Component Class Interface.
- *
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/component.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_component_class;
-
-extern
-struct bt_component_class *bt_component_class_filter_create(const char *name,
- bt_component_class_notification_iterator_next_method notification_iterator_next_method);
-
-extern
-int bt_component_class_filter_set_notification_iterator_init_method(
- struct bt_component_class *component_class,
- bt_component_class_notification_iterator_init_method notification_iterator_init_method);
-
-extern
-int bt_component_class_filter_set_notification_iterator_finalize_method(
- struct bt_component_class *component_class,
- bt_component_class_notification_iterator_finalize_method notification_iterator_finalize_method);
-
-extern
-int bt_component_class_filter_set_notification_iterator_seek_time_method(
- struct bt_component_class *component_class,
- bt_component_class_notification_iterator_seek_time_method notification_iterator_seek_time_method);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_COMPONENT_CLASS_FILTER_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_INTERNAL_H
-#define BABELTRACE_COMPONENT_COMPONENT_CLASS_INTERNAL_H
-
-/*
- * BabelTrace - Component Class Internal
- *
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/component.h>
-#include <babeltrace/component/component-class.h>
-#include <babeltrace/component/component-class-source.h>
-#include <babeltrace/component/component-class-filter.h>
-#include <babeltrace/component/component-class-sink.h>
-#include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/object-internal.h>
-#include <stdbool.h>
-#include <glib.h>
-
-struct bt_component_class;
-
-typedef void (*bt_component_class_destroy_listener_func)(
- struct bt_component_class *class, void *data);
-
-struct bt_component_class_destroy_listener {
- bt_component_class_destroy_listener_func func;
- void *data;
-};
-
-struct bt_component_class {
- struct bt_object base;
- enum bt_component_class_type type;
- GString *name;
- GString *description;
- GString *help;
- struct {
- bt_component_class_init_method init;
- bt_component_class_finalize_method finalize;
- bt_component_class_query_method query;
- bt_component_class_accept_port_connection_method accept_port_connection;
- bt_component_class_port_disconnected_method port_disconnected;
- } methods;
- /* Array of struct bt_component_class_destroy_listener */
- GArray *destroy_listeners;
- bool frozen;
-};
-
-struct bt_component_class_iterator_methods {
- bt_component_class_notification_iterator_init_method init;
- bt_component_class_notification_iterator_finalize_method finalize;
- bt_component_class_notification_iterator_next_method next;
- bt_component_class_notification_iterator_seek_time_method seek_time;
-};
-
-struct bt_component_class_source {
- struct bt_component_class parent;
- struct {
- struct bt_component_class_iterator_methods iterator;
- } methods;
-};
-
-struct bt_component_class_sink {
- struct bt_component_class parent;
- struct {
- bt_component_class_sink_consume_method consume;
- } methods;
-};
-
-struct bt_component_class_filter {
- struct bt_component_class parent;
- struct {
- struct bt_component_class_iterator_methods iterator;
- } methods;
-};
-
-BT_HIDDEN
-int bt_component_class_add_destroy_listener(struct bt_component_class *class,
- bt_component_class_destroy_listener_func func, void *data);
-
-#endif /* BABELTRACE_COMPONENT_COMPONENT_CLASS_INTERNAL_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_SINK_H
-#define BABELTRACE_COMPONENT_COMPONENT_CLASS_SINK_H
-
-/*
- * Babeltrace - Component Class Interface.
- *
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/private-component.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_component_class;
-
-typedef enum bt_component_status (*bt_component_class_sink_consume_method)(
- struct bt_private_component *private_component);
-
-extern
-struct bt_component_class *bt_component_class_sink_create(const char *name,
- bt_component_class_sink_consume_method consume_method);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_COMPONENT_CLASS_SINK_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_SOURCE_H
-#define BABELTRACE_COMPONENT_COMPONENT_CLASS_SOURCE_H
-
-/*
- * Babeltrace - Component Class Interface.
- *
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/component.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_component_class;
-
-extern
-struct bt_component_class *bt_component_class_source_create(const char *name,
- bt_component_class_notification_iterator_next_method notification_iterator_next_method);
-
-extern
-int bt_component_class_source_set_notification_iterator_init_method(
- struct bt_component_class *component_class,
- bt_component_class_notification_iterator_init_method notification_iterator_init_method);
-
-extern
-int bt_component_class_source_set_notification_iterator_finalize_method(
- struct bt_component_class *component_class,
- bt_component_class_notification_iterator_finalize_method notification_iterator_finalize_method);
-
-extern
-int bt_component_class_source_set_notification_iterator_seek_time_method(
- struct bt_component_class *component_class,
- bt_component_class_notification_iterator_seek_time_method notification_iterator_seek_time_method);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_COMPONENT_CLASS_SOURCE_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_H
-#define BABELTRACE_COMPONENT_COMPONENT_CLASS_H
-
-/*
- * Babeltrace - Component Class Interface.
- *
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/component.h>
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_component_class;
-struct bt_component;
-struct bt_private_component;
-struct bt_private_port;
-struct bt_port;
-struct bt_value;
-struct bt_private_notification_iterator;
-
-/**
- * Component class type.
- */
-enum bt_component_class_type {
- BT_COMPONENT_CLASS_TYPE_UNKNOWN = -1,
-
- /** A source component is a notification generator. */
- BT_COMPONENT_CLASS_TYPE_SOURCE = 0,
-
- /** A sink component handles incoming notifications. */
- BT_COMPONENT_CLASS_TYPE_SINK = 1,
-
- /** A filter component implements both Source and Sink interfaces. */
- BT_COMPONENT_CLASS_TYPE_FILTER = 2,
-};
-
-typedef enum bt_component_status (*bt_component_class_init_method)(
- struct bt_private_component *private_component,
- struct bt_value *params, void *init_method_data);
-
-typedef void (*bt_component_class_finalize_method)(
- struct bt_private_component *private_component);
-
-typedef enum bt_notification_iterator_status
- (*bt_component_class_notification_iterator_init_method)(
- struct bt_private_notification_iterator *private_notification_iterator,
- struct bt_private_port *private_port);
-
-typedef void (*bt_component_class_notification_iterator_finalize_method)(
- struct bt_private_notification_iterator *private_notification_iterator);
-
-typedef struct bt_notification_iterator_next_return (*bt_component_class_notification_iterator_next_method)(
- struct bt_private_notification_iterator *private_notification_iterator);
-
-typedef enum bt_notification_iterator_status
- (*bt_component_class_notification_iterator_seek_time_method)(
- struct bt_private_notification_iterator *private_notification_iterator,
- int64_t time);
-
-typedef struct bt_value *(*bt_component_class_query_method)(
- struct bt_component_class *component_class,
- const char *object, struct bt_value *params);
-
-typedef enum bt_component_status (*bt_component_class_accept_port_connection_method)(
- struct bt_private_component *private_component,
- struct bt_private_port *self_private_port,
- struct bt_port *other_port);
-
-typedef void (*bt_component_class_port_disconnected_method)(
- struct bt_private_component *private_component,
- struct bt_private_port *private_port);
-
-extern int bt_component_class_set_init_method(
- struct bt_component_class *component_class,
- bt_component_class_init_method init_method);
-
-extern int bt_component_class_set_finalize_method(
- struct bt_component_class *component_class,
- bt_component_class_finalize_method finalize_method);
-
-extern int bt_component_class_set_accept_port_connection_method(
- struct bt_component_class *component_class,
- bt_component_class_accept_port_connection_method accept_port_connection_method);
-
-extern int bt_component_class_set_port_disconnected_method(
- struct bt_component_class *component_class,
- bt_component_class_port_disconnected_method port_disconnected_method);
-
-extern int bt_component_class_set_query_method(
- struct bt_component_class *component_class,
- bt_component_class_query_method query_method);
-
-extern int bt_component_class_set_description(
- struct bt_component_class *component_class,
- const char *description);
-
-extern int bt_component_class_set_help(
- struct bt_component_class *component_class,
- const char *help);
-
-extern int bt_component_class_freeze(
- struct bt_component_class *component_class);
-
-/**
- * Get a component class' name.
- *
- * @param component_class Component class of which to get the name
- * @returns Name of the component class
- */
-extern const char *bt_component_class_get_name(
- struct bt_component_class *component_class);
-
-/**
- * Get a component class' description.
- *
- * Component classes may provide an optional description. It may, however,
- * opt not to.
- *
- * @param component_class Component class of which to get the description
- * @returns Description of the component class, or NULL.
- */
-extern const char *bt_component_class_get_description(
- struct bt_component_class *component_class);
-
-extern const char *bt_component_class_get_help(
- struct bt_component_class *component_class);
-
-extern struct bt_value *bt_component_class_query(
- struct bt_component_class *component_class,
- const char *object, struct bt_value *params);
-
-/**
- * Get a component class' type.
- *
- * @param component_class Component class of which to get the type
- * @returns One of #bt_component_type
- */
-extern enum bt_component_class_type bt_component_class_get_type(
- struct bt_component_class *component_class);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_COMPONENT_CLASS_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_FILTER_INTERNAL_H
-#define BABELTRACE_COMPONENT_FILTER_INTERNAL_H
-
-/*
- * BabelTrace - Filter Component Internal
- *
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/component/component-internal.h>
-#include <babeltrace/component/component-class-internal.h>
-
-struct bt_value;
-
-struct bt_component_filter {
- struct bt_component parent;
-};
-
-/**
- * Allocate a filter component.
- *
- * @param class Component class
- * @param params A dictionary of component parameters
- * @returns A filter component instance
- */
-BT_HIDDEN
-struct bt_component *bt_component_filter_create(
- struct bt_component_class *class, struct bt_value *params);
-
-BT_HIDDEN
-void bt_component_filter_destroy(struct bt_component *component);
-
-/**
- * Validate a filter component.
- *
- * @param component Filter component instance to validate
- * @returns One of #bt_component_status
- */
-BT_HIDDEN
-enum bt_component_status bt_component_filter_validate(
- struct bt_component *component);
-
-#endif /* BABELTRACE_COMPONENT_FILTER_INTERNAL_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_FILTER_H
-#define BABELTRACE_COMPONENT_FILTER_H
-
-/*
- * BabelTrace - Filter Plug-in Interface
- *
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdint.h>
-#include <babeltrace/component/component.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_port;
-struct bt_component;
-
-extern enum bt_component_status bt_component_filter_get_input_port_count(
- struct bt_component *component, uint64_t *count);
-extern struct bt_port *bt_component_filter_get_input_port(
- struct bt_component *component, const char *name);
-extern struct bt_port *bt_component_filter_get_input_port_at_index(
- struct bt_component *component, int index);
-extern struct bt_port *bt_component_filter_get_default_input_port(
- struct bt_component *component);
-
-extern enum bt_component_status bt_component_filter_get_output_port_count(
- struct bt_component *component, uint64_t *count);
-extern struct bt_port *bt_component_filter_get_output_port(
- struct bt_component *component, const char *name);
-extern struct bt_port *bt_component_filter_get_output_port_at_index(
- struct bt_component *component, int index);
-extern struct bt_port *bt_component_filter_get_default_output_port(
- struct bt_component *component);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_FILTER_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_COMPONENT_INTERNAL_H
-#define BABELTRACE_COMPONENT_COMPONENT_INTERNAL_H
-
-/*
- * BabelTrace - Component internal
- *
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/component/component.h>
-#include <babeltrace/component/component-class-internal.h>
-#include <babeltrace/component/port-internal.h>
-#include <babeltrace/object-internal.h>
-#include <glib.h>
-#include <stdio.h>
-
-#define DEFAULT_INPUT_PORT_NAME "default"
-#define DEFAULT_OUTPUT_PORT_NAME "default"
-
-struct bt_component {
- struct bt_object base;
- struct bt_component_class *class;
- GString *name;
-
- /*
- * Internal destroy function specific to a source, filter, or
- * sink component object.
- */
- void (*destroy)(struct bt_component *);
-
- /* User-defined data */
- void *user_data;
-
- /*
- * Used to protect operations which may only be used during
- * a component's initialization.
- */
- bool initializing;
-
- /* Input and output ports (weak references) */
- GPtrArray *input_ports;
- GPtrArray *output_ports;
-};
-
-static inline
-struct bt_component *bt_component_from_private(
- struct bt_private_component *private_component)
-{
- return (void *) private_component;
-}
-
-static inline
-struct bt_private_component *bt_private_component_from_component(
- struct bt_component *component)
-{
- return (void *) component;
-}
-
-BT_HIDDEN
-enum bt_component_status bt_component_accept_port_connection(
- struct bt_component *component, struct bt_port *self_port,
- struct bt_port *other_port);
-
-BT_HIDDEN
-void bt_component_port_disconnected(struct bt_component *comp,
- struct bt_port *port);
-
-BT_HIDDEN
-void bt_component_set_graph(struct bt_component *component,
- struct bt_graph *graph);
-
-BT_HIDDEN
-uint64_t bt_component_get_input_port_count(struct bt_component *comp);
-
-BT_HIDDEN
-uint64_t bt_component_get_output_port_count(struct bt_component *comp);
-
-BT_HIDDEN
-struct bt_port *bt_component_get_input_port_at_index(struct bt_component *comp,
- int index);
-
-BT_HIDDEN
-struct bt_port *bt_component_get_output_port_at_index(struct bt_component *comp,
- int index);
-
-BT_HIDDEN
-struct bt_port *bt_component_get_input_port(struct bt_component *comp,
- const char *name);
-
-BT_HIDDEN
-struct bt_port *bt_component_get_output_port(struct bt_component *comp,
- const char *name);
-
-BT_HIDDEN
-struct bt_port *bt_component_add_input_port(
- struct bt_component *component, const char *name);
-
-BT_HIDDEN
-struct bt_port *bt_component_add_output_port(
- struct bt_component *component, const char *name);
-
-BT_HIDDEN
-enum bt_component_status bt_component_remove_port(
- struct bt_component *component, struct bt_port *port);
-
-#endif /* BABELTRACE_COMPONENT_COMPONENT_INTERNAL_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_SINK_INTERNAL_H
-#define BABELTRACE_COMPONENT_SINK_INTERNAL_H
-
-/*
- * BabelTrace - Sink Component internal
- *
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/component/component-sink.h>
-#include <babeltrace/component/component-internal.h>
-#include <babeltrace/component/component-class-internal.h>
-
-struct bt_value;
-
-//typedef uint32_t notification_mask_t;
-
-struct bt_component_sink {
- struct bt_component parent;
-};
-
-/**
- * Allocate a sink component.
- *
- * @param class Component class
- * @param params A dictionary of component parameters
- * @returns A sink component instance
- */
-BT_HIDDEN
-struct bt_component *bt_component_sink_create(
- struct bt_component_class *class, struct bt_value *params);
-
-BT_HIDDEN
-void bt_component_sink_destroy(struct bt_component *component);
-
-/**
- * Validate a sink component.
- *
- * @param component Sink component instance to validate
- * @returns One of #bt_component_status
- */
-BT_HIDDEN
-enum bt_component_status bt_component_sink_validate(
- struct bt_component *component);
-
-/**
- * Process one event, consuming from sources as needed.
- *
- * @param component Component instance
- * @returns One of #bt_component_status values
- */
-BT_HIDDEN
-enum bt_component_status bt_component_sink_consume(
- struct bt_component *component);
-
-#endif /* BABELTRACE_COMPONENT_SINK_INTERNAL_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_SINK_H
-#define BABELTRACE_COMPONENT_SINK_H
-
-/*
- * BabelTrace - Sink Component Interface
- *
- * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/component.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_component;
-struct bt_notification;
-
-extern enum bt_component_status bt_component_sink_get_input_port_count(
- struct bt_component *component, uint64_t *count);
-extern struct bt_port *bt_component_sink_get_input_port(
- struct bt_component *component, const char *name);
-extern struct bt_port *bt_component_sink_get_input_port_at_index(
- struct bt_component *component, int index);
-extern struct bt_port *bt_component_sink_get_default_input_port(
- struct bt_component *component);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_SINK_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_SOURCE_INTERNAL_H
-#define BABELTRACE_COMPONENT_SOURCE_INTERNAL_H
-
-/*
- * BabelTrace - Source Component internal
- *
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/component/component-internal.h>
-#include <babeltrace/component/component-class-internal.h>
-
-struct bt_value;
-
-struct bt_component_source {
- struct bt_component parent;
-};
-
-/**
- * Allocate a source component.
- *
- * @param class Component class
- * @param params A dictionary of component parameters
- * @returns A source component instance
- */
-BT_HIDDEN
-struct bt_component *bt_component_source_create(
- struct bt_component_class *class, struct bt_value *params);
-
-BT_HIDDEN
-void bt_component_source_destroy(struct bt_component *component);
-
-/**
- * Validate a source component.
- *
- * @param component Source component instance to validate
- * @returns One of #bt_component_status
- */
-BT_HIDDEN
-enum bt_component_status bt_component_source_validate(
- struct bt_component *component);
-
-#endif /* BABELTRACE_COMPONENT_SOURCE_INTERNAL_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_SOURCE_H
-#define BABELTRACE_COMPONENT_SOURCE_H
-
-/*
- * BabelTrace - Source Plug-in Interface
- *
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdint.h>
-#include <babeltrace/component/component.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_component;
-struct bt_notification_iterator;
-
-extern enum bt_component_status bt_component_source_get_output_port_count(
- struct bt_component *component, uint64_t *count);
-extern struct bt_port *bt_component_source_get_output_port(
- struct bt_component *component, const char *name);
-extern struct bt_port *bt_component_source_get_output_port_at_index(
- struct bt_component *component, int index);
-extern struct bt_port *bt_component_source_get_default_output_port(
- struct bt_component *component);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_SOURCE_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_COMPONENT_H
-#define BABELTRACE_COMPONENT_COMPONENT_H
-
-/*
- * BabelTrace - Babeltrace Component Interface
- *
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/component-class.h>
-#include <babeltrace/component/notification/iterator.h>
-#include <babeltrace/values.h>
-#include <stdio.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_component_class;
-struct bt_component_graph;
-struct bt_component;
-struct bt_value;
-struct bt_port;
-
-/**
- * Status code. Errors are always negative.
- */
-enum bt_component_status {
- /** No error, okay. */
- BT_COMPONENT_STATUS_OK = 0,
- /** No more work to be done by this component. **/
- BT_COMPONENT_STATUS_END = 1,
- /**
- * Component can't process a notification at this time
- * (e.g. would block), try again later.
- */
- BT_COMPONENT_STATUS_AGAIN = 2,
- /** Refuse port connection. */
- BT_COMPONENT_STATUS_REFUSE_PORT_CONNECTION = 3,
- /** General error. */
- BT_COMPONENT_STATUS_ERROR = -1,
- /** Unsupported component feature. */
- BT_COMPONENT_STATUS_UNSUPPORTED = -2,
- /** Invalid arguments. */
- BT_COMPONENT_STATUS_INVALID = -3,
- /** Memory allocation failure. */
- BT_COMPONENT_STATUS_NOMEM = -4,
- /** Element not found. */
- BT_COMPONENT_STATUS_NOT_FOUND = -5,
-};
-
-/**
- * Create an instance of a component from a component class.
- *
- * @param component_class Component class of which to create an instance
- * @param name Name of the new component instance, optional
- * @param params A dictionary of component parameters
- * @returns Returns a pointer to a new component instance
- */
-extern struct bt_component *bt_component_create(
- struct bt_component_class *component_class, const char *name,
- struct bt_value *params);
-
-extern struct bt_component *bt_component_create_with_init_method_data(
- struct bt_component_class *component_class, const char *name,
- struct bt_value *params, void *init_method_data);
-
-/**
- * Get component's name.
- *
- * @param component Component instance of which to get the name
- * @returns Returns a pointer to the component's name
- */
-extern const char *bt_component_get_name(struct bt_component *component);
-
-/**
- * Get component's class.
- *
- * @param component Component instance of which to get the class
- * @returns The component's class
- */
-extern struct bt_component_class *bt_component_get_class(
- struct bt_component *component);
-
-extern enum bt_component_class_type bt_component_get_class_type(
- struct bt_component *component);
-
-extern struct bt_graph *bt_component_get_graph(struct bt_component *component);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_COMPONENT_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H
-#define BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H
-
-/*
- * BabelTrace - Component Connection Internal
- *
- * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/connection.h>
-#include <babeltrace/component/private-connection.h>
-#include <babeltrace/object-internal.h>
-
-struct bt_graph;
-
-struct bt_connection {
- /*
- * The graph is a connection's parent and the connection is the parent
- * of all iterators it has created.
- */
- struct bt_object base;
- /*
- * Weak references are held to both ports. Their existence is guaranteed
- * by the existence of the graph and thus, of their respective
- * components.
- */
- /* Downstream port. */
- struct bt_port *downstream_port;
- /* Upstream port. */
- struct bt_port *upstream_port;
-};
-
-static inline
-struct bt_connection *bt_connection_from_private(
- struct bt_private_connection *private_connection)
-{
- return (void *) private_connection;
-}
-
-static inline
-struct bt_private_connection *bt_private_connection_from_connection(
- struct bt_connection *connection)
-{
- return (void *) connection;
-}
-
-BT_HIDDEN
-struct bt_connection *bt_connection_create(struct bt_graph *graph,
- struct bt_port *upstream_port,
- struct bt_port *downstream_port);
-
-BT_HIDDEN
-void bt_connection_disconnect_ports(struct bt_connection *conn,
- struct bt_component *comp);
-
-#endif /* BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_CONNECTION_H
-#define BABELTRACE_COMPONENT_CONNECTION_H
-
-/*
- * BabelTrace - Babeltrace Component Connection Interface
- *
- * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_component;
-struct bt_connection;
-
-/* Returns the "downstream" input port. */
-extern struct bt_port *bt_connection_get_downstream_port(
- struct bt_connection *connection);
-/* Returns the "upstream" output port. */
-extern struct bt_port *bt_connection_get_upstream_port(
- struct bt_connection *connection);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_CONNECTION_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_COMPONENT_GRAPH_INTERNAL_H
-#define BABELTRACE_COMPONENT_COMPONENT_GRAPH_INTERNAL_H
-
-/*
- * BabelTrace - Component Graph Internal
- *
- * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/graph.h>
-#include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/object-internal.h>
-#include <glib.h>
-
-struct bt_component;
-struct bt_port;
-
-struct bt_graph {
- /**
- * A component graph contains components and point-to-point connection
- * between these components.
- *
- * In terms of ownership:
- * 1) The graph is the components' parent,
- * 2) The graph is the connnections' parent,
- * 3) Components share the ownership of their connections,
- * 4) A connection holds weak references to its two component endpoints.
- */
- struct bt_object base;
-
- /* Array of pointers to bt_connection. */
- GPtrArray *connections;
- /* Array of pointers to bt_component. */
- GPtrArray *components;
- /* Queue of pointers (weak references) to sink bt_components. */
- GQueue *sinks_to_consume;
-
- struct {
- GArray *port_added;
- GArray *port_removed;
- GArray *port_connected;
- GArray *port_disconnected;
- } listeners;
-};
-
-BT_HIDDEN
-void bt_graph_notify_port_added(struct bt_graph *graph, struct bt_port *port);
-
-BT_HIDDEN
-void bt_graph_notify_port_removed(struct bt_graph *graph,
- struct bt_component *comp, struct bt_port *port);
-
-BT_HIDDEN
-void bt_graph_notify_port_connected(struct bt_graph *graph,
- struct bt_port *port);
-
-BT_HIDDEN
-void bt_graph_notify_port_disconnected(struct bt_graph *graph,
- struct bt_component *comp, struct bt_port *port);
-
-#endif /* BABELTRACE_COMPONENT_COMPONENT_GRAPH_INTERNAL_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_GRAPH_H
-#define BABELTRACE_COMPONENT_GRAPH_H
-
-/*
- * BabelTrace - Babeltrace Graph Interface
- *
- * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/component.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_port;
-struct bt_connection;
-
-enum bt_graph_status {
- /** No sink can consume at the moment. */
- BT_GRAPH_STATUS_AGAIN = 2,
- /** Downstream component does not support multiple inputs. */
- BT_GRAPH_STATUS_END = 1,
- BT_GRAPH_STATUS_OK = 0,
- /** Downstream component does not support multiple inputs. */
- BT_GRAPH_STATUS_MULTIPLE_INPUTS_UNSUPPORTED = -1,
- /** Component is already part of another graph. */
- BT_GRAPH_STATUS_ALREADY_IN_A_GRAPH = -2,
- /** Invalid arguments. */
- BT_GRAPH_STATUS_INVALID = -3,
- /** No sink in graph. */
- BT_GRAPH_STATUS_NO_SINK = -4,
- /** General error. */
- BT_GRAPH_STATUS_ERROR = -5,
-};
-
-typedef void (*bt_graph_port_added_listener)(struct bt_port *port,
- void *data);
-typedef void (*bt_graph_port_removed_listener)(struct bt_component *component,
- struct bt_port *port, void *data);
-typedef void (*bt_graph_port_connected_listener)(struct bt_port *port,
- void *data);
-typedef void (*bt_graph_port_disconnected_listener)(
- struct bt_component *component, struct bt_port *port,
- void *data);
-
-extern struct bt_graph *bt_graph_create(void);
-
-/**
- * Creates a connection between two components using the two ports specified
- * and adds the connection and components (if not already added) to the graph.
- */
-extern struct bt_connection *bt_graph_connect(struct bt_graph *graph,
- struct bt_port *upstream,
- struct bt_port *downstream);
-
-/**
- * Add a component as a "sibling" of the origin component. Sibling share
- * connections equivalent to each other at the time of connection (same
- * upstream and downstream ports).
- */
-extern enum bt_graph_status bt_graph_add_component_as_sibling(
- struct bt_graph *graph, struct bt_component *origin,
- struct bt_component *new_component);
-
-/**
- * Run graph to completion or until a single sink is left and "AGAIN" is received.
- *
- * Runs "bt_component_sink_consume()" on all sinks in round-robin until they all
- * indicate that the end is reached or that an error occured.
- */
-extern enum bt_graph_status bt_graph_run(struct bt_graph *graph);
-
-/**
- * Runs "bt_component_sink_consume()" on the graph's sinks. Each invokation will
- * invoke "bt_component_sink_consume()" on the next sink, in round-robin, until
- * they all indicated that the end is reached.
- */
-extern enum bt_graph_status bt_graph_consume(struct bt_graph *graph);
-
-extern enum bt_graph_status bt_graph_add_port_added_listener(
- struct bt_graph *graph,
- bt_graph_port_added_listener listener, void *data);
-
-extern enum bt_graph_status bt_graph_add_port_removed_listener(
- struct bt_graph *graph,
- bt_graph_port_removed_listener listener, void *data);
-
-extern enum bt_graph_status bt_graph_add_port_connected_listener(
- struct bt_graph *graph,
- bt_graph_port_connected_listener listener, void *data);
-
-extern enum bt_graph_status bt_graph_add_port_disconnected_listener(
- struct bt_graph *graph,
- bt_graph_port_disconnected_listener listener, void *data);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_GRAPH_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_EOT_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_EOT_H
-
-/*
- * BabelTrace - Plug-in End of Trace Notification
- *
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_EOT_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_EVENT_INTERNAL_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_EVENT_INTERNAL_H
-
-/*
- * BabelTrace - Plug-in Event Notification internal
- *
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/ctf-ir/event.h>
-#include <babeltrace/component/notification/notification-internal.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_notification_event {
- struct bt_notification parent;
- struct bt_ctf_event *event;
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACECOMPONENTPLUGIN_NOTIFICATION_EVENT_INTERNAL_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_EVENT_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_EVENT_H
-
-/*
- * BabelTrace - Plug-in Event Notification
- *
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_notification;
-struct bt_ctf_event;
-
-/***BT_NOTIFICATION_TYPE_EVENT ***/
-/**
- * Create an event notification.
- *
- * @param event The event
- * @returns An event notification instance
- *
- * @see #bt_notification_type
- */
-extern struct bt_notification *bt_notification_event_create(
- struct bt_ctf_event *event);
-
-/**
- * Get an event notification's event.
- *
- * @param notification Event notification instance
- * @returns An event instance
- *
- * @see #bt_ctf_event
- */
-extern struct bt_ctf_event *bt_notification_event_get_event(
- struct bt_notification *notification);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_EVENT_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_HEAP_INTERNAL_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_HEAP_INTERNAL_H
-
-/*
- * Babeltrace - CTF notification heap priority heap
- *
- * Copyright (c) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/object-internal.h>
-#include <babeltrace/component/notification/heap.h>
-#include <babeltrace/component/notification/notification.h>
-#include <glib.h>
-
-struct bt_notification_heap {
- struct bt_object base;
- GPtrArray *ptrs;
- size_t count;
- bt_notification_time_compare_func compare;
- void *compare_data;
-};
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_HEAP_INTERNAL_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_HEAP_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_HEAP_H
-
-/*
- * Babeltrace - Notification Heap
- *
- * Copyright (c) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- * Copyright (c) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stddef.h>
-#include <stdbool.h>
-#include <babeltrace/component/notification/notification.h>
-#include <babeltrace/babeltrace-internal.h>
-
-/**
- * bt_notification_time_compare - Compare two notifications' timestamps
- *
- * Compare two notifications in the time domain. Return true if 'a' happened
- * prior to 'b'. In the case where both notifications are deemed to have
- * happened at the same time, an implementation-defined critarion shall be
- * used to order the notifications. This criterion shall ensure a consistent
- * ordering over multiple runs.
- */
-typedef bool (*bt_notification_time_compare_func)(
- struct bt_notification *a, struct bt_notification *b,
- void *user_data);
-
-/**
- * bt_notification_heap_create - create a new bt_notification heap.
- *
- * @comparator: Function to use for notification comparisons.
- *
- * Returns a new notification heap, NULL on error.
- */
-extern struct bt_notification_heap *bt_notification_heap_create(
- bt_notification_time_compare_func comparator, void *user_data);
-
-/**
- * bt_notification_heap_insert - insert an element into the heap
- *
- * @heap: the heap to be operated on
- * @notification: the notification to add
- *
- * Insert a notification into the heap.
- *
- * Returns 0 on success, a negative value on error.
- */
-extern int bt_notification_heap_insert(struct bt_notification_heap *heap,
- struct bt_notification *notification);
-
-/**
- * bt_notification_heap_peek - return the element on top of the heap.
- *
- * @heap: the heap to be operated on
- *
- * Returns the top element of the heap, without performing any modification
- * to the heap structure. Returns NULL if the heap is empty. The returned
- * notification must be bt_put() by the caller.
- */
-extern struct bt_notification *bt_notification_heap_peek(
- struct bt_notification_heap *heap);
-
-/**
- * bt_notification_heap_pop - remove the element sitting on top of the heap.
- * @heap: the heap to be operated on
- *
- * Returns the top element of the heap. The element is removed from the
- * heap. Returns NULL if the heap is empty. The returned notification must be
- * bt_put() by the caller.
- */
-extern struct bt_notification *bt_notification_heap_pop(
- struct bt_notification_heap *heap);
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_HEAP_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_INTERNAL_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_INTERNAL_H
-
-/*
- * BabelTrace - Notification Iterator Internal
- *
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/object-internal.h>
-#include <babeltrace/ref-internal.h>
-#include <babeltrace/component/notification/notification.h>
-#include <babeltrace/component/notification/iterator.h>
-#include <babeltrace/component/notification/private-iterator.h>
-
-struct bt_notification_iterator {
- struct bt_object base;
- struct bt_component *component;
- struct bt_notification *current_notification;
- void *user_data;
-};
-
-static inline
-struct bt_notification_iterator *bt_notification_iterator_from_private(
- struct bt_private_notification_iterator *private_notification_iterator)
-{
- return (void *) private_notification_iterator;
-}
-
-static inline
-struct bt_private_notification_iterator *
-bt_private_notification_iterator_from_notification_iterator(
- struct bt_notification_iterator *notification_iterator)
-{
- return (void *) notification_iterator;
-}
-
-/**
- * Allocate a notification iterator.
- *
- * @param component Component instance
- * @returns A notification iterator instance
- */
-BT_HIDDEN
-struct bt_notification_iterator *bt_notification_iterator_create(
- struct bt_component *component);
-
-/**
- * Validate a notification iterator.
- *
- * @param iterator Notification iterator instance
- * @returns One of #bt_component_status values
- */
-BT_HIDDEN
-enum bt_notification_iterator_status bt_notification_iterator_validate(
- struct bt_notification_iterator *iterator);
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_INTERNAL_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_H
-
-/*
- * BabelTrace - Plug-in Notification Iterator
- *
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_notification;
-struct bt_notification_iterator;
-
-/**
- * Status code. Errors are always negative.
- */
-enum bt_notification_iterator_status {
- /** No more notifications to be delivered. */
- BT_NOTIFICATION_ITERATOR_STATUS_END = 1,
- /** No error, okay. */
- BT_NOTIFICATION_ITERATOR_STATUS_OK = 0,
- /** Invalid arguments. */
- BT_NOTIFICATION_ITERATOR_STATUS_INVAL = -1,
- /** General error. */
- BT_NOTIFICATION_ITERATOR_STATUS_ERROR = -2,
- /** Out of memory. */
- BT_NOTIFICATION_ITERATOR_STATUS_NOMEM = -3,
- /** Unsupported iterator feature. */
- BT_NOTIFICATION_ITERATOR_STATUS_UNSUPPORTED = -4,
-
-};
-
-/**
- * Notification iterator seek reference.
- */
-enum bt_notification_iterator_seek_origin {
- /** Seek at a time relative to the beginning of the trace. */
- BT_NOTIFICATION_ITERATOR_SEEK_ORIGIN_BEGIN = 0,
-
- /** Seek at a time relative to the current position. */
- BT_NOTIFICATION_ITERATOR_SEEK_ORIGIN_CURRENT = 1,
-
- /** Seek at a time relative to the end of the trace. */
- BT_NOTIFICATION_ITERATOR_SEEK_ORIGIN_END = 2,
-
- /** Seek at a time relative to EPOCH. */
- BT_NOTIFICATION_ITERATOR_SEEK_ORIGIN_EPOCH = 3,
-};
-
-struct bt_notification_iterator_next_return {
- struct bt_notification *notification;
- enum bt_notification_iterator_status status;
-};
-
-/**
- * Get current notification at iterator's position.
- *
- * This functions will <b>not</b> advance the cursor's position.
- * The returned notification's reference count is already incremented.
- *
- * @param iterator Iterator instance
- * @returns Returns a bt_notification instance
- *
- * @see bt_put()
- */
-extern struct bt_notification *bt_notification_iterator_get_notification(
- struct bt_notification_iterator *iterator);
-
-/**
- * Advance the iterator's position forward.
- *
- * This function can be called repeatedly to iterate through the iterator's
- * associated trace.
- *
- * @param iterator Iterator instance
- * @returns Returns a bt_notification instance
- *
- * @see bt_notification_iterator_get_notification()
- */
-extern enum bt_notification_iterator_status
-bt_notification_iterator_next(struct bt_notification_iterator *iterator);
-
-/**
- * Seek iterator to time.
- *
- * Sets the iterator's position for the trace associated with the iterator.
- * The new position is computed by adding \p time to the position specified
- * by \p seek_origin.
- *
- * time is expressed in nanoseconds.
- *
- * @param iterator Iterator instance
- * @param seek_origin One of #bt_notification_iterator_seek_type values.
- * @returns One of #bt_notification_iterator_status values;
- * if \iterator does not support seeking,
- * #BT_NOTIFICATION_ITERATOR_STATUS_UNSUPPORTED is
- * returned.
- *
- * @see bt_notification_iterator_get_notification()
- */
-extern enum bt_notification_iterator_status bt_notification_iterator_seek_time(
- struct bt_notification_iterator *iterator,
- enum bt_notification_iterator_seek_origin seek_origin,
- int64_t time);
-
-extern struct bt_component *bt_notification_iterator_get_component(
- struct bt_notification_iterator *iterator);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_NOTIFICATION_INTERNAL_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_NOTIFICATION_INTERNAL_H
-
-/*
- * BabelTrace - Plug-in Notification internal
- *
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/ref-internal.h>
-#include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/object-internal.h>
-#include <babeltrace/component/notification/notification.h>
-#include <babeltrace/ctf-ir/stream.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct bt_ctf_stream *(*get_stream_func)(
- struct bt_notification *notification);
-
-struct bt_notification {
- struct bt_object base;
- enum bt_notification_type type;
- get_stream_func get_stream;
-};
-
-BT_HIDDEN
-void bt_notification_init(struct bt_notification *notification,
- enum bt_notification_type type,
- bt_object_release_func release);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_NOTIFICATION_INTERNAL_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_NOTIFICATION_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_NOTIFICATION_H
-
-/*
- * BabelTrace - Plug-in Notification
- *
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_notification;
-
-/**
- * Notification types. Unhandled notification types should be ignored.
- */
-enum bt_notification_type {
- BT_NOTIFICATION_TYPE_UNKNOWN = -1,
-
- /**
- * All types of notifications (used to register to notification
- * delivery).
- */
- BT_NOTIFICATION_TYPE_ALL = 0,
-
- /** Event delivery notification, see event.h */
- BT_NOTIFICATION_TYPE_EVENT = 1,
-
- /** Beginning of stream packet notification, see packet.h */
- BT_NOTIFICATION_TYPE_PACKET_BEGIN = 2,
-
- /** End of stream packet notification, see packet.h */
- BT_NOTIFICATION_TYPE_PACKET_END = 3,
-
- /** End of stream packet notification, see stream.h */
- BT_NOTIFICATION_TYPE_STREAM_END = 4,
-
- /** New trace notification, see model.h */
- BT_NOTIFICATION_TYPE_NEW_TRACE = 5,
-
- /** New stream class notification, see model.h */
- BT_NOTIFICATION_TYPE_NEW_STREAM_CLASS = 6,
-
- /** New event class notification, see model.h */
- BT_NOTIFICATION_TYPE_NEW_EVENT_CLASS = 7,
-
- /** End of trace notification, see eot.h */
- BT_NOTIFICATION_TYPE_END_OF_TRACE = 8,
-
- BT_NOTIFICATION_TYPE_NR, /* Not part of ABI. */
-};
-
-/**
- * Get a notification's type.
- *
- * @param notification Notification instance
- * @returns One of #bt_notification_type
- */
-extern enum bt_notification_type bt_notification_get_type(
- struct bt_notification *notification);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_NOTIFICATION_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_PACKET_INTERNAL_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_PACKET_INTERNAL_H
-
-/*
- * BabelTrace - Packet-related Notifications
- *
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/ctf-ir/packet.h>
-#include <babeltrace/component/notification/notification-internal.h>
-
-struct bt_notification_packet_begin {
- struct bt_notification parent;
- struct bt_ctf_packet *packet;
-};
-
-struct bt_notification_packet_end {
- struct bt_notification parent;
- struct bt_ctf_packet *packet;
-};
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_PACKET_INTERNAL_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_PACKET_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_PACKET_H
-
-/*
- * BabelTrace - Plug-in Packet-related Notifications
- *
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/notification/notification.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_ctf_packet;
-
-/*** BT_NOTIFICATION_TYPE_PACKET_BEGIN ***/
-struct bt_notification *bt_notification_packet_begin_create(
- struct bt_ctf_packet *packet);
-struct bt_ctf_packet *bt_notification_packet_begin_get_packet(
- struct bt_notification *notification);
-
-/*** BT_NOTIFICATION_TYPE_PACKET_END ***/
-struct bt_notification *bt_notification_packet_end_create(
- struct bt_ctf_packet *packet);
-struct bt_ctf_packet *bt_notification_packet_end_get_packet(
- struct bt_notification *notification);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_PACKET_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_PRIVATE_ITERATOR_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_PRIVATE_ITERATOR_H
-
-/*
- * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_connection;
-struct bt_private_port;
-struct bt_private_connection;
-struct bt_private_notification_iterator;
-
-struct bt_notification_iterator *
-bt_notification_iterator_from_private_notification_iterator(
- struct bt_private_notification_iterator *private_notification_iterator);
-
-extern struct bt_private_component *
-bt_private_notification_iterator_get_private_component(
- struct bt_private_notification_iterator *private_notification_iterator);
-
-extern enum bt_notification_iterator_status
-bt_private_notification_iterator_set_user_data(
- struct bt_private_notification_iterator *private_notification_iterator,
- void *user_data);
-
-extern void *bt_private_notification_iterator_get_user_data(
- struct bt_private_notification_iterator *private_notification_iterator);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_PRIVATE_ITERATOR_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_SCHEMA_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_SCHEMA_H
-
-/*
- * BabelTrace - Plug-in Schema Change Notification
- *
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_notification;
-struct bt_ctf_trace;
-struct bt_ctf_stream_class;
-struct bt_ctf_event_class;
-
-/* BT_NOTIFICATION_TYPE_NEW_TRACE */
-/**
- * Create a new trace notification.
- *
- * @param trace The new trace
- * @returns A new trace notification instance
- *
- * @see #bt_notification_type
- */
-extern struct bt_notification *bt_notification_new_trace_create(
- struct bt_ctf_trace *trace);
-
-/**
- * Get a new trace notification's associated trace.
- *
- * @param notification New trace notification instance
- * @returns A trace instance
- *
- * @see #bt_ctf_trace
- */
-extern struct bt_ctf_trace *bt_notification_new_trace_get_trace(
- struct bt_notification *notification);
-
-
-/* BT_NOTIFICATION_TYPE_NEW_STREAM_CLASS */
-/**
- * Create a new stream class notification.
- *
- * @param trace The event's trace
- * @returns A new stream class notification instance
- *
- * @see #bt_notification_type
- */
-extern struct bt_notification *bt_notification_new_stream_class_create(
- struct bt_ctf_stream_class *stream_class);
-
-/**
- * Get a new stream class notification's associated stream class.
- *
- * @param notification New stream class notification instance
- * @returns A stream class instance
- *
- * @see #bt_ctf_stream_class
- */
-extern struct bt_ctf_trace *bt_notification_new_stream_class_get_stream_class(
- struct bt_notification *notification);
-
-
-/* BT_NOTIFICATION_TYPE_EVENT_CLASS */
-/**
- * Create a new trace notification.
- *
- * @param trace The event's trace
- * @returns An event notification instance
- *
- * @see #bt_notification_type
- */
-extern struct bt_notification *bt_notification_new_trace_create(
- struct bt_ctf_trace *trace);
-
-/**
- * Get a new trace notification's associated trace.
- *
- * @param notification New trace notification instance
- * @returns A trace instance
- *
- * @see #bt_ctf_trace
- */
-extern struct bt_ctf_trace *bt_notification_new_trace_get_trace(
- struct bt_notification *notification);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_SCHEMA_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_STREAM_INTERNAL_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_STREAM_INTERNAL_H
-
-/*
- * BabelTrace - Stream-related Notifications
- *
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/ctf-ir/packet.h>
-#include <babeltrace/component/notification/notification-internal.h>
-
-struct bt_notification_stream_end {
- struct bt_notification parent;
- struct bt_ctf_stream *stream;
-};
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_STREAM_INTERNAL_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_STREAM_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_STREAM_H
-
-/*
- * BabelTrace - Plug-in Stream-related Notifications
- *
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/notification/notification.h>
-#include <babeltrace/ctf-ir/stream.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*** BT_NOTIFICATION_TYPE_STREAM_END ***/
-struct bt_notification *bt_notification_stream_end_create(
- struct bt_ctf_stream *stream);
-struct bt_ctf_stream *bt_notification_stream_end_get_stream(
- struct bt_notification *notification);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_STREAM_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_PORT_INTERNAL_H
-#define BABELTRACE_COMPONENT_PORT_INTERNAL_H
-
-/*
- * BabelTrace - Babeltrace Component Port
- *
- * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/port.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_port {
- struct bt_object base;
- enum bt_port_type type;
- GString *name;
- struct bt_connection *connection;
-};
-
-static inline
-struct bt_port *bt_port_from_private(
- struct bt_private_port *private_port)
-{
- return (void *) private_port;
-}
-
-static inline
-struct bt_private_port *bt_private_port_from_port(
- struct bt_port *port)
-{
- return (void *) port;
-}
-
-BT_HIDDEN
-struct bt_port *bt_port_create(struct bt_component *parent_component,
- enum bt_port_type type, const char *name);
-
-BT_HIDDEN
-void bt_port_set_connection(struct bt_port *port,
- struct bt_connection *connection);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_PORT_INTERNAL_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_PORT_H
-#define BABELTRACE_COMPONENT_PORT_H
-
-/*
- * BabelTrace - Babeltrace Component Connection Interface
- *
- * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_port;
-struct bt_connection;
-
-enum bt_port_status {
- BT_PORT_STATUS_OK = 0,
- BT_PORT_STATUS_ERROR = -1,
- BT_PORT_STATUS_INVALID = -2,
-};
-
-enum bt_port_type {
- BT_PORT_TYPE_INPUT = 0,
- BT_PORT_TYPE_OUTPUT = 1,
- BT_PORT_TYPE_UNKOWN = -1,
-};
-
-extern const char *BT_DEFAULT_PORT_NAME;
-
-extern const char *bt_port_get_name(struct bt_port *port);
-extern enum bt_port_type bt_port_get_type(struct bt_port *port);
-extern struct bt_connection *bt_port_get_connection(struct bt_port *port);
-extern struct bt_component *bt_port_get_component(struct bt_port *port);
-extern int bt_port_remove_from_component(struct bt_port *port);
-extern int bt_port_disconnect(struct bt_port *port);
-extern int bt_port_is_connected(struct bt_port *port);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_PORT_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H
-#define BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H
-
-/*
- * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/component.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_private_component;
-struct bt_private_port;
-
-extern struct bt_private_port *
-bt_private_component_filter_get_output_private_port(
- struct bt_private_component *private_component,
- const char *name);
-
-extern struct bt_private_port *
-bt_private_component_filter_get_output_private_port_at_index(
- struct bt_private_component *private_component, int index);
-
-extern struct bt_private_port *
-bt_private_component_filter_get_default_output_private_port(
- struct bt_private_component *private_component);
-
-extern struct bt_private_port *
-bt_private_component_filter_add_output_private_port(
- struct bt_private_component *private_component,
- const char *name);
-
-extern struct bt_private_port *
-bt_private_component_filter_get_input_private_port(
- struct bt_private_component *private_component,
- const char *name);
-
-extern struct bt_private_port *
-bt_private_component_filter_get_input_private_port_at_index(
- struct bt_private_component *private_component, int index);
-
-extern struct bt_private_port *
-bt_private_component_filter_get_default_input_private_port(
- struct bt_private_component *private_component);
-
-extern struct bt_private_port *
-bt_private_component_filter_add_input_private_port(
- struct bt_private_component *private_component,
- const char *name);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H
-#define BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H
-
-/*
- * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/component.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_private_component;
-struct bt_private_port;
-
-extern struct bt_private_port *
-bt_private_component_sink_get_input_private_port(
- struct bt_private_component *private_component,
- const char *name);
-
-extern struct bt_private_port *
-bt_private_component_sink_get_input_private_port_at_index(
- struct bt_private_component *private_component, int index);
-
-extern struct bt_private_port *
-bt_private_component_sink_get_default_input_private_port(
- struct bt_private_component *private_component);
-
-extern struct bt_private_port *
-bt_private_component_sink_add_input_private_port(
- struct bt_private_component *private_component,
- const char *name);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SOURCE_H
-#define BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SOURCE_H
-
-/*
- * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/component.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_private_component;
-struct bt_private_port;
-
-extern struct bt_private_port *
-bt_private_component_source_get_output_private_port(
- struct bt_private_component *private_component,
- const char *name);
-
-extern struct bt_private_port *
-bt_private_component_source_get_output_private_port_at_index(
- struct bt_private_component *private_component, int index);
-
-extern struct bt_private_port *
-bt_private_component_source_get_default_output_private_port(
- struct bt_private_component *private_component);
-
-extern struct bt_private_port *
-bt_private_component_source_add_output_private_port(
- struct bt_private_component *private_component,
- const char *name);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SOURCE_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_PRIVATE_COMPONENT_H
-#define BABELTRACE_COMPONENT_PRIVATE_COMPONENT_H
-
-/*
- * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <babeltrace/component/component.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_private_component;
-
-struct bt_component *bt_component_from_private_component(
- struct bt_private_component *private_component);
-
-extern void *bt_private_component_get_user_data(
- struct bt_private_component *private_component);
-
-extern enum bt_component_status bt_private_component_set_user_data(
- struct bt_private_component *private_component,
- void *user_data);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_PRIVATE_COMPONENT_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_PRIVATE_CONNECTION_H
-#define BABELTRACE_COMPONENT_PRIVATE_CONNECTION_H
-
-/*
- * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_connection;
-struct bt_private_port;
-struct bt_private_connection;
-
-struct bt_connection *bt_connection_from_private_connection(
- struct bt_private_connection *private_connection);
-
-extern struct bt_notification_iterator *
-bt_private_connection_create_notification_iterator(
- struct bt_private_connection *private_connection);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_PRIVATE_CONNECTION_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_PRIVATE_PORT_H
-#define BABELTRACE_COMPONENT_PRIVATE_PORT_H
-
-/*
- * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
- *
- * 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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_port;
-struct bt_private_port;
-struct bt_private_component;
-struct bt_private_connection;
-
-struct bt_port *bt_port_from_private_port(struct bt_private_port *private_port);
-extern struct bt_private_connection *bt_private_port_get_private_connection(
- struct bt_private_port *private_port);
-extern struct bt_private_component *bt_private_port_get_private_component(
- struct bt_private_port *private_port);
-extern int bt_private_port_remove_from_component(
- struct bt_private_port *private_port);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_PRIVATE_PORT_H */
#include <babeltrace/ctf-ir/field-types.h>
#include <babeltrace/ctf-ir/visitor.h>
#include <babeltrace/values.h>
-#include <babeltrace/component/notification/notification.h>
+#include <babeltrace/graph/notification.h>
#include <stdint.h>
#ifdef __cplusplus
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_FILTER_H
+#define BABELTRACE_COMPONENT_COMPONENT_CLASS_FILTER_H
+
+/*
+ * Babeltrace - Component Class Interface.
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/component.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component_class;
+
+extern
+struct bt_component_class *bt_component_class_filter_create(const char *name,
+ bt_component_class_notification_iterator_next_method notification_iterator_next_method);
+
+extern
+int bt_component_class_filter_set_notification_iterator_init_method(
+ struct bt_component_class *component_class,
+ bt_component_class_notification_iterator_init_method notification_iterator_init_method);
+
+extern
+int bt_component_class_filter_set_notification_iterator_finalize_method(
+ struct bt_component_class *component_class,
+ bt_component_class_notification_iterator_finalize_method notification_iterator_finalize_method);
+
+extern
+int bt_component_class_filter_set_notification_iterator_seek_time_method(
+ struct bt_component_class *component_class,
+ bt_component_class_notification_iterator_seek_time_method notification_iterator_seek_time_method);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_COMPONENT_CLASS_FILTER_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_INTERNAL_H
+#define BABELTRACE_COMPONENT_COMPONENT_CLASS_INTERNAL_H
+
+/*
+ * BabelTrace - Component Class Internal
+ *
+ * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/component-class.h>
+#include <babeltrace/graph/component-class-source.h>
+#include <babeltrace/graph/component-class-filter.h>
+#include <babeltrace/graph/component-class-sink.h>
+#include <babeltrace/babeltrace-internal.h>
+#include <babeltrace/object-internal.h>
+#include <stdbool.h>
+#include <glib.h>
+
+struct bt_component_class;
+
+typedef void (*bt_component_class_destroy_listener_func)(
+ struct bt_component_class *class, void *data);
+
+struct bt_component_class_destroy_listener {
+ bt_component_class_destroy_listener_func func;
+ void *data;
+};
+
+struct bt_component_class {
+ struct bt_object base;
+ enum bt_component_class_type type;
+ GString *name;
+ GString *description;
+ GString *help;
+ struct {
+ bt_component_class_init_method init;
+ bt_component_class_finalize_method finalize;
+ bt_component_class_query_method query;
+ bt_component_class_accept_port_connection_method accept_port_connection;
+ bt_component_class_port_disconnected_method port_disconnected;
+ } methods;
+ /* Array of struct bt_component_class_destroy_listener */
+ GArray *destroy_listeners;
+ bool frozen;
+};
+
+struct bt_component_class_iterator_methods {
+ bt_component_class_notification_iterator_init_method init;
+ bt_component_class_notification_iterator_finalize_method finalize;
+ bt_component_class_notification_iterator_next_method next;
+ bt_component_class_notification_iterator_seek_time_method seek_time;
+};
+
+struct bt_component_class_source {
+ struct bt_component_class parent;
+ struct {
+ struct bt_component_class_iterator_methods iterator;
+ } methods;
+};
+
+struct bt_component_class_sink {
+ struct bt_component_class parent;
+ struct {
+ bt_component_class_sink_consume_method consume;
+ } methods;
+};
+
+struct bt_component_class_filter {
+ struct bt_component_class parent;
+ struct {
+ struct bt_component_class_iterator_methods iterator;
+ } methods;
+};
+
+BT_HIDDEN
+int bt_component_class_add_destroy_listener(struct bt_component_class *class,
+ bt_component_class_destroy_listener_func func, void *data);
+
+#endif /* BABELTRACE_COMPONENT_COMPONENT_CLASS_INTERNAL_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_SINK_H
+#define BABELTRACE_COMPONENT_COMPONENT_CLASS_SINK_H
+
+/*
+ * Babeltrace - Component Class Interface.
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/private-component.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component_class;
+
+typedef enum bt_component_status (*bt_component_class_sink_consume_method)(
+ struct bt_private_component *private_component);
+
+extern
+struct bt_component_class *bt_component_class_sink_create(const char *name,
+ bt_component_class_sink_consume_method consume_method);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_COMPONENT_CLASS_SINK_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_SOURCE_H
+#define BABELTRACE_COMPONENT_COMPONENT_CLASS_SOURCE_H
+
+/*
+ * Babeltrace - Component Class Interface.
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/component.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component_class;
+
+extern
+struct bt_component_class *bt_component_class_source_create(const char *name,
+ bt_component_class_notification_iterator_next_method notification_iterator_next_method);
+
+extern
+int bt_component_class_source_set_notification_iterator_init_method(
+ struct bt_component_class *component_class,
+ bt_component_class_notification_iterator_init_method notification_iterator_init_method);
+
+extern
+int bt_component_class_source_set_notification_iterator_finalize_method(
+ struct bt_component_class *component_class,
+ bt_component_class_notification_iterator_finalize_method notification_iterator_finalize_method);
+
+extern
+int bt_component_class_source_set_notification_iterator_seek_time_method(
+ struct bt_component_class *component_class,
+ bt_component_class_notification_iterator_seek_time_method notification_iterator_seek_time_method);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_COMPONENT_CLASS_SOURCE_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_H
+#define BABELTRACE_COMPONENT_COMPONENT_CLASS_H
+
+/*
+ * Babeltrace - Component Class Interface.
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/component.h>
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component_class;
+struct bt_component;
+struct bt_private_component;
+struct bt_private_port;
+struct bt_port;
+struct bt_value;
+struct bt_private_notification_iterator;
+
+/**
+ * Component class type.
+ */
+enum bt_component_class_type {
+ BT_COMPONENT_CLASS_TYPE_UNKNOWN = -1,
+
+ /** A source component is a notification generator. */
+ BT_COMPONENT_CLASS_TYPE_SOURCE = 0,
+
+ /** A sink component handles incoming notifications. */
+ BT_COMPONENT_CLASS_TYPE_SINK = 1,
+
+ /** A filter component implements both Source and Sink interfaces. */
+ BT_COMPONENT_CLASS_TYPE_FILTER = 2,
+};
+
+typedef enum bt_component_status (*bt_component_class_init_method)(
+ struct bt_private_component *private_component,
+ struct bt_value *params, void *init_method_data);
+
+typedef void (*bt_component_class_finalize_method)(
+ struct bt_private_component *private_component);
+
+typedef enum bt_notification_iterator_status
+ (*bt_component_class_notification_iterator_init_method)(
+ struct bt_private_notification_iterator *private_notification_iterator,
+ struct bt_private_port *private_port);
+
+typedef void (*bt_component_class_notification_iterator_finalize_method)(
+ struct bt_private_notification_iterator *private_notification_iterator);
+
+typedef struct bt_notification_iterator_next_return (*bt_component_class_notification_iterator_next_method)(
+ struct bt_private_notification_iterator *private_notification_iterator);
+
+typedef enum bt_notification_iterator_status
+ (*bt_component_class_notification_iterator_seek_time_method)(
+ struct bt_private_notification_iterator *private_notification_iterator,
+ int64_t time);
+
+typedef struct bt_value *(*bt_component_class_query_method)(
+ struct bt_component_class *component_class,
+ const char *object, struct bt_value *params);
+
+typedef enum bt_component_status (*bt_component_class_accept_port_connection_method)(
+ struct bt_private_component *private_component,
+ struct bt_private_port *self_private_port,
+ struct bt_port *other_port);
+
+typedef void (*bt_component_class_port_disconnected_method)(
+ struct bt_private_component *private_component,
+ struct bt_private_port *private_port);
+
+extern int bt_component_class_set_init_method(
+ struct bt_component_class *component_class,
+ bt_component_class_init_method init_method);
+
+extern int bt_component_class_set_finalize_method(
+ struct bt_component_class *component_class,
+ bt_component_class_finalize_method finalize_method);
+
+extern int bt_component_class_set_accept_port_connection_method(
+ struct bt_component_class *component_class,
+ bt_component_class_accept_port_connection_method accept_port_connection_method);
+
+extern int bt_component_class_set_port_disconnected_method(
+ struct bt_component_class *component_class,
+ bt_component_class_port_disconnected_method port_disconnected_method);
+
+extern int bt_component_class_set_query_method(
+ struct bt_component_class *component_class,
+ bt_component_class_query_method query_method);
+
+extern int bt_component_class_set_description(
+ struct bt_component_class *component_class,
+ const char *description);
+
+extern int bt_component_class_set_help(
+ struct bt_component_class *component_class,
+ const char *help);
+
+extern int bt_component_class_freeze(
+ struct bt_component_class *component_class);
+
+/**
+ * Get a component class' name.
+ *
+ * @param component_class Component class of which to get the name
+ * @returns Name of the component class
+ */
+extern const char *bt_component_class_get_name(
+ struct bt_component_class *component_class);
+
+/**
+ * Get a component class' description.
+ *
+ * Component classes may provide an optional description. It may, however,
+ * opt not to.
+ *
+ * @param component_class Component class of which to get the description
+ * @returns Description of the component class, or NULL.
+ */
+extern const char *bt_component_class_get_description(
+ struct bt_component_class *component_class);
+
+extern const char *bt_component_class_get_help(
+ struct bt_component_class *component_class);
+
+extern struct bt_value *bt_component_class_query(
+ struct bt_component_class *component_class,
+ const char *object, struct bt_value *params);
+
+/**
+ * Get a component class' type.
+ *
+ * @param component_class Component class of which to get the type
+ * @returns One of #bt_component_type
+ */
+extern enum bt_component_class_type bt_component_class_get_type(
+ struct bt_component_class *component_class);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_COMPONENT_CLASS_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_FILTER_INTERNAL_H
+#define BABELTRACE_COMPONENT_FILTER_INTERNAL_H
+
+/*
+ * BabelTrace - Filter Component Internal
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/babeltrace-internal.h>
+#include <babeltrace/graph/component-internal.h>
+#include <babeltrace/graph/component-class-internal.h>
+
+struct bt_value;
+
+struct bt_component_filter {
+ struct bt_component parent;
+};
+
+/**
+ * Allocate a filter component.
+ *
+ * @param class Component class
+ * @param params A dictionary of component parameters
+ * @returns A filter component instance
+ */
+BT_HIDDEN
+struct bt_component *bt_component_filter_create(
+ struct bt_component_class *class, struct bt_value *params);
+
+BT_HIDDEN
+void bt_component_filter_destroy(struct bt_component *component);
+
+/**
+ * Validate a filter component.
+ *
+ * @param component Filter component instance to validate
+ * @returns One of #bt_component_status
+ */
+BT_HIDDEN
+enum bt_component_status bt_component_filter_validate(
+ struct bt_component *component);
+
+#endif /* BABELTRACE_COMPONENT_FILTER_INTERNAL_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_FILTER_H
+#define BABELTRACE_COMPONENT_FILTER_H
+
+/*
+ * BabelTrace - Filter Plug-in Interface
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdint.h>
+#include <babeltrace/graph/component.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_port;
+struct bt_component;
+
+extern enum bt_component_status bt_component_filter_get_input_port_count(
+ struct bt_component *component, uint64_t *count);
+extern struct bt_port *bt_component_filter_get_input_port(
+ struct bt_component *component, const char *name);
+extern struct bt_port *bt_component_filter_get_input_port_at_index(
+ struct bt_component *component, int index);
+extern struct bt_port *bt_component_filter_get_default_input_port(
+ struct bt_component *component);
+
+extern enum bt_component_status bt_component_filter_get_output_port_count(
+ struct bt_component *component, uint64_t *count);
+extern struct bt_port *bt_component_filter_get_output_port(
+ struct bt_component *component, const char *name);
+extern struct bt_port *bt_component_filter_get_output_port_at_index(
+ struct bt_component *component, int index);
+extern struct bt_port *bt_component_filter_get_default_output_port(
+ struct bt_component *component);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_FILTER_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_COMPONENT_INTERNAL_H
+#define BABELTRACE_COMPONENT_COMPONENT_INTERNAL_H
+
+/*
+ * BabelTrace - Component internal
+ *
+ * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/babeltrace-internal.h>
+#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/component-class-internal.h>
+#include <babeltrace/graph/port-internal.h>
+#include <babeltrace/object-internal.h>
+#include <glib.h>
+#include <stdio.h>
+
+#define DEFAULT_INPUT_PORT_NAME "default"
+#define DEFAULT_OUTPUT_PORT_NAME "default"
+
+struct bt_component {
+ struct bt_object base;
+ struct bt_component_class *class;
+ GString *name;
+
+ /*
+ * Internal destroy function specific to a source, filter, or
+ * sink component object.
+ */
+ void (*destroy)(struct bt_component *);
+
+ /* User-defined data */
+ void *user_data;
+
+ /*
+ * Used to protect operations which may only be used during
+ * a component's initialization.
+ */
+ bool initializing;
+
+ /* Input and output ports (weak references) */
+ GPtrArray *input_ports;
+ GPtrArray *output_ports;
+};
+
+static inline
+struct bt_component *bt_component_from_private(
+ struct bt_private_component *private_component)
+{
+ return (void *) private_component;
+}
+
+static inline
+struct bt_private_component *bt_private_component_from_component(
+ struct bt_component *component)
+{
+ return (void *) component;
+}
+
+BT_HIDDEN
+enum bt_component_status bt_component_accept_port_connection(
+ struct bt_component *component, struct bt_port *self_port,
+ struct bt_port *other_port);
+
+BT_HIDDEN
+void bt_component_port_disconnected(struct bt_component *comp,
+ struct bt_port *port);
+
+BT_HIDDEN
+void bt_component_set_graph(struct bt_component *component,
+ struct bt_graph *graph);
+
+BT_HIDDEN
+uint64_t bt_component_get_input_port_count(struct bt_component *comp);
+
+BT_HIDDEN
+uint64_t bt_component_get_output_port_count(struct bt_component *comp);
+
+BT_HIDDEN
+struct bt_port *bt_component_get_input_port_at_index(struct bt_component *comp,
+ int index);
+
+BT_HIDDEN
+struct bt_port *bt_component_get_output_port_at_index(struct bt_component *comp,
+ int index);
+
+BT_HIDDEN
+struct bt_port *bt_component_get_input_port(struct bt_component *comp,
+ const char *name);
+
+BT_HIDDEN
+struct bt_port *bt_component_get_output_port(struct bt_component *comp,
+ const char *name);
+
+BT_HIDDEN
+struct bt_port *bt_component_add_input_port(
+ struct bt_component *component, const char *name);
+
+BT_HIDDEN
+struct bt_port *bt_component_add_output_port(
+ struct bt_component *component, const char *name);
+
+BT_HIDDEN
+enum bt_component_status bt_component_remove_port(
+ struct bt_component *component, struct bt_port *port);
+
+#endif /* BABELTRACE_COMPONENT_COMPONENT_INTERNAL_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_SINK_INTERNAL_H
+#define BABELTRACE_COMPONENT_SINK_INTERNAL_H
+
+/*
+ * BabelTrace - Sink Component internal
+ *
+ * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/babeltrace-internal.h>
+#include <babeltrace/graph/component-sink.h>
+#include <babeltrace/graph/component-internal.h>
+#include <babeltrace/graph/component-class-internal.h>
+
+struct bt_value;
+
+//typedef uint32_t notification_mask_t;
+
+struct bt_component_sink {
+ struct bt_component parent;
+};
+
+/**
+ * Allocate a sink component.
+ *
+ * @param class Component class
+ * @param params A dictionary of component parameters
+ * @returns A sink component instance
+ */
+BT_HIDDEN
+struct bt_component *bt_component_sink_create(
+ struct bt_component_class *class, struct bt_value *params);
+
+BT_HIDDEN
+void bt_component_sink_destroy(struct bt_component *component);
+
+/**
+ * Validate a sink component.
+ *
+ * @param component Sink component instance to validate
+ * @returns One of #bt_component_status
+ */
+BT_HIDDEN
+enum bt_component_status bt_component_sink_validate(
+ struct bt_component *component);
+
+/**
+ * Process one event, consuming from sources as needed.
+ *
+ * @param component Component instance
+ * @returns One of #bt_component_status values
+ */
+BT_HIDDEN
+enum bt_component_status bt_component_sink_consume(
+ struct bt_component *component);
+
+#endif /* BABELTRACE_COMPONENT_SINK_INTERNAL_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_SINK_H
+#define BABELTRACE_COMPONENT_SINK_H
+
+/*
+ * BabelTrace - Sink Component Interface
+ *
+ * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/component.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component;
+struct bt_notification;
+
+extern enum bt_component_status bt_component_sink_get_input_port_count(
+ struct bt_component *component, uint64_t *count);
+extern struct bt_port *bt_component_sink_get_input_port(
+ struct bt_component *component, const char *name);
+extern struct bt_port *bt_component_sink_get_input_port_at_index(
+ struct bt_component *component, int index);
+extern struct bt_port *bt_component_sink_get_default_input_port(
+ struct bt_component *component);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_SINK_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_SOURCE_INTERNAL_H
+#define BABELTRACE_COMPONENT_SOURCE_INTERNAL_H
+
+/*
+ * BabelTrace - Source Component internal
+ *
+ * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/babeltrace-internal.h>
+#include <babeltrace/graph/component-internal.h>
+#include <babeltrace/graph/component-class-internal.h>
+
+struct bt_value;
+
+struct bt_component_source {
+ struct bt_component parent;
+};
+
+/**
+ * Allocate a source component.
+ *
+ * @param class Component class
+ * @param params A dictionary of component parameters
+ * @returns A source component instance
+ */
+BT_HIDDEN
+struct bt_component *bt_component_source_create(
+ struct bt_component_class *class, struct bt_value *params);
+
+BT_HIDDEN
+void bt_component_source_destroy(struct bt_component *component);
+
+/**
+ * Validate a source component.
+ *
+ * @param component Source component instance to validate
+ * @returns One of #bt_component_status
+ */
+BT_HIDDEN
+enum bt_component_status bt_component_source_validate(
+ struct bt_component *component);
+
+#endif /* BABELTRACE_COMPONENT_SOURCE_INTERNAL_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_SOURCE_H
+#define BABELTRACE_COMPONENT_SOURCE_H
+
+/*
+ * BabelTrace - Source Plug-in Interface
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdint.h>
+#include <babeltrace/graph/component.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component;
+struct bt_notification_iterator;
+
+extern enum bt_component_status bt_component_source_get_output_port_count(
+ struct bt_component *component, uint64_t *count);
+extern struct bt_port *bt_component_source_get_output_port(
+ struct bt_component *component, const char *name);
+extern struct bt_port *bt_component_source_get_output_port_at_index(
+ struct bt_component *component, int index);
+extern struct bt_port *bt_component_source_get_default_output_port(
+ struct bt_component *component);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_SOURCE_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_COMPONENT_H
+#define BABELTRACE_COMPONENT_COMPONENT_H
+
+/*
+ * BabelTrace - Babeltrace Component Interface
+ *
+ * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/component-class.h>
+#include <babeltrace/graph/notification-iterator.h>
+#include <babeltrace/values.h>
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component_class;
+struct bt_component_graph;
+struct bt_component;
+struct bt_value;
+struct bt_port;
+
+/**
+ * Status code. Errors are always negative.
+ */
+enum bt_component_status {
+ /** No error, okay. */
+ BT_COMPONENT_STATUS_OK = 0,
+ /** No more work to be done by this component. **/
+ BT_COMPONENT_STATUS_END = 1,
+ /**
+ * Component can't process a notification at this time
+ * (e.g. would block), try again later.
+ */
+ BT_COMPONENT_STATUS_AGAIN = 2,
+ /** Refuse port connection. */
+ BT_COMPONENT_STATUS_REFUSE_PORT_CONNECTION = 3,
+ /** General error. */
+ BT_COMPONENT_STATUS_ERROR = -1,
+ /** Unsupported component feature. */
+ BT_COMPONENT_STATUS_UNSUPPORTED = -2,
+ /** Invalid arguments. */
+ BT_COMPONENT_STATUS_INVALID = -3,
+ /** Memory allocation failure. */
+ BT_COMPONENT_STATUS_NOMEM = -4,
+ /** Element not found. */
+ BT_COMPONENT_STATUS_NOT_FOUND = -5,
+};
+
+/**
+ * Create an instance of a component from a component class.
+ *
+ * @param component_class Component class of which to create an instance
+ * @param name Name of the new component instance, optional
+ * @param params A dictionary of component parameters
+ * @returns Returns a pointer to a new component instance
+ */
+extern struct bt_component *bt_component_create(
+ struct bt_component_class *component_class, const char *name,
+ struct bt_value *params);
+
+extern struct bt_component *bt_component_create_with_init_method_data(
+ struct bt_component_class *component_class, const char *name,
+ struct bt_value *params, void *init_method_data);
+
+/**
+ * Get component's name.
+ *
+ * @param component Component instance of which to get the name
+ * @returns Returns a pointer to the component's name
+ */
+extern const char *bt_component_get_name(struct bt_component *component);
+
+/**
+ * Get component's class.
+ *
+ * @param component Component instance of which to get the class
+ * @returns The component's class
+ */
+extern struct bt_component_class *bt_component_get_class(
+ struct bt_component *component);
+
+extern enum bt_component_class_type bt_component_get_class_type(
+ struct bt_component *component);
+
+extern struct bt_graph *bt_component_get_graph(struct bt_component *component);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_COMPONENT_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H
+#define BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H
+
+/*
+ * BabelTrace - Component Connection Internal
+ *
+ * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/connection.h>
+#include <babeltrace/graph/private-connection.h>
+#include <babeltrace/object-internal.h>
+
+struct bt_graph;
+
+struct bt_connection {
+ /*
+ * The graph is a connection's parent and the connection is the parent
+ * of all iterators it has created.
+ */
+ struct bt_object base;
+ /*
+ * Weak references are held to both ports. Their existence is guaranteed
+ * by the existence of the graph and thus, of their respective
+ * components.
+ */
+ /* Downstream port. */
+ struct bt_port *downstream_port;
+ /* Upstream port. */
+ struct bt_port *upstream_port;
+};
+
+static inline
+struct bt_connection *bt_connection_from_private(
+ struct bt_private_connection *private_connection)
+{
+ return (void *) private_connection;
+}
+
+static inline
+struct bt_private_connection *bt_private_connection_from_connection(
+ struct bt_connection *connection)
+{
+ return (void *) connection;
+}
+
+BT_HIDDEN
+struct bt_connection *bt_connection_create(struct bt_graph *graph,
+ struct bt_port *upstream_port,
+ struct bt_port *downstream_port);
+
+BT_HIDDEN
+void bt_connection_disconnect_ports(struct bt_connection *conn,
+ struct bt_component *comp);
+
+#endif /* BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_CONNECTION_H
+#define BABELTRACE_COMPONENT_CONNECTION_H
+
+/*
+ * BabelTrace - Babeltrace Component Connection Interface
+ *
+ * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component;
+struct bt_connection;
+
+/* Returns the "downstream" input port. */
+extern struct bt_port *bt_connection_get_downstream_port(
+ struct bt_connection *connection);
+/* Returns the "upstream" output port. */
+extern struct bt_port *bt_connection_get_upstream_port(
+ struct bt_connection *connection);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_CONNECTION_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_COMPONENT_GRAPH_INTERNAL_H
+#define BABELTRACE_COMPONENT_COMPONENT_GRAPH_INTERNAL_H
+
+/*
+ * BabelTrace - Component Graph Internal
+ *
+ * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/graph.h>
+#include <babeltrace/babeltrace-internal.h>
+#include <babeltrace/object-internal.h>
+#include <glib.h>
+
+struct bt_component;
+struct bt_port;
+
+struct bt_graph {
+ /**
+ * A component graph contains components and point-to-point connection
+ * between these components.
+ *
+ * In terms of ownership:
+ * 1) The graph is the components' parent,
+ * 2) The graph is the connnections' parent,
+ * 3) Components share the ownership of their connections,
+ * 4) A connection holds weak references to its two component endpoints.
+ */
+ struct bt_object base;
+
+ /* Array of pointers to bt_connection. */
+ GPtrArray *connections;
+ /* Array of pointers to bt_component. */
+ GPtrArray *components;
+ /* Queue of pointers (weak references) to sink bt_components. */
+ GQueue *sinks_to_consume;
+
+ struct {
+ GArray *port_added;
+ GArray *port_removed;
+ GArray *port_connected;
+ GArray *port_disconnected;
+ } listeners;
+};
+
+BT_HIDDEN
+void bt_graph_notify_port_added(struct bt_graph *graph, struct bt_port *port);
+
+BT_HIDDEN
+void bt_graph_notify_port_removed(struct bt_graph *graph,
+ struct bt_component *comp, struct bt_port *port);
+
+BT_HIDDEN
+void bt_graph_notify_port_connected(struct bt_graph *graph,
+ struct bt_port *port);
+
+BT_HIDDEN
+void bt_graph_notify_port_disconnected(struct bt_graph *graph,
+ struct bt_component *comp, struct bt_port *port);
+
+#endif /* BABELTRACE_COMPONENT_COMPONENT_GRAPH_INTERNAL_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_GRAPH_H
+#define BABELTRACE_COMPONENT_GRAPH_H
+
+/*
+ * BabelTrace - Babeltrace Graph Interface
+ *
+ * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/component.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_port;
+struct bt_connection;
+
+enum bt_graph_status {
+ /** No sink can consume at the moment. */
+ BT_GRAPH_STATUS_AGAIN = 2,
+ /** Downstream component does not support multiple inputs. */
+ BT_GRAPH_STATUS_END = 1,
+ BT_GRAPH_STATUS_OK = 0,
+ /** Downstream component does not support multiple inputs. */
+ BT_GRAPH_STATUS_MULTIPLE_INPUTS_UNSUPPORTED = -1,
+ /** Component is already part of another graph. */
+ BT_GRAPH_STATUS_ALREADY_IN_A_GRAPH = -2,
+ /** Invalid arguments. */
+ BT_GRAPH_STATUS_INVALID = -3,
+ /** No sink in graph. */
+ BT_GRAPH_STATUS_NO_SINK = -4,
+ /** General error. */
+ BT_GRAPH_STATUS_ERROR = -5,
+};
+
+typedef void (*bt_graph_port_added_listener)(struct bt_port *port,
+ void *data);
+typedef void (*bt_graph_port_removed_listener)(struct bt_component *component,
+ struct bt_port *port, void *data);
+typedef void (*bt_graph_port_connected_listener)(struct bt_port *port,
+ void *data);
+typedef void (*bt_graph_port_disconnected_listener)(
+ struct bt_component *component, struct bt_port *port,
+ void *data);
+
+extern struct bt_graph *bt_graph_create(void);
+
+/**
+ * Creates a connection between two components using the two ports specified
+ * and adds the connection and components (if not already added) to the graph.
+ */
+extern struct bt_connection *bt_graph_connect(struct bt_graph *graph,
+ struct bt_port *upstream,
+ struct bt_port *downstream);
+
+/**
+ * Add a component as a "sibling" of the origin component. Sibling share
+ * connections equivalent to each other at the time of connection (same
+ * upstream and downstream ports).
+ */
+extern enum bt_graph_status bt_graph_add_component_as_sibling(
+ struct bt_graph *graph, struct bt_component *origin,
+ struct bt_component *new_component);
+
+/**
+ * Run graph to completion or until a single sink is left and "AGAIN" is received.
+ *
+ * Runs "bt_component_sink_consume()" on all sinks in round-robin until they all
+ * indicate that the end is reached or that an error occured.
+ */
+extern enum bt_graph_status bt_graph_run(struct bt_graph *graph);
+
+/**
+ * Runs "bt_component_sink_consume()" on the graph's sinks. Each invokation will
+ * invoke "bt_component_sink_consume()" on the next sink, in round-robin, until
+ * they all indicated that the end is reached.
+ */
+extern enum bt_graph_status bt_graph_consume(struct bt_graph *graph);
+
+extern enum bt_graph_status bt_graph_add_port_added_listener(
+ struct bt_graph *graph,
+ bt_graph_port_added_listener listener, void *data);
+
+extern enum bt_graph_status bt_graph_add_port_removed_listener(
+ struct bt_graph *graph,
+ bt_graph_port_removed_listener listener, void *data);
+
+extern enum bt_graph_status bt_graph_add_port_connected_listener(
+ struct bt_graph *graph,
+ bt_graph_port_connected_listener listener, void *data);
+
+extern enum bt_graph_status bt_graph_add_port_disconnected_listener(
+ struct bt_graph *graph,
+ bt_graph_port_disconnected_listener listener, void *data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_GRAPH_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_NOTIFICATION_EOT_H
+#define BABELTRACE_COMPONENT_NOTIFICATION_EOT_H
+
+/*
+ * BabelTrace - Plug-in End of Trace Notification
+ *
+ * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_NOTIFICATION_EOT_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_NOTIFICATION_EVENT_INTERNAL_H
+#define BABELTRACE_COMPONENT_NOTIFICATION_EVENT_INTERNAL_H
+
+/*
+ * BabelTrace - Plug-in Event Notification internal
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/ctf-ir/event.h>
+#include <babeltrace/graph/notification-internal.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_notification_event {
+ struct bt_notification parent;
+ struct bt_ctf_event *event;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACECOMPONENTPLUGIN_NOTIFICATION_EVENT_INTERNAL_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_NOTIFICATION_EVENT_H
+#define BABELTRACE_COMPONENT_NOTIFICATION_EVENT_H
+
+/*
+ * BabelTrace - Plug-in Event Notification
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_notification;
+struct bt_ctf_event;
+
+/***BT_NOTIFICATION_TYPE_EVENT ***/
+/**
+ * Create an event notification.
+ *
+ * @param event The event
+ * @returns An event notification instance
+ *
+ * @see #bt_notification_type
+ */
+extern struct bt_notification *bt_notification_event_create(
+ struct bt_ctf_event *event);
+
+/**
+ * Get an event notification's event.
+ *
+ * @param notification Event notification instance
+ * @returns An event instance
+ *
+ * @see #bt_ctf_event
+ */
+extern struct bt_ctf_event *bt_notification_event_get_event(
+ struct bt_notification *notification);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_NOTIFICATION_EVENT_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_NOTIFICATION_HEAP_INTERNAL_H
+#define BABELTRACE_COMPONENT_NOTIFICATION_HEAP_INTERNAL_H
+
+/*
+ * Babeltrace - CTF notification heap priority heap
+ *
+ * Copyright (c) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/object-internal.h>
+#include <babeltrace/graph/notification-heap.h>
+#include <babeltrace/graph/notification.h>
+#include <glib.h>
+
+struct bt_notification_heap {
+ struct bt_object base;
+ GPtrArray *ptrs;
+ size_t count;
+ bt_notification_time_compare_func compare;
+ void *compare_data;
+};
+
+#endif /* BABELTRACE_COMPONENT_NOTIFICATION_HEAP_INTERNAL_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_NOTIFICATION_HEAP_H
+#define BABELTRACE_COMPONENT_NOTIFICATION_HEAP_H
+
+/*
+ * Babeltrace - Notification Heap
+ *
+ * Copyright (c) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (c) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stddef.h>
+#include <stdbool.h>
+#include <babeltrace/graph/notification.h>
+#include <babeltrace/babeltrace-internal.h>
+
+/**
+ * bt_notification_time_compare - Compare two notifications' timestamps
+ *
+ * Compare two notifications in the time domain. Return true if 'a' happened
+ * prior to 'b'. In the case where both notifications are deemed to have
+ * happened at the same time, an implementation-defined critarion shall be
+ * used to order the notifications. This criterion shall ensure a consistent
+ * ordering over multiple runs.
+ */
+typedef bool (*bt_notification_time_compare_func)(
+ struct bt_notification *a, struct bt_notification *b,
+ void *user_data);
+
+/**
+ * bt_notification_heap_create - create a new bt_notification heap.
+ *
+ * @comparator: Function to use for notification comparisons.
+ *
+ * Returns a new notification heap, NULL on error.
+ */
+extern struct bt_notification_heap *bt_notification_heap_create(
+ bt_notification_time_compare_func comparator, void *user_data);
+
+/**
+ * bt_notification_heap_insert - insert an element into the heap
+ *
+ * @heap: the heap to be operated on
+ * @notification: the notification to add
+ *
+ * Insert a notification into the heap.
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_notification_heap_insert(struct bt_notification_heap *heap,
+ struct bt_notification *notification);
+
+/**
+ * bt_notification_heap_peek - return the element on top of the heap.
+ *
+ * @heap: the heap to be operated on
+ *
+ * Returns the top element of the heap, without performing any modification
+ * to the heap structure. Returns NULL if the heap is empty. The returned
+ * notification must be bt_put() by the caller.
+ */
+extern struct bt_notification *bt_notification_heap_peek(
+ struct bt_notification_heap *heap);
+
+/**
+ * bt_notification_heap_pop - remove the element sitting on top of the heap.
+ * @heap: the heap to be operated on
+ *
+ * Returns the top element of the heap. The element is removed from the
+ * heap. Returns NULL if the heap is empty. The returned notification must be
+ * bt_put() by the caller.
+ */
+extern struct bt_notification *bt_notification_heap_pop(
+ struct bt_notification_heap *heap);
+
+#endif /* BABELTRACE_COMPONENT_NOTIFICATION_HEAP_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_NOTIFICATION_NOTIFICATION_INTERNAL_H
+#define BABELTRACE_COMPONENT_NOTIFICATION_NOTIFICATION_INTERNAL_H
+
+/*
+ * BabelTrace - Plug-in Notification internal
+ *
+ * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/ref-internal.h>
+#include <babeltrace/babeltrace-internal.h>
+#include <babeltrace/object-internal.h>
+#include <babeltrace/graph/notification.h>
+#include <babeltrace/ctf-ir/stream.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct bt_ctf_stream *(*get_stream_func)(
+ struct bt_notification *notification);
+
+struct bt_notification {
+ struct bt_object base;
+ enum bt_notification_type type;
+ get_stream_func get_stream;
+};
+
+BT_HIDDEN
+void bt_notification_init(struct bt_notification *notification,
+ enum bt_notification_type type,
+ bt_object_release_func release);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_NOTIFICATION_NOTIFICATION_INTERNAL_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_INTERNAL_H
+#define BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_INTERNAL_H
+
+/*
+ * BabelTrace - Notification Iterator Internal
+ *
+ * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/babeltrace-internal.h>
+#include <babeltrace/object-internal.h>
+#include <babeltrace/ref-internal.h>
+#include <babeltrace/graph/notification.h>
+#include <babeltrace/graph/notification-iterator.h>
+#include <babeltrace/graph/private-notification-iterator.h>
+
+struct bt_notification_iterator {
+ struct bt_object base;
+ struct bt_component *component;
+ struct bt_notification *current_notification;
+ void *user_data;
+};
+
+static inline
+struct bt_notification_iterator *bt_notification_iterator_from_private(
+ struct bt_private_notification_iterator *private_notification_iterator)
+{
+ return (void *) private_notification_iterator;
+}
+
+static inline
+struct bt_private_notification_iterator *
+bt_private_notification_iterator_from_notification_iterator(
+ struct bt_notification_iterator *notification_iterator)
+{
+ return (void *) notification_iterator;
+}
+
+/**
+ * Allocate a notification iterator.
+ *
+ * @param component Component instance
+ * @returns A notification iterator instance
+ */
+BT_HIDDEN
+struct bt_notification_iterator *bt_notification_iterator_create(
+ struct bt_component *component);
+
+/**
+ * Validate a notification iterator.
+ *
+ * @param iterator Notification iterator instance
+ * @returns One of #bt_component_status values
+ */
+BT_HIDDEN
+enum bt_notification_iterator_status bt_notification_iterator_validate(
+ struct bt_notification_iterator *iterator);
+
+#endif /* BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_INTERNAL_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_H
+#define BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_H
+
+/*
+ * BabelTrace - Plug-in Notification Iterator
+ *
+ * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_notification;
+struct bt_notification_iterator;
+
+/**
+ * Status code. Errors are always negative.
+ */
+enum bt_notification_iterator_status {
+ /** No more notifications to be delivered. */
+ BT_NOTIFICATION_ITERATOR_STATUS_END = 1,
+ /** No error, okay. */
+ BT_NOTIFICATION_ITERATOR_STATUS_OK = 0,
+ /** Invalid arguments. */
+ BT_NOTIFICATION_ITERATOR_STATUS_INVAL = -1,
+ /** General error. */
+ BT_NOTIFICATION_ITERATOR_STATUS_ERROR = -2,
+ /** Out of memory. */
+ BT_NOTIFICATION_ITERATOR_STATUS_NOMEM = -3,
+ /** Unsupported iterator feature. */
+ BT_NOTIFICATION_ITERATOR_STATUS_UNSUPPORTED = -4,
+
+};
+
+/**
+ * Notification iterator seek reference.
+ */
+enum bt_notification_iterator_seek_origin {
+ /** Seek at a time relative to the beginning of the trace. */
+ BT_NOTIFICATION_ITERATOR_SEEK_ORIGIN_BEGIN = 0,
+
+ /** Seek at a time relative to the current position. */
+ BT_NOTIFICATION_ITERATOR_SEEK_ORIGIN_CURRENT = 1,
+
+ /** Seek at a time relative to the end of the trace. */
+ BT_NOTIFICATION_ITERATOR_SEEK_ORIGIN_END = 2,
+
+ /** Seek at a time relative to EPOCH. */
+ BT_NOTIFICATION_ITERATOR_SEEK_ORIGIN_EPOCH = 3,
+};
+
+struct bt_notification_iterator_next_return {
+ struct bt_notification *notification;
+ enum bt_notification_iterator_status status;
+};
+
+/**
+ * Get current notification at iterator's position.
+ *
+ * This functions will <b>not</b> advance the cursor's position.
+ * The returned notification's reference count is already incremented.
+ *
+ * @param iterator Iterator instance
+ * @returns Returns a bt_notification instance
+ *
+ * @see bt_put()
+ */
+extern struct bt_notification *bt_notification_iterator_get_notification(
+ struct bt_notification_iterator *iterator);
+
+/**
+ * Advance the iterator's position forward.
+ *
+ * This function can be called repeatedly to iterate through the iterator's
+ * associated trace.
+ *
+ * @param iterator Iterator instance
+ * @returns Returns a bt_notification instance
+ *
+ * @see bt_notification_iterator_get_notification()
+ */
+extern enum bt_notification_iterator_status
+bt_notification_iterator_next(struct bt_notification_iterator *iterator);
+
+/**
+ * Seek iterator to time.
+ *
+ * Sets the iterator's position for the trace associated with the iterator.
+ * The new position is computed by adding \p time to the position specified
+ * by \p seek_origin.
+ *
+ * time is expressed in nanoseconds.
+ *
+ * @param iterator Iterator instance
+ * @param seek_origin One of #bt_notification_iterator_seek_type values.
+ * @returns One of #bt_notification_iterator_status values;
+ * if \iterator does not support seeking,
+ * #BT_NOTIFICATION_ITERATOR_STATUS_UNSUPPORTED is
+ * returned.
+ *
+ * @see bt_notification_iterator_get_notification()
+ */
+extern enum bt_notification_iterator_status bt_notification_iterator_seek_time(
+ struct bt_notification_iterator *iterator,
+ enum bt_notification_iterator_seek_origin seek_origin,
+ int64_t time);
+
+extern struct bt_component *bt_notification_iterator_get_component(
+ struct bt_notification_iterator *iterator);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_NOTIFICATION_PACKET_INTERNAL_H
+#define BABELTRACE_COMPONENT_NOTIFICATION_PACKET_INTERNAL_H
+
+/*
+ * BabelTrace - Packet-related Notifications
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/ctf-ir/packet.h>
+#include <babeltrace/graph/notification-internal.h>
+
+struct bt_notification_packet_begin {
+ struct bt_notification parent;
+ struct bt_ctf_packet *packet;
+};
+
+struct bt_notification_packet_end {
+ struct bt_notification parent;
+ struct bt_ctf_packet *packet;
+};
+
+#endif /* BABELTRACE_COMPONENT_NOTIFICATION_PACKET_INTERNAL_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_NOTIFICATION_PACKET_H
+#define BABELTRACE_COMPONENT_NOTIFICATION_PACKET_H
+
+/*
+ * BabelTrace - Plug-in Packet-related Notifications
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/notification.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_ctf_packet;
+
+/*** BT_NOTIFICATION_TYPE_PACKET_BEGIN ***/
+struct bt_notification *bt_notification_packet_begin_create(
+ struct bt_ctf_packet *packet);
+struct bt_ctf_packet *bt_notification_packet_begin_get_packet(
+ struct bt_notification *notification);
+
+/*** BT_NOTIFICATION_TYPE_PACKET_END ***/
+struct bt_notification *bt_notification_packet_end_create(
+ struct bt_ctf_packet *packet);
+struct bt_ctf_packet *bt_notification_packet_end_get_packet(
+ struct bt_notification *notification);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_NOTIFICATION_PACKET_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_NOTIFICATION_SCHEMA_H
+#define BABELTRACE_COMPONENT_NOTIFICATION_SCHEMA_H
+
+/*
+ * BabelTrace - Plug-in Schema Change Notification
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_notification;
+struct bt_ctf_trace;
+struct bt_ctf_stream_class;
+struct bt_ctf_event_class;
+
+/* BT_NOTIFICATION_TYPE_NEW_TRACE */
+/**
+ * Create a new trace notification.
+ *
+ * @param trace The new trace
+ * @returns A new trace notification instance
+ *
+ * @see #bt_notification_type
+ */
+extern struct bt_notification *bt_notification_new_trace_create(
+ struct bt_ctf_trace *trace);
+
+/**
+ * Get a new trace notification's associated trace.
+ *
+ * @param notification New trace notification instance
+ * @returns A trace instance
+ *
+ * @see #bt_ctf_trace
+ */
+extern struct bt_ctf_trace *bt_notification_new_trace_get_trace(
+ struct bt_notification *notification);
+
+
+/* BT_NOTIFICATION_TYPE_NEW_STREAM_CLASS */
+/**
+ * Create a new stream class notification.
+ *
+ * @param trace The event's trace
+ * @returns A new stream class notification instance
+ *
+ * @see #bt_notification_type
+ */
+extern struct bt_notification *bt_notification_new_stream_class_create(
+ struct bt_ctf_stream_class *stream_class);
+
+/**
+ * Get a new stream class notification's associated stream class.
+ *
+ * @param notification New stream class notification instance
+ * @returns A stream class instance
+ *
+ * @see #bt_ctf_stream_class
+ */
+extern struct bt_ctf_trace *bt_notification_new_stream_class_get_stream_class(
+ struct bt_notification *notification);
+
+
+/* BT_NOTIFICATION_TYPE_EVENT_CLASS */
+/**
+ * Create a new trace notification.
+ *
+ * @param trace The event's trace
+ * @returns An event notification instance
+ *
+ * @see #bt_notification_type
+ */
+extern struct bt_notification *bt_notification_new_trace_create(
+ struct bt_ctf_trace *trace);
+
+/**
+ * Get a new trace notification's associated trace.
+ *
+ * @param notification New trace notification instance
+ * @returns A trace instance
+ *
+ * @see #bt_ctf_trace
+ */
+extern struct bt_ctf_trace *bt_notification_new_trace_get_trace(
+ struct bt_notification *notification);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_NOTIFICATION_SCHEMA_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_NOTIFICATION_STREAM_INTERNAL_H
+#define BABELTRACE_COMPONENT_NOTIFICATION_STREAM_INTERNAL_H
+
+/*
+ * BabelTrace - Stream-related Notifications
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/ctf-ir/packet.h>
+#include <babeltrace/graph/notification-internal.h>
+
+struct bt_notification_stream_end {
+ struct bt_notification parent;
+ struct bt_ctf_stream *stream;
+};
+
+#endif /* BABELTRACE_COMPONENT_NOTIFICATION_STREAM_INTERNAL_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_NOTIFICATION_STREAM_H
+#define BABELTRACE_COMPONENT_NOTIFICATION_STREAM_H
+
+/*
+ * BabelTrace - Plug-in Stream-related Notifications
+ *
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/notification.h>
+#include <babeltrace/ctf-ir/stream.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*** BT_NOTIFICATION_TYPE_STREAM_END ***/
+struct bt_notification *bt_notification_stream_end_create(
+ struct bt_ctf_stream *stream);
+struct bt_ctf_stream *bt_notification_stream_end_get_stream(
+ struct bt_notification *notification);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_NOTIFICATION_STREAM_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_NOTIFICATION_NOTIFICATION_H
+#define BABELTRACE_COMPONENT_NOTIFICATION_NOTIFICATION_H
+
+/*
+ * BabelTrace - Plug-in Notification
+ *
+ * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_notification;
+
+/**
+ * Notification types. Unhandled notification types should be ignored.
+ */
+enum bt_notification_type {
+ BT_NOTIFICATION_TYPE_UNKNOWN = -1,
+
+ /**
+ * All types of notifications (used to register to notification
+ * delivery).
+ */
+ BT_NOTIFICATION_TYPE_ALL = 0,
+
+ /** Event delivery notification, see event.h */
+ BT_NOTIFICATION_TYPE_EVENT = 1,
+
+ /** Beginning of stream packet notification, see packet.h */
+ BT_NOTIFICATION_TYPE_PACKET_BEGIN = 2,
+
+ /** End of stream packet notification, see packet.h */
+ BT_NOTIFICATION_TYPE_PACKET_END = 3,
+
+ /** End of stream packet notification, see stream.h */
+ BT_NOTIFICATION_TYPE_STREAM_END = 4,
+
+ /** New trace notification, see model.h */
+ BT_NOTIFICATION_TYPE_NEW_TRACE = 5,
+
+ /** New stream class notification, see model.h */
+ BT_NOTIFICATION_TYPE_NEW_STREAM_CLASS = 6,
+
+ /** New event class notification, see model.h */
+ BT_NOTIFICATION_TYPE_NEW_EVENT_CLASS = 7,
+
+ /** End of trace notification, see eot.h */
+ BT_NOTIFICATION_TYPE_END_OF_TRACE = 8,
+
+ BT_NOTIFICATION_TYPE_NR, /* Not part of ABI. */
+};
+
+/**
+ * Get a notification's type.
+ *
+ * @param notification Notification instance
+ * @returns One of #bt_notification_type
+ */
+extern enum bt_notification_type bt_notification_get_type(
+ struct bt_notification *notification);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_NOTIFICATION_NOTIFICATION_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_PORT_INTERNAL_H
+#define BABELTRACE_COMPONENT_PORT_INTERNAL_H
+
+/*
+ * BabelTrace - Babeltrace Component Port
+ *
+ * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/port.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_port {
+ struct bt_object base;
+ enum bt_port_type type;
+ GString *name;
+ struct bt_connection *connection;
+};
+
+static inline
+struct bt_port *bt_port_from_private(
+ struct bt_private_port *private_port)
+{
+ return (void *) private_port;
+}
+
+static inline
+struct bt_private_port *bt_private_port_from_port(
+ struct bt_port *port)
+{
+ return (void *) port;
+}
+
+BT_HIDDEN
+struct bt_port *bt_port_create(struct bt_component *parent_component,
+ enum bt_port_type type, const char *name);
+
+BT_HIDDEN
+void bt_port_set_connection(struct bt_port *port,
+ struct bt_connection *connection);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_PORT_INTERNAL_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_PORT_H
+#define BABELTRACE_COMPONENT_PORT_H
+
+/*
+ * BabelTrace - Babeltrace Component Connection Interface
+ *
+ * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_port;
+struct bt_connection;
+
+enum bt_port_status {
+ BT_PORT_STATUS_OK = 0,
+ BT_PORT_STATUS_ERROR = -1,
+ BT_PORT_STATUS_INVALID = -2,
+};
+
+enum bt_port_type {
+ BT_PORT_TYPE_INPUT = 0,
+ BT_PORT_TYPE_OUTPUT = 1,
+ BT_PORT_TYPE_UNKOWN = -1,
+};
+
+extern const char *BT_DEFAULT_PORT_NAME;
+
+extern const char *bt_port_get_name(struct bt_port *port);
+extern enum bt_port_type bt_port_get_type(struct bt_port *port);
+extern struct bt_connection *bt_port_get_connection(struct bt_port *port);
+extern struct bt_component *bt_port_get_component(struct bt_port *port);
+extern int bt_port_remove_from_component(struct bt_port *port);
+extern int bt_port_disconnect(struct bt_port *port);
+extern int bt_port_is_connected(struct bt_port *port);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_PORT_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H
+#define BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H
+
+/*
+ * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/component.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_private_component;
+struct bt_private_port;
+
+extern struct bt_private_port *
+bt_private_component_filter_get_output_private_port(
+ struct bt_private_component *private_component,
+ const char *name);
+
+extern struct bt_private_port *
+bt_private_component_filter_get_output_private_port_at_index(
+ struct bt_private_component *private_component, int index);
+
+extern struct bt_private_port *
+bt_private_component_filter_get_default_output_private_port(
+ struct bt_private_component *private_component);
+
+extern struct bt_private_port *
+bt_private_component_filter_add_output_private_port(
+ struct bt_private_component *private_component,
+ const char *name);
+
+extern struct bt_private_port *
+bt_private_component_filter_get_input_private_port(
+ struct bt_private_component *private_component,
+ const char *name);
+
+extern struct bt_private_port *
+bt_private_component_filter_get_input_private_port_at_index(
+ struct bt_private_component *private_component, int index);
+
+extern struct bt_private_port *
+bt_private_component_filter_get_default_input_private_port(
+ struct bt_private_component *private_component);
+
+extern struct bt_private_port *
+bt_private_component_filter_add_input_private_port(
+ struct bt_private_component *private_component,
+ const char *name);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H
+#define BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H
+
+/*
+ * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/component.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_private_component;
+struct bt_private_port;
+
+extern struct bt_private_port *
+bt_private_component_sink_get_input_private_port(
+ struct bt_private_component *private_component,
+ const char *name);
+
+extern struct bt_private_port *
+bt_private_component_sink_get_input_private_port_at_index(
+ struct bt_private_component *private_component, int index);
+
+extern struct bt_private_port *
+bt_private_component_sink_get_default_input_private_port(
+ struct bt_private_component *private_component);
+
+extern struct bt_private_port *
+bt_private_component_sink_add_input_private_port(
+ struct bt_private_component *private_component,
+ const char *name);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SOURCE_H
+#define BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SOURCE_H
+
+/*
+ * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/component.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_private_component;
+struct bt_private_port;
+
+extern struct bt_private_port *
+bt_private_component_source_get_output_private_port(
+ struct bt_private_component *private_component,
+ const char *name);
+
+extern struct bt_private_port *
+bt_private_component_source_get_output_private_port_at_index(
+ struct bt_private_component *private_component, int index);
+
+extern struct bt_private_port *
+bt_private_component_source_get_default_output_private_port(
+ struct bt_private_component *private_component);
+
+extern struct bt_private_port *
+bt_private_component_source_add_output_private_port(
+ struct bt_private_component *private_component,
+ const char *name);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SOURCE_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_PRIVATE_COMPONENT_H
+#define BABELTRACE_COMPONENT_PRIVATE_COMPONENT_H
+
+/*
+ * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <babeltrace/graph/component.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_private_component;
+
+struct bt_component *bt_component_from_private_component(
+ struct bt_private_component *private_component);
+
+extern void *bt_private_component_get_user_data(
+ struct bt_private_component *private_component);
+
+extern enum bt_component_status bt_private_component_set_user_data(
+ struct bt_private_component *private_component,
+ void *user_data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_PRIVATE_COMPONENT_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_PRIVATE_CONNECTION_H
+#define BABELTRACE_COMPONENT_PRIVATE_CONNECTION_H
+
+/*
+ * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_connection;
+struct bt_private_port;
+struct bt_private_connection;
+
+struct bt_connection *bt_connection_from_private_connection(
+ struct bt_private_connection *private_connection);
+
+extern struct bt_notification_iterator *
+bt_private_connection_create_notification_iterator(
+ struct bt_private_connection *private_connection);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_PRIVATE_CONNECTION_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_NOTIFICATION_PRIVATE_ITERATOR_H
+#define BABELTRACE_COMPONENT_NOTIFICATION_PRIVATE_ITERATOR_H
+
+/*
+ * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_connection;
+struct bt_private_port;
+struct bt_private_connection;
+struct bt_private_notification_iterator;
+
+struct bt_notification_iterator *
+bt_notification_iterator_from_private_notification_iterator(
+ struct bt_private_notification_iterator *private_notification_iterator);
+
+extern struct bt_private_component *
+bt_private_notification_iterator_get_private_component(
+ struct bt_private_notification_iterator *private_notification_iterator);
+
+extern enum bt_notification_iterator_status
+bt_private_notification_iterator_set_user_data(
+ struct bt_private_notification_iterator *private_notification_iterator,
+ void *user_data);
+
+extern void *bt_private_notification_iterator_get_user_data(
+ struct bt_private_notification_iterator *private_notification_iterator);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_NOTIFICATION_PRIVATE_ITERATOR_H */
--- /dev/null
+#ifndef BABELTRACE_COMPONENT_PRIVATE_PORT_H
+#define BABELTRACE_COMPONENT_PRIVATE_PORT_H
+
+/*
+ * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
+ *
+ * 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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_port;
+struct bt_private_port;
+struct bt_private_component;
+struct bt_private_connection;
+
+struct bt_port *bt_port_from_private_port(struct bt_private_port *private_port);
+extern struct bt_private_connection *bt_private_port_get_private_connection(
+ struct bt_private_port *private_port);
+extern struct bt_private_component *bt_private_port_get_private_component(
+ struct bt_private_port *private_port);
+extern int bt_private_port_remove_from_component(
+ struct bt_private_port *private_port);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_COMPONENT_PRIVATE_PORT_H */
#include <stdint.h>
#include <babeltrace/plugin/plugin.h>
-#include <babeltrace/component/component-class.h>
-#include <babeltrace/component/component-class-source.h>
-#include <babeltrace/component/component-class-filter.h>
-#include <babeltrace/component/component-class-sink.h>
+#include <babeltrace/graph/component-class.h>
+#include <babeltrace/graph/component-class-source.h>
+#include <babeltrace/graph/component-class-filter.h>
+#include <babeltrace/graph/component-class-sink.h>
#ifdef __cplusplus
extern "C" {
#include <stddef.h>
#include <stdbool.h>
-#include <babeltrace/component/component-class.h>
+#include <babeltrace/graph/component-class.h>
#ifdef __cplusplus
extern "C" {
*/
#include <babeltrace/compiler.h>
-#include <babeltrace/component/component-class-internal.h>
+#include <babeltrace/graph/component-class-internal.h>
#include <babeltrace/ref.h>
#include <stdbool.h>
#include <glib.h>
* SOFTWARE.
*/
-#include <babeltrace/component/private-component.h>
-#include <babeltrace/component/component.h>
-#include <babeltrace/component/component-internal.h>
-#include <babeltrace/component/component-class-internal.h>
-#include <babeltrace/component/component-source-internal.h>
-#include <babeltrace/component/component-filter-internal.h>
-#include <babeltrace/component/component-sink-internal.h>
-#include <babeltrace/component/private-connection.h>
-#include <babeltrace/component/connection-internal.h>
-#include <babeltrace/component/graph-internal.h>
-#include <babeltrace/component/notification/iterator-internal.h>
-#include <babeltrace/component/notification/private-iterator.h>
+#include <babeltrace/graph/private-component.h>
+#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/component-internal.h>
+#include <babeltrace/graph/component-class-internal.h>
+#include <babeltrace/graph/component-source-internal.h>
+#include <babeltrace/graph/component-filter-internal.h>
+#include <babeltrace/graph/component-sink-internal.h>
+#include <babeltrace/graph/private-connection.h>
+#include <babeltrace/graph/connection-internal.h>
+#include <babeltrace/graph/graph-internal.h>
+#include <babeltrace/graph/notification-iterator-internal.h>
+#include <babeltrace/graph/private-notification-iterator.h>
#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/compiler.h>
#include <babeltrace/ref.h>
* SOFTWARE.
*/
-#include <babeltrace/component/notification/iterator-internal.h>
-#include <babeltrace/component/component-internal.h>
-#include <babeltrace/component/component-source-internal.h>
-#include <babeltrace/component/component-filter-internal.h>
-#include <babeltrace/component/connection-internal.h>
-#include <babeltrace/component/private-connection.h>
-#include <babeltrace/component/graph-internal.h>
-#include <babeltrace/component/port-internal.h>
+#include <babeltrace/graph/notification-iterator-internal.h>
+#include <babeltrace/graph/component-internal.h>
+#include <babeltrace/graph/component-source-internal.h>
+#include <babeltrace/graph/component-filter-internal.h>
+#include <babeltrace/graph/connection-internal.h>
+#include <babeltrace/graph/private-connection.h>
+#include <babeltrace/graph/graph-internal.h>
+#include <babeltrace/graph/port-internal.h>
#include <babeltrace/object-internal.h>
#include <babeltrace/compiler.h>
#include <glib.h>
#include <babeltrace/compiler.h>
#include <babeltrace/values.h>
-#include <babeltrace/component/component-filter-internal.h>
-#include <babeltrace/component/component-internal.h>
-#include <babeltrace/component/component-class-internal.h>
-#include <babeltrace/component/notification/notification.h>
-#include <babeltrace/component/notification/iterator-internal.h>
+#include <babeltrace/graph/component-filter-internal.h>
+#include <babeltrace/graph/component-internal.h>
+#include <babeltrace/graph/component-class-internal.h>
+#include <babeltrace/graph/notification.h>
+#include <babeltrace/graph/notification-iterator-internal.h>
BT_HIDDEN
void bt_component_filter_destroy(struct bt_component *component)
* SOFTWARE.
*/
-#include <babeltrace/component/component-internal.h>
-#include <babeltrace/component/graph-internal.h>
-#include <babeltrace/component/connection-internal.h>
-#include <babeltrace/component/component-sink-internal.h>
-#include <babeltrace/component/component-source.h>
-#include <babeltrace/component/component-filter.h>
-#include <babeltrace/component/port.h>
+#include <babeltrace/graph/component-internal.h>
+#include <babeltrace/graph/graph-internal.h>
+#include <babeltrace/graph/connection-internal.h>
+#include <babeltrace/graph/component-sink-internal.h>
+#include <babeltrace/graph/component-source.h>
+#include <babeltrace/graph/component-filter.h>
+#include <babeltrace/graph/port.h>
#include <babeltrace/compiler.h>
#include <unistd.h>
#include <glib.h>
#include <babeltrace/compiler.h>
#include <babeltrace/ref.h>
-#include <babeltrace/component/component.h>
-#include <babeltrace/component/component-source-internal.h>
-#include <babeltrace/component/component-class-internal.h>
-#include <babeltrace/component/notification/iterator.h>
-#include <babeltrace/component/notification/iterator-internal.h>
+#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/component-source-internal.h>
+#include <babeltrace/graph/component-class-internal.h>
+#include <babeltrace/graph/notification-iterator.h>
+#include <babeltrace/graph/notification-iterator-internal.h>
static
void bt_notification_iterator_destroy(struct bt_object *obj)
*/
#include <babeltrace/compiler.h>
-#include <babeltrace/component/notification/event-internal.h>
+#include <babeltrace/graph/notification-event-internal.h>
static
void bt_notification_event_destroy(struct bt_object *obj)
#include <assert.h>
#include <stddef.h>
#include <babeltrace/compiler.h>
-#include <babeltrace/component/notification/heap-internal.h>
+#include <babeltrace/graph/notification-heap-internal.h>
#ifdef DEBUG_HEAP
static
* SOFTWARE.
*/
-#include <babeltrace/component/notification/notification-internal.h>
+#include <babeltrace/graph/notification-internal.h>
BT_HIDDEN
void bt_notification_init(struct bt_notification *notification,
*/
#include <babeltrace/compiler.h>
-#include <babeltrace/component/notification/packet-internal.h>
+#include <babeltrace/graph/notification-packet-internal.h>
static
void bt_notification_packet_begin_destroy(struct bt_object *obj)
*/
#include <babeltrace/compiler.h>
-#include <babeltrace/component/notification/stream-internal.h>
+#include <babeltrace/graph/notification-stream-internal.h>
static
void bt_notification_stream_end_destroy(struct bt_object *obj)
* SOFTWARE.
*/
-#include <babeltrace/component/component-internal.h>
-#include <babeltrace/component/port-internal.h>
-#include <babeltrace/component/connection-internal.h>
+#include <babeltrace/graph/component-internal.h>
+#include <babeltrace/graph/port-internal.h>
+#include <babeltrace/graph/connection-internal.h>
#include <babeltrace/object-internal.h>
#include <babeltrace/compiler.h>
#include <babeltrace/compiler.h>
#include <babeltrace/values.h>
-#include <babeltrace/component/component-sink-internal.h>
-#include <babeltrace/component/component-internal.h>
-#include <babeltrace/component/notification/notification.h>
+#include <babeltrace/graph/component-sink-internal.h>
+#include <babeltrace/graph/component-internal.h>
+#include <babeltrace/graph/notification.h>
BT_HIDDEN
enum bt_component_status bt_component_sink_validate(
#include <babeltrace/ref.h>
#include <babeltrace/compiler.h>
-#include <babeltrace/component/component-source-internal.h>
-#include <babeltrace/component/component-internal.h>
-#include <babeltrace/component/port-internal.h>
-#include <babeltrace/component/notification/iterator.h>
-#include <babeltrace/component/notification/iterator-internal.h>
+#include <babeltrace/graph/component-source-internal.h>
+#include <babeltrace/graph/component-internal.h>
+#include <babeltrace/graph/port-internal.h>
+#include <babeltrace/graph/notification-iterator.h>
+#include <babeltrace/graph/notification-iterator-internal.h>
BT_HIDDEN
enum bt_component_status bt_component_source_validate(
#include <babeltrace/plugin/plugin-so-internal.h>
#include <babeltrace/plugin/plugin-dev.h>
#include <babeltrace/plugin/plugin-internal.h>
-#include <babeltrace/component/component-class-internal.h>
+#include <babeltrace/graph/component-class-internal.h>
#include <string.h>
#include <stdbool.h>
#include <glib.h>
#include <babeltrace/ctf-ir/stream.h>
#include <babeltrace/ctf-ir/clock-class.h>
#include <babeltrace/ctf-ir/event-class.h>
-#include <babeltrace/component/notification/packet.h>
-#include <babeltrace/component/notification/event.h>
-#include <babeltrace/component/notification/stream.h>
+#include <babeltrace/graph/notification-packet.h>
+#include <babeltrace/graph/notification-event.h>
+#include <babeltrace/graph/notification-stream.h>
#include <babeltrace/ref.h>
#include <glib.h>
#include <inttypes.h>
#include <sys/mman.h>
#include <babeltrace/ctf-ir/stream.h>
-#include <babeltrace/component/notification/iterator.h>
+#include <babeltrace/graph/notification-iterator.h>
#include "file.h"
#include "metadata.h"
#include "../common/notif-iter/notif-iter.h"
#include <babeltrace/ctf-ir/packet.h>
#include <babeltrace/ctf-ir/clock-class.h>
-#include <babeltrace/component/private-component.h>
-#include <babeltrace/component/component.h>
-#include <babeltrace/component/notification/iterator.h>
-#include <babeltrace/component/notification/private-iterator.h>
-#include <babeltrace/component/notification/stream.h>
-#include <babeltrace/component/notification/event.h>
-#include <babeltrace/component/notification/packet.h>
-#include <babeltrace/component/notification/heap.h>
+#include <babeltrace/graph/private-component.h>
+#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/notification-iterator.h>
+#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/notification-stream.h>
+#include <babeltrace/graph/notification-event.h>
+#include <babeltrace/graph/notification-packet.h>
+#include <babeltrace/graph/notification-heap.h>
#include <plugins-common.h>
#include <glib.h>
#include <assert.h>
*/
#include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/component/component.h>
+#include <babeltrace/graph/component.h>
#include "data-stream.h"
#define CTF_FS_COMPONENT_DESCRIPTION \
*/
#include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/component/component.h>
+#include <babeltrace/graph/component.h>
#define LTTNG_LIVE_COMPONENT_DESCRIPTION "Component implementing an LTTng-live client."
*/
#include "lttng-live-internal.h"
-#include <babeltrace/component/component-source.h>
+#include <babeltrace/graph/component-source.h>
#include <plugins-common.h>
BT_HIDDEN
*/
#include <babeltrace/plugin/plugin-dev.h>
-#include <babeltrace/component/component.h>
-#include <babeltrace/component/component-filter.h>
-#include <babeltrace/component/notification/notification.h>
-#include <babeltrace/component/notification/iterator.h>
-#include <babeltrace/component/notification/event.h>
+#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/component-filter.h>
+#include <babeltrace/graph/notification.h>
+#include <babeltrace/graph/notification-iterator.h>
+#include <babeltrace/graph/notification-event.h>
#include <plugins-common.h>
#include "muxer.h"
*/
#include <babeltrace/plugin/plugin-dev.h>
-#include <babeltrace/component/component.h>
-#include <babeltrace/component/private-component.h>
-#include <babeltrace/component/component-sink.h>
-#include <babeltrace/component/port.h>
-#include <babeltrace/component/private-port.h>
-#include <babeltrace/component/connection.h>
-#include <babeltrace/component/private-connection.h>
-#include <babeltrace/component/notification/notification.h>
-#include <babeltrace/component/notification/iterator.h>
-#include <babeltrace/component/notification/event.h>
+#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/private-component.h>
+#include <babeltrace/graph/component-sink.h>
+#include <babeltrace/graph/port.h>
+#include <babeltrace/graph/private-port.h>
+#include <babeltrace/graph/connection.h>
+#include <babeltrace/graph/private-connection.h>
+#include <babeltrace/graph/notification.h>
+#include <babeltrace/graph/notification-iterator.h>
+#include <babeltrace/graph/notification-event.h>
#include <babeltrace/values.h>
#include <babeltrace/compiler.h>
#include <babeltrace/common-internal.h>
#include <stdbool.h>
#include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/component/component.h>
+#include <babeltrace/graph/component.h>
enum text_default {
TEXT_DEFAULT_UNSET,
*/
#include <babeltrace/plugin/plugin-dev.h>
-#include <babeltrace/component/component.h>
-#include <babeltrace/component/private-component.h>
-#include <babeltrace/component/private-port.h>
-#include <babeltrace/component/port.h>
-#include <babeltrace/component/private-connection.h>
-#include <babeltrace/component/component-sink.h>
-#include <babeltrace/component/notification/iterator.h>
-#include <babeltrace/component/notification/notification.h>
+#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/private-component.h>
+#include <babeltrace/graph/private-port.h>
+#include <babeltrace/graph/port.h>
+#include <babeltrace/graph/private-connection.h>
+#include <babeltrace/graph/component-sink.h>
+#include <babeltrace/graph/notification-iterator.h>
+#include <babeltrace/graph/notification.h>
#include <plugins-common.h>
#include <assert.h>
#include "dummy.h"
*/
#include <glib.h>
-#include <babeltrace/component/private-component.h>
-#include <babeltrace/component/private-port.h>
-#include <babeltrace/component/port.h>
+#include <babeltrace/graph/private-component.h>
+#include <babeltrace/graph/private-port.h>
+#include <babeltrace/graph/port.h>
struct dummy {
GPtrArray *iterators;
#include "trimmer.h"
#include "iterator.h"
-#include <babeltrace/component/notification/iterator.h>
-#include <babeltrace/component/notification/private-iterator.h>
-#include <babeltrace/component/notification/notification.h>
-#include <babeltrace/component/notification/event.h>
-#include <babeltrace/component/notification/stream.h>
-#include <babeltrace/component/notification/packet.h>
-#include <babeltrace/component/component-filter.h>
-#include <babeltrace/component/private-component-filter.h>
-#include <babeltrace/component/private-port.h>
-#include <babeltrace/component/private-connection.h>
-#include <babeltrace/component/private-component.h>
+#include <babeltrace/graph/notification-iterator.h>
+#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/notification.h>
+#include <babeltrace/graph/notification-event.h>
+#include <babeltrace/graph/notification-stream.h>
+#include <babeltrace/graph/notification-packet.h>
+#include <babeltrace/graph/component-filter.h>
+#include <babeltrace/graph/private-component-filter.h>
+#include <babeltrace/graph/private-port.h>
+#include <babeltrace/graph/private-connection.h>
+#include <babeltrace/graph/private-component.h>
#include <babeltrace/ctf-ir/event.h>
#include <babeltrace/ctf-ir/stream.h>
#include <babeltrace/ctf-ir/stream-class.h>
*/
#include "trimmer.h"
-#include <babeltrace/component/notification/notification.h>
-#include <babeltrace/component/notification/iterator.h>
-#include <babeltrace/component/private-component.h>
-#include <babeltrace/component/private-port.h>
+#include <babeltrace/graph/notification.h>
+#include <babeltrace/graph/notification-iterator.h>
+#include <babeltrace/graph/private-component.h>
+#include <babeltrace/graph/private-port.h>
struct trimmer_iterator {
/* Input iterator associated with this output iterator. */
*/
#include <babeltrace/plugin/plugin-dev.h>
-#include <babeltrace/component/component.h>
-#include <babeltrace/component/private-component.h>
-#include <babeltrace/component/component-filter.h>
-#include <babeltrace/component/notification/notification.h>
-#include <babeltrace/component/notification/iterator.h>
-#include <babeltrace/component/notification/private-iterator.h>
-#include <babeltrace/component/notification/event.h>
+#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/private-component.h>
+#include <babeltrace/graph/component-filter.h>
+#include <babeltrace/graph/notification.h>
+#include <babeltrace/graph/notification-iterator.h>
+#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/notification-event.h>
#include <plugins-common.h>
#include "trimmer.h"
#include "iterator.h"
#include <stdbool.h>
#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/values.h>
-#include <babeltrace/component/private-component.h>
+#include <babeltrace/graph/private-component.h>
#define NSEC_PER_SEC 1000000000LL
#include <babeltrace/ctf-ir/packet.h>
#include <babeltrace/plugin/plugin-dev.h>
-#include <babeltrace/component/component.h>
-#include <babeltrace/component/private-component.h>
-#include <babeltrace/component/component-sink.h>
-#include <babeltrace/component/private-component-sink.h>
-#include <babeltrace/component/private-port.h>
-#include <babeltrace/component/private-connection.h>
-#include <babeltrace/component/notification/notification.h>
-#include <babeltrace/component/notification/iterator.h>
-#include <babeltrace/component/notification/event.h>
-#include <babeltrace/component/notification/packet.h>
+#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/private-component.h>
+#include <babeltrace/graph/component-sink.h>
+#include <babeltrace/graph/private-component-sink.h>
+#include <babeltrace/graph/private-port.h>
+#include <babeltrace/graph/private-connection.h>
+#include <babeltrace/graph/notification.h>
+#include <babeltrace/graph/notification-iterator.h>
+#include <babeltrace/graph/notification-event.h>
+#include <babeltrace/graph/notification-packet.h>
#include <plugins-common.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdbool.h>
#include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/component/component.h>
+#include <babeltrace/graph/component.h>
#include <babeltrace/ctf-writer/writer.h>
struct writer_component {
*/
#include <babeltrace/plugin/plugin-dev.h>
-#include <babeltrace/component/component-class.h>
+#include <babeltrace/graph/component-class.h>
#include <babeltrace/values.h>
#include <babeltrace/ref.h>
#include <assert.h>
#include <stdlib.h>
#include <babeltrace/compiler.h>
#include <babeltrace/ref.h>
-#include <babeltrace/component/notification/heap.h>
-#include <babeltrace/component/notification/notification.h>
-#include <babeltrace/component/notification/notification-internal.h>
+#include <babeltrace/graph/notification-heap.h>
+#include <babeltrace/graph/notification.h>
+#include <babeltrace/graph/notification-internal.h>
#define NR_TESTS 7