Lines Matching defs:tok
137 char *tok;
147 for (tok = strtok(list, sep); tok != 0; tok = strtok((char *) 0, sep)) {
148 if (strcasecmp(tok, "EXCEPT") == 0) /* EXCEPT: give up */
150 if ((match = (*match_fn)(tok, item)) != 0) /* YES */
156 while ((tok = strtok((char *) 0, sep)) && strcasecmp(tok, "EXCEPT"))
158 if (tok == 0 || list_match((char *) 0, item, match_fn) == NO)
177 user_match(const char *tok, const char *string)
189 if (tok[0] == '@') { /* netgroup */
190 return (netgroup_match(tok + 1, (char *) 0, string));
191 } else if (string_match(tok, string)) { /* ALL or exact match */
193 } else if (getgrnam_r(tok, &grres, grbuf, sizeof(grbuf), &group) == 0 &&
205 from_match(const char *tok, const char *string)
219 if (tok[0] == '@') { /* netgroup */
220 return (netgroup_match(tok + 1, string, (char *) 0));
221 } else if (string_match(tok, string)) { /* ALL or exact match */
223 } else if (tok[0] == '.') { /* domain: match last fields */
224 if ((str_len = strlen(string)) > (tok_len = strlen(tok))
225 && strcasecmp(tok, string + str_len - tok_len) == 0)
227 } else if (strcasecmp(tok, "LOCAL") == 0) { /* local: no dots */
230 } else if (tok[(tok_len = strlen(tok)) - 1] == '.' /* network */
231 && strncmp(tok, string, tok_len) == 0) {
240 string_match(const char *tok, const char *string)
248 if (strcasecmp(tok, "ALL") == 0) { /* all: always matches */
250 } else if (strcasecmp(tok, string) == 0) { /* try exact match */