From aec07d974edb8416a44805e0f9149b2042b3ce43 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 18 Mar 2024 11:41:01 +0100 Subject: [PATCH] acp: move acp_dict_lookup to public header --- spa/plugins/alsa/acp/acp.c | 10 ---------- spa/plugins/alsa/acp/acp.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spa/plugins/alsa/acp/acp.c b/spa/plugins/alsa/acp/acp.c index 3c814da86..93a68ab4c 100644 --- a/spa/plugins/alsa/acp/acp.c +++ b/spa/plugins/alsa/acp/acp.c @@ -1625,16 +1625,6 @@ static void prune_singleton_availability_groups(pa_hashmap *ports) { pa_hashmap_free(group_counts); } -static const char *acp_dict_lookup(const struct acp_dict *dict, const char *key) -{ - const struct acp_dict_item *it; - acp_dict_for_each(it, dict) { - if (spa_streq(key, it->key)) - return it->value; - } - return NULL; -} - struct acp_card *acp_card_new(uint32_t index, const struct acp_dict *props) { pa_card *impl; diff --git a/spa/plugins/alsa/acp/acp.h b/spa/plugins/alsa/acp/acp.h index cc6429b22..fadf78538 100644 --- a/spa/plugins/alsa/acp/acp.h +++ b/spa/plugins/alsa/acp/acp.h @@ -15,6 +15,7 @@ extern "C" { #include #include #include +#include #ifdef __GNUC__ #define ACP_PRINTF_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1))) @@ -103,6 +104,15 @@ struct acp_format { (item) < &(dict)->items[(dict)->n_items]; \ (item)++) +static inline const char *acp_dict_lookup(const struct acp_dict *dict, const char *key) +{ + const struct acp_dict_item *it; + acp_dict_for_each(it, dict) + if (strcmp(key, it->key) == 0) + return it->value; + return NULL; +} + enum acp_direction { ACP_DIRECTION_PLAYBACK = 1, ACP_DIRECTION_CAPTURE = 2