anchor.diff:  %%
   
   -module(asn1ct_func).
  --export([start_link/0,need/1,call/3,generate/1]).
  +-export([start_link/0,need/1,call/3,call_gen/3,call_gen/4,generate/1]).
   -export([init/1,handle_call/3,handle_cast/2,terminate/2]).
   
   start_link() ->
  
positive.code:     asn1ct_rtt:assert_defined(MFA),
      cast({need,MFA}).
  
  generate(Fd) ->
      Used0 = req(get_used),
      erase(?MODULE),
      Used = sofs:set(Used0, [mfa]),
  
negative.code:     end.
  
  handle_call(get_used, _From, #st{used=Used}=St) ->
      {stop,normal,gb_sets:to_list(Used),St};
  handle_call(get_gen, _From, #st{gen=G0}=St) ->
      {L,G} = do_get_gen(gb_trees:to_list(G0), [], []),
      {reply,L,St#st{gen=gb_trees:from_orddict(G)}};
  handle_call({gen_func,Prefix,Key,GenFun}, _From, #st{gen=G0,gc=Gc0}=St) ->
      case gb_trees:lookup(Key, G0) of
  	none ->
  	    Name = list_to_atom(Prefix ++ integer_to_list(Gc0)),
  	    Gc = Gc0 + 1,
  	    G = gb_trees:insert(Key, {Name,GenFun}, G0),
  	    {reply,Name,St#st{gen=G,gc=Gc}};
  	{value,{Name,_}} ->
  	    {reply,Name,St}
      end.
  
  terminate(_, _) ->
      ok.
  