[Privoxy-devel] atoi vs. parse_numeric_value

Lee ler762 at gmail.com
Mon May 9 16:01:00 UTC 2016


On 5/9/16, Fabian Keil <fk at fabiankeil.de> wrote:
> Lee <ler762 at gmail.com> wrote:
>
>> Now that loadcfg.c has changed from
>> case hash_debug :
>>    config->debug |= atoi(arg);
>>
>> to
>> case hash_debug :
>>    config->debug |= parse_numeric_value(cmd, arg);
>>
>> anyone else like the idea of changing the privoxy config debug flags
>> to actually look like bit flags?
>
> Who do you think would benefit from this?

I already have; I'm just pointing out that it's fractionally easier to
enable something like
  log_error(LOG_LEVEL_RE_FILTER,
now than it used to be (assuming you've copied the LOG_LEVEL_xxx
defines in errlog.h to the config).

> Most Privoxy user are probably not familiar with bitmasks and
> hexadecimal values so this change would make the config file
> even more cryptic for them.

I put the question on the developers list because I doubt it's going
to make any difference to users either way.  They're given some
documentation that effectively says <do this> if you want <that> to
happen.  So as far as a normal user[*] is concerned, I don't see any
difference between <this> being "debug 32768" or "debug 0x8000";
either way it's a string constant.


[*]  or maybe an abnormal user?  Sometimes it feels like most all
'normal' users don't bother to read the docs.

> As someone who understands the concept, I still find decimal
> values easier to remember than the hexadecimal representation.

So why the switch from atoi to parse_numeric_value?  I was a bit
surprised that no changes were made to take advantage of the ability
to use hex instead of decimal, so I thought I'd get the process
started :)

> Eventually I'd like to deprecate the whole debug directive
> and introduce something like:
>
> log-categories header,debug,connect...

If you were allowed only one 'debug' line in the config I'd agree that
a single 'log-categories' would be better.  But I'm not seeing how
that's better than multiple 'debug' lines.

Regards,
Lee


More information about the Privoxy-devel mailing list