Hello Ryan,
thanks for your reply. > > 1/ as 'PRE' is a latin prefix which means before, would it be possible > for > > the sanity of the developpers to either: > > a/ call it *before* the configuration is read. > > b/ or rename it 'post_config';-) > > then the 'post_config' can be renamed 'post_post_config';-) > > No, neither is possible. The pre refers to when we process the config, > not when it is read. Argh. So I need pre/post_read_file hook maybe;-) > > 2/ if the pre_config is to be run anyway after the configuration file > is read, could you suggest another hook I could use ? I can't see > any... > > and the developper documentation is rather scarse and not up to > date. > > > > 3/ or explain what I missed in the source code to understand the logic > > behind all that. > > The easiest way to solve the problem you are looking at, is to mark the > Macro directives as EXEC_ON_READ, I already needed that so as to be able to locate error messages, as the cmd->config_file field is not defined otherwise, and I have to deal with it. The problem is that I need an initialization *before* lines are submitted to my commands, and this does not solve this issue at all. > that will get the macros loaded while we read the config file. Then, in > pre_config, walk the tree looking for the macro names, and replace them > with the definitions that you read in earlier. It seems to me not to work, as you can have a macro definition within a macro, which might be defined after macro expansion. Also, I have a problem understanding what you mean by 'walk the tree'. The macro processing simply performs a macro expansion at the textual level, which is parsed after expansion by modifying on the fly the config_file structure with my own stuff... I can't see anyway a parse-tree for apache configuration file, given its lexical structure... Is there such a thing? Thus I think that it would be great if I had a pre/post read hook, really?! How can I get one? Or should I investigate the 'tree' stuff and try to cast my stuff into that? Thanks again for your help, -- Fabien