FreeBSD/sys/dev/kbd/kbd.c
/* find a function table by the driver name */
find a function table by the driver name
find a function table by the driver name
keyboard_switch_t
*kbd_get_switch(char *driver)
{
	const keyboard_driver_t **list;
	const keyboard_driver_t *p;
	SLIST_FOREACH(p, &keyboard_drivers, link) {
		if (strcmp(p->name, driver) == 0)
			return (p->kbdsw);
	}
	SET_FOREACH(list, kbddriver_set) {
		p = *list;
		if (strcmp(p->name, driver) == 0)
			return (p->kbdsw);
	}
	return (NULL);
}
keyboard_switch_t * kbd_get_switch ( char * driver ) { const keyboard_driver_t * * list ; const keyboard_driver_t * p ; SLIST_FOREACH ( p , & keyboard_drivers , link ) { if ( strcmp ( p -> name , driver ) == 0 ) return ( p -> kbdsw ) ; } SET_FOREACH ( list , kbddriver_set ) { p = * list ; if ( strcmp ( p -> name , driver ) == 0 ) return ( p -> kbdsw ) ; } return ( NULL ) ; }
find a function table by the driver name
find a function table by the driver name