Move bt_{self_component,message_iterator}_status_string() to `common.h`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 15 Jun 2019 06:29:58 +0000 (02:29 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 20 Jun 2019 18:01:16 +0000 (14:01 -0400)
Now `muxer.c` does not include internal library headers.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I33a9cf2db3df6a8d06d385f352280d90a922c4d9
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1465
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/common/common.h
src/lib/graph/component.h
src/lib/graph/graph.h
src/lib/graph/message/iterator.h
src/plugins/utils/muxer/muxer.c

index 8ac995358bf7d746977ebef36fa677a2e546d26c..31448a45d09ce77921052a9715ba535bc92f4e4e 100644 (file)
@@ -37,6 +37,8 @@
 #include <babeltrace2/trace-ir/event-class-const.h>
 #include <babeltrace2/trace-ir/field-class-const.h>
 #include <babeltrace2/trace-ir/field-path-const.h>
+#include <babeltrace2/graph/self-component.h>
+#include <babeltrace2/graph/message-iterator-const.h>
 #include <babeltrace2/logging.h>
 #include <babeltrace2/value.h>
 
@@ -590,6 +592,48 @@ const char *bt_common_logging_level_string(
        }
 };
 
+static inline
+const char *bt_self_component_status_string(
+               enum bt_self_component_status status)
+{
+       switch (status) {
+       case BT_SELF_COMPONENT_STATUS_OK:
+               return "BT_SELF_COMPONENT_STATUS_OK";
+       case BT_SELF_COMPONENT_STATUS_END:
+               return "BT_SELF_COMPONENT_STATUS_END";
+       case BT_SELF_COMPONENT_STATUS_AGAIN:
+               return "BT_SELF_COMPONENT_STATUS_AGAIN";
+       case BT_SELF_COMPONENT_STATUS_REFUSE_PORT_CONNECTION:
+               return "BT_SELF_COMPONENT_STATUS_REFUSE_PORT_CONNECTION";
+       case BT_SELF_COMPONENT_STATUS_ERROR:
+               return "BT_SELF_COMPONENT_STATUS_ERROR";
+       case BT_SELF_COMPONENT_STATUS_NOMEM:
+               return "BT_SELF_COMPONENT_STATUS_NOMEM";
+       default:
+               return "(unknown)";
+       }
+}
+
+static inline
+const char *bt_message_iterator_status_string(
+               enum bt_message_iterator_status status)
+{
+       switch (status) {
+       case BT_MESSAGE_ITERATOR_STATUS_AGAIN:
+               return "BT_MESSAGE_ITERATOR_STATUS_AGAIN";
+       case BT_MESSAGE_ITERATOR_STATUS_END:
+               return "BT_MESSAGE_ITERATOR_STATUS_END";
+       case BT_MESSAGE_ITERATOR_STATUS_OK:
+               return "BT_MESSAGE_ITERATOR_STATUS_OK";
+       case BT_MESSAGE_ITERATOR_STATUS_ERROR:
+               return "BT_MESSAGE_ITERATOR_STATUS_ERROR";
+       case BT_MESSAGE_ITERATOR_STATUS_NOMEM:
+               return "BT_MESSAGE_ITERATOR_STATUS_NOMEM";
+       default:
+               return "(unknown)";
+       }
+}
+
 #define NS_PER_S_I     INT64_C(1000000000)
 #define NS_PER_S_U     UINT64_C(1000000000)
 
index 2155d5da203ca6bcbf5acb0edee384c440dae7fa..accd5d1ffa5a34ecb4a476defc1a032a6db70f43 100644 (file)
@@ -141,26 +141,4 @@ BT_HIDDEN
 void bt_component_remove_destroy_listener(struct bt_component *component,
                bt_component_destroy_listener_func func, void *data);
 
-static inline
-const char *bt_self_component_status_string(
-               enum bt_self_component_status status)
-{
-       switch (status) {
-       case BT_SELF_COMPONENT_STATUS_OK:
-               return "BT_SELF_COMPONENT_STATUS_OK";
-       case BT_SELF_COMPONENT_STATUS_END:
-               return "BT_SELF_COMPONENT_STATUS_END";
-       case BT_SELF_COMPONENT_STATUS_AGAIN:
-               return "BT_SELF_COMPONENT_STATUS_AGAIN";
-       case BT_SELF_COMPONENT_STATUS_REFUSE_PORT_CONNECTION:
-               return "BT_SELF_COMPONENT_STATUS_REFUSE_PORT_CONNECTION";
-       case BT_SELF_COMPONENT_STATUS_ERROR:
-               return "BT_SELF_COMPONENT_STATUS_ERROR";
-       case BT_SELF_COMPONENT_STATUS_NOMEM:
-               return "BT_SELF_COMPONENT_STATUS_NOMEM";
-       default:
-               return "(unknown)";
-       }
-}
-
 #endif /* BABELTRACE_GRAPH_COMPONENT_INTERNAL_H */
index e108d508c0661ccd89c1ded1ae508a0e082fa9a0..d2ce47ad6ae94e37b09500f8d31175a5d418c7f0 100644 (file)
@@ -30,6 +30,7 @@
 #include "lib/object.h"
 #include "lib/object-pool.h"
 #include "common/assert.h"
+#include "common/common.h"
 #include <stdlib.h>
 #include <glib.h>
 
index 475abf555cc40d7a8e391976dc6173f64d4c503e..2c442a15db749f2ca4ff5610684806cf8b7d0b93 100644 (file)
@@ -137,26 +137,6 @@ void bt_self_component_port_input_message_iterator_set_connection(
                struct bt_self_component_port_input_message_iterator *iterator,
                struct bt_connection *connection);
 
-static inline
-const char *bt_message_iterator_status_string(
-               enum bt_message_iterator_status status)
-{
-       switch (status) {
-       case BT_MESSAGE_ITERATOR_STATUS_AGAIN:
-               return "BT_MESSAGE_ITERATOR_STATUS_AGAIN";
-       case BT_MESSAGE_ITERATOR_STATUS_END:
-               return "BT_MESSAGE_ITERATOR_STATUS_END";
-       case BT_MESSAGE_ITERATOR_STATUS_OK:
-               return "BT_MESSAGE_ITERATOR_STATUS_OK";
-       case BT_MESSAGE_ITERATOR_STATUS_ERROR:
-               return "BT_MESSAGE_ITERATOR_STATUS_ERROR";
-       case BT_MESSAGE_ITERATOR_STATUS_NOMEM:
-               return "BT_MESSAGE_ITERATOR_STATUS_NOMEM";
-       default:
-               return "(unknown)";
-       }
-};
-
 static inline
 const char *bt_self_component_port_input_message_iterator_state_string(
                enum bt_self_component_port_input_message_iterator_state state)
index 9c48a7606f6140fb8adbd84848bc8b451c8d8fd3..90d692f2742d66fabedf87a70449ae990ed0387d 100644 (file)
 #include "common/macros.h"
 #include "compat/uuid.h"
 #include <babeltrace2/babeltrace.h>
-#include "lib/value.h"
-#include "lib/graph/component.h"
-#include "lib/graph/message/iterator.h"
-#include "lib/graph/connection.h"
 #include <glib.h>
 #include <stdbool.h>
 #include <inttypes.h>
This page took 0.027491 seconds and 4 git commands to generate.