httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: [PATCH] Take 2: Line Numbers are counted wrong in config file parsing
Date Wed, 22 Oct 1997 22:36:55 GMT
You could do this:

struct config_file {
    int (*getc_func)(void *data);	/* should behave like getc() */
    void *data;
    const char *filename;	/* verbose enough description for error msgs */
    unsigned line_number;	/* incremented for each \n in the input */
};

that would allow anything using cfg_getline to do nicer error reporting, and
would allow Doug to do mod_perl's <Perl> sections better.

It's a feature though ;)

Dean

On Wed, 22 Oct 1997, Martin Kraemer wrote:

> On Wed, Oct 22, 1997 at 10:23:47AM -0700, Dean Gaudet wrote:
> > I'd rather you passed the entire cmd_param structure to cfg_getline ... 
> > it's cheaper and allows easier future expansion (i.e. a gets callback). 
> 
> Yes, that was my first approach whe I rewrote the patch. But then I noticed
> that there are more places _without_ a cmd_param structure than there are
> _with_ structure. In the modules, cfg_getline() is mostly called with a
> locally opened FILE ptr, like for the htpasswd or group file.
> 
> My only choice would have been to write a second cfg_cmd_getline() function,
> duplicating most of the code.  :-(
> 
>     Martin
> -- 
> | S I E M E N S |  <Martin.Kraemer@mch.sni.de>  |      Siemens Nixdorf
> | ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
> | N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
> ~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request
> 


Mime
View raw message