You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@locus.apache.org on 2000/08/07 00:38:24 UTC

cvs commit: apache-2.0/src/modules/standard mod_usertrack.c mod_expires.c mod_cern_meta.c

trawick     00/08/06 15:38:24

  Modified:    src/modules/standard mod_usertrack.c mod_expires.c
                        mod_cern_meta.c
  Log:
  Use AP_INIT_* macros for command_rec [] in a few more modules.
  
  Revision  Changes    Path
  1.20      +9 -9      apache-2.0/src/modules/standard/mod_usertrack.c
  
  Index: mod_usertrack.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_usertrack.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- mod_usertrack.c	2000/08/06 06:07:48	1.19
  +++ mod_usertrack.c	2000/08/06 22:38:23	1.20
  @@ -167,14 +167,14 @@
       cookie_dir_rec *dcfg = ap_get_module_config(r->per_dir_config,
   						&usertrack_module);
       const char *cookie;
  -    char *value;
  +    const char *value;
   
       if (!dcfg->enabled) {
           return DECLINED;
       }
   
       if ((cookie = apr_table_get(r->headers_in, "Cookie")))
  -        if ((value = strstr(cookie, dcfg->cookie_name))) {
  +        if ((value = ap_strstr_c(cookie, dcfg->cookie_name))) {
               char *cookiebuf, *cookieend;
   
               value += strlen(dcfg->cookie_name) + 1;  /* Skip over the '=' */
  @@ -287,7 +287,7 @@
       return NULL;
   }
   
  -static const char *set_cookie_name(cmd_parms *cmd, void *mconfig, char *name)
  +static const char *set_cookie_name(cmd_parms *cmd, void *mconfig, const char *name)
   {
       cookie_dir_rec *dcfg = (cookie_dir_rec *) mconfig;
   
  @@ -296,12 +296,12 @@
   }
   
   static const command_rec cookie_log_cmds[] = {
  -    {"CookieExpires", set_cookie_exp, NULL, RSRC_CONF, TAKE1,
  -     "an expiry date code"},
  -    {"CookieTracking", set_cookie_enable, NULL, OR_FILEINFO, FLAG,
  -     "whether or not to enable cookies"},
  -    {"CookieName", set_cookie_name, NULL, OR_FILEINFO, TAKE1,
  -     "name of the tracking cookie"},
  +    AP_INIT_TAKE1("CookieExpires", set_cookie_exp, NULL, RSRC_CONF,
  +                  "an expiry date code"),
  +    AP_INIT_FLAG("CookieTracking", set_cookie_enable, NULL, OR_FILEINFO,
  +                 "whether or not to enable cookies"),
  +    AP_INIT_TAKE1("CookieName", set_cookie_name, NULL, OR_FILEINFO,
  +                  "name of the tracking cookie"),
       {NULL}
   };
   static void register_hooks(void)
  
  
  
  1.22      +15 -9     apache-2.0/src/modules/standard/mod_expires.c
  
  Index: mod_expires.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_expires.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- mod_expires.c	2000/08/06 06:07:47	1.21
  +++ mod_expires.c	2000/08/06 22:38:23	1.22
  @@ -229,8 +229,10 @@
       return (void *) new;
   }
   
  -static const char *set_expiresactive(cmd_parms *cmd, expires_dir_config * dir_config, int arg)
  +static const char *set_expiresactive(cmd_parms *cmd, void *in_dir_config, int arg)
   {
  +    expires_dir_config *dir_config = in_dir_config;
  +
       /* if we're here at all it's because someone explicitly
        * set the active flag
        */
  @@ -347,8 +349,10 @@
       return NULL;
   }
   
  -static const char *set_expiresbytype(cmd_parms *cmd, expires_dir_config * dir_config, char *mime, char *code)
  +static const char *set_expiresbytype(cmd_parms *cmd, void *in_dir_config,
  +                                     const char *mime, const char *code)
   {
  +    expires_dir_config *dir_config = in_dir_config;
       char *response, *real_code;
   
       if ((response = check_code(cmd->pool, code, &real_code)) == NULL) {
  @@ -359,8 +363,10 @@
                    "'ExpiresByType ", mime, " ", code, "': ", response, NULL);
   }
   
  -static const char *set_expiresdefault(cmd_parms *cmd, expires_dir_config * dir_config, char *code)
  +static const char *set_expiresdefault(cmd_parms *cmd, void *in_dir_config,
  +                                      const char *code)
   {
  +    expires_dir_config * dir_config = in_dir_config;
       char *response, *real_code;
   
       if ((response = check_code(cmd->pool, code, &real_code)) == NULL) {
  @@ -373,12 +379,12 @@
   
   static const command_rec expires_cmds[] =
   {
  -    {"ExpiresActive", set_expiresactive, NULL, DIR_CMD_PERMS, FLAG,
  -     "Limited to 'on' or 'off'"},
  -    {"ExpiresBytype", set_expiresbytype, NULL, DIR_CMD_PERMS, TAKE2,
  -     "a MIME type followed by an expiry date code"},
  -    {"ExpiresDefault", set_expiresdefault, NULL, DIR_CMD_PERMS, TAKE1,
  -     "an expiry date code"},
  +    AP_INIT_FLAG("ExpiresActive", set_expiresactive, NULL, DIR_CMD_PERMS,
  +                 "Limited to 'on' or 'off'"),
  +    AP_INIT_TAKE2("ExpiresBytype", set_expiresbytype, NULL, DIR_CMD_PERMS,
  +                  "a MIME type followed by an expiry date code"),
  +    AP_INIT_TAKE1("ExpiresDefault", set_expiresdefault, NULL, DIR_CMD_PERMS,
  +                  "an expiry date code"),
       {NULL}
   };
   
  
  
  
  1.20      +18 -12    apache-2.0/src/modules/standard/mod_cern_meta.c
  
  Index: mod_cern_meta.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_cern_meta.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- mod_cern_meta.c	2000/08/06 06:07:46	1.19
  +++ mod_cern_meta.c	2000/08/06 22:38:23	1.20
  @@ -170,9 +170,9 @@
   module MODULE_VAR_EXPORT cern_meta_module;
   
   typedef struct {
  -    char *metadir;
  -    char *metasuffix;
  -    char *metafiles;
  +    const char *metadir;
  +    const char *metasuffix;
  +    int metafiles;
   } cern_meta_dir_config;
   
   static void *create_cern_meta_dir_config(apr_pool_t *p, char *dummy)
  @@ -201,20 +201,26 @@
       return new;
   }
   
  -static const char *set_metadir(cmd_parms *parms, cern_meta_dir_config * dconf, char *arg)
  +static const char *set_metadir(cmd_parms *parms, void *in_dconf, const char *arg)
   {
  +    cern_meta_dir_config *dconf = in_dconf;
  +
       dconf->metadir = arg;
       return NULL;
   }
   
  -static const char *set_metasuffix(cmd_parms *parms, cern_meta_dir_config * dconf, char *arg)
  +static const char *set_metasuffix(cmd_parms *parms, void *in_dconf, const char *arg)
   {
  +    cern_meta_dir_config *dconf = in_dconf;
  +
       dconf->metasuffix = arg;
       return NULL;
   }
   
  -static const char *set_metafiles(cmd_parms *parms, cern_meta_dir_config * dconf, char *arg)
  +static const char *set_metafiles(cmd_parms *parms, void *in_dconf, int arg)
   {
  +    cern_meta_dir_config *dconf = in_dconf;
  +
       dconf->metafiles = arg;
       return NULL;
   }
  @@ -222,12 +228,12 @@
   
   static const command_rec cern_meta_cmds[] =
   {
  -    {"MetaFiles", set_metafiles, NULL, DIR_CMD_PERMS, FLAG,
  -    "Limited to 'on' or 'off'"},
  -    {"MetaDir", set_metadir, NULL, DIR_CMD_PERMS, TAKE1,
  -     "the name of the directory containing meta files"},
  -    {"MetaSuffix", set_metasuffix, NULL, DIR_CMD_PERMS, TAKE1,
  -     "the filename suffix for meta files"},
  +    AP_INIT_FLAG("MetaFiles", set_metafiles, NULL, DIR_CMD_PERMS,
  +                 "Limited to 'on' or 'off'"),
  +    AP_INIT_TAKE1("MetaDir", set_metadir, NULL, DIR_CMD_PERMS,
  +                  "the name of the directory containing meta files"),
  +    AP_INIT_TAKE1("MetaSuffix", set_metasuffix, NULL, DIR_CMD_PERMS,
  +                  "the filename suffix for meta files"),
       {NULL}
   };