anchor.diff:  	    Pad > 0 ->
   	        [Value, <<0:Pad>>]
       end.
  -
  -<<<<<<< HEAD
  -unmarshal_message(Data) when is_binary(Data) ->
  -    lager:info("unmarshal_message 1 "),
  -    {Header, BinBody, Data1} = unmarshal_header(Data),
  -    lager:info("unmarshal_message 2"),
  -    Signature =
  -	    case dbus_message:find_field(?HEADER_SIGNATURE, Header) of
  -	        #dbus_variant{type=signature, value=Signature1} ->
  -		        Signature1;
  -	        undefined ->
  -		        <<"">>
  -	    end,
  -    Types = unmarshal_signature(Signature),
  -    {<<>>, Body, _Pos} = unmarshal_list(Types, BinBody),
  -    {#dbus_message{header=Header, body=Body}, Data1}.
  -
  -unmarshal_header(Bin) ->
  -    lager:info("unmarshal_header 1 "),
  -    {Data1, HeaderData, Pos} = unmarshal_list([byte, byte, byte, byte, uint32, uint32, {array, {struct, [byte, variant]}}], Bin),
  -    [$l, Type, Flags, ?DBUS_VERSION_MAJOR, Size, Serial, Fields] = HeaderData,
  -    Header = #dbus_header{type=Type,
  -			              flags=Flags,
  -			              serial=Serial,
  -			              fields=Fields},
  -    Pad = pad(8, Pos),
  -    <<0:Pad, Body:Size/binary, Data2/binary>> = Data1,
  -    {Header, Body, Data2}.
  -=======
  ->>>>>>> 6724b4b84878ed57521e1481daa05226d0d2b963
   
   
   marshal_list([], [], Pos, Res) ->
  
positive.code: unmarshal_data(Data) ->
      unmarshal_data(Data, []).
  
  <<<<<<< HEAD
  unmarshal_data(<<>>, Res) ->
      lager:info("unmarshal_data 1"),
      {Res, <<>>};
  unmarshal_data(Data, Res) ->
      lager:info("unmarshal_data 2"),
      try unmarshal_message(Data) of
  	    {Header, Data1} ->
  	        lager:info("unmarshal_data 2 Header=~p,Data1=~p",[Header,Data1]),
  	        unmarshal_data(Data1, Res ++ [Header])
      catch
  	    {'EXIT', _Reason} ->
  	        {Res, Data}
      end.
  
  
  unmarshal_signature(Signature) when is_binary(Signature) ->
      lager:info("unmarshal_signature/1  1"),
      unmarshal_signature(binary_to_list(Signature));
  
  
  unmarshal_signature(Signature) when is_list(Signature) ->
      lager:info("unmarshal_signature/1  2"),
      {Sig, []} = unmarshal_signature(Signature, []),
      lager:info("unmarshal_signature/1  2 Sig=~p",[Sig]),
      Sig;
  
  
  unmarshal_signature($y) -> byte;
  unmarshal_signature($b) -> boolean;
  unmarshal_signature($n) -> int16;
  unmarshal_signature($q) -> uint16;
  unmarshal_signature($i) -> int32;
  unmarshal_signature($u) -> uint32;
  unmarshal_signature($x) -> int64;
  unmarshal_signature($t) -> uint64;
  unmarshal_signature($d) -> double;
  unmarshal_signature($s) -> string;
  unmarshal_signature($o) -> object_path;
  unmarshal_signature($g) -> signature;
  unmarshal_signature($r) -> struct;
  unmarshal_signature($v) -> variant;
  unmarshal_signature($e) -> dict_entry;
  unmarshal_signature(Signature) ->
      throw({bad_signature, Signature}).
  =======
  
  -spec unmarshal_signature(binary()) -> dbus_signature().
  unmarshal_signature(<<>>) -> 
      [];
  unmarshal_signature(<<C>>) ->
      unmarshal_type(<<C>>);
  unmarshal_signature(Bin) when is_binary(Bin) ->
      {Signature, <<>>} = unmarshal_signature(Bin, []),
      Signature.
  >>>>>>> 6724b4b84878ed57521e1481daa05226d0d2b963
  
  %%%
  %%% Priv marshalling
  
negative.code: unmarshal(variant, Data, Pos) ->
      lager:info("unmarshal 17"),
      {Signature, Data1, Pos1} = unmarshal(signature, Data, Pos),
      lager:info("unmarshal Signature=~p, Data1=~p, Pos1=~p",[Signature,Data, Pos]),
      Type = unmarshal_signature(Signature),
      lager:info("unmarshal 17 Type=~p",[Type]),
      {Value, Data2, Pos2} = unmarshal(Type, Data1, Pos1),
      lager:info("unmarshal 17 Value=~p,Data1=~p,Pos1=~p",[Value,Data,Pos]),
      {#dbus_variant{type=Type, value=Value}, Data2, Pos2}.
  
  
  