anchor.diff:      Dir = filename:dirname(YangFile),
       case read(YangFile, Ext = filename:extension(YangFile), Opts) of
   	{{ok, Y}, Ext} ->
  -	    each_module(fun to_json_rpc/3, Y, {Dir, Ext, Opts});
  +	    with_module(fun to_json_rpc/3, Y, {Dir, Ext, Opts});
   	{Error, _} ->
   	    Error
       end.
  +
  +hrl(YangFile, HrlFile) ->
  +    hrl(YangFile, HrlFile, []).
  +
  +hrl(YangFile, HrlFile, Opts) ->
  +    [{module, M, RPCs}] = json_rpc(YangFile, Opts),
  +    Forms = to_hrl_forms(RPCs, M),
  +    write_hrl(HrlFile, Forms, Opts).
  +
  +write_hrl(_HrlFile, _Forms, _Opts) ->
  +    error(nyi).
   
   read(F) ->
       read(F, filename:extension(F), []).
  
positive.code:     read_open_file(Read(), Read, <<Acc/binary, Bytes/binary>>).
  
  
  each_module(F, [{module,_,M,Data}|Rest], Dir) ->
      Ms = binary_to_list(M),
      [{module, Ms, F(Data, Dir, Ms)} | each_module(F, Rest, Dir)];
  each_module(F, [_|Rest], Dir) ->
      each_module(F, Rest, Dir);
  each_module(_, [], _) ->
      [].
  
  to_json_rpc(Data, Arg, M) ->
  
negative.code:     case lists:keyfind(type, 1, Is) of
  	false ->
  	    undefined;
  	{type, L, <<"union">>, Ts} ->
  	    {type, L, <<"union">>, [type([T1], Data, Imports) ||
  				       {type,_,_,_} = T1 <- Ts]};
  	{type, _, T, _} = Type ->
  	    case binary:split(T, <<":">>) of
  		[Pfx, Ts] ->
  		    ImpData = orddict:fetch(Pfx, Imports),
  		    case [D1 || {typedef,_,T1,D1} <- ImpData, Ts == T1] of
  			[_] = Def ->
  			    type(Def, ImpData, Imports);
  			[] ->
  			    Type
  