anchor.diff:      state_functions.
   
   %% --------------------------------------------------------------------
  -%% Func: handle_call/4 handling sync "send_all_state_event""
  +%% Func: handle_call/4 handling sync call events for all statenames
   %% Returns: {next_state, NextSN, NextStateData}            |
   %%          {next_state, NextSN, NextStateData, Reply}   |
   %%          {stop, Reason, NewStateData}                          |
  
positive.code: -spec delete_until(ets:tid(), integer()) -> ok.
  delete_until(TableId, LimitId) ->
      Ids = ets:select_reverse(TableId,[{'$1',[{'=<',{element,1,'$1'},LimitId}],[{element,1,'$1'}]}]),
      [ets:delete(TableId, Id) || Id <- Ids],
      ok.
  
  -spec key_times_2(integer() | tuple(), #state{}) -> integer() | tuple() | undefined.
  
negative.code: change_list(TableId, DirtyCnt, DirtyTop, DirtyBot) ->
      [tuple_to_list(R) || R <- change_tuples(TableId, DirtyCnt, DirtyTop, DirtyBot)].
  
  -spec write_subscription(binary(), binary(), #state{}) -> ok | {error, term()}.
  write_subscription(Topic, Key, #state{ctx = #ctx{update_cursor_prepare_fun = Ucpf, update_cursor_execute_fun = Ucef}}) ->
      %% TODO: Read and update maybe is needed for multiple topic subscription.
      SubsKey = imem_json:encode([<<"register">>, <<"focus">>, [atom_to_binary(node(), utf8), list_to_binary(pid_to_list(self()))]]),
  