anchor.diff:  -module(nklib_gen_server).
   -author('Carlos Gonzalez <carlosj.gf@gmail.com>').
   
  --export([init/4, init/5, handle_call/5, handle_call/6, handle_cast/4, handle_cast/5,
  -         handle_info/4, handle_info/5, terminate/4, terminate/5, 
  -         code_change/5, code_change/6, handle_any/5]).
  +-export([init/4, init/5]).
  +-export([handle_call/5, handle_call/6, handle_call/7]).
  +-export([handle_cast/4, handle_cast/5, handle_cast/6]).
  +-export([handle_info/4, handle_info/5, handle_info/6]).
  +-export([terminate/4, terminate/5, code_change/5, code_change/6]).
  +-export([handle_any/5, handle_any/6]).
   -include("nklib.hrl").
   
   
   %% ===================================================================
   %% Types
   %% ===================================================================
  +
  +-type reply() ::
  +    {reply, term(), tuple()} |
  +    {reply, term(), tuple(), timeout() | hibernate} |
  +    {noreply, tuple()} |
  +    {noreply, tuple(), timeout() | hibernate} |
  +    {stop, term(), term(), tuple()} |
  +    {stop, term(), tuple()}.
  +
  +
  +-type noreply() ::
  +    {noreply, tuple()} |
  +    {noreply, tuple(), timeout() | hibernate} |
  +    {stop, term(), tuple()}.
  +
   
   
   
  
positive.code:     term().
  
  handle_any(Fun, Args, State, PosMod, PosUser) ->
      SubMod = element(PosMod, State),
      User = element(PosUser, State),
      Args1 = Args++[User],
      case erlang:function_exported(SubMod, Fun, length(Args1)) of
          true ->
              proc_reply(apply(SubMod, Fun, Args1), PosUser, State);
          false ->
              ok
      end.
  
  
  %% @private
  proc_reply(Term, PosUser, State) ->
      case Term of
          {reply, Reply, User1} ->
              {reply, Reply, setelement(PosUser, State, User1)};
          {reply, Reply, User1, Timeout} ->
              {reply, Reply, setelement(PosUser, State, User1), Timeout};
          {noreply, User1} ->
              {noreply, setelement(PosUser, State, User1)};
          {noreply, User1, Timeout} ->
              {noreply, setelement(PosUser, State, User1), Timeout};
          {stop, Reason, User1} ->
              {stop, Reason, setelement(PosUser, State, User1)};
          {stop, Reason, Reply, User1} ->
  
negative.code: 
  %% @private
  -spec handle_any(atom(), list(), tuple(), pos_integer(), pos_integer()) ->
      {ok, tuple()} |
      {ok, term(), tuple()} |
      {error, term(), tuple()} |
  