Move bt_message_type_string to common
[babeltrace.git] / src / lib / graph / message / message.h
index 87fd49a6b75aff5cce61dba27fe638d53bf0b912..791ac9aeb08815bda876ea0e8f319cb4157a93d5 100644 (file)
@@ -39,24 +39,6 @@ struct bt_message {
        struct bt_graph *graph;
 };
 
-#define _BT_ASSERT_PRE_MSG_IS_TYPE_COND(_msg, _type)                   \
-       (((struct bt_message *) (_msg))->type == (_type))
-
-#define _BT_ASSERT_PRE_MSG_IS_TYPE_FMT                                 \
-       "Message has the wrong type: expected-type=%s, %![msg-]+n"
-
-#define BT_ASSERT_PRE_MSG_IS_TYPE(_msg, _type)                         \
-       BT_ASSERT_PRE(                                                  \
-               _BT_ASSERT_PRE_MSG_IS_TYPE_COND((_msg), (_type)),       \
-               _BT_ASSERT_PRE_MSG_IS_TYPE_FMT,                         \
-               bt_message_type_string(_type), (_msg))
-
-#define BT_ASSERT_PRE_DEV_MSG_IS_TYPE(_msg, _type)                     \
-       BT_ASSERT_PRE_DEV(                                              \
-               _BT_ASSERT_PRE_MSG_IS_TYPE_COND((_msg), (_type)),       \
-               _BT_ASSERT_PRE_MSG_IS_TYPE_FMT,                         \
-               bt_message_type_string(_type), (_msg))
-
 BT_HIDDEN
 void bt_message_init(struct bt_message *message,
                enum bt_message_type type,
@@ -113,27 +95,4 @@ void bt_message_unlink_graph(struct bt_message *msg);
 # define bt_message_freeze(_x)
 #endif /* BT_DEV_MODE */
 
-static inline
-const char *bt_message_type_string(enum bt_message_type type)
-{
-       switch (type) {
-       case BT_MESSAGE_TYPE_EVENT:
-               return "EVENT";
-       case BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY:
-               return "MESSAGE_ITERATOR_INACTIVITY";
-       case BT_MESSAGE_TYPE_STREAM_BEGINNING:
-               return "STREAM_BEGINNING";
-       case BT_MESSAGE_TYPE_STREAM_END:
-               return "STREAM_END";
-       case BT_MESSAGE_TYPE_PACKET_BEGINNING:
-               return "PACKET_BEGINNING";
-       case BT_MESSAGE_TYPE_PACKET_END:
-               return "PACKET_END";
-       case BT_MESSAGE_TYPE_DISCARDED_EVENTS:
-               return "DISCARDED_EVENTS";
-       default:
-               return "(unknown)";
-       }
-}
-
 #endif /* BABELTRACE_GRAPH_MESSAGE_MESSAGE_INTERNAL_H */
This page took 0.024568 seconds and 4 git commands to generate.