MCPcopy Create free account
hub / github.com/F-Stack/f-stack / match_class

Function match_class

freebsd/contrib/openzfs/module/lua/lstrlib.c:277–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275
276
277static int match_class (int c, int cl) {
278 int res;
279 switch (tolower(cl)) {
280 case 'a' : res = isalpha(c); break;
281 case 'c' : res = iscntrl(c); break;
282 case 'd' : res = isdigit(c); break;
283 case 'g' : res = isgraph(c); break;
284 case 'l' : res = islower(c); break;
285 case 'p' : res = ispunct(c); break;
286 case 's' : res = isspace(c); break;
287 case 'u' : res = isupper(c); break;
288 case 'w' : res = isalnum(c); break;
289 case 'x' : res = isxdigit(c); break;
290 case 'z' : res = (c == 0); break; /* deprecated option */
291 default: return (cl == c);
292 }
293 return (islower(cl) ? res : !res);
294}
295
296
297static int matchbracketclass (int c, const char *p, const char *ec) {

Callers 2

matchbracketclassFunction · 0.70
singlematchFunction · 0.70

Calls 7

tolowerFunction · 0.85
isalphaFunction · 0.85
isdigitFunction · 0.85
islowerFunction · 0.85
isspaceFunction · 0.85
isupperFunction · 0.85
isxdigitFunction · 0.85

Tested by

no test coverage detected