lib/kuhl-config.c
/** Reads a floating point number from the config file. Returns returnWhenMissing if the key is missing. Returns returnInvalidValue if they key is set to a non-floating point number. */
Reads a floating point number from the config file. Returns returnWhenMissing if the key is missing. Returns returnInvalidValue if they key is set to a non-floating point number.
Reads a floating point number from the config file . Returns returnWhenMissing if the key is missing . Returns returnInvalidValue if they key is set to a non - floating point number .
float kuhl_config_float(const char *key, float returnWhenMissing, float returnInvalidValue)
{
	const char *value = kuhl_config_get(key);
	if(value == NULL)
		return returnWhenMissing;
	float f;
	if(sscanf(value, "%f", &f) == 1)
		return f;
	else
		return returnInvalidValue;
}
float kuhl_config_float ( const char * key , float returnWhenMissing , float returnInvalidValue ) { const char * value = kuhl_config_get ( key ) ; if ( value == NULL ) return returnWhenMissing ; float f ; if ( sscanf ( value , " " , & f ) == 1 ) return f ; else return returnInvalidValue ; }
Reads a floating point number from the config file.
Reads a floating point number from the config file .