OSDN Git Service

openat*: use a static function with the different type and strong_alias_untyped
[uclinux-h8/uClibc.git] / include / libintl.h
1 /* Message catalogs for internationalization.
2    Copyright (C) 1995-2002, 2004, 2005 Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
4    This file is derived from the file libgettext.h in the GNU gettext package.
5
6    The GNU C Library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10
11    The GNU C Library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser General Public
17    License along with the GNU C Library; if not, write to the Free
18    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19    02111-1307 USA.  */
20
21 #ifndef _LIBINTL_H
22 #define _LIBINTL_H      1
23
24 #include <features.h>
25
26 #ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
27
28 /* We define an additional symbol to signal that we use the GNU
29    implementation of gettext.  */
30 #define __USE_GNU_GETTEXT 1
31
32 /* Provide information about the supported file formats.  Returns the
33    maximum minor revision number supported for a given major revision.  */
34 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
35   ((major) == 0 ? 1 : -1)
36
37 __BEGIN_DECLS
38
39 /* Look up MSGID in the current default message catalog for the current
40    LC_MESSAGES locale.  If not found, returns MSGID itself (the default
41    text).  */
42 extern char *gettext (__const char *__msgid)
43      __THROW __attribute_format_arg__ (1);
44
45 /* Look up MSGID in the DOMAINNAME message catalog for the current
46    LC_MESSAGES locale.  */
47 extern char *dgettext (__const char *__domainname, __const char *__msgid)
48      __THROW __attribute_format_arg__ (2);
49 #if 0 /* uClibc: disabled */
50 extern char *__dgettext (__const char *__domainname, __const char *__msgid)
51      __THROW __attribute_format_arg__ (2);
52 #endif
53
54 /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
55    locale.  */
56 extern char *dcgettext (__const char *__domainname,
57                         __const char *__msgid, int __category)
58      __THROW __attribute_format_arg__ (2);
59 #if 0 /* uClibc: disabled */
60 extern char *__dcgettext (__const char *__domainname,
61                           __const char *__msgid, int __category)
62      __THROW __attribute_format_arg__ (2);
63 #endif
64
65
66 /* Similar to `gettext' but select the plural form corresponding to the
67    number N.  */
68 extern char *ngettext (__const char *__msgid1, __const char *__msgid2,
69                        unsigned long int __n)
70      __THROW __attribute_format_arg__ (1) __attribute_format_arg__ (2);
71
72 /* Similar to `dgettext' but select the plural form corresponding to the
73    number N.  */
74 extern char *dngettext (__const char *__domainname, __const char *__msgid1,
75                         __const char *__msgid2, unsigned long int __n)
76      __THROW __attribute_format_arg__ (2) __attribute_format_arg__ (3);
77
78 /* Similar to `dcgettext' but select the plural form corresponding to the
79    number N.  */
80 extern char *dcngettext (__const char *__domainname, __const char *__msgid1,
81                          __const char *__msgid2, unsigned long int __n,
82                          int __category)
83      __THROW __attribute_format_arg__ (2) __attribute_format_arg__ (3);
84
85
86 /* Set the current default message catalog to DOMAINNAME.
87    If DOMAINNAME is null, return the current default.
88    If DOMAINNAME is "", reset to the default of "messages".  */
89 extern char *textdomain (__const char *__domainname) __THROW;
90
91 /* Specify that the DOMAINNAME message catalog will be found
92    in DIRNAME rather than in the system locale data base.  */
93 extern char *bindtextdomain (__const char *__domainname,
94                              __const char *__dirname) __THROW;
95
96 /* Specify the character encoding in which the messages from the
97    DOMAINNAME message catalog will be returned.  */
98 extern char *bind_textdomain_codeset (__const char *__domainname,
99                                       __const char *__codeset) __THROW;
100
101
102 /* Optimized version of the function above.  */
103 #if defined __OPTIMIZE__ && !defined __cplusplus
104
105 /* We need NULL for `gettext'.  */
106 # define __need_NULL
107 # include <stddef.h>
108
109 /* We need LC_MESSAGES for `dgettext'.  */
110 # include <locale.h>
111
112 /* These must be macros.  Inlined functions are useless because the
113    `__builtin_constant_p' predicate in dcgettext would always return
114    false.  */
115
116 # define gettext(msgid) dgettext (NULL, msgid)
117
118 # define dgettext(domainname, msgid) \
119   dcgettext (domainname, msgid, LC_MESSAGES)
120
121 # define ngettext(msgid1, msgid2, n) dngettext (NULL, msgid1, msgid2, n)
122
123 # define dngettext(domainname, msgid1, msgid2, n) \
124   dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES)
125
126 #endif  /* Optimizing.  */
127
128 __END_DECLS
129
130 #else
131
132 #define gettext(msgid) ((const char *) (msgid))
133
134 #endif /* __UCLIBC_HAS_GETTEXT_AWARENESS__ */
135
136 #ifdef _LIBC
137 # define _(x) gettext(x)
138 # define N_(x) x
139 #endif
140
141 #endif /* libintl.h */