My question is very similar to
Apache module command parser prototype
However, I have more initializations in apr_cmd[], i.e. I have something like
static const command_rec apr_cmds[] =
{
AP_INIT_TAKE1("analytics_ip", apr_cfg_set_analytics_ip, NULL, OR_ALL, ""),
AP_INIT_TAKE1("AuthenDenied", set_authen_denied, (void*)APR_OFFSETOF(config_rec, authen_denied), OR_AUTHCFG, ""),
AP_INIT_FLAG("RefreshCookies", ap_set_flag_slot, (void*)APR_OFFSETOF(config_rec, refresh_cookies), OR_AUTHCFG, ""),
{ NULL }
};
For each initialization, I got "cannot convert to cmd_func" compiling error.
Krystof suggests use
#ifdef __cplusplus
typedef const char *(*cmd_func) (cmd_parms *cmd, void *dummy, const char *path);
#else
typedef const char *(*cmd_func) ();
#endif
If I do this, the first error will be gone. However, the other errors remain since I can't redefine cmd_func again for second function set_authen_denied.
Any help is appreciated.