develop/Logical/Libraries/ac_invlib/ac_invparameter.c
int find_parameter( char *name, UINT *index, USINT *subindex, ac_inv_DriveType drive_type )
{
	int i = 0;
	acpireg *regs;

	switch( drive_type )
	{
		default: 	
		regs = p86reg; 
		break;
		
		case ACPiDriveType_P84: 
		regs = p84reg; 
		break;

		case ACPiDriveType_P74: 		
		regs = p74reg; 
		break;

		case ACPiDriveType_P76:
		case ACPiDriveType_P66: 	
		regs = p76reg; 
		break;
	}
	
	while( regs[i].name )
	{
		if( strcasecmp( regs[i].name, name ) == 0 )   /* found ? */
		{
			if( index )
				*index = regs[i].index;
			if( subindex )
				*subindex = regs[i].subindex;
			return i;
		}
		++i;
	}
	return -1; /* not found */
}
/* -----------------------------------------------------------------------------------
   find parameter in list
   returns index of parameter in parameter list or -1 in case of failure
   -----------------------------------------------------------------------------------
*/
find parameter in list
returns index of parameter in parameter list or -1 in case of failure
find parameter in list returns index of parameter in parameter list or - 1 in case of failure
int find_parameter( char *name, UINT *index, USINT *subindex, ac_inv_DriveType drive_type )
{
	int i = 0;
	acpireg *regs;
	switch( drive_type )
	{
		default: 	
		regs = p86reg; 
		break;
		case ACPiDriveType_P84: 
		regs = p84reg; 
		break;
		case ACPiDriveType_P74: 		
		regs = p74reg; 
		break;
		case ACPiDriveType_P76:
		case ACPiDriveType_P66: 	
		regs = p76reg; 
		break;
	}
	while( regs[i].name )
	{
		if( strcasecmp( regs[i].name, name ) == 0 )   
		{
			if( index )
				*index = regs[i].index;
			if( subindex )
				*subindex = regs[i].subindex;
			return i;
		}
		++i;
	}
	return -1; 
}
int find_parameter ( char * name , UINT * index , USINT * subindex , ac_inv_DriveType drive_type ) { int i = 0 ; acpireg * regs ; switch ( drive_type ) { default : regs = p86reg ; break ; case ACPiDriveType_P84 : regs = p84reg ; break ; case ACPiDriveType_P74 : regs = p74reg ; break ; case ACPiDriveType_P76 : case ACPiDriveType_P66 : regs = p76reg ; break ; } while ( regs [ i ] . name ) { if ( strcasecmp ( regs [ i ] . name , name ) == 0 ) { if ( index ) * index = regs [ i ] . index ; if ( subindex ) * subindex = regs [ i ] . subindex ; return i ; } ++ i ; } return -1 ; }
find parameter in list
returns index of parameter in parameter list or -1 in case of failure
find parameter in list returns index of parameter in parameter list or - 1 in case of failure
/* found ? */ /* not found */