mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
Add a spa_debug_type_find_short_name method
Using the short name of a type without the base part is common enough that a common utility method is warranted. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
This commit is contained in:
parent
8b874a9514
commit
634a9558e4
1 changed files with 14 additions and 0 deletions
|
|
@ -57,6 +57,20 @@ static inline const char *spa_debug_type_find_name(const struct spa_type_info *i
|
|||
return info->name;
|
||||
}
|
||||
|
||||
static inline const char *spa_debug_type_find_short_name(const struct spa_type_info *info, uint32_t type)
|
||||
{
|
||||
const char *str, *h;
|
||||
|
||||
str = spa_debug_type_find_name(info, type);
|
||||
if (!str)
|
||||
return NULL;
|
||||
|
||||
h = rindex(str, ':');
|
||||
if (h)
|
||||
str = h + 1;
|
||||
return str;
|
||||
}
|
||||
|
||||
static inline uint32_t spa_debug_type_find_type(const struct spa_type_info *info, const char *name)
|
||||
{
|
||||
if (info == NULL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue