]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/locale-util.h
systemd-firstboot: add vconsole keymap support (#7035)
[thirdparty/systemd.git] / src / basic / locale-util.h
1 #pragma once
2
3 /***
4 This file is part of systemd.
5
6 Copyright 2014 Lennart Poettering
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 ***/
21
22 #include <libintl.h>
23 #include <stdbool.h>
24
25 #include "macro.h"
26
27 typedef enum LocaleVariable {
28 /* We don't list LC_ALL here on purpose. People should be
29 * using LANG instead. */
30
31 VARIABLE_LANG,
32 VARIABLE_LANGUAGE,
33 VARIABLE_LC_CTYPE,
34 VARIABLE_LC_NUMERIC,
35 VARIABLE_LC_TIME,
36 VARIABLE_LC_COLLATE,
37 VARIABLE_LC_MONETARY,
38 VARIABLE_LC_MESSAGES,
39 VARIABLE_LC_PAPER,
40 VARIABLE_LC_NAME,
41 VARIABLE_LC_ADDRESS,
42 VARIABLE_LC_TELEPHONE,
43 VARIABLE_LC_MEASUREMENT,
44 VARIABLE_LC_IDENTIFICATION,
45 _VARIABLE_LC_MAX,
46 _VARIABLE_LC_INVALID = -1
47 } LocaleVariable;
48
49 int get_locales(char ***l);
50 bool locale_is_valid(const char *name);
51
52 #define _(String) gettext(String)
53 #define N_(String) String
54 void init_gettext(void);
55
56 bool is_locale_utf8(void);
57
58 typedef enum {
59 TREE_VERTICAL,
60 TREE_BRANCH,
61 TREE_RIGHT,
62 TREE_SPACE,
63 TRIANGULAR_BULLET,
64 BLACK_CIRCLE,
65 ARROW,
66 MDASH,
67 _SPECIAL_GLYPH_MAX
68 } SpecialGlyph;
69
70 const char *special_glyph(SpecialGlyph code) _const_;
71
72 const char* locale_variable_to_string(LocaleVariable i) _const_;
73 LocaleVariable locale_variable_from_string(const char *s) _pure_;
74
75 int get_keymaps(char ***l);
76 bool keymap_is_valid(const char *name);