FreeBSD/lib/lib80211/lib80211_regdomain.c
/*
 * Lookup a country by ISO/long name.
 */
Lookup a country by ISO/long name.
Lookup a country by ISO / long name .
const struct country *
lib80211_country_findbyname(const struct regdata *rdp, const char *name)
{
	const struct country *cp;
	int len;
	len = strlen(name);
	LIST_FOREACH(cp, &rdp->countries, next) {
		if (strcasecmp(cp->isoname, name) == 0)
			return cp;
	}
	LIST_FOREACH(cp, &rdp->countries, next) {
		if (strncasecmp(cp->name, name, len) == 0)
			return cp;
	}
	return NULL;
}
const struct country * lib80211_country_findbyname ( const struct regdata * rdp , const char * name ) { const struct country * cp ; int len ; len = strlen ( name ) ; LIST_FOREACH ( cp , & rdp -> countries , next ) { if ( strcasecmp ( cp -> isoname , name ) == 0 ) return cp ; } LIST_FOREACH ( cp , & rdp -> countries , next ) { if ( strncasecmp ( cp -> name , name , len ) == 0 ) return cp ; } return NULL ; }
Lookup a country by ISO/long name.
Lookup a country by ISO / long name .