diff --git a/src/geef_config.erl b/src/geef_config.erl index ff8423b..bcbd014 100644 --- a/src/geef_config.erl +++ b/src/geef_config.erl @@ -14,6 +14,7 @@ -export([start_link/1]). -export([open/1]). -export([set/3]). +-export([get_bool/2]). %% gen_server callbacks -export([init/1, handle_call/3, handle_cast/2, handle_info/2, @@ -51,6 +52,9 @@ open(Path) -> set(Pid, Name, Val) when is_boolean(Val) -> gen_server:call(Pid, {set_bool, Name, Val}). +get_bool(Pid, Name) -> + gen_server:call(Pid, {get_bool, Name}). + %%%=================================================================== %%% gen_server callbacks %%%=================================================================== @@ -75,6 +79,10 @@ init(Handle) -> %%-------------------------------------------------------------------- handle_call({set_bool, Name, Val}, _From, State = #state{handle=Handle}) -> Reply = geef_nif:config_set_bool(Handle, Name, Val), + {reply, Reply, State}; + +handle_call({get_bool, Name}, _From, State = #state{handle=Handle}) -> + Reply = geef_nif:config_get_bool(Handle, Name), {reply, Reply, State}. %%--------------------------------------------------------------------