anchor.diff:  %% an {ok, ...} tuple.  Thereafter the state callbacks are called
   %% for all events to this server.
   -callback init(Args :: term()) ->
  -    {callback_mode(), state(), data()} |
  -    {callback_mode(), state(), data(), [action()] | action()} |
  +    {ok, state(), data()} |
  +    {ok, state(), data(), [action()] | action()} |
       'ignore' |
       {'stop', Reason :: term()}.
   
  -%% Example state callback for callback_mode() =:= state_functions
  -%% state name 'state_name'.
  -%%
  -%% In this mode all states has to be type state_name() i.e atom().
  -%%
  -%% Note that state callbacks and only state callbacks have arity 5
  -%% and that is intended.
  +%% This callback shall return the callback mode of the callback module.
  +%%
  +%% It is called once after init/0 and code_change/4 but before
  +%% the first state callback StateName/3 or handle_event/4.
  +-callback callback_mode() -> callback_mode().
  +
  +%% Example state callback for StateName = 'state_name'
  +%% when callback_mode() =:= state_functions.
  +%%
  +%% In this mode all states has to be of type state_name() i.e atom().
  +%%
  +%% Note that the only callbacks that have arity 3 are these
  +%% StateName/3 callbacks and terminate/3, so the state name
  +%% 'terminate' is unusable in this mode.
   -callback state_name(
   	    event_type(),
   	    EventContent :: term(),
   	    Data :: data()) ->
       state_function_result().
   %%
  -%% State callback for callback_mode() =:= handle_event_function.
  -%%
  -%% Note that state callbacks and only state callbacks have arity 5
  -%% and that is intended.
  +%% State callback for all states
  +%% when callback_mode() =:= handle_event_function.
   -callback handle_event(
   	    event_type(),
   	    EventContent :: term(),
  
positive.code: %% the same arguments as you would have returned from init/1
  -spec enter_loop(
  	Module :: module(), Opts :: [debug_opt()],
  	CallbackMode :: callback_mode(),
  	State :: state(), Data :: data()) ->
  			no_return().
  enter_loop(Module, Opts, CallbackMode, State, Data) ->
      enter_loop(Module, Opts, CallbackMode, State, Data, self()).
  %%
  -spec enter_loop(
  	Module :: module(), Opts :: [debug_opt()],
  	CallbackMode :: callback_mode(),
  	State :: state(), Data :: data(),
  	Server_or_Actions ::
  	  server_name() | pid() | [action()]) ->
  			no_return().
  enter_loop(Module, Opts, CallbackMode, State, Data, Server_or_Actions) ->
      if
  	is_list(Server_or_Actions) ->
  	    enter_loop(
  	      Module, Opts, CallbackMode, State, Data,
  	      self(), Server_or_Actions);
  	true ->
  	    enter_loop(
  	      Module, Opts, CallbackMode, State, Data,
  	      Server_or_Actions, [])
      end.
  %%
  -spec enter_loop(
  	Module :: module(), Opts :: [debug_opt()],
  	CallbackMode :: callback_mode(),
  	State :: state(), Data :: data(),
  	Server :: server_name() | pid(),
  	Actions :: [action()] | action()) ->
  			no_return().
  enter_loop(Module, Opts, CallbackMode, State, Data, Server, Actions) ->
      is_atom(Module) orelse error({atom,Module}),
      callback_mode(CallbackMode) orelse error({callback_mode,CallbackMode}),
      Parent = gen:get_parent(),
      enter(Module, Opts, CallbackMode, State, Data, Server, Actions, Parent).
  
  %%---------------------------------------------------------------------------
  %% API helpers
  
negative.code: 
  init_result(Starter, Parent, ServerRef, Module, Result, Opts) ->
      case Result of
  	{ok,State,Data} ->
  	    proc_lib:init_ack(Starter, {ok,self()}),
  	    enter(Module, Opts, State, Data, ServerRef, [], Parent);
  	{ok,State,Data,Actions} ->
  	    proc_lib:init_ack(Starter, {ok,self()}),
  	    enter(Module, Opts, State, Data, ServerRef, Actions, Parent);
  	{stop,Reason} ->
  	    gen:unregister_name(ServerRef),
  	    proc_lib:init_ack(Starter, {error,Reason}),
  