15 std::map<std::string,std::string> options;
17 FILE* file = fopen( name,
"r" );
20 log_warning( stderr,
"failed opening \"%s\"\n", name );
27 while (fscanf( file,
"%s %s", key, value ) == 2)
28 options[ key ] = std::string( value );
41 for (
uint32 l = 0; *str !=
'\0' && l < len; ++l)
43 const char c = *str; ++str;
44 if (c ==
'.')
continue;
45 if (c >=
'0' && c <=
'9')
continue;
57 if (!(str[0] ==
'C' ||
69 std::string nums = std::string( str + 2 );
70 const size_t c = nums.find(
',');
71 if (c == std::string::npos)
75 if (
is_number( nums.c_str() + c + 1 ) ==
false)
return def;
77 const std::string num1 = nums.substr( 0, c );
78 const std::string num2 = std::string( nums.c_str() + c + 1 );
80 ret.
k = (float)atof( num1.c_str() );
81 ret.
m = (float)atof( nums.c_str() + c + 1 );
92 template <
typename options_type>
95 return (options.find( std::string(name) ) != options.end()) ?
96 parse_function( options.find(std::string(name))->second.c_str(), func ) :
100 template <
typename options_type>
104 (options.find( std::string(name1) ) != options.end()) ?
105 parse_function( options.find(std::string(name1))->second.c_str(), func ) :
106 (options.find( std::string(name2) ) != options.end()) ?
107 parse_function( options.find(std::string(name2))->second.c_str(), func ) :
155 if (init || (local != old_local))
207 if (init || (local != old_local))
286 log_warning(stderr,
"--very-fast-local is incompatible with --end-to-end\n");
299 log_warning(stderr,
"--fast-local is incompatible with --end-to-end\n");
312 log_warning(stderr,
"--sensitive-local is incompatible with --end-to-end\n");
314 if (
uint_option(options,
"very-sensitive-local", 0u))
325 log_warning(stderr,
"--very-sensitive-local is incompatible with --end-to-end\n");
330 if (
uint_option(options,
"very-fast",
"very-fast-local", 0u))
337 if (
uint_option(options,
"fast",
"fast-local", 0u))
344 if (
uint_option(options,
"sensitive",
"sensitive-local", 0u))
351 if (
uint_option(options,
"very-sensitive",
"very-sensitive-local", 0u))