Add a few basic functions for the repository

This commit is contained in:
Carlos Martín Nieto
2012-08-13 23:53:31 +02:00
parent 23f6345043
commit 9cbf4024a0
3 changed files with 103 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
-module(geef).
-export([start/0, hex_to_raw/1, object_exists/2]).
-export([start/0, hex_to_raw/1, object_exists/2, repository/1, repository_path/1]).
-on_load(start/0).
start() ->
@@ -18,5 +18,18 @@ hex_to_raw(_Val) ->
object_exists(_Val, _Val2) ->
nif_error(?LINE).
repository_open(_Val) ->
nif_error(?LINE).
repository_get_path(_Val) ->
nif_error(?LINE).
repository_path({repository, Handle}) ->
repository_get_path(Handle).
repository(Path) ->
{ok, Repository} = repository_open(Path),
{repository, Repository}.
nif_error(Line) ->
exit({nif_not_loaded,module,?MODULE,line,Line}).