Commits

Oscar Hellström committed 7a4d32d

Added start/0 and stop/0.

  • Participants
  • Parent commits bf35c48

Comments (0)

Files changed (1)

 -module(lhttpc).
 -behaviour(application).
 
--export([request/4, request/5, request/6, request/9]).
+-export([start/0, stop/0, request/4, request/5, request/6, request/9]).
 -export([start/2, stop/1]).
 
 -include("lhttpc_types.hrl").
 stop(_) ->
     ok.
 
+%% @spec () -> ok
+%% @doc
+%% Start the application.
+%% This is a helper function that will call `application:start(lhttpc)' to
+%% allow the library to be started using the `-s' flag.
+%% For instance:
+%% `$ erl -s crypto -s ssl -s lhttpc'
+%% @end
+-spec start() -> ok.
+start() ->
+	application:start(lhttpc),
+	ok.
+
+%% @spec () -> ok
+%% @doc
+%% Stops the application.
+%% This is a helper function that will call `application:stop(lhttpc)'.
+%% @end
+-spec stop() -> ok.
+stop() ->
+	application:stop(lhttpc).
+
 %% @spec (URL, Method, Hdrs, Timeout) -> Result
 %%   URL = string()
 %%   Method = string() | atom()