anchor.diff:      any().
   
   terminate(Reason, State, PosMod, PosUser) ->
  -    SubMod = element(PosMod, State),
  -    User = element(PosUser, State),
  -    case erlang:function_exported(SubMod, terminate, 2) of
  +    terminate(terminate, Reason, State, PosMod, PosUser).
  +
  +
  +%% @private
  +-spec terminate(atom(), term(), tuple(), pos_integer(), pos_integer()) ->
  +    any().
  +
  +terminate(Fun, Reason, State, PosMod, PosUser) ->
  +    SubMod = element(PosMod, State),
  +    User = element(PosUser, State),
  +    case erlang:function_exported(SubMod, Fun, 2) of
           true -> 
  -            SubMod:terminate(Reason, User);
  +            SubMod:Fun(Reason, User);
           false ->
               ok
       end.
  
positive.code: -module(nklib_gen_server).
  -author('Carlos Gonzalez <carlosj.gf@gmail.com>').
  
  -export([init/4, handle_call/5, handle_cast/4, handle_info/4, terminate/4, 
           code_change/5, handle_any/5]).
  -include("nklib.hrl").
  
  
  
negative.code:     {stop, term(), tuple()}.
  
  handle_info(Msg, State, PosMod, PosUser) ->
      handle_info(handle_info, Msg, State, PosMod, PosUser).
  
  
  %% @private
  -spec handle_info(atom(), term(), tuple(), pos_integer(), pos_integer()) ->
      {noreply, tuple()} |
      {noreply, tuple(), timeout() | hibernate} |
      {stop, term(), tuple()}.
  
  handle_info(Fun, Msg, State, PosMod, PosUser) ->
      SubMod = element(PosMod, State),
      User = element(PosUser, State),
      case erlang:function_exported(SubMod, Fun, 2) of
          true ->
              proc_reply(SubMod:Fun(Msg, User), PosUser, State);
          false ->
              {noreply, State}
      end.
  