FreeBSD/sys/dev/kbd/kbd.c
/*
 * find the keyboard specified by a driver name and a unit number
 * starting at given index
 */
find the keyboard specified by a driver name and a unit number
starting at given index
find the keyboard specified by a driver name and a unit number starting at given index
int
kbd_find_keyboard2(char *driver, int unit, int index)
{
	int i;
	if ((index < 0) || (index >= keyboards))
		return (-1);
	for (i = index; i < keyboards; ++i) {
		if (keyboard[i] == NULL)
			continue;
		if (!KBD_IS_VALID(keyboard[i]))
			continue;
		if (strcmp("*", driver) && strcmp(keyboard[i]->kb_name, driver))
			continue;
		if ((unit != -1) && (keyboard[i]->kb_unit != unit))
			continue;
		return (i);
	}
	return (-1);
}
int kbd_find_keyboard2 ( char * driver , int unit , int index ) { int i ; if ( ( index < 0 ) || ( index >= keyboards ) ) return ( -1 ) ; for ( i = index ; i < keyboards ; ++ i ) { if ( keyboard [ i ] == NULL ) continue ; if ( ! KBD_IS_VALID ( keyboard [ i ] ) ) continue ; if ( strcmp ( " " , driver ) && strcmp ( keyboard [ i ] -> kb_name , driver ) ) continue ; if ( ( unit != -1 ) && ( keyboard [ i ] -> kb_unit != unit ) ) continue ; return ( i ) ; } return ( -1 ) ; }
find the keyboard specified by a driver name and a unit number
 starting at given index
find the keyboard specified by a driver name and a unit number starting at given index