From: Philippe Proulx Date: Wed, 29 Mar 2017 02:04:59 +0000 (-0400) Subject: Rename -> X-Git-Tag: v2.0.0-pre1~432 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=b2e0c9076135f47110af2d96dfaee397c597bc90 Rename -> Also put all the graph-related header files directly in this directory, not in subdirectories. Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/configure.ac b/configure.ac index 0f318214..51e229d8 100644 --- a/configure.ac +++ b/configure.ac @@ -410,11 +410,8 @@ AC_SUBST(babeltracectfirincludedir) 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) diff --git a/converter/babeltrace-cfg.h b/converter/babeltrace-cfg.h index caa90f44..ca2f9950 100644 --- a/converter/babeltrace-cfg.h +++ b/converter/babeltrace-cfg.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include struct bt_config_component { diff --git a/converter/babeltrace.c b/converter/babeltrace.c index ecfbf5be..5aa72556 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -29,15 +29,15 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/formats/ctf/ir/trace.c b/formats/ctf/ir/trace.c index 37884069..32ceca63 100644 --- a/formats/ctf/ir/trace.c +++ b/formats/ctf/ir/trace.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/Makefile.am b/include/Makefile.am index 94676992..a4ef7ecd 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -41,35 +41,33 @@ babeltraceplugininclude_HEADERS = \ 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 \ @@ -133,18 +131,18 @@ noinst_HEADERS = \ 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 diff --git a/include/babeltrace/component/component-class-filter.h b/include/babeltrace/component/component-class-filter.h deleted file mode 100644 index 60ed0f7c..00000000 --- a/include/babeltrace/component/component-class-filter.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_FILTER_H -#define BABELTRACE_COMPONENT_COMPONENT_CLASS_FILTER_H - -/* - * Babeltrace - Component Class Interface. - * - * Copyright 2016 Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 - -#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 */ diff --git a/include/babeltrace/component/component-class-internal.h b/include/babeltrace/component/component-class-internal.h deleted file mode 100644 index 1cafef64..00000000 --- a/include/babeltrace/component/component-class-internal.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_INTERNAL_H -#define BABELTRACE_COMPONENT_COMPONENT_CLASS_INTERNAL_H - -/* - * BabelTrace - Component Class Internal - * - * Copyright 2015 Jérémie Galarneau - * Copyright 2017 Philippe Proulx - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include -#include -#include -#include -#include -#include -#include -#include - -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 */ diff --git a/include/babeltrace/component/component-class-sink.h b/include/babeltrace/component/component-class-sink.h deleted file mode 100644 index b93b51d6..00000000 --- a/include/babeltrace/component/component-class-sink.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_SINK_H -#define BABELTRACE_COMPONENT_COMPONENT_CLASS_SINK_H - -/* - * Babeltrace - Component Class Interface. - * - * Copyright 2016 Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 - -#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 */ diff --git a/include/babeltrace/component/component-class-source.h b/include/babeltrace/component/component-class-source.h deleted file mode 100644 index a6de3ae5..00000000 --- a/include/babeltrace/component/component-class-source.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_SOURCE_H -#define BABELTRACE_COMPONENT_COMPONENT_CLASS_SOURCE_H - -/* - * Babeltrace - Component Class Interface. - * - * Copyright 2016 Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 - -#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 */ diff --git a/include/babeltrace/component/component-class.h b/include/babeltrace/component/component-class.h deleted file mode 100644 index a5bfee87..00000000 --- a/include/babeltrace/component/component-class.h +++ /dev/null @@ -1,167 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_H -#define BABELTRACE_COMPONENT_COMPONENT_CLASS_H - -/* - * Babeltrace - Component Class Interface. - * - * Copyright 2016 Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include - -#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 */ diff --git a/include/babeltrace/component/component-filter-internal.h b/include/babeltrace/component/component-filter-internal.h deleted file mode 100644 index 71690cad..00000000 --- a/include/babeltrace/component/component-filter-internal.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_FILTER_INTERNAL_H -#define BABELTRACE_COMPONENT_FILTER_INTERNAL_H - -/* - * BabelTrace - Filter Component Internal - * - * Copyright 2016 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include -#include - -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 */ diff --git a/include/babeltrace/component/component-filter.h b/include/babeltrace/component/component-filter.h deleted file mode 100644 index 6f42d4e9..00000000 --- a/include/babeltrace/component/component-filter.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_FILTER_H -#define BABELTRACE_COMPONENT_FILTER_H - -/* - * BabelTrace - Filter Plug-in Interface - * - * Copyright 2016 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include - -#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 */ diff --git a/include/babeltrace/component/component-internal.h b/include/babeltrace/component/component-internal.h deleted file mode 100644 index 744fb0d3..00000000 --- a/include/babeltrace/component/component-internal.h +++ /dev/null @@ -1,127 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_COMPONENT_INTERNAL_H -#define BABELTRACE_COMPONENT_COMPONENT_INTERNAL_H - -/* - * BabelTrace - Component internal - * - * Copyright 2015 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include -#include -#include -#include -#include -#include - -#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 */ diff --git a/include/babeltrace/component/component-sink-internal.h b/include/babeltrace/component/component-sink-internal.h deleted file mode 100644 index 465fa54b..00000000 --- a/include/babeltrace/component/component-sink-internal.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_SINK_INTERNAL_H -#define BABELTRACE_COMPONENT_SINK_INTERNAL_H - -/* - * BabelTrace - Sink Component internal - * - * Copyright 2015 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include -#include -#include - -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 */ diff --git a/include/babeltrace/component/component-sink.h b/include/babeltrace/component/component-sink.h deleted file mode 100644 index 924f8c74..00000000 --- a/include/babeltrace/component/component-sink.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_SINK_H -#define BABELTRACE_COMPONENT_SINK_H - -/* - * BabelTrace - Sink Component Interface - * - * Copyright 2017 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 - -#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 */ diff --git a/include/babeltrace/component/component-source-internal.h b/include/babeltrace/component/component-source-internal.h deleted file mode 100644 index 0a68e8a5..00000000 --- a/include/babeltrace/component/component-source-internal.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_SOURCE_INTERNAL_H -#define BABELTRACE_COMPONENT_SOURCE_INTERNAL_H - -/* - * BabelTrace - Source Component internal - * - * Copyright 2015 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include -#include - -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 */ diff --git a/include/babeltrace/component/component-source.h b/include/babeltrace/component/component-source.h deleted file mode 100644 index 94ebf707..00000000 --- a/include/babeltrace/component/component-source.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_SOURCE_H -#define BABELTRACE_COMPONENT_SOURCE_H - -/* - * BabelTrace - Source Plug-in Interface - * - * Copyright 2016 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include - -#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 */ diff --git a/include/babeltrace/component/component.h b/include/babeltrace/component/component.h deleted file mode 100644 index 1d884968..00000000 --- a/include/babeltrace/component/component.h +++ /dev/null @@ -1,114 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_COMPONENT_H -#define BABELTRACE_COMPONENT_COMPONENT_H - -/* - * BabelTrace - Babeltrace Component Interface - * - * Copyright 2015 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include -#include -#include - -#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 */ diff --git a/include/babeltrace/component/connection-internal.h b/include/babeltrace/component/connection-internal.h deleted file mode 100644 index 10533aff..00000000 --- a/include/babeltrace/component/connection-internal.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H -#define BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H - -/* - * BabelTrace - Component Connection Internal - * - * Copyright 2017 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include -#include - -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 */ diff --git a/include/babeltrace/component/connection.h b/include/babeltrace/component/connection.h deleted file mode 100644 index 4fe1d4c3..00000000 --- a/include/babeltrace/component/connection.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_CONNECTION_H -#define BABELTRACE_COMPONENT_CONNECTION_H - -/* - * BabelTrace - Babeltrace Component Connection Interface - * - * Copyright 2017 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 */ diff --git a/include/babeltrace/component/graph-internal.h b/include/babeltrace/component/graph-internal.h deleted file mode 100644 index 0084628a..00000000 --- a/include/babeltrace/component/graph-internal.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_COMPONENT_GRAPH_INTERNAL_H -#define BABELTRACE_COMPONENT_COMPONENT_GRAPH_INTERNAL_H - -/* - * BabelTrace - Component Graph Internal - * - * Copyright 2017 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include -#include -#include - -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 */ diff --git a/include/babeltrace/component/graph.h b/include/babeltrace/component/graph.h deleted file mode 100644 index 2d62484f..00000000 --- a/include/babeltrace/component/graph.h +++ /dev/null @@ -1,121 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_GRAPH_H -#define BABELTRACE_COMPONENT_GRAPH_H - -/* - * BabelTrace - Babeltrace Graph Interface - * - * Copyright 2017 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 - -#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 */ diff --git a/include/babeltrace/component/notification/eot-internal.h b/include/babeltrace/component/notification/eot-internal.h deleted file mode 100644 index e69de29b..00000000 diff --git a/include/babeltrace/component/notification/eot.h b/include/babeltrace/component/notification/eot.h deleted file mode 100644 index 4c3626c1..00000000 --- a/include/babeltrace/component/notification/eot.h +++ /dev/null @@ -1,38 +0,0 @@ -#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 - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 */ diff --git a/include/babeltrace/component/notification/event-internal.h b/include/babeltrace/component/notification/event-internal.h deleted file mode 100644 index 3db8ffd3..00000000 --- a/include/babeltrace/component/notification/event-internal.h +++ /dev/null @@ -1,46 +0,0 @@ -#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 - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include - -#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 */ diff --git a/include/babeltrace/component/notification/event.h b/include/babeltrace/component/notification/event.h deleted file mode 100644 index e5947b7e..00000000 --- a/include/babeltrace/component/notification/event.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_NOTIFICATION_EVENT_H -#define BABELTRACE_COMPONENT_NOTIFICATION_EVENT_H - -/* - * BabelTrace - Plug-in Event Notification - * - * Copyright 2016 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 */ diff --git a/include/babeltrace/component/notification/heap-internal.h b/include/babeltrace/component/notification/heap-internal.h deleted file mode 100644 index 86037801..00000000 --- a/include/babeltrace/component/notification/heap-internal.h +++ /dev/null @@ -1,41 +0,0 @@ -#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 - * - * 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 -#include -#include -#include - -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 */ diff --git a/include/babeltrace/component/notification/heap.h b/include/babeltrace/component/notification/heap.h deleted file mode 100644 index 3a5ce6d4..00000000 --- a/include/babeltrace/component/notification/heap.h +++ /dev/null @@ -1,93 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_NOTIFICATION_HEAP_H -#define BABELTRACE_COMPONENT_NOTIFICATION_HEAP_H - -/* - * Babeltrace - Notification Heap - * - * Copyright (c) 2011 Mathieu Desnoyers - * Copyright (c) 2016 Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include -#include -#include - -/** - * 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 */ diff --git a/include/babeltrace/component/notification/iterator-internal.h b/include/babeltrace/component/notification/iterator-internal.h deleted file mode 100644 index b1300f03..00000000 --- a/include/babeltrace/component/notification/iterator-internal.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_INTERNAL_H -#define BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_INTERNAL_H - -/* - * BabelTrace - Notification Iterator Internal - * - * Copyright 2015 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include -#include -#include -#include -#include - -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 */ diff --git a/include/babeltrace/component/notification/iterator.h b/include/babeltrace/component/notification/iterator.h deleted file mode 100644 index 8cf2a062..00000000 --- a/include/babeltrace/component/notification/iterator.h +++ /dev/null @@ -1,138 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_H -#define BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_H - -/* - * BabelTrace - Plug-in Notification Iterator - * - * Copyright 2015 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 - -#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 not 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 */ diff --git a/include/babeltrace/component/notification/notification-internal.h b/include/babeltrace/component/notification/notification-internal.h deleted file mode 100644 index 8f3d055b..00000000 --- a/include/babeltrace/component/notification/notification-internal.h +++ /dev/null @@ -1,58 +0,0 @@ -#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 - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include -#include -#include -#include - -#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 */ diff --git a/include/babeltrace/component/notification/notification.h b/include/babeltrace/component/notification/notification.h deleted file mode 100644 index d1797337..00000000 --- a/include/babeltrace/component/notification/notification.h +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_NOTIFICATION_NOTIFICATION_H -#define BABELTRACE_COMPONENT_NOTIFICATION_NOTIFICATION_H - -/* - * BabelTrace - Plug-in Notification - * - * Copyright 2015 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 */ diff --git a/include/babeltrace/component/notification/packet-internal.h b/include/babeltrace/component/notification/packet-internal.h deleted file mode 100644 index 3b7836d8..00000000 --- a/include/babeltrace/component/notification/packet-internal.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_NOTIFICATION_PACKET_INTERNAL_H -#define BABELTRACE_COMPONENT_NOTIFICATION_PACKET_INTERNAL_H - -/* - * BabelTrace - Packet-related Notifications - * - * Copyright 2016 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include - -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 */ diff --git a/include/babeltrace/component/notification/packet.h b/include/babeltrace/component/notification/packet.h deleted file mode 100644 index d457aa21..00000000 --- a/include/babeltrace/component/notification/packet.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_NOTIFICATION_PACKET_H -#define BABELTRACE_COMPONENT_NOTIFICATION_PACKET_H - -/* - * BabelTrace - Plug-in Packet-related Notifications - * - * Copyright 2016 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 - -#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 */ diff --git a/include/babeltrace/component/notification/private-iterator.h b/include/babeltrace/component/notification/private-iterator.h deleted file mode 100644 index 9cc8c664..00000000 --- a/include/babeltrace/component/notification/private-iterator.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_NOTIFICATION_PRIVATE_ITERATOR_H -#define BABELTRACE_COMPONENT_NOTIFICATION_PRIVATE_ITERATOR_H - -/* - * Copyright 2017 Philippe Proulx - * - * 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 */ diff --git a/include/babeltrace/component/notification/schema.h b/include/babeltrace/component/notification/schema.h deleted file mode 100644 index eb6f09e9..00000000 --- a/include/babeltrace/component/notification/schema.h +++ /dev/null @@ -1,114 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_NOTIFICATION_SCHEMA_H -#define BABELTRACE_COMPONENT_NOTIFICATION_SCHEMA_H - -/* - * BabelTrace - Plug-in Schema Change Notification - * - * Copyright 2016 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 */ diff --git a/include/babeltrace/component/notification/stream-internal.h b/include/babeltrace/component/notification/stream-internal.h deleted file mode 100644 index 83c7e24b..00000000 --- a/include/babeltrace/component/notification/stream-internal.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_NOTIFICATION_STREAM_INTERNAL_H -#define BABELTRACE_COMPONENT_NOTIFICATION_STREAM_INTERNAL_H - -/* - * BabelTrace - Stream-related Notifications - * - * Copyright 2016 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include - -struct bt_notification_stream_end { - struct bt_notification parent; - struct bt_ctf_stream *stream; -}; - -#endif /* BABELTRACE_COMPONENT_NOTIFICATION_STREAM_INTERNAL_H */ diff --git a/include/babeltrace/component/notification/stream.h b/include/babeltrace/component/notification/stream.h deleted file mode 100644 index c33b2518..00000000 --- a/include/babeltrace/component/notification/stream.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_NOTIFICATION_STREAM_H -#define BABELTRACE_COMPONENT_NOTIFICATION_STREAM_H - -/* - * BabelTrace - Plug-in Stream-related Notifications - * - * Copyright 2016 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 -#include - -#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 */ diff --git a/include/babeltrace/component/port-internal.h b/include/babeltrace/component/port-internal.h deleted file mode 100644 index fb4ff727..00000000 --- a/include/babeltrace/component/port-internal.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_PORT_INTERNAL_H -#define BABELTRACE_COMPONENT_PORT_INTERNAL_H - -/* - * BabelTrace - Babeltrace Component Port - * - * Copyright 2017 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 - -#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 */ diff --git a/include/babeltrace/component/port.h b/include/babeltrace/component/port.h deleted file mode 100644 index 9d802440..00000000 --- a/include/babeltrace/component/port.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_PORT_H -#define BABELTRACE_COMPONENT_PORT_H - -/* - * BabelTrace - Babeltrace Component Connection Interface - * - * Copyright 2017 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * 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 - -#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 */ diff --git a/include/babeltrace/component/private-component-filter.h b/include/babeltrace/component/private-component-filter.h deleted file mode 100644 index e54ccc4a..00000000 --- a/include/babeltrace/component/private-component-filter.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H -#define BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H - -/* - * Copyright 2017 Philippe Proulx - * - * 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 - -#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 */ diff --git a/include/babeltrace/component/private-component-sink.h b/include/babeltrace/component/private-component-sink.h deleted file mode 100644 index f1ba7a71..00000000 --- a/include/babeltrace/component/private-component-sink.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H -#define BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H - -/* - * Copyright 2017 Philippe Proulx - * - * 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 - -#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 */ diff --git a/include/babeltrace/component/private-component-source.h b/include/babeltrace/component/private-component-source.h deleted file mode 100644 index b54bbfb8..00000000 --- a/include/babeltrace/component/private-component-source.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SOURCE_H -#define BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SOURCE_H - -/* - * Copyright 2017 Philippe Proulx - * - * 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 - -#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 */ diff --git a/include/babeltrace/component/private-component.h b/include/babeltrace/component/private-component.h deleted file mode 100644 index e19b6ff2..00000000 --- a/include/babeltrace/component/private-component.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_PRIVATE_COMPONENT_H -#define BABELTRACE_COMPONENT_PRIVATE_COMPONENT_H - -/* - * Copyright 2017 Philippe Proulx - * - * 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 - -#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 */ diff --git a/include/babeltrace/component/private-connection.h b/include/babeltrace/component/private-connection.h deleted file mode 100644 index 76294604..00000000 --- a/include/babeltrace/component/private-connection.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_PRIVATE_CONNECTION_H -#define BABELTRACE_COMPONENT_PRIVATE_CONNECTION_H - -/* - * Copyright 2017 Philippe Proulx - * - * 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 */ diff --git a/include/babeltrace/component/private-port.h b/include/babeltrace/component/private-port.h deleted file mode 100644 index 2f0e49db..00000000 --- a/include/babeltrace/component/private-port.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef BABELTRACE_COMPONENT_PRIVATE_PORT_H -#define BABELTRACE_COMPONENT_PRIVATE_PORT_H - -/* - * Copyright 2017 Philippe Proulx - * - * 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 */ diff --git a/include/babeltrace/ctf-ir/trace.h b/include/babeltrace/ctf-ir/trace.h index b722d922..07daabe3 100644 --- a/include/babeltrace/ctf-ir/trace.h +++ b/include/babeltrace/ctf-ir/trace.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #ifdef __cplusplus diff --git a/include/babeltrace/graph/component-class-filter.h b/include/babeltrace/graph/component-class-filter.h new file mode 100644 index 00000000..bc30a77f --- /dev/null +++ b/include/babeltrace/graph/component-class-filter.h @@ -0,0 +1,59 @@ +#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_FILTER_H +#define BABELTRACE_COMPONENT_COMPONENT_CLASS_FILTER_H + +/* + * Babeltrace - Component Class Interface. + * + * Copyright 2016 Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 + +#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 */ diff --git a/include/babeltrace/graph/component-class-internal.h b/include/babeltrace/graph/component-class-internal.h new file mode 100644 index 00000000..68a8e0c1 --- /dev/null +++ b/include/babeltrace/graph/component-class-internal.h @@ -0,0 +1,101 @@ +#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_INTERNAL_H +#define BABELTRACE_COMPONENT_COMPONENT_CLASS_INTERNAL_H + +/* + * BabelTrace - Component Class Internal + * + * Copyright 2015 Jérémie Galarneau + * Copyright 2017 Philippe Proulx + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include +#include +#include +#include +#include +#include +#include +#include + +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 */ diff --git a/include/babeltrace/graph/component-class-sink.h b/include/babeltrace/graph/component-class-sink.h new file mode 100644 index 00000000..e2cf85e2 --- /dev/null +++ b/include/babeltrace/graph/component-class-sink.h @@ -0,0 +1,47 @@ +#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_SINK_H +#define BABELTRACE_COMPONENT_COMPONENT_CLASS_SINK_H + +/* + * Babeltrace - Component Class Interface. + * + * Copyright 2016 Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 + +#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 */ diff --git a/include/babeltrace/graph/component-class-source.h b/include/babeltrace/graph/component-class-source.h new file mode 100644 index 00000000..6190977b --- /dev/null +++ b/include/babeltrace/graph/component-class-source.h @@ -0,0 +1,59 @@ +#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_SOURCE_H +#define BABELTRACE_COMPONENT_COMPONENT_CLASS_SOURCE_H + +/* + * Babeltrace - Component Class Interface. + * + * Copyright 2016 Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 + +#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 */ diff --git a/include/babeltrace/graph/component-class.h b/include/babeltrace/graph/component-class.h new file mode 100644 index 00000000..cf031cfe --- /dev/null +++ b/include/babeltrace/graph/component-class.h @@ -0,0 +1,167 @@ +#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_H +#define BABELTRACE_COMPONENT_COMPONENT_CLASS_H + +/* + * Babeltrace - Component Class Interface. + * + * Copyright 2016 Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include + +#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 */ diff --git a/include/babeltrace/graph/component-filter-internal.h b/include/babeltrace/graph/component-filter-internal.h new file mode 100644 index 00000000..15db1bb6 --- /dev/null +++ b/include/babeltrace/graph/component-filter-internal.h @@ -0,0 +1,64 @@ +#ifndef BABELTRACE_COMPONENT_FILTER_INTERNAL_H +#define BABELTRACE_COMPONENT_FILTER_INTERNAL_H + +/* + * BabelTrace - Filter Component Internal + * + * Copyright 2016 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include +#include + +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 */ diff --git a/include/babeltrace/graph/component-filter.h b/include/babeltrace/graph/component-filter.h new file mode 100644 index 00000000..f9e681f3 --- /dev/null +++ b/include/babeltrace/graph/component-filter.h @@ -0,0 +1,62 @@ +#ifndef BABELTRACE_COMPONENT_FILTER_H +#define BABELTRACE_COMPONENT_FILTER_H + +/* + * BabelTrace - Filter Plug-in Interface + * + * Copyright 2016 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include + +#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 */ diff --git a/include/babeltrace/graph/component-internal.h b/include/babeltrace/graph/component-internal.h new file mode 100644 index 00000000..4c50ffb9 --- /dev/null +++ b/include/babeltrace/graph/component-internal.h @@ -0,0 +1,127 @@ +#ifndef BABELTRACE_COMPONENT_COMPONENT_INTERNAL_H +#define BABELTRACE_COMPONENT_COMPONENT_INTERNAL_H + +/* + * BabelTrace - Component internal + * + * Copyright 2015 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include +#include +#include +#include +#include +#include + +#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 */ diff --git a/include/babeltrace/graph/component-sink-internal.h b/include/babeltrace/graph/component-sink-internal.h new file mode 100644 index 00000000..84c37f2a --- /dev/null +++ b/include/babeltrace/graph/component-sink-internal.h @@ -0,0 +1,77 @@ +#ifndef BABELTRACE_COMPONENT_SINK_INTERNAL_H +#define BABELTRACE_COMPONENT_SINK_INTERNAL_H + +/* + * BabelTrace - Sink Component internal + * + * Copyright 2015 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include +#include +#include + +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 */ diff --git a/include/babeltrace/graph/component-sink.h b/include/babeltrace/graph/component-sink.h new file mode 100644 index 00000000..3bbfbb11 --- /dev/null +++ b/include/babeltrace/graph/component-sink.h @@ -0,0 +1,52 @@ +#ifndef BABELTRACE_COMPONENT_SINK_H +#define BABELTRACE_COMPONENT_SINK_H + +/* + * BabelTrace - Sink Component Interface + * + * Copyright 2017 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 + +#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 */ diff --git a/include/babeltrace/graph/component-source-internal.h b/include/babeltrace/graph/component-source-internal.h new file mode 100644 index 00000000..fa53bf04 --- /dev/null +++ b/include/babeltrace/graph/component-source-internal.h @@ -0,0 +1,64 @@ +#ifndef BABELTRACE_COMPONENT_SOURCE_INTERNAL_H +#define BABELTRACE_COMPONENT_SOURCE_INTERNAL_H + +/* + * BabelTrace - Source Component internal + * + * Copyright 2015 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include +#include + +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 */ diff --git a/include/babeltrace/graph/component-source.h b/include/babeltrace/graph/component-source.h new file mode 100644 index 00000000..165ba0d2 --- /dev/null +++ b/include/babeltrace/graph/component-source.h @@ -0,0 +1,53 @@ +#ifndef BABELTRACE_COMPONENT_SOURCE_H +#define BABELTRACE_COMPONENT_SOURCE_H + +/* + * BabelTrace - Source Plug-in Interface + * + * Copyright 2016 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include + +#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 */ diff --git a/include/babeltrace/graph/component.h b/include/babeltrace/graph/component.h new file mode 100644 index 00000000..74f38345 --- /dev/null +++ b/include/babeltrace/graph/component.h @@ -0,0 +1,114 @@ +#ifndef BABELTRACE_COMPONENT_COMPONENT_H +#define BABELTRACE_COMPONENT_COMPONENT_H + +/* + * BabelTrace - Babeltrace Component Interface + * + * Copyright 2015 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include +#include +#include + +#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 */ diff --git a/include/babeltrace/graph/connection-internal.h b/include/babeltrace/graph/connection-internal.h new file mode 100644 index 00000000..d22c7eea --- /dev/null +++ b/include/babeltrace/graph/connection-internal.h @@ -0,0 +1,76 @@ +#ifndef BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H +#define BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H + +/* + * BabelTrace - Component Connection Internal + * + * Copyright 2017 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include +#include + +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 */ diff --git a/include/babeltrace/graph/connection.h b/include/babeltrace/graph/connection.h new file mode 100644 index 00000000..4fe1d4c3 --- /dev/null +++ b/include/babeltrace/graph/connection.h @@ -0,0 +1,48 @@ +#ifndef BABELTRACE_COMPONENT_CONNECTION_H +#define BABELTRACE_COMPONENT_CONNECTION_H + +/* + * BabelTrace - Babeltrace Component Connection Interface + * + * Copyright 2017 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 */ diff --git a/include/babeltrace/graph/graph-internal.h b/include/babeltrace/graph/graph-internal.h new file mode 100644 index 00000000..e8e9e7f6 --- /dev/null +++ b/include/babeltrace/graph/graph-internal.h @@ -0,0 +1,81 @@ +#ifndef BABELTRACE_COMPONENT_COMPONENT_GRAPH_INTERNAL_H +#define BABELTRACE_COMPONENT_COMPONENT_GRAPH_INTERNAL_H + +/* + * BabelTrace - Component Graph Internal + * + * Copyright 2017 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include +#include +#include + +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 */ diff --git a/include/babeltrace/graph/graph.h b/include/babeltrace/graph/graph.h new file mode 100644 index 00000000..c0927922 --- /dev/null +++ b/include/babeltrace/graph/graph.h @@ -0,0 +1,121 @@ +#ifndef BABELTRACE_COMPONENT_GRAPH_H +#define BABELTRACE_COMPONENT_GRAPH_H + +/* + * BabelTrace - Babeltrace Graph Interface + * + * Copyright 2017 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 + +#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 */ diff --git a/include/babeltrace/graph/notification-eot-internal.h b/include/babeltrace/graph/notification-eot-internal.h new file mode 100644 index 00000000..e69de29b diff --git a/include/babeltrace/graph/notification-eot.h b/include/babeltrace/graph/notification-eot.h new file mode 100644 index 00000000..4c3626c1 --- /dev/null +++ b/include/babeltrace/graph/notification-eot.h @@ -0,0 +1,38 @@ +#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 + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 */ diff --git a/include/babeltrace/graph/notification-event-internal.h b/include/babeltrace/graph/notification-event-internal.h new file mode 100644 index 00000000..939b7711 --- /dev/null +++ b/include/babeltrace/graph/notification-event-internal.h @@ -0,0 +1,46 @@ +#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 + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include + +#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 */ diff --git a/include/babeltrace/graph/notification-event.h b/include/babeltrace/graph/notification-event.h new file mode 100644 index 00000000..e5947b7e --- /dev/null +++ b/include/babeltrace/graph/notification-event.h @@ -0,0 +1,64 @@ +#ifndef BABELTRACE_COMPONENT_NOTIFICATION_EVENT_H +#define BABELTRACE_COMPONENT_NOTIFICATION_EVENT_H + +/* + * BabelTrace - Plug-in Event Notification + * + * Copyright 2016 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 */ diff --git a/include/babeltrace/graph/notification-heap-internal.h b/include/babeltrace/graph/notification-heap-internal.h new file mode 100644 index 00000000..07e13789 --- /dev/null +++ b/include/babeltrace/graph/notification-heap-internal.h @@ -0,0 +1,41 @@ +#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 + * + * 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 +#include +#include +#include + +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 */ diff --git a/include/babeltrace/graph/notification-heap.h b/include/babeltrace/graph/notification-heap.h new file mode 100644 index 00000000..ddadc67e --- /dev/null +++ b/include/babeltrace/graph/notification-heap.h @@ -0,0 +1,93 @@ +#ifndef BABELTRACE_COMPONENT_NOTIFICATION_HEAP_H +#define BABELTRACE_COMPONENT_NOTIFICATION_HEAP_H + +/* + * Babeltrace - Notification Heap + * + * Copyright (c) 2011 Mathieu Desnoyers + * Copyright (c) 2016 Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include +#include +#include + +/** + * 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 */ diff --git a/include/babeltrace/graph/notification-internal.h b/include/babeltrace/graph/notification-internal.h new file mode 100644 index 00000000..c5a542d7 --- /dev/null +++ b/include/babeltrace/graph/notification-internal.h @@ -0,0 +1,58 @@ +#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 + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include +#include +#include +#include + +#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 */ diff --git a/include/babeltrace/graph/notification-iterator-internal.h b/include/babeltrace/graph/notification-iterator-internal.h new file mode 100644 index 00000000..d7025669 --- /dev/null +++ b/include/babeltrace/graph/notification-iterator-internal.h @@ -0,0 +1,79 @@ +#ifndef BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_INTERNAL_H +#define BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_INTERNAL_H + +/* + * BabelTrace - Notification Iterator Internal + * + * Copyright 2015 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include +#include +#include +#include +#include + +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 */ diff --git a/include/babeltrace/graph/notification-iterator.h b/include/babeltrace/graph/notification-iterator.h new file mode 100644 index 00000000..8cf2a062 --- /dev/null +++ b/include/babeltrace/graph/notification-iterator.h @@ -0,0 +1,138 @@ +#ifndef BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_H +#define BABELTRACE_COMPONENT_NOTIFICATION_ITERATOR_H + +/* + * BabelTrace - Plug-in Notification Iterator + * + * Copyright 2015 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 + +#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 not 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 */ diff --git a/include/babeltrace/graph/notification-packet-internal.h b/include/babeltrace/graph/notification-packet-internal.h new file mode 100644 index 00000000..8d525c55 --- /dev/null +++ b/include/babeltrace/graph/notification-packet-internal.h @@ -0,0 +1,43 @@ +#ifndef BABELTRACE_COMPONENT_NOTIFICATION_PACKET_INTERNAL_H +#define BABELTRACE_COMPONENT_NOTIFICATION_PACKET_INTERNAL_H + +/* + * BabelTrace - Packet-related Notifications + * + * Copyright 2016 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include + +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 */ diff --git a/include/babeltrace/graph/notification-packet.h b/include/babeltrace/graph/notification-packet.h new file mode 100644 index 00000000..a15a9692 --- /dev/null +++ b/include/babeltrace/graph/notification-packet.h @@ -0,0 +1,54 @@ +#ifndef BABELTRACE_COMPONENT_NOTIFICATION_PACKET_H +#define BABELTRACE_COMPONENT_NOTIFICATION_PACKET_H + +/* + * BabelTrace - Plug-in Packet-related Notifications + * + * Copyright 2016 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 + +#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 */ diff --git a/include/babeltrace/graph/notification-schema.h b/include/babeltrace/graph/notification-schema.h new file mode 100644 index 00000000..eb6f09e9 --- /dev/null +++ b/include/babeltrace/graph/notification-schema.h @@ -0,0 +1,114 @@ +#ifndef BABELTRACE_COMPONENT_NOTIFICATION_SCHEMA_H +#define BABELTRACE_COMPONENT_NOTIFICATION_SCHEMA_H + +/* + * BabelTrace - Plug-in Schema Change Notification + * + * Copyright 2016 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 */ diff --git a/include/babeltrace/graph/notification-stream-internal.h b/include/babeltrace/graph/notification-stream-internal.h new file mode 100644 index 00000000..839c220c --- /dev/null +++ b/include/babeltrace/graph/notification-stream-internal.h @@ -0,0 +1,38 @@ +#ifndef BABELTRACE_COMPONENT_NOTIFICATION_STREAM_INTERNAL_H +#define BABELTRACE_COMPONENT_NOTIFICATION_STREAM_INTERNAL_H + +/* + * BabelTrace - Stream-related Notifications + * + * Copyright 2016 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include + +struct bt_notification_stream_end { + struct bt_notification parent; + struct bt_ctf_stream *stream; +}; + +#endif /* BABELTRACE_COMPONENT_NOTIFICATION_STREAM_INTERNAL_H */ diff --git a/include/babeltrace/graph/notification-stream.h b/include/babeltrace/graph/notification-stream.h new file mode 100644 index 00000000..bdcf4c96 --- /dev/null +++ b/include/babeltrace/graph/notification-stream.h @@ -0,0 +1,47 @@ +#ifndef BABELTRACE_COMPONENT_NOTIFICATION_STREAM_H +#define BABELTRACE_COMPONENT_NOTIFICATION_STREAM_H + +/* + * BabelTrace - Plug-in Stream-related Notifications + * + * Copyright 2016 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 +#include + +#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 */ diff --git a/include/babeltrace/graph/notification.h b/include/babeltrace/graph/notification.h new file mode 100644 index 00000000..d1797337 --- /dev/null +++ b/include/babeltrace/graph/notification.h @@ -0,0 +1,88 @@ +#ifndef BABELTRACE_COMPONENT_NOTIFICATION_NOTIFICATION_H +#define BABELTRACE_COMPONENT_NOTIFICATION_NOTIFICATION_H + +/* + * BabelTrace - Plug-in Notification + * + * Copyright 2015 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 */ diff --git a/include/babeltrace/graph/port-internal.h b/include/babeltrace/graph/port-internal.h new file mode 100644 index 00000000..85d9d76b --- /dev/null +++ b/include/babeltrace/graph/port-internal.h @@ -0,0 +1,69 @@ +#ifndef BABELTRACE_COMPONENT_PORT_INTERNAL_H +#define BABELTRACE_COMPONENT_PORT_INTERNAL_H + +/* + * BabelTrace - Babeltrace Component Port + * + * Copyright 2017 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 + +#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 */ diff --git a/include/babeltrace/graph/port.h b/include/babeltrace/graph/port.h new file mode 100644 index 00000000..9d802440 --- /dev/null +++ b/include/babeltrace/graph/port.h @@ -0,0 +1,65 @@ +#ifndef BABELTRACE_COMPONENT_PORT_H +#define BABELTRACE_COMPONENT_PORT_H + +/* + * BabelTrace - Babeltrace Component Connection Interface + * + * Copyright 2017 Jérémie Galarneau + * + * Author: Jérémie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * 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 + +#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 */ diff --git a/include/babeltrace/graph/private-component-filter.h b/include/babeltrace/graph/private-component-filter.h new file mode 100644 index 00000000..4c52d0f4 --- /dev/null +++ b/include/babeltrace/graph/private-component-filter.h @@ -0,0 +1,75 @@ +#ifndef BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H +#define BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H + +/* + * Copyright 2017 Philippe Proulx + * + * 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 + +#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 */ diff --git a/include/babeltrace/graph/private-component-sink.h b/include/babeltrace/graph/private-component-sink.h new file mode 100644 index 00000000..52178aeb --- /dev/null +++ b/include/babeltrace/graph/private-component-sink.h @@ -0,0 +1,57 @@ +#ifndef BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H +#define BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SINK_H + +/* + * Copyright 2017 Philippe Proulx + * + * 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 + +#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 */ diff --git a/include/babeltrace/graph/private-component-source.h b/include/babeltrace/graph/private-component-source.h new file mode 100644 index 00000000..d74df865 --- /dev/null +++ b/include/babeltrace/graph/private-component-source.h @@ -0,0 +1,57 @@ +#ifndef BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SOURCE_H +#define BABELTRACE_COMPONENT_PRIVATE_COMPONENT_SOURCE_H + +/* + * Copyright 2017 Philippe Proulx + * + * 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 + +#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 */ diff --git a/include/babeltrace/graph/private-component.h b/include/babeltrace/graph/private-component.h new file mode 100644 index 00000000..c2091985 --- /dev/null +++ b/include/babeltrace/graph/private-component.h @@ -0,0 +1,48 @@ +#ifndef BABELTRACE_COMPONENT_PRIVATE_COMPONENT_H +#define BABELTRACE_COMPONENT_PRIVATE_COMPONENT_H + +/* + * Copyright 2017 Philippe Proulx + * + * 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 + +#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 */ diff --git a/include/babeltrace/graph/private-connection.h b/include/babeltrace/graph/private-connection.h new file mode 100644 index 00000000..76294604 --- /dev/null +++ b/include/babeltrace/graph/private-connection.h @@ -0,0 +1,45 @@ +#ifndef BABELTRACE_COMPONENT_PRIVATE_CONNECTION_H +#define BABELTRACE_COMPONENT_PRIVATE_CONNECTION_H + +/* + * Copyright 2017 Philippe Proulx + * + * 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 */ diff --git a/include/babeltrace/graph/private-notification-iterator.h b/include/babeltrace/graph/private-notification-iterator.h new file mode 100644 index 00000000..9cc8c664 --- /dev/null +++ b/include/babeltrace/graph/private-notification-iterator.h @@ -0,0 +1,56 @@ +#ifndef BABELTRACE_COMPONENT_NOTIFICATION_PRIVATE_ITERATOR_H +#define BABELTRACE_COMPONENT_NOTIFICATION_PRIVATE_ITERATOR_H + +/* + * Copyright 2017 Philippe Proulx + * + * 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 */ diff --git a/include/babeltrace/graph/private-port.h b/include/babeltrace/graph/private-port.h new file mode 100644 index 00000000..2f0e49db --- /dev/null +++ b/include/babeltrace/graph/private-port.h @@ -0,0 +1,47 @@ +#ifndef BABELTRACE_COMPONENT_PRIVATE_PORT_H +#define BABELTRACE_COMPONENT_PRIVATE_PORT_H + +/* + * Copyright 2017 Philippe Proulx + * + * 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 */ diff --git a/include/babeltrace/plugin/plugin-dev.h b/include/babeltrace/plugin/plugin-dev.h index 5221b974..4a0dadd2 100644 --- a/include/babeltrace/plugin/plugin-dev.h +++ b/include/babeltrace/plugin/plugin-dev.h @@ -33,10 +33,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/babeltrace/plugin/plugin.h b/include/babeltrace/plugin/plugin.h index 0ec3b6c0..1d172540 100644 --- a/include/babeltrace/plugin/plugin.h +++ b/include/babeltrace/plugin/plugin.h @@ -30,7 +30,7 @@ #include #include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/lib/component/component-class.c b/lib/component/component-class.c index f3cbb422..bdaa2d37 100644 --- a/lib/component/component-class.c +++ b/lib/component/component-class.c @@ -27,7 +27,7 @@ */ #include -#include +#include #include #include #include diff --git a/lib/component/component.c b/lib/component/component.c index 83437075..e8c4b5af 100644 --- a/lib/component/component.c +++ b/lib/component/component.c @@ -26,18 +26,18 @@ * SOFTWARE. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/lib/component/connection.c b/lib/component/connection.c index 587a1956..d57a2cd4 100644 --- a/lib/component/connection.c +++ b/lib/component/connection.c @@ -26,14 +26,14 @@ * SOFTWARE. */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/lib/component/filter.c b/lib/component/filter.c index 20c8b627..dd440120 100644 --- a/lib/component/filter.c +++ b/lib/component/filter.c @@ -28,11 +28,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include BT_HIDDEN void bt_component_filter_destroy(struct bt_component *component) diff --git a/lib/component/graph.c b/lib/component/graph.c index e16a1314..7f0a4258 100644 --- a/lib/component/graph.c +++ b/lib/component/graph.c @@ -26,13 +26,13 @@ * SOFTWARE. */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/lib/component/iterator.c b/lib/component/iterator.c index d72f8649..5e70e719 100644 --- a/lib/component/iterator.c +++ b/lib/component/iterator.c @@ -28,11 +28,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include static void bt_notification_iterator_destroy(struct bt_object *obj) diff --git a/lib/component/notification/event.c b/lib/component/notification/event.c index 93833a22..faf96352 100644 --- a/lib/component/notification/event.c +++ b/lib/component/notification/event.c @@ -25,7 +25,7 @@ */ #include -#include +#include static void bt_notification_event_destroy(struct bt_object *obj) diff --git a/lib/component/notification/heap.c b/lib/component/notification/heap.c index b58480fc..897b680b 100644 --- a/lib/component/notification/heap.c +++ b/lib/component/notification/heap.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #ifdef DEBUG_HEAP static diff --git a/lib/component/notification/notification.c b/lib/component/notification/notification.c index 3b2ffb3d..9dc64d79 100644 --- a/lib/component/notification/notification.c +++ b/lib/component/notification/notification.c @@ -24,7 +24,7 @@ * SOFTWARE. */ -#include +#include BT_HIDDEN void bt_notification_init(struct bt_notification *notification, diff --git a/lib/component/notification/packet.c b/lib/component/notification/packet.c index 587b8508..393181da 100644 --- a/lib/component/notification/packet.c +++ b/lib/component/notification/packet.c @@ -25,7 +25,7 @@ */ #include -#include +#include static void bt_notification_packet_begin_destroy(struct bt_object *obj) diff --git a/lib/component/notification/stream.c b/lib/component/notification/stream.c index 1fd096c6..56062f61 100644 --- a/lib/component/notification/stream.c +++ b/lib/component/notification/stream.c @@ -25,7 +25,7 @@ */ #include -#include +#include static void bt_notification_stream_end_destroy(struct bt_object *obj) diff --git a/lib/component/port.c b/lib/component/port.c index ed4eda05..68b1cb60 100644 --- a/lib/component/port.c +++ b/lib/component/port.c @@ -26,9 +26,9 @@ * SOFTWARE. */ -#include -#include -#include +#include +#include +#include #include #include diff --git a/lib/component/sink.c b/lib/component/sink.c index 91fa2353..1f01d319 100644 --- a/lib/component/sink.c +++ b/lib/component/sink.c @@ -28,9 +28,9 @@ #include #include -#include -#include -#include +#include +#include +#include BT_HIDDEN enum bt_component_status bt_component_sink_validate( diff --git a/lib/component/source.c b/lib/component/source.c index bddd2f6a..7d43e34c 100644 --- a/lib/component/source.c +++ b/lib/component/source.c @@ -28,11 +28,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include BT_HIDDEN enum bt_component_status bt_component_source_validate( diff --git a/lib/plugin/plugin-so.c b/lib/plugin/plugin-so.c index 4fc939e5..bf6f9425 100644 --- a/lib/plugin/plugin-so.c +++ b/lib/plugin/plugin-so.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/plugins/ctf/common/notif-iter/notif-iter.c b/plugins/ctf/common/notif-iter/notif-iter.c index 92de3579..c4b6f68d 100644 --- a/plugins/ctf/common/notif-iter/notif-iter.c +++ b/plugins/ctf/common/notif-iter/notif-iter.c @@ -38,9 +38,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/plugins/ctf/fs/data-stream.c b/plugins/ctf/fs/data-stream.c index 905e26a9..ceeefdf5 100644 --- a/plugins/ctf/fs/data-stream.c +++ b/plugins/ctf/fs/data-stream.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include "file.h" #include "metadata.h" #include "../common/notif-iter/notif-iter.h" diff --git a/plugins/ctf/fs/fs.c b/plugins/ctf/fs/fs.c index f559a7ba..9a38834a 100644 --- a/plugins/ctf/fs/fs.c +++ b/plugins/ctf/fs/fs.c @@ -28,14 +28,14 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/plugins/ctf/fs/fs.h b/plugins/ctf/fs/fs.h index 037d47ee..43977d28 100644 --- a/plugins/ctf/fs/fs.h +++ b/plugins/ctf/fs/fs.h @@ -29,7 +29,7 @@ */ #include -#include +#include #include "data-stream.h" #define CTF_FS_COMPONENT_DESCRIPTION \ diff --git a/plugins/ctf/lttng-live/lttng-live-internal.h b/plugins/ctf/lttng-live/lttng-live-internal.h index a99f170d..e2f99b47 100644 --- a/plugins/ctf/lttng-live/lttng-live-internal.h +++ b/plugins/ctf/lttng-live/lttng-live-internal.h @@ -28,7 +28,7 @@ */ #include -#include +#include #define LTTNG_LIVE_COMPONENT_DESCRIPTION "Component implementing an LTTng-live client." diff --git a/plugins/ctf/lttng-live/lttng-live.c b/plugins/ctf/lttng-live/lttng-live.c index 0c8b3c2b..2d996abb 100644 --- a/plugins/ctf/lttng-live/lttng-live.c +++ b/plugins/ctf/lttng-live/lttng-live.c @@ -27,7 +27,7 @@ */ #include "lttng-live-internal.h" -#include +#include #include BT_HIDDEN diff --git a/plugins/muxer/muxer.c b/plugins/muxer/muxer.c index 6fa10f38..5ce38d89 100644 --- a/plugins/muxer/muxer.c +++ b/plugins/muxer/muxer.c @@ -27,11 +27,11 @@ */ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include "muxer.h" diff --git a/plugins/text/text.c b/plugins/text/text.c index 04567368..66b476e9 100644 --- a/plugins/text/text.c +++ b/plugins/text/text.c @@ -28,16 +28,16 @@ */ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/plugins/text/text.h b/plugins/text/text.h index c819365f..95652760 100644 --- a/plugins/text/text.h +++ b/plugins/text/text.h @@ -29,7 +29,7 @@ #include #include -#include +#include enum text_default { TEXT_DEFAULT_UNSET, diff --git a/plugins/utils/dummy/dummy.c b/plugins/utils/dummy/dummy.c index 44d191c3..df4b5a3b 100644 --- a/plugins/utils/dummy/dummy.c +++ b/plugins/utils/dummy/dummy.c @@ -21,14 +21,14 @@ */ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include "dummy.h" diff --git a/plugins/utils/dummy/dummy.h b/plugins/utils/dummy/dummy.h index 31a84e83..77e25111 100644 --- a/plugins/utils/dummy/dummy.h +++ b/plugins/utils/dummy/dummy.h @@ -24,9 +24,9 @@ */ #include -#include -#include -#include +#include +#include +#include struct dummy { GPtrArray *iterators; diff --git a/plugins/utils/trimmer/iterator.c b/plugins/utils/trimmer/iterator.c index 9d15ba1d..2d487f19 100644 --- a/plugins/utils/trimmer/iterator.c +++ b/plugins/utils/trimmer/iterator.c @@ -28,17 +28,17 @@ #include "trimmer.h" #include "iterator.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/plugins/utils/trimmer/iterator.h b/plugins/utils/trimmer/iterator.h index 3fe3dc4b..3fd99a72 100644 --- a/plugins/utils/trimmer/iterator.h +++ b/plugins/utils/trimmer/iterator.h @@ -28,10 +28,10 @@ */ #include "trimmer.h" -#include -#include -#include -#include +#include +#include +#include +#include struct trimmer_iterator { /* Input iterator associated with this output iterator. */ diff --git a/plugins/utils/trimmer/trimmer.c b/plugins/utils/trimmer/trimmer.c index ec34c973..d3f907e1 100644 --- a/plugins/utils/trimmer/trimmer.c +++ b/plugins/utils/trimmer/trimmer.c @@ -27,13 +27,13 @@ */ #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include "trimmer.h" #include "iterator.h" diff --git a/plugins/utils/trimmer/trimmer.h b/plugins/utils/trimmer/trimmer.h index e4ee8824..165d7c8b 100644 --- a/plugins/utils/trimmer/trimmer.h +++ b/plugins/utils/trimmer/trimmer.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include #define NSEC_PER_SEC 1000000000LL diff --git a/plugins/writer/writer.c b/plugins/writer/writer.c index a7f4024b..8f1d2fc1 100644 --- a/plugins/writer/writer.c +++ b/plugins/writer/writer.c @@ -28,16 +28,16 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/plugins/writer/writer.h b/plugins/writer/writer.h index 12e2b65f..6c6fed35 100644 --- a/plugins/writer/writer.h +++ b/plugins/writer/writer.h @@ -29,7 +29,7 @@ #include #include -#include +#include #include struct writer_component { diff --git a/tests/lib/test-plugin-plugins/sfs.c b/tests/lib/test-plugin-plugins/sfs.c index 93fbb023..735bf2ae 100644 --- a/tests/lib/test-plugin-plugins/sfs.c +++ b/tests/lib/test-plugin-plugins/sfs.c @@ -16,7 +16,7 @@ */ #include -#include +#include #include #include #include diff --git a/tests/lib/test_bt_notification_heap.c b/tests/lib/test_bt_notification_heap.c index bacce9f6..a8c1a42b 100644 --- a/tests/lib/test_bt_notification_heap.c +++ b/tests/lib/test_bt_notification_heap.c @@ -24,9 +24,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #define NR_TESTS 7