[linux-dvb] Re: some libdvbcfg wishes, preset format

Andrew de Quincey adq_dvb at lidskialf.net
Sat Jul 16 00:14:13 CEST 2005


> > [... that backend parser draft...]
> > I get you - sounds cool... what about a structure containing a set of
> > callback function pointers though? I think it might make the parser
> > easier than doing it line by line.
>
> I generally don't like callbacks, as i don't like libraries which make
> any assumptions about the program flow.
>
> But generally, it would be the same thing, just a different layout.
>
> The advantage is that you don't need any context pointers (a "void *"
> probably does the thing, anyway), you don't need to declare (essentially
> wrapper) functions for the stuff, and you know on the first view that
> the program flow doesn't leave this loop.
>
> And you can feed in the data from whatever source. Though this stuff is
> probably always read from a file, i generally like to let the
> application do the "OS depending" stuff, especially because it's
> relatively easy here (never more than one "result" per line).
>
> It's really only a design decision - i don't like callbacks, but that's
> just my opinion.
>
> oh, another thing: If you don't use callbacks, you can easily write
> wrappers for other languages. Using callbacks, this really really gets
> difficult. for example with "swig" you can generate the wrapper code
> automatically, and with my draft, you don't need any specials things, it
> would just work.

You're right - this way is much better. Prepare to see it implemented! :)




More information about the linux-dvb mailing list