summaryrefslogtreecommitdiff
path: root/lib/mbchar.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-12-27 19:54:25 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-12-27 19:54:25 +0000
commitdb844e48b469f59ccfc7da42677040700b8eace9 (patch)
tree6f95ff71f9031308209000496072543847ba7408 /lib/mbchar.h
parentaafb133aa1176295ec51c8a477e46e498e98fb57 (diff)
downloadgnulib-db844e48b469f59ccfc7da42677040700b8eace9.tar.gz
* lib/mbchar.h: Just include <wctype.h>; the wctype module
handles its gotchas now. * lib/mbswidth.c: Likewise. * lib/wcwidth.h: Likewise. * m4/mbchar.m4 (gl_MBCHAR): Don't bother checking for wctype.h and iswcntrl; the wctype module does this stuff now. * m4/mbswidth.m4 (gl_MBSWIDTH): Likewise. * m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Likewise. * modules/mbchar (Depends-on): Add wctype. * modules/mbswidth (Depends-on): Likewise. * modules/wcwidth (Depends-on): Likewise.
Diffstat (limited to 'lib/mbchar.h')
-rw-r--r--lib/mbchar.h127
1 files changed, 1 insertions, 126 deletions
diff --git a/lib/mbchar.h b/lib/mbchar.h
index a0c2cdcb99..f3e28ef5ca 100644
--- a/lib/mbchar.h
+++ b/lib/mbchar.h
@@ -155,132 +155,7 @@
#include <stdio.h>
#include <time.h>
#include <wchar.h>
-
-/* BeOS 5 has the functions but no <wctype.h>. */
-#if HAVE_WCTYPE_H
-# include <wctype.h>
-#endif
-/* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
- Assume all 12 functions are implemented the same way, or not at all. */
-#if !defined iswalnum && !HAVE_ISWCNTRL
-static inline int
-iswalnum (wint_t wc)
-{
- return (wc >= 0 && wc < 128
- ? (wc >= '0' && wc <= '9') || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z')
- : 0);
-}
-# define iswalnum iswalnum
-#endif
-#if !defined iswalpha && !HAVE_ISWCNTRL
-static inline int
-iswalpha (wint_t wc)
-{
- return (wc >= 0 && wc < 128
- ? (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'
- : 0);
-}
-# define iswalpha iswalpha
-#endif
-#if !defined iswblank && !HAVE_ISWCNTRL
-static inline int
-iswblank (wint_t wc)
-{
- return (wc >= 0 && wc < 128
- ? wc == ' ' || wc == '\t'
- : 0);
-}
-# define iswblank iswblank
-#endif
-#if !defined iswcntrl && !HAVE_ISWCNTRL
-static inline int
-iswcntrl (wint_t wc)
-{
- return (wc >= 0 && wc < 128
- ? (wc & ~0x1f) == 0 || wc == 0x7f
- : 0);
-}
-# define iswcntrl iswcntrl
-#endif
-#if !defined iswdigit && !HAVE_ISWCNTRL
-static inline int
-iswdigit (wint_t wc)
-{
- return (wc >= '0' && wc <= '9');
-}
-# define iswdigit iswdigit
-#endif
-#if !defined iswgraph && !HAVE_ISWCNTRL
-static inline int
-iswgraph (wint_t wc)
-{
- return (wc >= 0 && wc < 128
- ? wc >= '!' && wc <= '~'
- : 1);
-}
-# define iswgraph iswgraph
-#endif
-#if !defined iswlower && !HAVE_ISWCNTRL
-static inline int
-iswlower (wint_t wc)
-{
- return (wc >= 0 && wc < 128
- ? wc >= 'a' && wc <= 'z'
- : 0);
-}
-# define iswlower iswlower
-#endif
-#if !defined iswprint && !HAVE_ISWCNTRL
-static inline int
-iswprint (wint_t wc)
-{
- return (wc >= 0 && wc < 128
- ? wc >= ' ' && wc <= '~'
- : 1);
-}
-# define iswprint iswprint
-#endif
-#if !defined iswpunct && !HAVE_ISWCNTRL
-static inline int
-iswpunct (wint_t wc)
-{
- return (wc >= 0 && wc < 128
- ? wc >= '!' && wc <= '~'
- && !((wc >= '0' && wc <= '9')
- || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'))
- : 1);
-}
-# define iswpunct iswpunct
-#endif
-#if !defined iswspace && !HAVE_ISWCNTRL
-static inline int
-iswspace (wint_t wc)
-{
- return (wc >= 0 && wc < 128
- ? wc == ' ' || wc == '\t'
- || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r'
- : 0);
-}
-# define iswspace iswspace
-#endif
-#if !defined iswupper && !HAVE_ISWCNTRL
-static inline int
-iswupper (wint_t wc)
-{
- return (wc >= 0 && wc < 128
- ? wc >= 'A' && wc <= 'Z'
- : 0);
-}
-# define iswupper iswupper
-#endif
-#if !defined iswxdigit && !HAVE_ISWCNTRL
-static inline int
-iswxdigit (wint_t wc)
-{
- return (wc >= '0' && wc <= '9') || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F');
-}
-# define iswxdigit iswxdigit
-#endif
+#include <wctype.h>
#include "wcwidth.h"