blob: e42a999cb2513101ba0cb9514dfe01ee93c644c4 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/* Copyright (C) 2003 Manuel Novoa III
2 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
3 *
4 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
5 */
6
7/*
8 * Stub version of libintl.
9 *
10 * Aug 30, 2003
11 * Add some hidden names to support locale-enabled libstd++.
12 */
13
14#include <stdlib.h>
15#include <string.h>
16#include <errno.h>
17
18#undef __OPTIMIZE__
19#include <libintl.h>
20
21/**********************************************************************/
22#ifdef L_gettext
23
24char *gettext(const char *msgid)
25{
26 return (char *) msgid;
27}
28
29#endif
30/**********************************************************************/
31#ifdef L_dgettext
32
33char *dgettext(const char *domainname,
34 const char *msgid)
35{
36 return (char *) msgid;
37}
38
39#endif
40/**********************************************************************/
41#ifdef L_dcgettext
42
43char *dcgettext(const char *domainname,
44 const char *msgid, int category)
45{
46 return (char *) msgid;
47}
48
49#endif
50/**********************************************************************/
51#ifdef L_ngettext
52
53char *ngettext(const char *msgid1, const char *msgid2,
54 unsigned long int n)
55{
56 return (char *) ((n == 1) ? msgid1 : msgid2);
57}
58
59#endif
60/**********************************************************************/
61#ifdef L_dngettext
62
63char *dngettext(const char *domainname, const char *msgid1,
64 const char *msgid2, unsigned long int n)
65{
66 return (char *) ((n == 1) ? msgid1 : msgid2);
67}
68
69#endif
70/**********************************************************************/
71#ifdef L_dcngettext
72
73char *dcngettext(const char *domainname, const char *msgid1,
74 const char *msgid2, unsigned long int n,
75 int category)
76{
77 return (char *) ((n == 1) ? msgid1 : msgid2);
78}
79
80#endif
81/**********************************************************************/
82#ifdef L_textdomain
83
84char *textdomain(const char *domainname)
85{
86 static const char default_str[] = "messages";
87
88 if (domainname && *domainname && strcmp(domainname, default_str)) {
89 __set_errno(EINVAL);
90 return NULL;
91 }
92 return (char *) default_str;
93}
94
95#endif
96/**********************************************************************/
97#ifdef L_bindtextdomain
98
99char *bindtextdomain(const char *domainname, const char *dirname)
100{
101 static const char dir[] = "/";
102
103 if (!domainname || !*domainname
104 || (dirname
105#if 1
106 && ((dirname[0] != '/') || dirname[1])
107#else
108 && strcmp(dirname, dir)
109#endif
110 )
111 ) {
112 __set_errno(EINVAL);
113 return NULL;
114 }
115
116 return (char *) dir;
117}
118
119#endif
120/**********************************************************************/
121#ifdef L_bind_textdomain_codeset
122
123/* Specify the character encoding in which the messages from the
124 DOMAINNAME message catalog will be returned. */
125char *bind_textdomain_codeset(const char *domainname, const char *codeset)
126{
127 if (!domainname || !*domainname || codeset) {
128 __set_errno(EINVAL);
129 }
130 return NULL;
131}
132
133#endif
134/**********************************************************************/
135#ifdef L__nl_expand_alias
136
137/* glibc-ism */
138
139const char *_nl_expand_alias(const char * name);
140const char *_nl_expand_alias(const char * name)
141{
142 return NULL; /* uClibc does not support locale aliases. */
143}
144
145#endif
146/**********************************************************************/
147#ifdef L__nl_msg_cat_cntr
148
149/* glibc-ism */
150
151int _nl_msg_cat_cntr = 0;
152
153#endif
154/**********************************************************************/