#include <errno.h>
#include <string.h>
+#include "locale_impl.h"
+#include "libc.h"
#define E(a,b) ((unsigned char)a),
static const unsigned char errid[] = {
#include "__strerror.h"
;
-char *strerror(int e)
+char *__strerror_l(int e, locale_t loc)
{
const char *s;
int i;
}
for (i=0; errid[i] && errid[i] != e; i++);
for (s=errmsg; i; s++, i--) for (; *s; s++);
- return (char *)s;
+ return (char *)LCTRANS(s, LC_MESSAGES, loc);
+}
+
+char *strerror(int e)
+{
+ return __strerror_l(e, CURRENT_LOCALE);
}
+
+weak_alias(__strerror_l, strerror_l);
}
for (; idx; idx--, str++) for (; *str; str++);
+ if (cat != LC_NUMERIC && *str) str = LCTRANS(str, cat, loc);
return (char *)str;
}
+++ /dev/null
-#include <string.h>
-#include <locale.h>
-
-char *strerror_l(int err, locale_t l)
-{
- return strerror(err);
-}
#include <netdb.h>
+#include "locale_impl.h"
static const char msgs[] =
"Invalid flags\0"
{
const char *s;
for (s=msgs, ecode++; ecode && *s; ecode++, s++) for (; *s; s++);
- return *s ? s : s+1;
+ if (!*s) s++;
+ return LCTRANS_CUR(s);
}
#define _GNU_SOURCE
#include <netdb.h>
+#include "locale_impl.h"
static const char msgs[] =
"Host not found\0"
{
const char *s;
for (s=msgs, ecode--; ecode && *s; ecode--, s++) for (; *s; s++);
- return *s ? s : s+1;
+ if (!*s) s++;
+ return LCTRANS_CUR(s);
}
#include <string.h>
#include <regex.h>
#include <stdio.h>
+#include "locale_impl.h"
/* Error message strings for error codes listed in `regex.h'. This list
needs to be in sync with the codes listed there, naturally. */
const char *s;
for (s=messages; e && *s; e--, s+=strlen(s)+1);
if (!*s) s++;
+ s = LCTRANS_CUR(s);
return 1+snprintf(buf, size, "%s", s);
}
#include <signal.h>
#include <string.h>
+#include "locale_impl.h"
#if (SIGHUP == 1) && (SIGINT == 2) && (SIGQUIT == 3) && (SIGILL == 4) \
&& (SIGTRAP == 5) && (SIGABRT == 6) && (SIGBUS == 7) && (SIGFPE == 8) \
char *strsignal(int signum)
{
- char *s = (char *)strings;
+ const char *s = strings;
signum = sigmap(signum);
if (signum - 1U >= _NSIG-1) signum = 0;
for (; signum--; s++) for (; *s; s++);
- return s;
+ return (char *)LCTRANS_CUR(s);
}