]> git.draconx.ca Git - cdecl99.git/blob - src/cdecl-internal.h
Make library i18n init conditional on NLS support.
[cdecl99.git] / src / cdecl-internal.h
1 /*
2  * Internal declarations for libcdecl.
3  * Copyright © 2021 Nick Bowler
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17  */
18 #ifndef CDECL_INTERNAL_H_
19 #define CDECL_INTERNAL_H_
20
21 #include <stddef.h>
22 #include <gettext.h>
23
24 #define _(s) dgettext(PACKAGE, s)
25 #define N_(s) s
26
27 struct cdecl_error;
28 struct cdecl_declspec;
29
30 #if ENABLE_NLS
31 void cdecl__init_i18n(void);
32 #else
33 static inline void cdecl__init_i18n(void)
34 {
35 }
36 #endif
37
38 const char *cdecl__strerror(unsigned code);
39 void cdecl__err(unsigned code, ...);
40
41 unsigned long cdecl__build_typemap(struct cdecl_declspec *s);
42 struct cdecl_declspec *cdecl__normalize_specs(struct cdecl_declspec *specs);
43
44 size_t cdecl__advance_(char **buf, size_t *n, size_t amount);
45 size_t cdecl__advance(char **buf, size_t *n, size_t amount);
46 size_t cdecl__explain_specs(char *buf, size_t n, struct cdecl_declspec *s,
47                                                  unsigned mask);
48 size_t cdecl__explain_pre_specs(char *buf, size_t n, struct cdecl_declspec *s);
49 size_t cdecl__explain_post_specs(char *buf, size_t n, struct cdecl_declspec *s);
50
51 #endif