X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-writer%2Fvalues-internal.h;h=4cd74e1bd866eceeb94373ec3888518ae8b73284;hb=7e69c04f557e46fb50e5a888a3bc3451afbd3b8e;hp=332626f2e557044ed25babdf40f1c73e1f1f280a;hpb=e1e02a22957d83adc526c016d5d3b978b8e6d26d;p=babeltrace.git diff --git a/include/babeltrace/ctf-writer/values-internal.h b/include/babeltrace/ctf-writer/values-internal.h index 332626f2..4cd74e1b 100644 --- a/include/babeltrace/ctf-writer/values-internal.h +++ b/include/babeltrace/ctf-writer/values-internal.h @@ -52,7 +52,7 @@ enum bt_ctf_value_status _bt_ctf_value_freeze(struct bt_ctf_value *object); # define bt_ctf_value_freeze(_value) #endif /* BT_DEV_MODE */ -struct bt_ctf_value *bt_ctf_value_null; +extern struct bt_ctf_value *const bt_ctf_value_null; enum bt_ctf_value_type { /// Null value object. @@ -190,7 +190,7 @@ enum bt_ctf_value_status bt_ctf_value_map_extend( struct bt_ctf_value; struct bt_ctf_private_value; -struct bt_ctf_private_value *bt_ctf_private_value_null; +extern struct bt_ctf_private_value *const bt_ctf_private_value_null; static inline struct bt_ctf_value *bt_ctf_private_value_as_value( @@ -331,4 +331,27 @@ BT_HIDDEN enum bt_ctf_value_status bt_ctf_private_value_map_insert_empty_map_entry( struct bt_ctf_private_value *map_obj, const char *key); +static inline +const char *bt_ctf_value_type_string(enum bt_ctf_value_type type) +{ + switch (type) { + case BT_CTF_VALUE_TYPE_NULL: + return "BT_CTF_VALUE_TYPE_NULL"; + case BT_CTF_VALUE_TYPE_BOOL: + return "BT_CTF_VALUE_TYPE_BOOL"; + case BT_CTF_VALUE_TYPE_INTEGER: + return "BT_CTF_VALUE_TYPE_INTEGER"; + case BT_CTF_VALUE_TYPE_REAL: + return "BT_CTF_VALUE_TYPE_REAL"; + case BT_CTF_VALUE_TYPE_STRING: + return "BT_CTF_VALUE_TYPE_STRING"; + case BT_CTF_VALUE_TYPE_ARRAY: + return "BT_CTF_VALUE_TYPE_ARRAY"; + case BT_CTF_VALUE_TYPE_MAP: + return "BT_CTF_VALUE_TYPE_MAP"; + default: + return "(unknown)"; + } +}; + #endif /* BABELTRACE_CTF_WRITER_VALUES_INTERNAL_H */