anchor.diff:  %% ----------------------------------------------------------------------
   %% low level parsers and data processing tools
   
  +logcfg(Key, Value) ->
  +    ?loginf(
  +       "~w> config: '~w' set to: ~s",
  +       [?MODULE, Key, cfg_to_list(Key, Value)]).
  +
   set_default(Key) ->
       Value = get_default_value(Key),
       ?loginf(
  -       "~w> config: '~w' set to default: ~9999p",
  -       [?MODULE, Key, Value]),
  +       "~w> config: '~w' set to default: ~s",
  +       [?MODULE, Key, cfg_to_list(Key, Value)]),
       Value.
  +
  +cfg_to_list(?CFG_LOGLEVEL, LogLevel) -> atom_to_list(LogLevel);
  +cfg_to_list(?CFG_IP_DENY_REDIRECT, URL) -> URL;
  +cfg_to_list(?CFG_ORDER, Order) ->
  +    string:join([atom_to_list(A) || A <- Order], ",");
  +cfg_to_list(?CFG_PRIVILEGED, []) -> "none";
  +cfg_to_list(?CFG_PRIVILEGED, IpRange) ->
  +    erjik_lib:ip_pool_to_list(IpRange);
  +cfg_to_list(?CFG_ALLOW, []) -> "none";
  +cfg_to_list(?CFG_ALLOW, IpRange) ->
  +    erjik_lib:ip_pool_to_list(IpRange);
  +cfg_to_list(?CFG_DENY, []) -> "none";
  +cfg_to_list(?CFG_DENY, IpRange) ->
  +    erjik_lib:ip_pool_to_list(IpRange);
  +cfg_to_list(?CFG_DEFAULT_POLICY, DefaultPolicy) ->
  +    atom_to_list(DefaultPolicy);
  +cfg_to_list(?CFG_BIND_IP, BindIP) ->
  +    erjik_lib:ip_to_list(BindIP);
  +cfg_to_list(?CFG_BIND_PORT, BindPort) ->
  +    integer_to_list(BindPort);
  +cfg_to_list(?CFG_WWW_ROOT, WwwRoot) -> WwwRoot;
  +cfg_to_list(_Key, Term) ->
  +    lists:flatten(io_lib:format("~9999999p", [Term])).
   
   read_blacklist(Filename) ->
       case file:read_file(Filename) of
  
positive.code:     Config =
          [{?CFG_LOGLEVEL,
            case [V || {?CFG_LOGLEVEL, V} <- CfgItems] of
                [LogLevel | _] -> LogLevel;
                _ -> set_default(?CFG_LOGLEVEL)
            end},
           {?CFG_IP_DENY_REDIRECT,
            case [V || {?CFG_IP_DENY_REDIRECT, [_ | _] = V} <- CfgItems] of
                [IpDenyRedirect | _] -> IpDenyRedirect;
                _ -> set_default(?CFG_IP_DENY_REDIRECT)
            end},
           {?CFG_ORDER,
            case [V || {?CFG_ORDER, V} <- CfgItems] of
                [Order | _] -> Order;
                _ -> set_default(?CFG_ORDER)
            end},
           {?CFG_PRIVILEGED,
            case [V || {?CFG_PRIVILEGED, V} <- CfgItems] of
                [_ | _] = Privileged ->
                    erjik_lib:flatten_ip_pool(Privileged);
                _ -> set_default(?CFG_PRIVILEGED)
            end},
           {?CFG_ALLOW,
            case [V || {?CFG_ALLOW, V} <- CfgItems] of
                [_ | _] = Allow ->
                    erjik_lib:flatten_ip_pool(Allow);
                _ -> set_default(?CFG_ALLOW)
            end},
           {?CFG_DENY,
            case [V || {?CFG_DENY, V} <- CfgItems] of
                [_ | _] = Deny ->
                    erjik_lib:flatten_ip_pool(Deny);
                _ -> set_default(?CFG_DENY)
            end},
           {?CFG_DEFAULT_POLICY,
            case [V || {?CFG_DEFAULT_POLICY, V} <- CfgItems] of
                [DefaultPolicy | _] -> DefaultPolicy;
                _ -> set_default(?CFG_DEFAULT_POLICY)
            end},
           {?CFG_BIND_IP,
            case [V || {?CFG_BIND_IP, V} <- CfgItems] of
                [BindIP | _] -> BindIP;
                _ -> set_default(?CFG_BIND_IP)
            end},
           {?CFG_BIND_PORT,
            case [V || {?CFG_BIND_PORT, V} <- CfgItems] of
                [BindPort | _] -> BindPort;
                _ -> set_default(?CFG_BIND_PORT)
            end},
           {?CFG_WWW_ROOT,
            case [V || {?CFG_WWW_ROOT, V} <- CfgItems] of
                [WwwRoot | _] -> WwwRoot;
                _ -> set_default(?CFG_WWW_ROOT)
            end},
           {?CFG_CLASS_NAMES, []}],
  
negative.code:     true = 0 < Int andalso Int < 16#ffff,
      {ok, Int};
  parse_val_(?CFG_WWW_ROOT, String) ->
      {ok, String};
  parse_val_({class, [_ | _] = _ClassName, ?CFG_CLASS_DOMAINS},
             [_ | _] = String) ->
      {ok, String};
  parse_val_({class, [_ | _] = _ClassName, ?CFG_CLASS_REGEXPS},
             [_ | _] = String) ->
      {ok, String};
  parse_val_({class, [_ | _] = _ClassName, ?CFG_CLASS_REDIRECT},
             [_ | _] = String) ->
      {ok, String}.
  
  parse_ip_range(String) ->
  