httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Prud'hommeaux" <e...@w3.org>
Subject Re: Quick Question: module structure initialization
Date Sat, 24 Oct 1998 19:09:55 GMT
On Sat, 24 Oct 1998, Ralf S. Engelschall wrote:

> 
> Just a quick question:
> 
> Is it correct that ANSI C _guarantees_ C compilers initialize missing entries
> (at the end) in structure initializations like our "module" structure to
> 0/NULL?
> 
> In other words: Is it safe when I add (inside the mod_ssl patch) two more hook
> pointers to the "module" structure definition in http_config.h but the module
> sources contain no explicit additional NULLs in their initialization of the
> "module" structure?
> 
> I hope this is the case because else it would be not possible to extend the
> set of hooks without requireing third party modules to change their structure,
> too. But NULLs for the additional hooks are needed or the stuff would
> segfault...

Could this be handled in the future (2.0) by having a macro that went into
the end of the module declaration?

proposal:
. modules declare extra variables in <module>.conf.
. extra variables are prefixed with module name.
. some config script reads <module>.conf and generates STANDARD_MODULE_END.
. all modules are expected to include STANDARD_MODULE_END at the end of
  their module definition.

example:
module1.conf:
int module1_someInt
char * module1_someCharPtr

module2.conf:
int module2_someOtherInt = 5

produces:
#define MODULE_EXTRA_STUFF \
int module1_someInt, \
char * module1_someCharPtr, \
int module2_someOtherInt = 5, \
char ap_sacrificialByteToMakeSureTherezNoCommaAtTheEnd

used in each module decl:
module myModule {
...
MODULE_END_STUFF
}

-eric

PS. I didn't grep the 2.0 code for name collisions on ap_sacrifi...


Mime
View raw message