Add bt_self_message_iterator_status_string() function
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Mon, 17 Dec 2018 16:53:14 +0000 (11:53 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:37 +0000 (18:19 -0400)
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
include/babeltrace/common-internal.h

index e24762a03cb9141d50ab46557704cc2f1cd75652..f17cdff906ccbd40ce5798d7a6505436dba4ea0d 100644 (file)
@@ -30,6 +30,7 @@
 #include <babeltrace/trace-ir/field-class-const.h>
 #include <babeltrace/trace-ir/field-path-const.h>
 #include <babeltrace/trace-ir/event-class-const.h>
+#include <babeltrace/graph/self-message-iterator.h>
 #include <babeltrace/value.h>
 #include <stdarg.h>
 #include <inttypes.h>
@@ -456,4 +457,24 @@ end:
        return str;
 }
 
+static inline
+const char *bt_self_message_iterator_status_string(
+               enum bt_self_message_iterator_status status)
+{
+       switch (status) {
+       case BT_SELF_MESSAGE_ITERATOR_STATUS_AGAIN:
+               return "BT_SELF_MESSAGE_ITERATOR_STATUS_AGAIN";
+       case BT_SELF_MESSAGE_ITERATOR_STATUS_END:
+               return "BT_SELF_MESSAGE_ITERATOR_STATUS_END";
+       case BT_SELF_MESSAGE_ITERATOR_STATUS_OK:
+               return "BT_SELF_MESSAGE_ITERATOR_STATUS_OK";
+       case BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR:
+               return "BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR";
+       case BT_SELF_MESSAGE_ITERATOR_STATUS_NOMEM:
+               return "BT_SELF_MESSAGE_ITERATOR_STATUS_NOMEM";
+       default:
+               return "(unknown)";
+       }
+};
+
 #endif /* BABELTRACE_COMMON_INTERNAL_H */
This page took 0.025087 seconds and 4 git commands to generate.