[MPlayer-G2-dev] Re: cfg.h (config layer 0 discussion)

Andriy N. Gritsenko andrej at lucky.net
Mon May 19 15:56:52 CEST 2003


    Hi, Andriy N. Gritsenko!

Sometime (on Monday, May 19 at 16:45) I've received something...
>>> >Hmm, so the point is to make it easy to nest groups (as subconfigs)
>>> >and add and remove items from them?

>>> Yes. For nested groups and separators. :)

>>Hmm. Do we really need nested groups??
>>It adds extra complexity (recursive parsing instead of for()) to config
>>layers, with very small advantage.

>    But we have recursive parsing already for CONF_TYPE_SUBCONFIG. Beside
>of that, this extra complexity is only one or two lines inside of parser
>(depending on implementation), for example (before strcmp, of course):

>if (opt->type==CONF_TYPE_GROUP && (err=read_config(....))==ERR_NOT_AN_OPTION)
>  continue;

Hmm. It seems I'm wrong and it need more lines (because err may be error
or exit code) but anyway IMHO 5-6 lines isn't a big cost.

if(opt->type==CONF_TYPE_GROUP) {
  if((err=read_config())==ERR_NOT_AN_OPTION) continue;
  if(err>=0) goto exit_ok;
  goto exit_error;
}

>and I don't think if that advantage is too small. It'll allow you don't
>create own type of option if you use a GUI and don't add lines above in
>the GUI's config parser in that case but use default. :)

    With best wishes.
    Andriy.



More information about the MPlayer-G2-dev mailing list