diff options
author | Wim Taymans <wtaymans@redhat.com> | 2016-10-14 10:32:11 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2016-10-14 10:32:11 +0200 |
commit | d79489b29b9c3be5357b551ef34c5831e596d457 (patch) | |
tree | 11ec7708db8e29a040dc3b6a94d90116a159d0e4 | |
parent | 523868d6bd4678aef88401df6e078b2182f44932 (diff) |
use a dict for extra property info
A dictionary is probably more extensible
-rw-r--r-- | spa/include/spa/props.h | 5 | ||||
-rw-r--r-- | spa/lib/debug.c | 12 |
2 files changed, 7 insertions, 10 deletions
diff --git a/spa/include/spa/props.h b/spa/include/spa/props.h index 3a871292..71be620d 100644 --- a/spa/include/spa/props.h +++ b/spa/include/spa/props.h @@ -31,6 +31,7 @@ typedef struct _SpaProps SpaProps; #include <string.h> #include <spa/defs.h> +#include <spa/dict.h> /** * SpaPropType: @@ -135,7 +136,7 @@ typedef struct { * @range_type: type of the range values * @n_range_values: number of elements in @range_values * @range_values: array of possible values - * @tags: extra tags, NULL terminated + * @info: extra info */ typedef struct { uint32_t id; @@ -147,7 +148,7 @@ typedef struct { SpaPropRangeType range_type; unsigned int n_range_values; const SpaPropRangeInfo *range_values; - const char **tags; + SpaDict *info; } SpaPropInfo; /** diff --git a/spa/lib/debug.c b/spa/lib/debug.c index 45da1c7c..2cad5ac3 100644 --- a/spa/lib/debug.c +++ b/spa/lib/debug.c @@ -377,8 +377,7 @@ spa_debug_props (const SpaProps *props, bool print_ranges) info = &props->prop_info[i]; - fprintf (stderr, " %-20s\n", info->name); - fprintf (stderr, "%-23.23s flags: ", ""); + fprintf (stderr, " %-20s flags: ", info->name); if (info->flags & SPA_PROP_FLAG_READABLE) fprintf (stderr, "readable "); if (info->flags & SPA_PROP_FLAG_WRITABLE) @@ -433,12 +432,9 @@ spa_debug_props (const SpaProps *props, bool print_ranges) fprintf (stderr, "\t: %-12s\n", rinfo->name); } } - if (info->tags) { - fprintf (stderr, "Tags: "); - for (j = 0; info->tags[j]; j++) { - fprintf (stderr, "\"%s\" ", info->tags[j]); - } - fprintf (stderr, "\n"); + if (info->info) { + fprintf (stderr, "Info: \n"); + spa_debug_dict (info->info); } } return SPA_RESULT_OK; |