Line data Source code
1 : /* i18n.h
2 : * Copyright (C) 1998, 2001 Free Software Foundation, Inc.
3 : *
4 : * This file is free software; as a special exception the author gives
5 : * unlimited permission to copy and/or distribute it, with or without
6 : * modifications, as long as this notice is preserved.
7 : *
8 : * This file is distributed in the hope that it will be useful, but
9 : * WITHOUT ANY WARRANTY, to the extent permitted by law; without even
10 : * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 : * PURPOSE.
12 : */
13 :
14 : #ifndef GNUPG_COMMON_I18N_H
15 : #define GNUPG_COMMON_I18N_H
16 :
17 :
18 : #ifdef USE_SIMPLE_GETTEXT
19 : # include "../common/w32help.h"
20 : # define _(a) gettext (a)
21 : # define N_(a) (a)
22 : #else
23 : # ifdef HAVE_LOCALE_H
24 : # include <locale.h>
25 : # endif
26 : # ifdef ENABLE_NLS
27 : # include <libintl.h>
28 : # define _(a) gettext (a)
29 : # ifdef gettext_noop
30 : # define N_(a) gettext_noop (a)
31 : # else
32 : # define N_(a) (a)
33 : # endif
34 : # else
35 : # define _(a) (a)
36 : # define N_(a) (a)
37 : # define ngettext(a,b,c) ((c)==1? (a):(b))
38 : # endif
39 : #endif /*!USE_SIMPLE_GETTEXT*/
40 :
41 : #ifndef GNUPG_GCC_ATTR_FORMAT_ARG
42 : #if __GNUC__ >= 3 /* Actually 2.8 but testing the major is easier. */
43 : # define GNUPG_GCC_ATTR_FORMAT_ARG(a) __attribute__ ((__format_arg__ (a)))
44 : #else
45 : # define GNUPG_GCC_ATTR_FORMAT_ARG(a)
46 : #endif
47 : #endif
48 :
49 : void i18n_init (void);
50 : char *i18n_switchto_utf8 (void);
51 : void i18n_switchback (char *saved_codeset);
52 : const char *i18n_utf8 (const char *string);
53 : const char *i18n_localegettext (const char *lc_messages, const char *string)
54 : GNUPG_GCC_ATTR_FORMAT_ARG(2);
55 :
56 : /* If a module wants a local L_() function we define it here. */
57 : #ifdef LunderscoreIMPL
58 : LunderscorePROTO
59 107 : LunderscoreIMPL
60 : #endif
61 :
62 :
63 : #endif /*GNUPG_COMMON_I18N_H*/
|