diff options
author | Damien Miller <djm@mindrot.org> | 2010-10-07 21:39:17 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2010-10-07 21:39:17 +1100 |
commit | a6e121aaa0ab61965db2dcfe8e2ba5d719fbe1e6 (patch) | |
tree | 4583d2a94482493f21537611187bd119f496807c /openbsd-compat/charclass.h | |
parent | aa18063baf35e303832d9ec58204ffaab221de85 (diff) |
- djm@cvs.openbsd.org 2010/09/25 09:30:16
[sftp.c configure.ac openbsd-compat/glob.c openbsd-compat/glob.h]
make use of new glob(3) GLOB_KEEPSTAT extension to save extra server
rountrips to fetch per-file stat(2) information.
NB. update openbsd-compat/ glob(3) implementation from OpenBSD libc to
match.
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 00000000..91f51744 --- /dev/null +++ b/openbsd-compat/charclass.h @@ -0,0 +1,31 @@ +/* + * Public domain, 2008, Todd C. Miller <Todd.Miller@courtesan.com> + * + * $OpenBSD: charclass.h,v 1.1 2008/10/01 23:04:13 millert Exp $ + */ + +/* OPENBSD ORIGINAL: lib/libc/gen/charclass.h */ + +/* + * POSIX character class support for fnmatch() and glob(). + */ +static struct cclass { + const char *name; + int (*isctype)(int); +} cclasses[] = { + { "alnum", isalnum }, + { "alpha", isalpha }, + { "blank", isblank }, + { "cntrl", iscntrl }, + { "digit", isdigit }, + { "graph", isgraph }, + { "lower", islower }, + { "print", isprint }, + { "punct", ispunct }, + { "space", isspace }, + { "upper", isupper }, + { "xdigit", isxdigit }, + { NULL, NULL } +}; + +#define NCCLASSES (sizeof(cclasses) / sizeof(cclasses[0]) - 1) |