Expose git_libgit2_version

This commit is contained in:
Carlos Martín Nieto
2013-04-01 15:08:05 +02:00
parent c2d1acbbe6
commit f41ff25a59
4 changed files with 26 additions and 0 deletions

View File

@@ -16,6 +16,9 @@
% objects
-export([object_lookup/2, object_id/1, commit_tree_id/1, commit_tree/1, tree_bypath/2, blob_size/1, blob_content/1]).
% git_libgit2
-export([library_version/0]).
-on_load(load_enif/0).
hex_to_raw(_Val) ->
@@ -108,6 +111,10 @@ blob_size(_ObjHandle) ->
blob_content(_ObjHandle) ->
nif_error(?LINE).
-spec library_version() -> {integer, integer, integer}.
library_version() ->
nif_error(?LINE).
nif_error(Line) ->
erlang:nif_error({nif_not_loaded,module,?MODULE,line,Line}).