xref: /freebsd/crypto/openssh/openbsd-compat/charclass.h (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
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)
32