mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-08-02 03:16:47 +02:00
config: Allow renice configuration
This commit adds configuration support for the renice value and amends documentation and examples. This commit by itself does nothing, the following commit is needed to actually apply the new settings. Signed-off-by: Kai Krakow <kai@kaishome.de>
This commit is contained in:
@@ -68,6 +68,7 @@ struct GameModeConfig {
|
||||
char desiredgov[CONFIG_VALUE_MAX];
|
||||
|
||||
char softrealtime[CONFIG_VALUE_MAX];
|
||||
long renice;
|
||||
|
||||
long reaper_frequency;
|
||||
};
|
||||
@@ -161,6 +162,8 @@ static int inih_handler(void *user, const char *section, const char *name, const
|
||||
valid = get_string_value(value, self->desiredgov);
|
||||
} else if (strcmp(name, "softrealtime") == 0) {
|
||||
valid = get_string_value(value, self->softrealtime);
|
||||
} else if (strcmp(name, "renice") == 0) {
|
||||
valid = get_long_value(name, value, &self->renice);
|
||||
}
|
||||
} else if (strcmp(section, "custom") == 0) {
|
||||
/* Custom subsection */
|
||||
@@ -413,3 +416,11 @@ void config_get_soft_realtime(GameModeConfig *self, char softrealtime[CONFIG_VAL
|
||||
{
|
||||
memcpy_locked_config(self, softrealtime, self->softrealtime, sizeof(self->softrealtime));
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the renice value
|
||||
*/
|
||||
void config_get_renice_value(GameModeConfig *self, long *value)
|
||||
{
|
||||
memcpy_locked_config(self, value, &self->renice, sizeof(long));
|
||||
}
|
||||
|
@@ -108,3 +108,8 @@ void config_get_desired_governor(GameModeConfig *self, char governor[CONFIG_VALU
|
||||
* Get the chosen soft realtime behavior
|
||||
*/
|
||||
void config_get_soft_realtime(GameModeConfig *self, char softrealtime[CONFIG_VALUE_MAX]);
|
||||
|
||||
/*
|
||||
* Get the renice value
|
||||
*/
|
||||
void config_get_renice_value(GameModeConfig *self, long *value);
|
||||
|
Reference in New Issue
Block a user