| * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
| /* returns the array index of the string */ |
| /* (index of first match is returned, or -1) */ |
| int index_in_str_array(const char *const string_array[], const char *key) |
| for (i = 0; string_array[i] != 0; i++) { |
| if (strcmp(string_array[i], key) == 0) { |
| int index_in_strings(const char *strings, const char *key) |
| if (strcmp(strings, key) == 0) { |
| strings += strlen(strings) + 1; /* skip NUL */ |
| /* returns the array index of the string, even if it matches only a beginning */ |
| /* (index of first match is returned, or -1) */ |
| int index_in_substr_array(const char *const string_array[], const char *key) |
| for (i = 0; string_array[i] != 0; i++) { |
| if (strncmp(string_array[i], key, len) == 0) { |
| int index_in_substrings(const char *strings, const char *key) |
| if (strncmp(strings, key, len) == 0) { |
| strings += strlen(strings) + 1; /* skip NUL */ |