1 /* Copyright (C) 2003 Manuel Novoa III
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Library General Public
5 * License as published by the Free Software Foundation; either
6 * version 2 of the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Library General Public License for more details.
13 * You should have received a copy of the GNU Library General Public
14 * License along with this library; if not, write to the Free
15 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 * Stub version of libintl.
22 * Add some hidden names to support locale-enabled libstd++.
32 /**********************************************************************/
35 char *gettext(const char *msgid)
37 return (char *) msgid;
41 /**********************************************************************/
44 char *__dgettext(const char *domainname,
47 return (char *) msgid;
50 strong_alias(__dgettext, dgettext)
53 /**********************************************************************/
56 char *__dcgettext(const char *domainname,
57 const char *msgid, int category)
59 return (char *) msgid;
62 strong_alias(__dcgettext, dcgettext)
65 /**********************************************************************/
68 char *ngettext(const char *msgid1, const char *msgid2,
71 return (char *) ((n == 1) ? msgid1 : msgid2);
75 /**********************************************************************/
78 char *dngettext(const char *domainname, const char *msgid1,
79 const char *msgid2, unsigned long int n)
81 return (char *) ((n == 1) ? msgid1 : msgid2);
85 /**********************************************************************/
88 char *dcngettext(const char *domainname, const char *msgid1,
89 const char *msgid2, unsigned long int n,
92 return (char *) ((n == 1) ? msgid1 : msgid2);
96 /**********************************************************************/
99 char *__textdomain(const char *domainname)
101 static const char default_str[] = "messages";
103 if (domainname && *domainname && strcmp(domainname, default_str)) {
107 return (char *) default_str;
110 strong_alias(__textdomain, textdomain)
113 /**********************************************************************/
114 #ifdef L_bindtextdomain
116 char *__bindtextdomain(const char *domainname, const char *dirname)
118 static const char dir[] = "/";
120 if (!domainname || !*domainname
123 && ((dirname[0] != '/') || dirname[1])
125 && strcmp(dirname, dir)
136 strong_alias(__bindtextdomain, bindtextdomain)
139 /**********************************************************************/
140 #ifdef L_bind_textdomain_codeset
142 /* Specify the character encoding in which the messages from the
143 DOMAINNAME message catalog will be returned. */
144 char *bind_textdomain_codeset(const char *domainname,
147 if (!domainname || !*domainname || codeset) {
154 /**********************************************************************/
155 #ifdef L__nl_expand_alias
159 const char *_nl_expand_alias(const char * name)
161 return NULL; /* uClibc does not support locale aliases. */
165 /**********************************************************************/
166 #ifdef L__nl_msg_cat_cntr
170 int _nl_msg_cat_cntr = 0;
173 /**********************************************************************/