anchor.diff:      ct_util:save_suite_data_async(?config_name, Hooks).
   
   get_hooks() ->
  -    ct_util:read_suite_data(?config_name).
  +    lists:keysort(#ct_hook_config.prio,ct_util:read_suite_data(?config_name)).
   
   catch_apply(M,F,A, Default) ->
       try
  
positive.code: %% -------------------------------------------------------------------------
  %% Internal Functions
  %% -------------------------------------------------------------------------
  call_id(Mod, Config, Meta) when is_atom(Mod) ->
      call_id({Mod, []}, Config, Meta);
  call_id({Mod, Opts}, Config, Scope) ->
      Id = catch_apply(Mod,id,[Opts], make_ref()),
      {Config, {Id, scope(Scope), {Mod, {Id,Opts}}}}.
  	
  call_init({Mod,{Id,Opts}},Config,_Meta) ->
      NewState = Mod:init(Id, Opts),
      {Config, {Mod, NewState}}.
  
  call_terminate({Mod, State}, _, _) ->
      catch_apply(Mod,terminate,[State], ok),
      {[],{Mod,State}}.
  
  call_cleanup({Mod, State}, Reason, [Function, _Suite | Args]) ->
      NewState = catch_apply(Mod,Function, Args ++ [Reason, State],
  			   State),
      {Reason, {Mod, NewState}}.
  
  call_generic({Mod, State}, Value, [Function | Args]) ->
      {NewValue, NewState} = catch_apply(Mod, Function, Args ++ [Value, State],
  				       {Value,State}),
      {NewValue, {Mod, NewState}}.
  
  %% Generic call function
  call(Fun, Config, Meta) ->
      maybe_lock(),
      Hooks = get_hooks(),
      Res = call([{HookId,Fun} || {HookId,_, _} <- Hooks] ++
  		   get_new_hooks(Config, Fun),
  	       remove(?config_name,Config), Meta, Hooks),
      maybe_unlock(),
  
negative.code: %% If you change this, remember to update ct_util:look -> stop clause as well.
  -define(config_name, ct_hooks).
  
  -record(ct_hook_config, {id, module, prio, scope, opts = [], state = []}).
  
  %% -------------------------------------------------------------------------
  %% API Functions
  %% -------------------------------------------------------------------------
  