}
static inline
-void write_bool_prop_line(struct details_write_ctx *ctx, const char *prop_name,
- bt_bool prop_value)
+void write_bool_prop_value(struct details_write_ctx *ctx, bt_bool prop_value)
{
const char *str;
- write_indent(ctx);
- write_prop_name(ctx, prop_name);
- g_string_append_printf(ctx->str, ": %s", color_bold(ctx));
+ g_string_append(ctx->str, color_bold(ctx));
if (prop_value) {
g_string_append(ctx->str, color_fg_green(ctx));
str = "No";
}
- g_string_append_printf(ctx->str, "%s%s\n", str, color_reset(ctx));
+ g_string_append_printf(ctx->str, "%s%s", str, color_reset(ctx));
+}
+
+static inline
+void write_bool_prop_line(struct details_write_ctx *ctx, const char *prop_name,
+ bt_bool prop_value)
+{
+ write_indent(ctx);
+ write_prop_name(ctx, prop_name);
+ g_string_append(ctx->str, ": ");
+ write_bool_prop_value(ctx, prop_value);
+ write_nl(ctx);
}
static inline
/* Write field class's type */
switch (fc_type) {
+ case BT_FIELD_CLASS_TYPE_BOOL:
+ type = "Boolean";
+ break;
case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER:
type = "Unsigned integer";
break;
/* Write field's value */
switch (fc_type) {
+ case BT_FIELD_CLASS_TYPE_BOOL:
+ write_sp(ctx);
+ write_bool_prop_value(ctx, bt_field_bool_get_value(field));
+ break;
case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER:
case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION:
case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER: