config: Introduce new setting "softrealtime"

This adds support for a new configuration option "softrealtime" to be
read from the general section. This commit alone does nothing, the
following commit adds actually making use of the value.

Signed-off-by: Kai Krakow <kai@kaishome.de>
This commit is contained in:
Kai Krakow
2018-05-24 22:31:57 +02:00
parent 057c245fa1
commit 47f97981a5
4 changed files with 25 additions and 0 deletions

View File

@@ -67,6 +67,8 @@ struct GameModeConfig {
char defaultgov[CONFIG_VALUE_MAX];
char desiredgov[CONFIG_VALUE_MAX];
char softrealtime[CONFIG_VALUE_MAX];
long reaper_frequency;
};
@@ -157,6 +159,8 @@ static int inih_handler(void *user, const char *section, const char *name, const
valid = get_string_value(value, self->defaultgov);
} else if (strcmp(name, "desiredgov") == 0) {
valid = get_string_value(value, self->desiredgov);
} else if (strcmp(name, "softrealtime") == 0) {
valid = get_string_value(value, self->softrealtime);
}
} else if (strcmp(section, "custom") == 0) {
/* Custom subsection */
@@ -401,3 +405,11 @@ void config_get_desired_governor(GameModeConfig *self, char governor[CONFIG_VALU
{
memcpy_locked_config(self, governor, self->desiredgov, sizeof(self->desiredgov));
}
/*
* Get the chosen soft realtime behavior
*/
void config_get_soft_realtime(GameModeConfig *self, char softrealtime[CONFIG_VALUE_MAX])
{
memcpy_locked_config(self, softrealtime, self->softrealtime, sizeof(self->softrealtime));
}