mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-24 07:00:05 -05:00
pipewire: add functions to get and set textdomain
This commit is contained in:
parent
d44955a199
commit
646842098c
2 changed files with 22 additions and 1 deletions
|
|
@ -75,7 +75,7 @@ struct support {
|
|||
const char *plugin_dir;
|
||||
const char *support_lib;
|
||||
struct registry *registry;
|
||||
const char *i18n_domain;
|
||||
char *i18n_domain;
|
||||
struct spa_interface i18n_iface;
|
||||
struct spa_support support[MAX_SUPPORT];
|
||||
uint32_t n_support;
|
||||
|
|
@ -345,6 +345,24 @@ static void *add_interface(struct support *support,
|
|||
return iface;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pw_set_domain(const char *domain)
|
||||
{
|
||||
struct support *support = &global_support;
|
||||
free(support->i18n_domain);
|
||||
if (domain == NULL)
|
||||
support->i18n_domain = NULL;
|
||||
else if ((support->i18n_domain = strdup(domain)) == NULL)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
SPA_EXPORT
|
||||
const char *pw_get_domain(void)
|
||||
{
|
||||
struct support *support = &global_support;
|
||||
return support->i18n_domain;
|
||||
}
|
||||
|
||||
static const char *i18n_text(void *object, const char *msgid)
|
||||
{
|
||||
struct support *support = object;
|
||||
|
|
|
|||
|
|
@ -141,6 +141,9 @@ bool pw_in_valgrind(void);
|
|||
enum pw_direction
|
||||
pw_direction_reverse(enum pw_direction direction);
|
||||
|
||||
int pw_set_domain(const char *domain);
|
||||
const char *pw_get_domain(void);
|
||||
|
||||
uint32_t pw_get_support(struct spa_support *support, uint32_t max_support);
|
||||
|
||||
struct spa_handle *pw_load_spa_handle(const char *lib,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue