/*1* SPDX-License-Identifier: ISC2*3* Copyright (c) 2008, 2010 Todd C. Miller <[email protected]>4*5* Permission to use, copy, modify, and distribute this software for any6* purpose with or without fee is hereby granted, provided that the above7* copyright notice and this permission notice appear in all copies.8*9* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES10* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF11* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR12* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES13* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN14* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF15* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.16*/1718/*19* POSIX character class support for fnmatch() and glob().20*/21static struct cclass {22const char *name;23int (*isctype)(int);24} cclasses[] = {25{ "alnum", isalnum },26{ "alpha", isalpha },27{ "blank", isblank },28{ "cntrl", iscntrl },29{ "digit", isdigit },30{ "graph", isgraph },31{ "lower", islower },32{ "print", isprint },33{ "punct", ispunct },34{ "space", isspace },35{ "upper", isupper },36{ "xdigit", isxdigit },37{ NULL, NULL }38};3940#define NCCLASSES (nitems(cclasses) - 1)414243