to jp2uc.c.
(__jp2uc): Remove declaration.
(_jp2uc): Declare.
* libc/ctype/jp2uc.c (JP_JIS, JP_SJIS, JP_EUCJP): Define.
(__jp2uc): Remove Cygwin special case.
(_jp2uc): New function. On Cygwin, just return c.
* libc/ctype/iswalpha.c (iswalpha): Just call _jp2uc.
* libc/ctype/iswblank.c (iswblank): Ditto.
* libc/ctype/iswcntrl.c (iswcntrl): Ditto.
* libc/ctype/iswprint.c (iswprint): Ditto.
* libc/ctype/iswpunct.c (iswpunt): Ditto.
* libc/ctype/iswspace.c (iswspace): Ditto.
* libc/ctype/towlower.c (towlower): Ditto.
* libc/ctype/towupper.c (towupper): Ditto.
+2009-05-14 Corinna Vinschen <corinna@vinschen.de>
+
+ * libc/ctype/local.h (JP_JIS, JP_SJIS, JP_EUCJP): Move definition
+ to jp2uc.c.
+ (__jp2uc): Remove declaration.
+ (_jp2uc): Declare.
+ * libc/ctype/jp2uc.c (JP_JIS, JP_SJIS, JP_EUCJP): Define.
+ (__jp2uc): Remove Cygwin special case.
+ (_jp2uc): New function. On Cygwin, just return c.
+ * libc/ctype/iswalpha.c (iswalpha): Just call _jp2uc.
+ * libc/ctype/iswblank.c (iswblank): Ditto.
+ * libc/ctype/iswcntrl.c (iswcntrl): Ditto.
+ * libc/ctype/iswprint.c (iswprint): Ditto.
+ * libc/ctype/iswpunct.c (iswpunt): Ditto.
+ * libc/ctype/iswspace.c (iswspace): Ditto.
+ * libc/ctype/towlower.c (towlower): Ditto.
+ * libc/ctype/towupper.c (towupper): Ditto.
+
2009-05-13 Paul Brook <paul@codesourcery.com>
* libc/machine/arm/setjmp.S: Don't bother saving IP. Copy SP to
int size;
wint_t x;
- if (!strcmp (__locale_charset (), "JIS"))
- c = __jp2uc (c, JP_JIS);
- else if (!strcmp (__locale_charset (), "SJIS"))
- c = __jp2uc (c, JP_SJIS);
- else if (!strcmp (__locale_charset (), "EUCJP"))
- c = __jp2uc (c, JP_EUCJP);
+ c = _jp2uc (c);
x = (c >> 8);
/* for some large sections, all characters are alphabetic so handle them here */
_DEFUN(iswblank,(c), wint_t c)
{
#ifdef _MB_CAPABLE
- if (!strcmp (__locale_charset (), "JIS"))
- c = __jp2uc (c, JP_JIS);
- else if (!strcmp (__locale_charset (), "SJIS"))
- c = __jp2uc (c, JP_SJIS);
- else if (!strcmp (__locale_charset (), "EUCJP"))
- c = __jp2uc (c, JP_EUCJP);
+ c = _jp2uc (c);
return (c == 0x0009 || c == 0x0020 || c == 0x1680 ||
(c >= 0x2000 && c <= 0x2006) ||
(c >= 0x2008 && c <= 0x200b) ||
_DEFUN(iswcntrl,(c), wint_t c)
{
#ifdef _MB_CAPABLE
- if (!strcmp (__locale_charset (), "JIS"))
- c = __jp2uc (c, JP_JIS);
- else if (!strcmp (__locale_charset (), "SJIS"))
- c = __jp2uc (c, JP_SJIS);
- else if (!strcmp (__locale_charset (), "EUCJP"))
- c = __jp2uc (c, JP_EUCJP);
+ c = _jp2uc (c);
return ((c >= 0x0000 && c <= 0x001f) ||
(c >= 0x007f && c <= 0x009f) ||
c == 0x2028 || c == 0x2029);
int size;
wint_t x;
- if (!strcmp (__locale_charset (), "JIS"))
- c = __jp2uc (c, JP_JIS);
- else if (!strcmp (__locale_charset (), "SJIS"))
- c = __jp2uc (c, JP_SJIS);
- else if (!strcmp (__locale_charset (), "EUCJP"))
- c = __jp2uc (c, JP_EUCJP);
+ c = _jp2uc (c);
x = (c >> 8);
/* for some large sections, all characters are printuation so handle them here */
int size;
wint_t x;
- if (!strcmp (__locale_charset (), "JIS"))
- c = __jp2uc (c, JP_JIS);
- else if (!strcmp (__locale_charset (), "SJIS"))
- c = __jp2uc (c, JP_SJIS);
- else if (!strcmp (__locale_charset (), "EUCJP"))
- c = __jp2uc (c, JP_EUCJP);
+ c = _jp2uc (c);
x = (c >> 8);
/* for some large sections, all characters are punctuation so handle them here */
_DEFUN(iswspace,(c), wint_t c)
{
#ifdef _MB_CAPABLE
- if (!strcmp (__locale_charset (), "JIS"))
- c = __jp2uc (c, JP_JIS);
- else if (!strcmp (__locale_charset (), "SJIS"))
- c = __jp2uc (c, JP_SJIS);
- else if (!strcmp (__locale_charset (), "EUCJP"))
- c = __jp2uc (c, JP_EUCJP);
+ c = _jp2uc (c);
return ((c >= 0x0009 && c <= 0x000d) || c == 0x0020 || c == 0x1680 ||
(c >= 0x2000 && c <= 0x2006) ||
(c >= 0x2008 && c <= 0x200b) ||
#include "local.h"
#include "jp2uc.h"
+/* Japanese encoding types supported */
+#define JP_JIS 1
+#define JP_SJIS 2
+#define JP_EUCJP 3
+
wint_t
_DEFUN (__jp2uc, (c, type), wint_t c _AND int type)
{
-/* Under Cygwin, the incoming wide character is already given in UTF due
- to the requirements of the underlying OS. */
-#ifdef __CYGWIN__
- return c;
-#else
int index, adj;
unsigned char byte1, byte2;
wint_t ret;
}
return WEOF;
+}
+
+wint_t
+_DEFUN (_jp2uc, (c), wint_t c)
+{
+/* Under Cygwin, the incoming wide character is already given in UTF due
+ to the requirements of the underlying OS. */
+#ifndef __CYGWIN__
+ if (!strcmp (__locale_charset (), "JIS"))
+ c = __jp2uc (c, JP_JIS);
+ else if (!strcmp (__locale_charset (), "SJIS"))
+ c = __jp2uc (c, JP_SJIS);
+ else if (!strcmp (__locale_charset (), "EUCJP"))
+ c = __jp2uc (c, JP_EUCJP);
#endif
+ return c;
}
#endif /* _MB_CAPABLE */
extern char *__locale_charset ();
-/* Japanese encoding types supported */
-#define JP_JIS 1
-#define JP_SJIS 2
-#define JP_EUCJP 3
-
/* internal function to translate JP to Unicode */
-wint_t _EXFUN (__jp2uc, (wint_t, int));
+wint_t _EXFUN (_jp2uc, (wint_t));
_DEFUN(towlower,(c), wint_t c)
{
#ifdef _MB_CAPABLE
- if (!strcmp (__locale_charset (), "JIS"))
- c = __jp2uc (c, JP_JIS);
- else if (!strcmp (__locale_charset (), "SJIS"))
- c = __jp2uc (c, JP_SJIS);
- else if (!strcmp (__locale_charset (), "EUCJP"))
- c = __jp2uc (c, JP_EUCJP);
-
+ c = _jp2uc (c);
if (c < 0x100)
{
if ((c >= 0x0041 && c <= 0x005a) ||
_DEFUN(towupper,(c), wint_t c)
{
#ifdef _MB_CAPABLE
- if (!strcmp (__locale_charset (), "JIS"))
- c = __jp2uc (c, JP_JIS);
- else if (!strcmp (__locale_charset (), "SJIS"))
- c = __jp2uc (c, JP_SJIS);
- else if (!strcmp (__locale_charset (), "EUCJP"))
- c = __jp2uc (c, JP_EUCJP);
-
+ c = _jp2uc (c);
if (c < 0x100)
{
if (c == 0x00b5)