Modified:
branches/RB-0.2/lib/ewgi/include/ewgi.hrl
branches/RB-0.2/lib/ewgi/src/ewgi_api.erl
branches/RB-0.2/lib/ewgi/src/ewgi_application.erl
Log:
Fixed existing dialyzer specs
Modified: branches/RB-0.2/lib/ewgi/include/ewgi.hrl
==============================================================================
--- branches/RB-0.2/lib/ewgi/include/ewgi.hrl (original)
+++ branches/RB-0.2/lib/ewgi/include/ewgi.hrl Tue Nov 18 08:22:12 2008
@@ -170,4 +170,4 @@
response = #ewgi_response{} :: #ewgi_response{}}).
%% @type ewgi_app() = function()
--type ewgi_app() :: fun((ewgi_context()) -> ewgi_context()).
+-type ewgi_app() :: fun((#ewgi_context{}) -> #ewgi_context{}).
Modified: branches/RB-0.2/lib/ewgi/src/ewgi_api.erl
==============================================================================
--- branches/RB-0.2/lib/ewgi/src/ewgi_api.erl (original)
+++ branches/RB-0.2/lib/ewgi/src/ewgi_api.erl Tue Nov 18 08:22:12 2008
@@ -67,15 +67,15 @@
%%====================================================================
%% API
%%====================================================================
--spec(empty_request/0 :: () -> ewgi_request()).
+-spec empty_request() -> #ewgi_request{}.
empty_request() ->
#ewgi_request{}.
--spec(empty_response/0 :: () -> ewgi_response()).
+-spec empty_response() -> #ewgi_response{}.
empty_response() ->
#ewgi_response{}.
--spec(context/2 :: (ewgi_request(), ewgi_response()) -> ewgi_context()).
+-spec context(#ewgi_request{}, #ewgi_response{}) -> #ewgi_context{}.
context(Request, Response) when is_record(Request, ewgi_request),
is_record(Response, ewgi_response) ->
#ewgi_context{request=Request, response=Response}.
@@ -310,7 +310,7 @@
%% @spec read_input_string(integer(), ewgi_context()) -> string()
%% @doc Reads the client message body into a string from the EWGI context.
--spec(read_input_string/2 :: (integer(), ewgi_context()) -> string()).
+-spec read_input_string(integer(), #ewgi_context{}) -> string().
read_input_string(L, Ctx) when is_integer(L) ->
R = read_input(Ctx),
Modified: branches/RB-0.2/lib/ewgi/src/ewgi_application.erl
==============================================================================
--- branches/RB-0.2/lib/ewgi/src/ewgi_application.erl (original)
+++ branches/RB-0.2/lib/ewgi/src/ewgi_application.erl Tue Nov 18 08:22:12
2008
@@ -35,13 +35,13 @@
%% @spec run(Application::ewgi_app(), Context::ewgi_context()) ->
Context1::ewgi_context()
%% @doc Runs an EWGI application with Context and returns the new Context1.
--spec(run/2 :: (ewgi_app(), ewgi_context()) -> ewgi_context()).
+-spec run(ewgi_app(), #ewgi_context{}) -> #ewgi_context{}.
run(Application, Context) when is_function(Application, 1) ->
Application(Context).
%% @spec module_mw(Module::term()) -> ewgi_app()
%% @doc Produces a middleware application which calls the handle/1
function exported by Module.
--spec(module_mw/1 :: (any()) -> ewgi_app()).
+-spec module_mw(any()) -> ewgi_app().
module_mw(Module) ->
F = fun(Context) ->
Module:handle(Context)
@@ -50,7 +50,7 @@
%% @spec rpc_mw(Node::atom(), Module::atom(), Fun::atom()) -> ewgi_app()
%% @doc Produces a middleware application which calls the remote function
Module:Fun on Node.
--spec(rpc_mw/3 :: (atom(), atom(), atom()) -> ewgi_app()).
+-spec rpc_mw(atom(), atom(), atom()) -> ewgi_app().
rpc_mw(Node, Module, Fun) ->
F = fun(Context) ->
rpc:call(Node, Module, Fun, [Context])
@@ -59,7 +59,7 @@
%% @spec mfa_mw(Module::atom(), Fun::atom()) -> ewgi_app()
%% @doc Produces a middleware application which calls the function
Module:Fun(Args)
--spec(mfa_mw/2 :: (atom(), atom()) -> ewgi_app()).
+-spec mfa_mw(atom(), atom()) -> ewgi_app().
mfa_mw(Module, Fun) when is_atom(Module), is_atom(Fun) ->
F = fun(Context) ->
apply(Module, Fun, [Context])