[FFmpeg-cvslog] r15366 - trunk/ffmpeg.c

Kostya kostya.shishkov
Fri Sep 19 05:49:38 CEST 2008


On Fri, Sep 19, 2008 at 01:30:38AM +0200, Michael Niedermayer wrote:
> On Thu, Sep 18, 2008 at 03:00:37PM -0700, Mike Melanson wrote:
> > michael wrote:
> > > +        if(line[0] == '#' && !e)
> > > +            continue;
> > 
> > So the comment marker can only occur at the start of a line? Still not 
> > very good behavior. Expected behavior would be for everything between 
> > '#' and the next newline to be disregarded.
> 
> -        e|= sscanf(line, "%999[^=]=%999[^\n]\n", tmp, tmp2) - 2;
> +        e|= sscanf(line, "%999[^=]=%999[^#\n]", tmp, tmp2) - 2;
> 
> 
> > 
> > Face it-- text parsers in C are ugly. Good luck trying to make this 
> > user-friendly feature pretty enough for the FFmpeg codebase.
> 
> Text parsers in C are only ugly when they are written by an idiot.
> One can always write whatever primitive building blocks are needed
> for a clean parser.

The only difference is that you have to know regexp for newer languages
and how to do parsing for C. The Dragon Book really helps.
 
> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB




More information about the ffmpeg-cvslog mailing list