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

Function str2value

freebsd/kern/kern_rctl.c:831–847  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

829}
830
831static int
832str2value(const char *str, int *value, struct dict *table)
833{
834 int i;
835
836 if (value == NULL)
837 return (EINVAL);
838
839 for (i = 0; table[i].d_name != NULL; i++) {
840 if (strcasecmp(table[i].d_name, str) == 0) {
841 *value = table[i].d_value;
842 return (0);
843 }
844 }
845
846 return (EINVAL);
847}
848
849static int
850str2id(const char *str, id_t *value)

Callers 1

rctl_string_to_ruleFunction · 0.85

Calls 1

strcasecmpFunction · 0.85

Tested by

no test coverage detected