You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@znep.com> on 1997/01/28 05:42:45 UTC

[PATCH] (PR#128) remove _const from mod_rewrite

See PR#128.  I don't see why we need the _const bit there anyway, and if
we do I don't think we should be using "_"-anything.


Index: mod_rewrite.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_rewrite.c,v
retrieving revision 1.15
diff -c -r1.15 mod_rewrite.c
*** mod_rewrite.c	1997/01/20 04:28:15	1.15
--- mod_rewrite.c	1997/01/28 04:36:03
***************
*** 356,362 ****
  **
  */
  
! static _const char *cmd_rewriteengine(cmd_parms *cmd, rewrite_perdir_conf *dconf, int flag)
  {
      rewrite_server_conf *sconf;
  
--- 356,362 ----
  **
  */
  
! static const char *cmd_rewriteengine(cmd_parms *cmd, rewrite_perdir_conf *dconf, int flag)
  {
      rewrite_server_conf *sconf;
  
***************
*** 369,378 ****
      return NULL;
  }
  
! static _const char *cmd_rewriteoptions(cmd_parms *cmd, rewrite_perdir_conf *dconf, char *option)
  {
      rewrite_server_conf *sconf;
!     _const char *err;
  
      sconf = (rewrite_server_conf *)get_module_config(cmd->server->module_config, &rewrite_module);
      if (cmd->path == NULL) /* is server command */
--- 369,378 ----
      return NULL;
  }
  
! static const char *cmd_rewriteoptions(cmd_parms *cmd, rewrite_perdir_conf *dconf, char *option)
  {
      rewrite_server_conf *sconf;
!     const char *err;
  
      sconf = (rewrite_server_conf *)get_module_config(cmd->server->module_config, &rewrite_module);
      if (cmd->path == NULL) /* is server command */
***************
*** 383,389 ****
      return err;
  }
  
! static _const char *cmd_rewriteoptions_setoption(pool *p, int *options, char *name)
  {
      if (strcasecmp(name, "inherit") == 0)
          *options |= OPTION_INHERIT;
--- 383,389 ----
      return err;
  }
  
! static const char *cmd_rewriteoptions_setoption(pool *p, int *options, char *name)
  {
      if (strcasecmp(name, "inherit") == 0)
          *options |= OPTION_INHERIT;
***************
*** 392,398 ****
      return NULL;
  }
  
! static _const char *cmd_rewritelog(cmd_parms *cmd, void *dconf, char *a1)
  {
      rewrite_server_conf *sconf;
  
--- 392,398 ----
      return NULL;
  }
  
! static const char *cmd_rewritelog(cmd_parms *cmd, void *dconf, char *a1)
  {
      rewrite_server_conf *sconf;
  
***************
*** 402,408 ****
      return NULL;
  }
  
! static _const char *cmd_rewriteloglevel(cmd_parms *cmd, void *dconf, char *a1)
  {
      rewrite_server_conf *sconf;
  
--- 402,408 ----
      return NULL;
  }
  
! static const char *cmd_rewriteloglevel(cmd_parms *cmd, void *dconf, char *a1)
  {
      rewrite_server_conf *sconf;
  
***************
*** 412,418 ****
      return NULL;
  }
  
! static _const char *cmd_rewritemap(cmd_parms *cmd, void *dconf, char *a1, char *a2)
  {
      rewrite_server_conf *sconf;
      rewritemap_entry *new;
--- 412,418 ----
      return NULL;
  }
  
! static const char *cmd_rewritemap(cmd_parms *cmd, void *dconf, char *a1, char *a2)
  {
      rewrite_server_conf *sconf;
      rewritemap_entry *new;
***************
*** 456,462 ****
      return NULL;
  }
  
! static _const char *cmd_rewritebase(cmd_parms *cmd, rewrite_perdir_conf *dconf, char *a1)
  {
      if (cmd->path == NULL || dconf == NULL)
          return "RewriteBase: only valid in per-directory config files";
--- 456,462 ----
      return NULL;
  }
  
! static const char *cmd_rewritebase(cmd_parms *cmd, rewrite_perdir_conf *dconf, char *a1)
  {
      if (cmd->path == NULL || dconf == NULL)
          return "RewriteBase: only valid in per-directory config files";
***************
*** 470,476 ****
      return NULL;
  }
  
! static _const char *cmd_rewritecond(cmd_parms *cmd, rewrite_perdir_conf *dconf, char *str)
  {
      rewrite_server_conf *sconf;
      rewritecond_entry *new;
--- 470,476 ----
      return NULL;
  }
  
! static const char *cmd_rewritecond(cmd_parms *cmd, rewrite_perdir_conf *dconf, char *str)
  {
      rewrite_server_conf *sconf;
      rewritecond_entry *new;
***************
*** 484,490 ****
      char *a2;
      char *a3;
      char *cp;
!     _const char *err;
      int rc;
  
      sconf = (rewrite_server_conf *)get_module_config(cmd->server->module_config, &rewrite_module);
--- 484,490 ----
      char *a2;
      char *a3;
      char *cp;
!     const char *err;
      int rc;
  
      sconf = (rewrite_server_conf *)get_module_config(cmd->server->module_config, &rewrite_module);
***************
*** 542,548 ****
      return NULL;
  }
  
! static _const char *cmd_rewritecond_parseflagfield(pool *p, rewritecond_entry *cfg, char *str)
  {
      char *cp;
      char *cp1;
--- 542,548 ----
      return NULL;
  }
  
! static const char *cmd_rewritecond_parseflagfield(pool *p, rewritecond_entry *cfg, char *str)
  {
      char *cp;
      char *cp1;
***************
*** 550,556 ****
      char *cp3;
      char *key;
      char *val;
!     _const char *err;
  
      if (str[0] != '[' || str[strlen(str)-1] != ']')
          return pstrdup(p, "RewriteCond: bad flag delimiters");
--- 550,556 ----
      char *cp3;
      char *key;
      char *val;
!     const char *err;
  
      if (str[0] != '[' || str[strlen(str)-1] != ']')
          return pstrdup(p, "RewriteCond: bad flag delimiters");
***************
*** 588,594 ****
      return NULL;
  }
  
! static _const char *cmd_rewritecond_setflag(pool *p, rewritecond_entry *cfg, char *key, char *val)
  {
      if (   strcasecmp(key, "nocase") == 0
          || strcasecmp(key, "NC") == 0    ) {
--- 588,594 ----
      return NULL;
  }
  
! static const char *cmd_rewritecond_setflag(pool *p, rewritecond_entry *cfg, char *key, char *val)
  {
      if (   strcasecmp(key, "nocase") == 0
          || strcasecmp(key, "NC") == 0    ) {
***************
*** 605,611 ****
  }
  
  /* NON static */
! _const char *cmd_rewriterule(cmd_parms *cmd, rewrite_perdir_conf *dconf, char *str)
  {
      rewrite_server_conf *sconf;
      rewriterule_entry *new;
--- 605,611 ----
  }
  
  /* NON static */
! const char *cmd_rewriterule(cmd_parms *cmd, rewrite_perdir_conf *dconf, char *str)
  {
      rewrite_server_conf *sconf;
      rewriterule_entry *new;
***************
*** 619,625 ****
      char *a2;
      char *a3;
      char *cp;
!     _const char *err;
  
      sconf = (rewrite_server_conf *)get_module_config(cmd->server->module_config, &rewrite_module);
  
--- 619,625 ----
      char *a2;
      char *a3;
      char *cp;
!     const char *err;
  
      sconf = (rewrite_server_conf *)get_module_config(cmd->server->module_config, &rewrite_module);
  
***************
*** 684,690 ****
      return NULL;
  }
  
! static _const char *cmd_rewriterule_parseflagfield(pool *p, rewriterule_entry *cfg, char *str)
  {
      char *cp;
      char *cp1;
--- 684,690 ----
      return NULL;
  }
  
! static const char *cmd_rewriterule_parseflagfield(pool *p, rewriterule_entry *cfg, char *str)
  {
      char *cp;
      char *cp1;
***************
*** 692,698 ****
      char *cp3;
      char *key;
      char *val;
!     _const char *err;
  
      if (str[0] != '[' || str[strlen(str)-1] != ']')
          return pstrdup(p, "RewriteRule: bad flag delimiters");
--- 692,698 ----
      char *cp3;
      char *key;
      char *val;
!     const char *err;
  
      if (str[0] != '[' || str[strlen(str)-1] != ']')
          return pstrdup(p, "RewriteRule: bad flag delimiters");
***************
*** 730,736 ****
      return NULL;
  }
  
! static _const char *cmd_rewriterule_setflag(pool *p, rewriterule_entry *cfg, char *key, char *val)
  {
      if (   strcasecmp(key, "redirect") == 0
          || strcasecmp(key, "R") == 0       ) {
--- 730,736 ----
      return NULL;
  }
  
! static const char *cmd_rewriterule_setflag(pool *p, rewriterule_entry *cfg, char *key, char *val)
  {
      if (   strcasecmp(key, "redirect") == 0
          || strcasecmp(key, "R") == 0       ) {
***************
*** 2869,2875 ****
      char **cppHNLtest;
      char *ourhostname;
      char *ourhostip;
!     _const char *names;
      char *name;
      int i, j;
  
--- 2869,2875 ----
      char **cppHNLtest;
      char *ourhostname;
      char *ourhostip;
!     const char *names;
      char *name;
      int i, j;
  
***************
*** 2993,2999 ****
  */
  
  #ifdef IS_APACHE_12
! int is_proxy_available(server_rec *s)
  {
      extern module *preloaded_modules[];
      command_rec *c;
--- 2993,2999 ----
  */
  
  #ifdef IS_APACHE_12
! static int is_proxy_available(server_rec *s)
  {
      extern module *preloaded_modules[];
      command_rec *c;
***************
*** 3009,3015 ****
      return 0;
  }
  #else
! int is_proxy_available(server_rec *s)
  {
      extern char *module_names[];
      int n;
--- 3009,3015 ----
      return 0;
  }
  #else
! static int is_proxy_available(server_rec *s)
  {
      extern char *module_names[];
      int n;
Index: mod_rewrite.h
===================================================================
RCS file: /export/home/cvs/apache/src/mod_rewrite.h,v
retrieving revision 1.15
diff -c -r1.15 mod_rewrite.h
*** mod_rewrite.h	1997/01/20 04:28:16	1.15
--- mod_rewrite.h	1997/01/28 04:36:04
***************
*** 101,117 ****
  #endif
  
  
-     /* The const problem:
-        The Apache Group changed some essential prototypes
-        to have an additional "const" qualifier. To be backward
-        compatible with Apache 1.1.1 we use a special define */
- #ifdef IS_APACHE_12
- #define _const const
- #else
- #define _const  
- #endif
- 
- 
      /* The RegExp support:
         For Apache 1.1.1 we provide our own Spencer V8 library,
         for Apache 1.2 and higher there is a Spencer POSIX library
--- 101,106 ----