Implement fluid_get_userconf() on windows (#425)

This commit is contained in:
Tom M 2018-09-09 22:34:35 +02:00 committed by GitHub
parent 64687c3a05
commit e4b8e2b44c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View file

@ -81,6 +81,7 @@ FluidSynths major version was bumped. The API was reworked, deprecated functions
- rename chorus getters to match naming conventions: fluid_synth_get_chorus_speed() and fluid_synth_get_chorus_depth()
- fluid_synth_remove_sfont() returns FLUID_OK or FLUID_FAILED
- introduce a separate data type for sequencer client IDs: #fluid_seq_id_t
- fluid_get_userconf() has been implemented for Windows
<strong>New Features and API additions:</strong>

View file

@ -623,22 +623,27 @@ fluid_source(fluid_cmd_handler_t *handler, const char *filename)
char *
fluid_get_userconf(char *buf, int len)
{
#if defined(WIN32) || defined(MACOS9)
return NULL;
#else
char *home = getenv("HOME");
const char *home = NULL;
const char *config_file;
#if defined(WIN32)
home = getenv("USERPROFILE");
config_file = "\\fluidsynth.cfg";
#elif !defined(MACOS9)
home = getenv("HOME");
config_file = "/.fluidsynth";
#endif
if(home == NULL)
{
return NULL;
}
else
{
FLUID_SNPRINTF(buf, len, "%s/.fluidsynth", home);
FLUID_SNPRINTF(buf, len, "%s%s", home, config_file);
return buf;
}
#endif
}
/**