Permalink
Browse files

Return a tuple instead of a 3 element tuple. Consistency is good.

  • Loading branch information...
msantos committed Jan 11, 2010
1 parent 06bf60f commit 6a15ed036870e535564281b7e297845f7af863a5
Showing with 6 additions and 3 deletions.
  1. +3 −1 README
  2. +3 −2 c_src/procket.c
View
4 README
@@ -8,14 +8,16 @@ R13B03.
EXPORTS
-listen(Port, Options) -> {ok, FD} | {error, Reason} | {error, Reason, Description}
+listen(Port, Options) -> {ok, FD} | {error, Reason} | {error, {Reason, Description}}
Types Port = 0..65535
Options = [Opts]
Opts = {pipe, Path} | {protocol, Protocol} | {ip, IPAddress} |
{progname, string()}
Protocol = tcp | udp
IPAddress = string() | tuple()
+ Reason = atom()
+ Description = string()
COMPILING
View
@@ -198,10 +198,11 @@ error_tuple(ErlNifEnv *env, char *atom, char *err)
static ERL_NIF_TERM
error_message(ErlNifEnv *env, char *atom, char *err, char *msg)
{
- return enif_make_tuple(env, 3,
+ return enif_make_tuple(env, 2,
enif_make_atom(env, atom),
+ enif_make_tuple(env, 2,
enif_make_atom(env, err),
- enif_make_string(env, msg));
+ enif_make_string(env, msg)));
}

0 comments on commit 6a15ed0

Please sign in to comment.