anchor.diff:  %%--------------------------------------------------------------------
   %% Function: fetch(Key, List)
   %%           Key = string(), the name of a field in a sip message
  -%%           header - all RFC 3261 formats are accepted
  -%%           List = keylist record()
  -%% Descrip.: return the contens that of the header that matches Key
  -%% Returns : E#keyelem.item
  +%%                 header - all RFC 3261 formats are accepted
  +%%           List = keylist record()
  +%% Descrip.: return the contents of the header that matches Key
  +%% Returns : list() of string(), the value of Key - Key may have
  +%%           several values associated with it (e.g. the "Via"
  +%%           header in sip requests)
   %%--------------------------------------------------------------------
   fetch(Key, List) when record(List, keylist) ->
       fetchcase(to_lower(Key), List#keylist.list);
  +%% XXX redundant check
   fetch(Key, List) ->
       erlang:fault("Keylist not wellformed", [Key, List]).
   
  -fetchcase(Key, []) ->
  +fetchcase(_Key, []) ->
       [];
  -fetchcase(Key, [Elem | List]) when record(Elem, keyelem), Elem#keyelem.casekey == Key ->
  +fetchcase(Key, [Elem | _List]) when record(Elem, keyelem), Elem#keyelem.casekey == Key ->
       Elem#keyelem.item;
   fetchcase(Key, [Elem | List]) when record(Elem, keyelem) ->
       fetchcase(Key, List);
   fetchcase(Key, [Elem | List]) ->
  +%% XXX ok to crash process ? redundant check it will result in a crash any way
       erlang:fault("Keylist element not wellformed", [Key, [Elem | List]]).
   
   %%--------------------------------------------------------------------
  
positive.code: 
  %%--------------------------------------------------------------------
  %% Function: to_lower(Key)
  %%           Key = string(), the name of a field in a sip message
  %% Descrip.: convert header key, to a standard format - lowercase and
  %%           verbose string()
  %% Returns : string()
  %% XXX something like "normalize" might be a more descriptive name
  
negative.code: %%--------------------------------------------------------------------
  %% Note: It may be preferable to store the #keyelem.casekey field as
  %% an atom() rather than a string() - this should speed up
  %% patternmatching, but don't store random strings as atom(), as
  %% atoms are not GCed. It may be possible to convert the header tags
  %% to atom() when parsed initially so that yxa can treat them as atom()
  %% internaly and only output them as string().
  %%
  %% Note: this module does some costly list operations, such as
  %% appendning elements to the end of lists.
  %% There may be a datastructure better suited for this need, of adding
  %% elements to both front and end of lists, but note that most
  %% #keyelem.item are probably short, so that the overhead of smarter
  %% datastructures may still be more costly.
  %% It may also be beneficial, when several elements are added to the
  %% end of a list - to reverse it, append the new elements in revese
  %% order and then reverse the new list back to it's proper order.
  %% This results in O(3N+2M) rather than O(N * M) (aproximate - M
  %% grows for each element in N) list hd/1 calls
  %% (N = new list of elements to add, M = the orginal list). If N is
  %% small compared to M this results in roughly a O(2M) vs a O(N*M)
  %% algorithm.
  %%--------------------------------------------------------------------
  
  -module(keylist).
  
  %%--------------------------------------------------------------------
  