Skip to content

Commit

Permalink
reformat exat.erl
Browse files Browse the repository at this point in the history
  • Loading branch information
gleber committed Jan 2, 2012
1 parent 4f32b79 commit ebbf544
Showing 1 changed file with 37 additions and 36 deletions.
73 changes: 37 additions & 36 deletions src/exat.erl
@@ -1,25 +1,25 @@
% %%
% exat.erl %% exat.erl
% %%
% ---------------------------------------------------------------------- %% ----------------------------------------------------------------------
% %%
% eXAT, an erlang eXperimental Agent Tool %% eXAT, an erlang eXperimental Agent Tool
% Copyright (C) 2005-07 Corrado Santoro (csanto@diit.unict.it) %% Copyright (C) 2005-07 Corrado Santoro (csanto@diit.unict.it)
% %%
% This program is free software: you can redistribute it and/or modify %% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by %% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or %% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version. %% (at your option) any later version.
% %%
% This program is distributed in the hope that it will be useful, %% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of %% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details. %% GNU General Public License for more details.
% %%
% You should have received a copy of the GNU General Public License %% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/> %% along with this program. If not, see <http://www.gnu.org/licenses/>
% %%
% %%
-module (exat). -module (exat).
-behaviour (application). -behaviour (application).


Expand Down Expand Up @@ -69,7 +69,7 @@ start (Type, StartArgs) ->
%% Returns: any %% Returns: any
%%==================================================================== %%====================================================================
stop (State) -> stop (State) ->
ok. ok.






Expand All @@ -78,9 +78,9 @@ stop (State) ->
%% Returns: string() %% Returns: string()
%%==================================================================== %%====================================================================
current_platform () -> current_platform () ->
{CurrentPlatform, _} = lists:splitwith (fun(X) -> X =/= $@ end , {CurrentPlatform, [$@ | Hostname]} = lists:splitwith(fun(X) -> X =/= $@ end ,
atom_to_list (node ())), atom_to_list (node ())),
CurrentPlatform. CurrentPlatform ++ "." ++ Hostname.






Expand All @@ -89,23 +89,24 @@ current_platform () ->
%% Returns: {string(), string()} %% Returns: {string(), string()}
%%==================================================================== %%====================================================================
split_agent_identifier (AgentID) -> split_agent_identifier (AgentID) ->
{LocalID, HAP} = lists:splitwith (fun(X) -> X =/= $@ end , AgentID), case lists:splitwith(fun(X) -> X =/= $@ end , AgentID) of
if {LocalID, []} ->
HAP == [] -> {LocalID, current_platform()}; {LocalID, current_platform()};
true -> [_ | RealHAP] = HAP, {LocalID, RealHAP} {LocalID, [$@ | RealHAP]} ->
end. {LocalID, RealHAP}
end.






%%==================================================================== %%====================================================================
%% Func: get_argument/1 %% Func: get_argument/1
%% Returns: {ok, [string()]} | error %% Returns: {ok, [string()]} | error
%%==================================================================== %%====================================================================
get_argument (Name) -> get_argument(Name) ->
case init:get_argument (Name) of case init:get_argument(Name) of
{ok, [List]} -> {ok, List}; {ok, [List]} -> {ok, List};
_ -> error _ -> error
end. end.




%%==================================================================== %%====================================================================
Expand Down

0 comments on commit ebbf544

Please sign in to comment.