X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fcommon%2Fcommon.h;h=31448a45d09ce77921052a9715ba535bc92f4e4e;hb=de625d1c106f5c13b37fcbdb8304cbba3c147542;hp=8ac995358bf7d746977ebef36fa677a2e546d26c;hpb=9d87d0ead74ed4f7db76f5d1a842a3a525a792d9;p=babeltrace.git diff --git a/src/common/common.h b/src/common/common.h index 8ac99535..31448a45 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -37,6 +37,8 @@ #include #include #include +#include +#include #include #include @@ -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)