1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
10 typedef enum LocaleVariable
{
11 /* We don't list LC_ALL here on purpose. People should be
12 * using LANG instead. */
25 VARIABLE_LC_TELEPHONE
,
26 VARIABLE_LC_MEASUREMENT
,
27 VARIABLE_LC_IDENTIFICATION
,
29 _VARIABLE_LC_INVALID
= -EINVAL
,
32 int get_locales(char ***l
);
33 bool locale_is_valid(const char *name
);
34 int locale_is_installed(const char *name
);
36 #define _(String) dgettext(GETTEXT_PACKAGE, String)
37 #define N_(String) String
39 bool is_locale_utf8(void);
41 const char* locale_variable_to_string(LocaleVariable i
) _const_
;
42 LocaleVariable
locale_variable_from_string(const char *s
) _pure_
;
44 static inline void freelocalep(locale_t
*p
) {
45 if (*p
== (locale_t
) 0)
51 void locale_variables_free(char* l
[_VARIABLE_LC_MAX
]);
52 static inline void locale_variables_freep(char*(*l
)[_VARIABLE_LC_MAX
]) {
53 locale_variables_free(*l
);
55 void locale_variables_simplify(char *l
[_VARIABLE_LC_MAX
]);