/* Otherwise, the default value that was passed as the third argument is returned.  */
static gint find_val_for_string(const char *needle, const enum_val_t *haystack, gint default_value)
/* Otherwise, the default value that was passed as the third argument is returned.  */
static gint find_val_for_string(const char *needle, const enum_val_t *haystack, gint default_value)
{
    int i;
    for (i = 0; haystack[i].name != NULL; i++) {
        if (g_ascii_strcasecmp(needle, haystack[i].name) == 0) {
            return haystack[i].value;
        }
    }
    for (i = 0; haystack[i].name != NULL; i++) {
        if (g_ascii_strcasecmp(needle, haystack[i].description) == 0) {
            return haystack[i].value;
        }
    }
    return default_value;
}