chiark / gitweb /
core: rework how we flush incoming traffic when a socket unit goes down
[elogind.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 DrawSpecialChar {
59         DRAW_TREE_VERTICAL,
60         DRAW_TREE_BRANCH,
61         DRAW_TREE_RIGHT,
62         DRAW_TREE_SPACE,
63         DRAW_TRIANGULAR_BULLET,
64         DRAW_BLACK_CIRCLE,
65         DRAW_ARROW,
66         DRAW_DASH,
67         _DRAW_SPECIAL_CHAR_MAX
68 } DrawSpecialChar;
69
70 const char *draw_special_char(DrawSpecialChar ch);
71
72 const char* locale_variable_to_string(LocaleVariable i) _const_;
73 LocaleVariable locale_variable_from_string(const char *s) _pure_;