You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Ervin Hegedüs <ai...@gmail.com> on 2019/04/15 20:39:37 UTC

Modul command directive arguments

Hi,

I'm playing with a module, and found an interesting function.

Example:

const command_rec module_directives[] = {
   ...
    AP_INIT_TAKE23 (
        "DirectiveCmd",
        cmd,
        NULL,
        CMD_SCOPE_ANY,
        "Directive Command"
    ),

...
extern const command_rec module_directives[];

module AP_MODULE_DECLARE_DATA foo_module = {
    STANDARD20_MODULE_STUFF,
    create_directory_config,
    merge_directory_configs,
    NULL,
    NULL,
    module_directives,
    register_hooks
};

And now if there is a command directive in the config, eg:

DirectiveCmd Arg1 "Arg2 re(\\\\foo)"

then I'll got the unescaped form of 2nd argument: "Arg2 re(\\foo)" (and of
course, it looks like all argument will unsescaped).

(It's new for me, because so far I've always used the "raw" stream reader
functions (eg. fread()) - nevermind :).)

Could anybody helps me please, which function parses the config file, and
make this unescaped formula (inside of Apache API)?


Many thanks,


a.

Re: Modul command directive arguments

Posted by Ervin Hegedüs <ai...@gmail.com>.
Hi Sorin,

On Tue, Apr 16, 2019 at 10:21:05AM +0200, Sorin Manolache wrote:
> On 15/04/2019 22.39, Ervin Hegedüs wrote:
> >Hi,
> >
> >I'm playing with a module, and found an interesting function.
> >
[...]

> >
> >And now if there is a command directive in the config, eg:
> >
> >DirectiveCmd Arg1 "Arg2 re(\\\\foo)"


> The function that extracts words from a line of text is ap_getword_conf
> declared in httpd.h.
> 
> It is called from ap_build_config declared in http_config.h.
> 
> The root of the call-chain is ap_read_config delared in http_config.h.


vaow, many thanks for awesome detailed informations! :)


a.
 

Re: Modul command directive arguments

Posted by Sorin Manolache <so...@gmail.com>.
On 15/04/2019 22.39, Ervin Hegedüs wrote:
> Hi,
> 
> I'm playing with a module, and found an interesting function.
> 
> Example:
> 
> const command_rec module_directives[] = {
>     ...
>      AP_INIT_TAKE23 (
>          "DirectiveCmd",
>          cmd,
>          NULL,
>          CMD_SCOPE_ANY,
>          "Directive Command"
>      ),
> 
> ...
> extern const command_rec module_directives[];
> 
> module AP_MODULE_DECLARE_DATA foo_module = {
>      STANDARD20_MODULE_STUFF,
>      create_directory_config,
>      merge_directory_configs,
>      NULL,
>      NULL,
>      module_directives,
>      register_hooks
> };
> 
> And now if there is a command directive in the config, eg:
> 
> DirectiveCmd Arg1 "Arg2 re(\\\\foo)"
> 
> then I'll got the unescaped form of 2nd argument: "Arg2 re(\\foo)" (and of
> course, it looks like all argument will unsescaped).
> 
> (It's new for me, because so far I've always used the "raw" stream reader
> functions (eg. fread()) - nevermind :).)
> 
> Could anybody helps me please, which function parses the config file, and
> make this unescaped formula (inside of Apache API)?

Hello,

The function that extracts words from a line of text is ap_getword_conf 
declared in httpd.h.

It is called from ap_build_config declared in http_config.h.

The root of the call-chain is ap_read_config delared in http_config.h.

Best regards,
Sorin