tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native/common jk_map.c jk_map.h
Date Fri, 19 Nov 2004 14:24:45 GMT
mturk       2004/11/19 06:24:45

  Modified:    jk/native/common jk_map.c jk_map.h
  Log:
  Added boolean map option so we can be less restrictive on
  bool options. Instead just 1 or 0 we'll allow true/false and
  yes/no options.
  
  Revision  Changes    Path
  1.18      +19 -2     jakarta-tomcat-connectors/jk/native/common/jk_map.c
  
  Index: jk_map.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_map.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- jk_map.c	9 Nov 2004 12:17:43 -0000	1.17
  +++ jk_map.c	19 Nov 2004 14:24:44 -0000	1.18
  @@ -153,7 +153,24 @@
       sprintf(buf, "%f", def);
       rc = jk_map_get_string(m, name, buf);
   
  -    return atof(rc);
  +    return atof(rc); 
  +}
  +
  +int jk_map_get_bool(jk_map_t *m, const char *name, int def)
  +{
  +    char buf[100];
  +    int rv = 0;
  +    
  +    sprintf(buf, "%d", def);
  +    rc = jk_map_get_string(m, name, buf);
  +
  +    len = strlen(rc);
  +    if (len) {
  +        if (strcasecmp(rc, "true") == 0 ||
  +            *rc == 'Y' || *rc == 'y' || *rc == '1') {
  +            rv = 1;
  +        }
  +    }    
   }
   
   char *jk_map_get_string(jk_map_t *m, const char *name, const char *def)
  
  
  
  1.13      +3 -1      jakarta-tomcat-connectors/jk/native/common/jk_map.h
  
  Index: jk_map.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_map.h,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- jk_map.h	9 Nov 2004 12:17:43 -0000	1.12
  +++ jk_map.h	19 Nov 2004 14:24:44 -0000	1.13
  @@ -47,6 +47,8 @@
   
   double jk_map_get_double(jk_map_t *m, const char *name, double def);
   
  +int jk_map_get_bool(jk_map_t *m, const char *name, int def);
  +
   char *jk_map_get_string(jk_map_t *m, const char *name, const char *def);
   
   char **jk_map_get_string_list(jk_map_t *m,
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message