Stipe Tolj wrote:
> Hi list,
>
> now, as Kannel maintains its own way of "knowing" what config directives
> are allowed in group sections, this is a problem if external modules,
> ie. Rene's sqlbox or Paul's Mbuni need to use the same gwlib/cfg.[ch]
> thingies.
>
> I tried to introduce a generic hooking mechanism for the 2 functions
> is_allowed_in_group() and is_single_group() that use the #include
> "cfg.def" for the core.
>
> Now extenal modules can use cfg_add_hooks(void *a, void *b) to offer
> their own "version" of these 2 routines and hence #include
> "foobar-cfg.def" in their own code space.
>
> The hooks are appended to a list and a wrapper loops arround the
> functiokns in the lists to get a boolean value.
>
> I know that this is not the most elegant way. Alex suggested using
> dlopne() and dlsym(), which are of course a "better" approach, but still
> we need to "concatenate" the defined groups and I had no idea how to do.
>
> Please review and vote.
commited to cvs, ChangeLog entry:
2006-07-05 Stipe Tolj <stolj at kannel.org>
* gwlib/cfg.[ch]: adding support for hooking config group definition files
as our own gwlib/cfg.def from external add-on modules to the core via
cfg_add_hooks(), taking two function arguments within the local scope of
the external module, representing the is_allowed_in_group() and
is_single_group() from the core. In the local scope the external .def
file is included as we do in the core. The purpose of this cfg_add_hooks()
function is to allow add-on modules to use seamlessly the core's cfg.c
code for semantical config checks at startup.
Stipe
-------------------------------------------------------------------
Kölner Landstrasse 419
40589 Düsseldorf, NRW, Germany
tolj.org system architecture Kannel Software Foundation (KSF)
http://www.tolj.org/ http://www.kannel.org/
mailto:st_{at}_tolj.org mailto:stolj_{at}_kannel.org
-------------------------------------------------------------------
_______________________________________________
devel mailing list
[email protected]
http://www.kannel.org/mailman/listinfo/devel