diff options
Diffstat (limited to 'openbsd-compat/charclass.h')
-rw-r--r-- | openbsd-compat/charclass.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/openbsd-compat/charclass.h b/openbsd-compat/charclass.h new file mode 100644 index 000000000..91f517447 --- /dev/null +++ b/openbsd-compat/charclass.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Public domain, 2008, Todd C. Miller <Todd.Miller@courtesan.com> | ||
3 | * | ||
4 | * $OpenBSD: charclass.h,v 1.1 2008/10/01 23:04:13 millert Exp $ | ||
5 | */ | ||
6 | |||
7 | /* OPENBSD ORIGINAL: lib/libc/gen/charclass.h */ | ||
8 | |||
9 | /* | ||
10 | * POSIX character class support for fnmatch() and glob(). | ||
11 | */ | ||
12 | static struct cclass { | ||
13 | const char *name; | ||
14 | int (*isctype)(int); | ||
15 | } cclasses[] = { | ||
16 | { "alnum", isalnum }, | ||
17 | { "alpha", isalpha }, | ||
18 | { "blank", isblank }, | ||
19 | { "cntrl", iscntrl }, | ||
20 | { "digit", isdigit }, | ||
21 | { "graph", isgraph }, | ||
22 | { "lower", islower }, | ||
23 | { "print", isprint }, | ||
24 | { "punct", ispunct }, | ||
25 | { "space", isspace }, | ||
26 | { "upper", isupper }, | ||
27 | { "xdigit", isxdigit }, | ||
28 | { NULL, NULL } | ||
29 | }; | ||
30 | |||
31 | #define NCCLASSES (sizeof(cclasses) / sizeof(cclasses[0]) - 1) | ||