[Tizen] Add codes for Dali Windows Backend
[platform/core/uifw/dali-adaptor.git] / dali-windows-backend / ExInclude / libintl.h
1 /* Message catalogs for internationalization.\r
2    Copyright (C) 1995-1997, 2000-2010 Free Software Foundation, Inc.\r
3 \r
4    This program is free software; you can redistribute it and/or modify it\r
5    under the terms of the GNU Library General Public License as published\r
6    by the Free Software Foundation; either version 2, or (at your option)\r
7    any later version.\r
8 \r
9    This program is distributed in the hope that it will be useful,\r
10    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
12    Library General Public License for more details.\r
13 \r
14    You should have received a copy of the GNU Library General Public\r
15    License along with this program; if not, write to the Free Software\r
16    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,\r
17    USA.  */\r
18 \r
19 #ifndef _LIBINTL_H\r
20 #define _LIBINTL_H 1\r
21 \r
22 #ifdef _MSC_VER\r
23 #define inline __inline\r
24 #endif\r
25 \r
26 #include <locale.h>\r
27 #if (defined __APPLE__ && defined __MACH__) && 0\r
28 # include <xlocale.h>\r
29 #endif\r
30 \r
31 /* The LC_MESSAGES locale category is the category used by the functions\r
32    gettext() and dgettext().  It is specified in POSIX, but not in ANSI C.\r
33    On systems that don't define it, use an arbitrary value instead.\r
34    On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)\r
35    then includes <libintl.h> (i.e. this file!) and then only defines\r
36    LC_MESSAGES.  To avoid a redefinition warning, don't define LC_MESSAGES\r
37    in this case.  */\r
38 #if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))\r
39 # define LC_MESSAGES 1729\r
40 #endif\r
41 \r
42 /* We define an additional symbol to signal that we use the GNU\r
43    implementation of gettext.  */\r
44 #define __USE_GNU_GETTEXT 1\r
45 \r
46 /* Provide information about the supported file formats.  Returns the\r
47    maximum minor revision number supported for a given major revision.  */\r
48 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) \\r
49   ((major) == 0 || (major) == 1 ? 1 : -1)\r
50 \r
51 /* Resolve a platform specific conflict on DJGPP.  GNU gettext takes\r
52    precedence over _conio_gettext.  */\r
53 #ifdef __DJGPP__\r
54 # undef gettext\r
55 #endif\r
56 \r
57 #ifdef __cplusplus\r
58 extern "C" {\r
59 #endif\r
60 \r
61 \r
62 /* Version number: (major<<16) + (minor<<8) + subminor */\r
63 #define LIBINTL_VERSION 0x001200\r
64 extern int libintl_version;\r
65 \r
66 \r
67 /* We redirect the functions to those prefixed with "libintl_".  This is\r
68    necessary, because some systems define gettext/textdomain/... in the C\r
69    library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).\r
70    If we used the unprefixed names, there would be cases where the\r
71    definition in the C library would override the one in the libintl.so\r
72    shared library.  Recall that on ELF systems, the symbols are looked\r
73    up in the following order:\r
74      1. in the executable,\r
75      2. in the shared libraries specified on the link command line, in order,\r
76      3. in the dependencies of the shared libraries specified on the link\r
77         command line,\r
78      4. in the dlopen()ed shared libraries, in the order in which they were\r
79         dlopen()ed.\r
80    The definition in the C library would override the one in libintl.so if\r
81    either\r
82      * -lc is given on the link command line and -lintl isn't, or\r
83      * -lc is given on the link command line before -lintl, or\r
84      * libintl.so is a dependency of a dlopen()ed shared library but not\r
85        linked to the executable at link time.\r
86    Since Solaris gettext() behaves differently than GNU gettext(), this\r
87    would be unacceptable.\r
88 \r
89    The redirection happens by default through macros in C, so that &gettext\r
90    is independent of the compilation unit, but through inline functions in\r
91    C++, in order not to interfere with the name mangling of class fields or\r
92    class methods called 'gettext'.  */\r
93 \r
94 /* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.\r
95    If he doesn't, we choose the method.  A third possible method is\r
96    _INTL_REDIRECT_ASM, supported only by GCC.  */\r
97 #if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)\r
98 # if defined __GNUC__ && __GNUC__ >= 2 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)\r
99 #  define _INTL_REDIRECT_ASM\r
100 # else\r
101 #  ifdef __cplusplus\r
102 #   define _INTL_REDIRECT_INLINE\r
103 #  else\r
104 #   define _INTL_REDIRECT_MACROS\r
105 #  endif\r
106 # endif\r
107 #endif\r
108 /* Auxiliary macros.  */\r
109 #ifdef _INTL_REDIRECT_ASM\r
110 # define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname))\r
111 # define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring\r
112 # define _INTL_STRINGIFY(prefix) #prefix\r
113 #else\r
114 # define _INTL_ASM(cname)\r
115 #endif\r
116 \r
117 /* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return\r
118    its n-th argument literally.  This enables GCC to warn for example about\r
119    printf (gettext ("foo %y")).  */\r
120 #if defined __GNUC__ && __GNUC__ >= 3 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1 && defined __cplusplus)\r
121 # define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n)))\r
122 #else\r
123 # define _INTL_MAY_RETURN_STRING_ARG(n)\r
124 #endif\r
125 \r
126 /* Look up MSGID in the current default message catalog for the current\r
127    LC_MESSAGES locale.  If not found, returns MSGID itself (the default\r
128    text).  */\r
129 #ifdef _INTL_REDIRECT_INLINE\r
130 extern char *libintl_gettext (const char *__msgid)\r
131        _INTL_MAY_RETURN_STRING_ARG (1);\r
132 static inline char *gettext (const char *__msgid)\r
133 {\r
134   return libintl_gettext (__msgid);\r
135 }\r
136 #else\r
137 #ifdef _INTL_REDIRECT_MACROS\r
138 # define gettext libintl_gettext\r
139 #endif\r
140 extern char *gettext (const char *__msgid)\r
141        _INTL_ASM (libintl_gettext)\r
142        _INTL_MAY_RETURN_STRING_ARG (1);\r
143 #endif\r
144 \r
145 /* Look up MSGID in the DOMAINNAME message catalog for the current\r
146    LC_MESSAGES locale.  */\r
147 #ifdef _INTL_REDIRECT_INLINE\r
148 extern char *libintl_dgettext (const char *__domainname, const char *__msgid)\r
149        _INTL_MAY_RETURN_STRING_ARG (2);\r
150 static inline char *dgettext (const char *__domainname, const char *__msgid)\r
151 {\r
152   //return libintl_dgettext (__domainname, __msgid);\r
153   return NULL;\r
154 }\r
155 #else\r
156 #ifdef _INTL_REDIRECT_MACROS\r
157 # define dgettext libintl_dgettext\r
158 #endif\r
159 extern char *dgettext (const char *__domainname, const char *__msgid)\r
160        _INTL_ASM (libintl_dgettext)\r
161        _INTL_MAY_RETURN_STRING_ARG (2);\r
162 #endif\r
163 \r
164 /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY\r
165    locale.  */\r
166 #ifdef _INTL_REDIRECT_INLINE\r
167 extern char *libintl_dcgettext (const char *__domainname, const char *__msgid,\r
168                                 int __category)\r
169        _INTL_MAY_RETURN_STRING_ARG (2);\r
170 static inline char *dcgettext (const char *__domainname, const char *__msgid,\r
171                                int __category)\r
172 {\r
173   return libintl_dcgettext (__domainname, __msgid, __category);\r
174 }\r
175 #else\r
176 #ifdef _INTL_REDIRECT_MACROS\r
177 # define dcgettext libintl_dcgettext\r
178 #endif\r
179 extern char *dcgettext (const char *__domainname, const char *__msgid,\r
180                         int __category)\r
181        _INTL_ASM (libintl_dcgettext)\r
182        _INTL_MAY_RETURN_STRING_ARG (2);\r
183 #endif\r
184 \r
185 \r
186 /* Similar to `gettext' but select the plural form corresponding to the\r
187    number N.  */\r
188 #ifdef _INTL_REDIRECT_INLINE\r
189 extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2,\r
190                                unsigned long int __n)\r
191        _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);\r
192 static inline char *ngettext (const char *__msgid1, const char *__msgid2,\r
193                               unsigned long int __n)\r
194 {\r
195   return libintl_ngettext (__msgid1, __msgid2, __n);\r
196 }\r
197 #else\r
198 #ifdef _INTL_REDIRECT_MACROS\r
199 # define ngettext libintl_ngettext\r
200 #endif\r
201 extern char *ngettext (const char *__msgid1, const char *__msgid2,\r
202                        unsigned long int __n)\r
203        _INTL_ASM (libintl_ngettext)\r
204        _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);\r
205 #endif\r
206 \r
207 /* Similar to `dgettext' but select the plural form corresponding to the\r
208    number N.  */\r
209 #ifdef _INTL_REDIRECT_INLINE\r
210 extern char *libintl_dngettext (const char *__domainname, const char *__msgid1,\r
211                                 const char *__msgid2, unsigned long int __n)\r
212        _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);\r
213 static inline char *dngettext (const char *__domainname, const char *__msgid1,\r
214                                const char *__msgid2, unsigned long int __n)\r
215 {\r
216   return libintl_dngettext (__domainname, __msgid1, __msgid2, __n);\r
217 }\r
218 #else\r
219 #ifdef _INTL_REDIRECT_MACROS\r
220 # define dngettext libintl_dngettext\r
221 #endif\r
222 extern char *dngettext (const char *__domainname,\r
223                         const char *__msgid1, const char *__msgid2,\r
224                         unsigned long int __n)\r
225        _INTL_ASM (libintl_dngettext)\r
226        _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);\r
227 #endif\r
228 \r
229 /* Similar to `dcgettext' but select the plural form corresponding to the\r
230    number N.  */\r
231 #ifdef _INTL_REDIRECT_INLINE\r
232 extern char *libintl_dcngettext (const char *__domainname,\r
233                                  const char *__msgid1, const char *__msgid2,\r
234                                  unsigned long int __n, int __category)\r
235        _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);\r
236 static inline char *dcngettext (const char *__domainname,\r
237                                 const char *__msgid1, const char *__msgid2,\r
238                                 unsigned long int __n, int __category)\r
239 {\r
240   return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category);\r
241 }\r
242 #else\r
243 #ifdef _INTL_REDIRECT_MACROS\r
244 # define dcngettext libintl_dcngettext\r
245 #endif\r
246 extern char *dcngettext (const char *__domainname,\r
247                          const char *__msgid1, const char *__msgid2,\r
248                          unsigned long int __n, int __category)\r
249        _INTL_ASM (libintl_dcngettext)\r
250        _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);\r
251 #endif\r
252 \r
253 \r
254 #ifndef IN_LIBGLOCALE\r
255 \r
256 /* Set the current default message catalog to DOMAINNAME.\r
257    If DOMAINNAME is null, return the current default.\r
258    If DOMAINNAME is "", reset to the default of "messages".  */\r
259 #ifdef _INTL_REDIRECT_INLINE\r
260 extern char *libintl_textdomain (const char *__domainname);\r
261 static inline char *textdomain (const char *__domainname)\r
262 {\r
263   return libintl_textdomain (__domainname);\r
264 }\r
265 #else\r
266 #ifdef _INTL_REDIRECT_MACROS\r
267 # define textdomain libintl_textdomain\r
268 #endif\r
269 extern char *textdomain (const char *__domainname)\r
270        _INTL_ASM (libintl_textdomain);\r
271 #endif\r
272 \r
273 /* Specify that the DOMAINNAME message catalog will be found\r
274    in DIRNAME rather than in the system locale data base.  */\r
275 #ifdef _INTL_REDIRECT_INLINE\r
276 extern char *libintl_bindtextdomain (const char *__domainname,\r
277                                      const char *__dirname);\r
278 static inline char *bindtextdomain (const char *__domainname,\r
279                                     const char *__dirname)\r
280 {\r
281   return libintl_bindtextdomain (__domainname, __dirname);\r
282 }\r
283 #else\r
284 #ifdef _INTL_REDIRECT_MACROS\r
285 # define bindtextdomain libintl_bindtextdomain\r
286 #endif\r
287 extern char *bindtextdomain (const char *__domainname, const char *__dirname)\r
288        _INTL_ASM (libintl_bindtextdomain);\r
289 #endif\r
290 \r
291 /* Specify the character encoding in which the messages from the\r
292    DOMAINNAME message catalog will be returned.  */\r
293 #ifdef _INTL_REDIRECT_INLINE\r
294 extern char *libintl_bind_textdomain_codeset (const char *__domainname,\r
295                                               const char *__codeset);\r
296 static inline char *bind_textdomain_codeset (const char *__domainname,\r
297                                              const char *__codeset)\r
298 {\r
299   return libintl_bind_textdomain_codeset (__domainname, __codeset);\r
300 }\r
301 #else\r
302 #ifdef _INTL_REDIRECT_MACROS\r
303 # define bind_textdomain_codeset libintl_bind_textdomain_codeset\r
304 #endif\r
305 extern char *bind_textdomain_codeset (const char *__domainname,\r
306                                       const char *__codeset)\r
307        _INTL_ASM (libintl_bind_textdomain_codeset);\r
308 #endif\r
309 \r
310 #endif /* IN_LIBGLOCALE */\r
311 \r
312 \r
313 /* Support for format strings with positions in *printf(), following the\r
314    POSIX/XSI specification.\r
315    Note: These replacements for the *printf() functions are visible only\r
316    in source files that #include <libintl.h> or #include "gettext.h".\r
317    Packages that use *printf() in source files that don't refer to _()\r
318    or gettext() but for which the format string could be the return value\r
319    of _() or gettext() need to add this #include.  Oh well.  */\r
320 \r
321 #if !0\r
322 \r
323 #include <stdio.h>\r
324 #include <stddef.h>\r
325 \r
326 /* Get va_list.  */\r
327 #if (defined __STDC__ && __STDC__) || defined __cplusplus || defined _MSC_VER\r
328 # include <stdarg.h>\r
329 #else\r
330 # include <varargs.h>\r
331 #endif\r
332 \r
333 #if !(defined fprintf && defined _GL_STDIO_H) /* don't override gnulib */\r
334 #undef fprintf\r
335 #define fprintf libintl_fprintf\r
336 extern int fprintf (FILE *, const char *, ...);\r
337 #endif\r
338 #if !(defined vfprintf && defined _GL_STDIO_H) /* don't override gnulib */\r
339 #undef vfprintf\r
340 #define vfprintf libintl_vfprintf\r
341 extern int vfprintf (FILE *, const char *, va_list);\r
342 #endif\r
343 \r
344 #if !(defined printf && defined _GL_STDIO_H) /* don't override gnulib */\r
345 #undef printf\r
346 #if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__\r
347 /* Don't break __attribute__((format(printf,M,N))).\r
348    This redefinition is only possible because the libc in NetBSD, Cygwin,\r
349    mingw does not have a function __printf__.  */\r
350 # define libintl_printf __printf__\r
351 #endif\r
352 #define printf libintl_printf\r
353 extern int printf (const char *, ...);\r
354 #endif\r
355 #if !(defined vprintf && defined _GL_STDIO_H) /* don't override gnulib */\r
356 #undef vprintf\r
357 #define vprintf libintl_vprintf\r
358 extern int vprintf (const char *, va_list);\r
359 #endif\r
360 \r
361 #if !(defined sprintf && defined _GL_STDIO_H) /* don't override gnulib */\r
362 #undef sprintf\r
363 #define sprintf libintl_sprintf\r
364 extern int sprintf (char *, const char *, ...);\r
365 #endif\r
366 #if !(defined vsprintf && defined _GL_STDIO_H) /* don't override gnulib */\r
367 #undef vsprintf\r
368 #define vsprintf libintl_vsprintf\r
369 extern int vsprintf (char *, const char *, va_list);\r
370 #endif\r
371 \r
372 #if 0\r
373 \r
374 #if !(defined snprintf && defined _GL_STDIO_H) /* don't override gnulib */\r
375 #undef snprintf\r
376 #define snprintf libintl_snprintf\r
377 extern int snprintf (char *, size_t, const char *, ...);\r
378 #endif\r
379 #if !(defined vsnprintf && defined _GL_STDIO_H) /* don't override gnulib */\r
380 #undef vsnprintf\r
381 #define vsnprintf libintl_vsnprintf\r
382 extern int vsnprintf (char *, size_t, const char *, va_list);\r
383 #endif\r
384 \r
385 #endif\r
386 \r
387 #if 0\r
388 \r
389 #if !(defined asprintf && defined _GL_STDIO_H) /* don't override gnulib */\r
390 #undef asprintf\r
391 #define asprintf libintl_asprintf\r
392 extern int asprintf (char **, const char *, ...);\r
393 #endif\r
394 #if !(defined vasprintf && defined _GL_STDIO_H) /* don't override gnulib */\r
395 #undef vasprintf\r
396 #define vasprintf libintl_vasprintf\r
397 extern int vasprintf (char **, const char *, va_list);\r
398 #endif\r
399 \r
400 #endif\r
401 \r
402 #if 0\r
403 \r
404 #undef fwprintf\r
405 #define fwprintf libintl_fwprintf\r
406 extern int fwprintf (FILE *, const wchar_t *, ...);\r
407 #undef vfwprintf\r
408 #define vfwprintf libintl_vfwprintf\r
409 extern int vfwprintf (FILE *, const wchar_t *, va_list);\r
410 \r
411 #undef wprintf\r
412 #define wprintf libintl_wprintf\r
413 extern int wprintf (const wchar_t *, ...);\r
414 #undef vwprintf\r
415 #define vwprintf libintl_vwprintf\r
416 extern int vwprintf (const wchar_t *, va_list);\r
417 \r
418 #undef swprintf\r
419 #define swprintf libintl_swprintf\r
420 extern int swprintf (wchar_t *, size_t, const wchar_t *, ...);\r
421 #undef vswprintf\r
422 #define vswprintf libintl_vswprintf\r
423 extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);\r
424 \r
425 #endif\r
426 \r
427 #endif\r
428 \r
429 \r
430 /* Support for the locale chosen by the user.  */\r
431 #if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __WIN32__ || defined __CYGWIN__\r
432 \r
433 #undef setlocale\r
434 #define setlocale libintl_setlocale\r
435 extern char *setlocale (int, const char *);\r
436 \r
437 #if 0\r
438 \r
439 #undef newlocale\r
440 #define newlocale libintl_newlocale\r
441 extern locale_t newlocale (int, const char *, locale_t);\r
442 \r
443 #endif\r
444 \r
445 #endif\r
446 \r
447 \r
448 /* Support for relocatable packages.  */\r
449 \r
450 /* Sets the original and the current installation prefix of the package.\r
451    Relocation simply replaces a pathname starting with the original prefix\r
452    by the corresponding pathname with the current prefix instead.  Both\r
453    prefixes should be directory names without trailing slash (i.e. use ""\r
454    instead of "/").  */\r
455 #define libintl_set_relocation_prefix libintl_set_relocation_prefix\r
456 extern void\r
457        libintl_set_relocation_prefix (const char *orig_prefix,\r
458                                       const char *curr_prefix);\r
459 \r
460 \r
461 #ifdef __cplusplus\r
462 }\r
463 #endif\r
464 \r
465 #endif /* libintl.h */\r