blob: 91f517447b8f18f7595ef9906aecc74ffd1c2bef [file] [log] [blame]
Damien Millera6e121a2010-10-07 21:39:17 +11001/*
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 */
12static 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)