include/ctype.h: restore __isctype_l definition
[uclibc-ng.git] / libintl / libintl.c
blob0851fac1ca7c632934fc5ca2fd5dcd94601877ea
1 /* Copyright (C) 2003 Manuel Novoa III
2 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
4 * Trivial Stubs, Public Domain.
5 */
7 #include <stdlib.h>
8 #include <string.h>
9 #include <errno.h>
11 char *gettext(const char *msgid)
13 return (char *) msgid;
16 char *dgettext(const char *domainname, const char *msgid)
18 (void) domainname;
19 return (char *) msgid;
22 char *dcgettext(const char *domainname, const char *msgid, int category)
24 (void) domainname;
25 (void) category;
26 return (char *) msgid;
29 char *ngettext(const char *msgid1, const char *msgid2, unsigned long n)
31 return (char *) ((n == 1) ? msgid1 : msgid2);
34 char *dngettext(const char *domainname, const char *msgid1, const char *msgid2, unsigned long n)
36 (void) domainname;
37 return (char *) ((n == 1) ? msgid1 : msgid2);
40 char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2, unsigned long n, int category)
42 (void) domainname;
43 (void) category;
44 return (char *) ((n == 1) ? msgid1 : msgid2);
47 char *textdomain(const char *domainname)
49 static const char default_str[] = "messages";
51 if (domainname && *domainname && strcmp(domainname, default_str)) {
52 errno = EINVAL;
53 return NULL;
55 return (char *) default_str;
58 char *bindtextdomain(const char *domainname, const char *dirname)
60 static const char dir[] = "/";
62 if (!domainname || !*domainname
63 || (dirname && ((dirname[0] != '/') || dirname[1]))
64 ) {
65 errno = EINVAL;
66 return NULL;
69 return (char *) dir;
72 char *bind_textdomain_codeset(const char *domainname, const char *codeset)
74 if (!domainname || !*domainname || (codeset && strcasecmp(codeset, "UTF-8"))) {
75 errno = EINVAL;
77 return NULL;
80 /* trick configure tests checking for gnu libintl, as in the copy included in gdb */
81 const char *_nl_expand_alias () { return NULL; }
82 int _nl_msg_cat_cntr = 0;