httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: [PATCH] Start of command handlers patch
Date Mon, 12 Jun 2000 18:25:50 GMT
On Mon, Jun 12, 2000 at 04:47:22AM -0700, dean gaudet wrote:
> On Sun, 11 Jun 2000, Ben Laurie wrote:
> > Just to make sure everyone knows what I had in mind, here's the start of
> > the patch. BTW, if we're all agreed this is worth doing, I'd really like
> > to commit it part-done and share the load of converting every single
> > command handler!
> 
> ok... i kind of don't see the point -- 'cause it just makes the compile
> work without really providing type safety.

At the moment, a person can put any function into that field and it will
compile. With Ben's change, it will compile and run (no signature mismatch).
As I pointed out yesterday, though, that still doesn't mean the function
will examine the right arguments in the cmd_parms :-)

> we could do something we've done before -- set things up to give us
> warnings on the majority of platforms we develop on, but have no warnings
> on other platforms.

Even better... That would be coolness.

>...
> #define INIT_TAKE1(name, func, cmd_data, req_override, errmsg) \
>     { name, { .take1 = func }, cmd_data, req_override, TAKE1, errmsg }
> #define INIT_TAKE2(name, func, cmd_data, req_override, errmsg) \
>     { name, { .take2 = func }, cmd_data, req_override, TAKE2, errmsg }
> ...
> 
> at least i think that's the right syntax.
> 
> and if the compiler doesn't support that syntax we just cast in the
> INIT_xxx() macros.

+1 as long as the INIT_xxx() macros are prefixed with AP_. I'd also
recommend using the c9x format ([].take1 =...) that Dean posted in a
followup message, rather than the gcc-specific form (we can at least hope
for some compatibility from non-gcc compilers).
[ note some configure magic will be needed, too ]

A nice benefit from this approach is that the command functions don't have
to change at all. Just the initialization. A *much* lower impact change.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message