pipewire/src/modules/module-protocol-pulse/remap.h
Barnabás Pőcze 934ab3036e treewide: use SPDX tags to specify copyright information
SPDX tags make the licensing information easy to understand and clear,
and they are machine parseable.

See https://spdx.dev for more information.
2023-02-16 10:54:48 +00:00

32 lines
722 B
C

/* PipeWire */
/* SPDX-FileCopyrightText: Copyright © 2020 Wim Taymans */
/* SPDX-License-Identifier: MIT */
#ifndef PULSE_SERVER_REMAP_H
#define PULSE_SERVER_REMAP_H
#include <stddef.h>
#include <spa/utils/string.h>
struct str_map {
const char *pw_str;
const char *pa_str;
const struct str_map *child;
};
extern const struct str_map media_role_map[];
extern const struct str_map props_key_map[];
static inline const struct str_map *str_map_find(const struct str_map *map, const char *pw, const char *pa)
{
size_t i;
for (i = 0; map[i].pw_str; i++)
if ((pw && spa_streq(map[i].pw_str, pw)) ||
(pa && spa_streq(map[i].pa_str, pa)))
return &map[i];
return NULL;
}
#endif /* PULSE_SERVER_REMAP_H */