Shuffle some types

Put types in the modules they belong to instead of including them in
each one from the header.
This commit is contained in:
Carlos Martín Nieto
2013-08-31 14:43:25 +02:00
parent dea88e5a59
commit b04809ca59
15 changed files with 78 additions and 50 deletions

View File

@@ -7,15 +7,18 @@
-include("geef_records.hrl").
-type oid() :: #geef_oid{oid :: binary()}.
-export_type([oid/0]).
-export([parse/1, hex/1]).
%% @doc Get a hex-encoded string of the hash
-spec hex(geef_oid()) -> binary().
-spec hex(geef_oid:oid()) -> binary().
hex(#geef_oid{oid=Oid}) ->
geef_nif:oid_fmt(Oid).
%% @doc Parse an iolist as a hash
-spec parse(iolist() | binary()) -> geef_oid().
-spec parse(iolist() | binary()) -> geef_oid:oid().
parse(Sha) ->
Oid = geef_nif:oid_parse(Sha),
#geef_oid{oid=Oid}.