anchor.diff:  	 handle_cast/2,
   	 handle_info/2,
   	 terminate/2,
  -	 code_change/3
  +	 code_change/3,
  +
  +	 test/0
   	]).
   
   %%--------------------------------------------------------------------
  
positive.code: %%           Address = address record()
  %%           Reason  = string()
  %%--------------------------------------------------------------------
  parse_address([], A) when is_record(A, address)->
      A;
  parse_address([{user, V} | T], A) when is_record(A, address) ->
      parse_address(T, A#address{user=V});
  parse_address([{address, V} | T], A) when is_record(A, address) ->
      parse_address(T, A#address{address=V});
  parse_address([H | _T], A) when is_record(A, address) ->
      E = io_lib:format("bad data in address record (user ~p) : ~p", [A#address.user, H]),
      {error, E}.
  
negative.code: 	    E
      end;
  parse_term([H | _T], _UserList, _AddrList) ->
      E = io_lib:format("sipuserdb_file: Unknown data : ~p", [H]),
      {error, lists:flatten(E)}.
  
  
  %% part of parse_term/3, parse addresses listed together with user
  parse_addresses(Username, [H | T], Res) ->
      case parse_address([{address, H}], #address{user=Username}) of
  	A when is_record(A, address) ->
  	    parse_addresses(Username, T, [A | Res]);
  	E ->
  	    E
      end;
  parse_addresses(_Username, [], Res) ->
      lists:reverse(Res).
  
  %%--------------------------------------------------------------------
  %% Function: parse_user(Params, U, Addrs)
  %%           Params = list() of {Key, Value} tuple()
  %%           U      = user record()
  %%           Addrs  = list() of string() - just accumulator
  %% Descrip.: Parse a user entry.
  %% Returns : {ok, User, AddrList} |
  %%           {error, Reason}
  %%           User     = user record()
  %%           AddrList = list() of string()
  %%           Reason   = string()
  %%--------------------------------------------------------------------
  parse_user([], U, Addrs) when is_record(U, user), U#user.name == undefined ->
      E = io_lib:format("user record incomplete (no user, raw user ~p, addresses ~p)", [U, Addrs]),
      {error, lists:flatten(E)};
  parse_user([], U, Addrs) when is_record(U, user) ->
      {ok, U, Addrs};
  
  parse_user([{name, V} | T], U, Addrs) when is_record(U, user), is_list(V) ->
      parse_user(T, U#user{name=V}, Addrs);
  parse_user([{password, V} | T], U, Addrs) when is_record(U, user), is_list(V) ->
      parse_user(T, U#user{password=V}, Addrs);
  parse_user([{classes, V} | T], U, Addrs) when is_record(U, user), is_list(V) ->
      parse_user(T, U#user{classes=V}, Addrs);
  parse_user([{forward, V} | _T], U, _Addrs) when is_record(U, user), is_list(V) ->
      E = io_lib:format("forward not implemented in sipuserdb_file yet (name ~p) : ~p",
  		      [U#user.name, {forward, V}]),
      {error, lists:flatten(E)};
  parse_user([{addresses, V} | T], U, Addrs) when is_record(U, user), is_list(V) ->
      parse_user(T, U, Addrs ++ V);
  parse_user([H | _T], U, _Addrs) when is_record(U, user) ->
      E = io_lib:format("bad data in user record (name ~p) : ~p", [U#user.name, H]),
      {error, lists:flatten(E)}.
  
  
  %%--------------------------------------------------------------------
  %% Function: parse_address(Params, A)
  