diff options
author | Loïc Hoguin <[email protected]> | 2014-04-09 13:45:07 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2014-04-09 13:45:07 +0200 |
commit | 889f87c866f647628aa552bfc36758fbc11ee24e (patch) | |
tree | 4fc7064f82c3526997a0f1392808e82702384017 | |
parent | 0eb48d66447cca4a9b1e719542b9551357fc7a17 (diff) | |
download | esdl2-889f87c866f647628aa552bfc36758fbc11ee24e.tar.gz esdl2-889f87c866f647628aa552bfc36758fbc11ee24e.tar.bz2 esdl2-889f87c866f647628aa552bfc36758fbc11ee24e.zip |
Add typespecs to the sdl_filesystem module
Again the interface had to change a little to better distinguish
errors.
-rw-r--r-- | c_src/sdl_filesystem.c | 4 | ||||
-rw-r--r-- | src/sdl_filesystem.erl | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/c_src/sdl_filesystem.c b/c_src/sdl_filesystem.c index cf6c601..4187bbe 100644 --- a/c_src/sdl_filesystem.c +++ b/c_src/sdl_filesystem.c @@ -30,7 +30,7 @@ NIF_FUNCTION(get_base_path) SDL_free(path); - return term; + return enif_make_tuple2(env, atom_ok, term); } // get_pref_path @@ -53,5 +53,5 @@ NIF_FUNCTION(get_pref_path) SDL_free(path); - return term; + return enif_make_tuple2(env, atom_ok, term); } diff --git a/src/sdl_filesystem.erl b/src/sdl_filesystem.erl index 5dd5441..f608c03 100644 --- a/src/sdl_filesystem.erl +++ b/src/sdl_filesystem.erl @@ -17,8 +17,10 @@ -export([get_base_path/0]). -export([get_pref_path/2]). +-spec get_base_path() -> {ok, string()} | sdl:error(). get_base_path() -> esdl2:get_base_path(). +-spec get_pref_path(string(), string()) -> {ok, string()} | sdl:error(). get_pref_path(Org, App) -> esdl2:get_pref_path(Org, App). |