From b9c9a5f12044a91126fb85320e9d4627664bdd12 Mon Sep 17 00:00:00 2001 From: Kai Krakow Date: Mon, 8 Oct 2018 21:45:23 +0200 Subject: [PATCH] refactor: Avoid exposing various internal types Signed-off-by: Kai Krakow --- daemon/gamemode.c | 5 +++++ daemon/gamemode.h | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/daemon/gamemode.c b/daemon/gamemode.c index 1f550d2..3d4a1e7 100644 --- a/daemon/gamemode.c +++ b/daemon/gamemode.c @@ -718,6 +718,11 @@ GameModeContext *game_mode_context_instance() return &instance; } +GameModeConfig *game_mode_config_from_context(const GameModeContext *context) +{ + return context ? context->config : NULL; +} + /** * Attempt to resolve the exe for wine-preloader. * This function is used if game_mode_context_find_exe() identified the diff --git a/daemon/gamemode.h b/daemon/gamemode.h index f9df524..201cf85 100644 --- a/daemon/gamemode.h +++ b/daemon/gamemode.h @@ -39,9 +39,10 @@ POSSIBILITY OF SUCH DAMAGE. typedef int procfd_t; /** - * Opaque context + * Opaque types */ typedef struct GameModeContext GameModeContext; +typedef struct GameModeConfig GameModeConfig; /** * Return the singleton instance @@ -88,6 +89,14 @@ bool game_mode_context_unregister(GameModeContext *self, pid_t pid); */ int game_mode_context_query_status(GameModeContext *self, pid_t pid); +/** + * Query the config of a gamemode context + * + * @param context A gamemode context + * @returns Configuration from the gamemode context + */ +GameModeConfig *game_mode_config_from_context(const GameModeContext *context); + /** gamemode-env.c * Provides internal API functions specific to working environment * variables.