static unsigned int nominateLanguageCandidatesForPattern(const char *const baseName, parserCandidate** candidates) { unsigned int count; langType i; const char* spec; *candidates = parserCandidateNew(LanguageCount); for (count = 0, i = LANG_AUTO; i != LANG_IGNORE; ) { i = getPatternLanguageAndSpec (baseName, i, &spec); if (i != LANG_IGNORE) { (*candidates)[count].lang = i++; (*candidates)[count++].spec = spec; } } return count; }
/* If multiple parsers are found, return LANG_AUTO */ static unsigned int nominateLanguageCandidates (const char *const key, parserCandidate** candidates) { unsigned int count; langType i; const char* spec = NULL; *candidates = parserCandidateNew(LanguageCount); for (count = 0, i = LANG_AUTO; i != LANG_IGNORE; ) { i = getNameOrAliasesLanguageAndSpec (key, i, &spec); if (i != LANG_IGNORE) { (*candidates)[count].lang = i++; (*candidates)[count++].spec = spec; } } return count; }