blob: 5edb2c1144c6e1b52a3e799016fa5078ad3238bf [file] [log] [blame]
Nick Kralevichd1860ad2012-03-21 09:46:46 -07001/*
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/*
8 * POSIX character class support for fnmatch() and glob().
9 */
10static struct cclass {
11 const char *name;
12 int (*isctype)(int);
13} cclasses[] = {
14 { "alnum", isalnum },
15 { "alpha", isalpha },
16 { "blank", isblank },
17 { "cntrl", iscntrl },
18 { "digit", isdigit },
19 { "graph", isgraph },
20 { "lower", islower },
21 { "print", isprint },
22 { "punct", ispunct },
23 { "space", isspace },
24 { "upper", isupper },
25 { "xdigit", isxdigit },
26 { NULL, NULL }
27};
28
29#define NCCLASSES (sizeof(cclasses) / sizeof(cclasses[0]) - 1)