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-integer. */
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-integer.
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 - integer .
int kuhl_config_int(const char *key, int returnWhenMissing, int returnInvalidValue)
{
	const char *value = kuhl_config_get(key);
	if(value == NULL)
		return returnWhenMissing;
	int i;
	if(sscanf(value, "%d", &i) == 1)
		return i;
	else
		return returnInvalidValue;
}
int kuhl_config_int ( const char * key , int returnWhenMissing , int returnInvalidValue ) { const char * value = kuhl_config_get ( key ) ; if ( value == NULL ) return returnWhenMissing ; int i ; if ( sscanf ( value , " " , & i ) == 1 ) return i ; else return returnInvalidValue ; }
Reads a floating point number from the config file.
Reads a floating point number from the config file .