@@ -1568,37 +1568,18 @@
#ifndef HAVE_FNMATCH
STATIC int ccmatch(const char *p, int chr, const char **r)
{
- static const struct class {
- char name[10];
- int (*fn)(int);
- } classes[] = {
- { .name = ":alnum:]", .fn = isalnum },
- { .name = ":cntrl:]", .fn = iscntrl },
- { .name = ":lower:]", .fn = islower },
- { .name = ":space:]", .fn = isspace },
- { .name = ":alpha:]", .fn = isalpha },
- { .name = ":digit:]", .fn = isdigit },
- { .name = ":print:]", .fn = isprint },
- { .name = ":upper:]", .fn = isupper },
- { .name = ":blank:]", .fn = isblank },
- { .name = ":graph:]", .fn = isgraph },
- { .name = ":punct:]", .fn = ispunct },
- { .name = ":xdigit:]", .fn = isxdigit },
- };
- const struct class *class, *end;
-
- end = classes + sizeof(classes) / sizeof(classes[0]);
- for (class = classes; class < end; class++) {
- const char *q;
-
- q = prefix(p, class->name);
- if (!q)
- continue;
- *r = q;
- return class->fn(chr);
- }
-
- *r = 0;
+ if(( *r=prefix(p, ":alnum:]") )) return isalnum(chr); else
+ if(( *r=prefix(p, ":cntrl:]") )) return iscntrl(chr); else
+ if(( *r=prefix(p, ":lower:]") )) return islower(chr); else
+ if(( *r=prefix(p, ":space:]") )) return isspace(chr); else
+ if(( *r=prefix(p, ":alpha:]") )) return isalpha(chr); else
+ if(( *r=prefix(p, ":digit:]") )) return isdigit(chr); else
+ if(( *r=prefix(p, ":print:]") )) return isprint(chr); else
+ if(( *r=prefix(p, ":upper:]") )) return isupper(chr); else
+ if(( *r=prefix(p, ":blank:]") )) return isblank(chr); else
+ if(( *r=prefix(p, ":graph:]") )) return isgraph(chr); else
+ if(( *r=prefix(p, ":punct:]") )) return ispunct(chr); else
+ if(( *r=prefix(p, ":xdigit:]") )) return isxdigit(chr); else
return 0;
}
@@ -27,31 +27,7 @@
*/
#ifndef HAVE_ISALPHA
-#define isalnum _isalnum
-#define iscntrl _iscntrl
-#define islower _islower
-#define isspace _isspace
-#define isalpha _isalpha
-#define isdigit _isdigit
-#define isprint _isprint
-#define isupper _isupper
-#define isblank _isblank
-#define isgraph _isgraph
-#define ispunct _ispunct
-#define isxdigit _isxdigit
#include <ctype.h>
-#undef isalnum
-#undef iscntrl
-#undef islower
-#undef isspace
-#undef isalpha
-#undef isdigit
-#undef isprint
-#undef isupper
-#undef isblank
-#undef isgraph
-#undef ispunct
-#undef isxdigit
#endif
#include <signal.h>
@@ -157,69 +133,6 @@
}
#endif
-#ifndef HAVE_ISALPHA
-int isalnum(int c) {
- return _isalnum(c);
-}
-
-
-int iscntrl(int c) {
- return _iscntrl(c);
-}
-
-
-int islower(int c) {
- return _islower(c);
-}
-
-
-int isspace(int c) {
- return _isspace(c);
-}
-
-
-int isalpha(int c) {
- return _isalpha(c);
-}
-
-
-int isdigit(int c) {
- return _isdigit(c);
-}
-
-
-int isprint(int c) {
- return _isprint(c);
-}
-
-
-int isupper(int c) {
- return _isupper(c);
-}
-
-
-#if HAVE_DECL_ISBLANK
-int isblank(int c) {
- return _isblank(c);
-}
-#endif
-
-
-int isgraph(int c) {
- return _isgraph(c);
-}
-
-
-int ispunct(int c) {
- return _ispunct(c);
-}
-
-
-int isxdigit(int c) {
- return _isxdigit(c);
-}
-#endif
-
#if !HAVE_DECL_ISBLANK
int isblank(int c) {
return c == ' ' || c == '\t';