]>
Commit | Line | Data |
---|---|---|
3d36b5d7 YW |
1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
2 | #pragma once | |
3 | ||
56b7f112 YW |
4 | #include <sys/stat.h> |
5 | ||
3d36b5d7 | 6 | #include "locale-util.h" |
3d36b5d7 YW |
7 | |
8 | typedef struct LocaleContext { | |
56b7f112 | 9 | struct stat st; |
3d36b5d7 YW |
10 | char *locale[_VARIABLE_LC_MAX]; |
11 | } LocaleContext; | |
12 | ||
13 | typedef enum LocaleLoadFlag { | |
14 | LOCALE_LOAD_PROC_CMDLINE = 1 << 0, | |
15 | LOCALE_LOAD_LOCALE_CONF = 1 << 1, | |
16 | LOCALE_LOAD_ENVIRONMENT = 1 << 2, | |
17 | LOCALE_LOAD_SIMPLIFY = 1 << 3, | |
18 | } LocaleLoadFlag; | |
19 | ||
20 | void locale_context_clear(LocaleContext *c); | |
21 | int locale_context_load(LocaleContext *c, LocaleLoadFlag flag); | |
22 | int locale_context_build_env(const LocaleContext *c, char ***ret_set, char ***ret_unset); | |
23 | int locale_context_save(LocaleContext *c, char ***ret_set, char ***ret_unset); | |
24 | ||
25 | int locale_context_merge(const LocaleContext *c, char *l[_VARIABLE_LC_MAX]); | |
26 | void locale_context_take(LocaleContext *c, char *l[_VARIABLE_LC_MAX]); | |
27 | bool locale_context_equal(const LocaleContext *c, char *l[_VARIABLE_LC_MAX]); | |
28 | ||
29 | int locale_setup(char ***environment); |