develop/Logical/Libraries/ac_invlib/ac_invparameter.c
int find_numeric_value( char *name, char *constant, ac_inv_DriveType drive_type )
{
	int index;
	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;
	}


	index = find_parameter( name, 0, 0, drive_type );
	if( index >= 0 )
	{
		int i = 0;
		/* try to find the constant */
		if( regs[index].enu )   /* are constants defined ? */
		{
			while( regs[index].enu[i].name )
			{
				if( strcasecmp( regs[index].enu[i].name, constant ) == 0 )
				{
					return( regs[index].enu[i].value );  /* return enumerated name */
				}
				++i;
			}
		}
	}
	return m_atol(constant);  /* return numeric value */

}
/* -----------------------------------------------------------------------------------
 	returns the value for the given constant
   -----------------------------------------------------------------------------------
*/
returns the value for the given constant
returns the value for the given constant
int find_numeric_value( char *name, char *constant, ac_inv_DriveType drive_type )
{
	int index;
	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;
	}
	index = find_parameter( name, 0, 0, drive_type );
	if( index >= 0 )
	{
		int i = 0;
		if( regs[index].enu )   
		{
			while( regs[index].enu[i].name )
			{
				if( strcasecmp( regs[index].enu[i].name, constant ) == 0 )
				{
					return( regs[index].enu[i].value );  
				}
				++i;
			}
		}
	}
	return m_atol(constant);  
}
int find_numeric_value ( char * name , char * constant , ac_inv_DriveType drive_type ) { int index ; 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 ; } index = find_parameter ( name , 0 , 0 , drive_type ) ; if ( index >= 0 ) { int i = 0 ; if ( regs [ index ] . enu ) { while ( regs [ index ] . enu [ i ] . name ) { if ( strcasecmp ( regs [ index ] . enu [ i ] . name , constant ) == 0 ) { return ( regs [ index ] . enu [ i ] . value ) ; } ++ i ; } } } return m_atol ( constant ) ; }
returns the value for the given constant
returns the value for the given constant
/* try to find the constant */ /* are constants defined ? */ /* return enumerated name */ /* return numeric value */