Hi Marius,
On 04/10/2010 02:19 AM, Marius Zbihlei wrote:
Hello Alex,
Thus, it is not possible
in advance to know which modules will be loaded, nor possible to
iterate through some list and combine them into a string, so I cannot do:
modparam("mod1|mod2|mod3", "db_url", ...)
Regarding the modparam statement, I think you can. Unfortunately, I
can't test it a.t.m., but as far as I remember I think the modparam
statement succeeds even if only one of the modules listed in the module
section is configured correctly. For example you can have something like
modparam("carrierroute|xyz", "db_url", ....)
and work, even if xyz module doesn't exist (yet).
I agree, this is possible, but I find it an inelegant solution; it
still requires me to anticipate every conceivable module that could be
loaded elsewhere in the configuration, and this is not as easy as it
sounds given its highly flexible, indeterminate nature. It's also
just not pretty.
As another approach goes, I was thinking of having
something like a
preprocessor for ser cfg language. The lexer now only supports #define
and #ifdef's but doesn't support macro substitution. The #define's and
#ifdef's are integrated into the lexer and not an performed as a
separate initial step, thus full macro support is hard to integrate.
Your code might look smth like this :
#define DBURL "mysql://..."
modparam("module", "db_url", DBURL)
In my opinion it will be a nice feature.
I agree, and think that would be wonderful. My only goal is to be
able to define arbitrary constants in the config and use them anywhere
in script, including module parameters.
Cheers,
--
Alex Balashov - Principal
Evariste Systems LLC
1170 Peachtree Street
12th Floor, Suite 1200
Atlanta, GA 30309
Tel: +1-678-954-0670
Fax: +1-404-961-1892
Web:
http://www.evaristesys.com/