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 Sun, 20 Feb 2005 12:19:18 GMT
mturk       2005/02/20 04:19:17

  Modified:    jk/native/common jk_map.c jk_map.h
  Log:
  Add map id function. Returns the map slot number.
  
  Revision  Changes    Path
  1.29      +19 -1     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.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- jk_map.c	12 Feb 2005 19:24:08 -0000	1.28
  +++ jk_map.c	20 Feb 2005 12:19:17 -0000	1.29
  @@ -156,6 +156,24 @@
       return (void *)rc;          /* DIRTY */
   }
   
  +int jk_map_get_id(jk_map_t *m, const char *name)
  +{
  +    int rc = -1;
  +    if (m && name) {
  +        unsigned int i;
  +        unsigned int key;
  +        COMPUTE_KEY_CHECKSUM(name, key)
  +        for (i = 0; i < m->size; i++) {
  +            if (m->keys[i] == key && strcasecmp(m->names[i], name) == 0)
{
  +                rc = i;
  +                break;
  +            }
  +        }
  +    }
  +
  +    return rc;
  +}
  +
   const char *jk_map_get_string(jk_map_t *m, const char *name, const char *def)
   {
       const char *rc = def;
  
  
  
  1.15      +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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- jk_map.h	6 Feb 2005 13:30:34 -0000	1.14
  +++ jk_map.h	20 Feb 2005 12:19:17 -0000	1.15
  @@ -43,6 +43,8 @@
   
   void *jk_map_get(jk_map_t *m, const char *name, const void *def);
   
  +int jk_map_get_id(jk_map_t *m, const char *name);
  +
   int jk_map_get_int(jk_map_t *m, const char *name, int def);
   
   double jk_map_get_double(jk_map_t *m, const char *name, double def);
  
  
  

---------------------------------------------------------------------
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