lib/dgr.c
/** Given a name, find the index of the name in our list. Returns -1 if
 * name is not found. */
Given a name, find the index of the name in our list. Returns -1 if
name is not found.
Given a name find the index of the name in our list . Returns - 1 if name is not found .
static int dgr_findIndex(const char *name)
{
	for(int i=0; i<dgr_list_size; i++)
	{
		if(strcmp(name, dgr_list[i].name) == 0)
			return i;
	}
	return -1;
}
static int dgr_findIndex ( const char * name ) { for ( int i = 0 ; i < dgr_list_size ; i ++ ) { if ( strcmp ( name , dgr_list [ i ] . name ) == 0 ) return i ; } return -1 ; }
Given a name, find the index of the name in our list.
Given a name find the index of the name in our list .