static int findAction (const char **actions, const char *action) { int actionLength = strlen (action); int k; for (k = 0; actions[k]; k += 2) if (actionLength == strlen (actions[k]) && ignoreCaseComp (actions[k], action, actionLength) == 0) break; if (actions[k] == NULL) return -1; return atoi (actions[k + 1]); }
static int checkActions (FileInfo * nested, const char **actions) { int k; for (k = 0; actions[k]; k += 2) if (nested->actionLength == strlen (actions[k]) && ignoreCaseComp (actions[k], nested->action, nested->actionLength) == 0) break; if (actions[k] == NULL) return NOTFOUND; return atoi (actions[k + 1]); }
static int checkValues (FileInfo * nested, const char **values) { int k; for (k = 0; values[k]; k += 2) if (nested->valueLength == strlen (values[k]) && ignoreCaseComp (values[k], nested->value, nested->valueLength) == 0) break; if (values[k] == NULL) { configureError (nested, "word %s in column 2 not recognized", nested->value); return NOTFOUND; } return atoi (values[k + 1]); }