diff options
Diffstat (limited to 'usr.bin/rsync/charclass.h')
-rw-r--r-- | usr.bin/rsync/charclass.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/usr.bin/rsync/charclass.h b/usr.bin/rsync/charclass.h new file mode 100644 index 00000000000..1c5ff7ee044 --- /dev/null +++ b/usr.bin/rsync/charclass.h @@ -0,0 +1,29 @@ +/* + * Public domain, 2008, Todd C. Miller <millert@openbsd.org> + * + * $OpenBSD: charclass.h,v 1.1 2021/08/29 13:43:46 claudio Exp $ + */ + +/* + * POSIX character class support for fnmatch() and glob(). + */ +static const 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) |