MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / match_class

Function match_class

src/Chain/libraries/glua/lstrlib.cpp:293–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291
292
293static int match_class(int c, int cl) {
294 int res;
295 switch (tolower(cl)) {
296 case 'a': res = isalpha(c); break;
297 case 'c': res = iscntrl(c); break;
298 case 'd': res = isdigit(c); break;
299 case 'g': res = isgraph(c); break;
300 case 'l': res = islower(c); break;
301 case 'p': res = ispunct(c); break;
302 case 's': res = isspace(c); break;
303 case 'u': res = isupper(c); break;
304 case 'w': res = isalnum(c); break;
305 case 'x': res = isxdigit(c); break;
306 case 'z': res = (c == 0); break; /* deprecated option */
307 default: return (cl == c);
308 }
309 return (islower(cl) ? res : !res);
310}
311
312
313static int matchbracketclass(int c, const char *p, const char *ec) {

Callers 2

matchbracketclassFunction · 0.85
singlematchFunction · 0.85

Calls 1

tolowerFunction · 0.50

Tested by

no test coverage detected