Add a few basic functions for the repository
This commit is contained in:
15
src/geef.erl
15
src/geef.erl
@@ -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}).
|
||||
|
||||
Reference in New Issue
Block a user