lib/kuhl-config.c
/** Set the configuration file to be used. If another configuration
    file is already loaded, it will be unloaded and the new file will
    later be loaded when a key is requested.

    @param filename The name of the configuration file to be
    loaded. If NULL, then any existing configuration file will be
    unloaded.
 */
Set the configuration file to be used. If another configuration
file is already loaded, it will be unloaded and the new file will
later be loaded when a key is requested.
Set the configuration file to be used . If another configuration file is already loaded it will be unloaded and the new file will later be loaded when a key is requested .
void kuhl_config_filename(const char *filename)
{
	if(cfg_filename != NULL && filename != NULL && strcmp(cfg_filename, filename) == 0)
		return;
	if(cfg != NULL)
	{
		cfg_free(cfg);
		cfg = NULL;
	}
	if(cfg_filename != NULL)
		msg(MSG_WARNING, "We have already loaded config file '%s' but we are now switching to file '%s'. This can happen when the program requests a configuration value and then kuhl_config_filename is called.", cfg_filename, filename);
	if(cfg_filename)
		free(cfg_filename);
	cfg_filename = strdup(filename);
}
void kuhl_config_filename ( const char * filename ) { if ( cfg_filename != NULL && filename != NULL && strcmp ( cfg_filename , filename ) == 0 ) return ; if ( cfg != NULL ) { cfg_free ( cfg ) ; cfg = NULL ; } if ( cfg_filename != NULL ) msg ( MSG_WARNING , " " , cfg_filename , filename ) ; if ( cfg_filename ) free ( cfg_filename ) ; cfg_filename = strdup ( filename ) ; }
Set the configuration file to be used.
Set the configuration file to be used .
// If the user sets the filename to the file we are already using. // Unload any settings we have already loaded.