tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r591502 - in /tomcat/connectors/trunk/jk/native/common: jk_map.c jk_map.h
Date Fri, 02 Nov 2007 22:56:00 GMT
Author: rjung
Date: Fri Nov  2 15:55:58 2007
New Revision: 591502

URL: http://svn.apache.org/viewvc?rev=591502&view=rev
Log:
Adding jk_map_copy().
Such a function existed in mod_jk.c. Since it's general purpose
we move it to jk_map.

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_map.c
    tomcat/connectors/trunk/jk/native/common/jk_map.h

Modified: tomcat/connectors/trunk/jk/native/common/jk_map.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_map.c?rev=591502&r1=591501&r2=591502&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_map.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_map.c Fri Nov  2 15:55:58 2007
@@ -596,6 +596,24 @@
     }
 }
 
+int jk_map_copy(jk_map_t *src, jk_map_t *dst)
+{
+    int sz = jk_map_size(src);
+    int i;
+    for (i = 0; i < sz; i++) {
+        const char *name = jk_map_name_at(src, i);
+        if (jk_map_get(dst, name, NULL) == NULL) {
+            if (!jk_map_put(dst, name,
+                            jk_pool_strdup(&dst->p, jk_map_get_string(src, name, NULL)),
+                            NULL)) {
+                return JK_FALSE;
+            }
+        }
+    }
+    return JK_TRUE;
+}
+
+
 static void trim_prp_comment(char *prp)
 {
 #if defined(AS400) && !defined(AS400_UTF8)

Modified: tomcat/connectors/trunk/jk/native/common/jk_map.h
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_map.h?rev=591502&r1=591501&r2=591502&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_map.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_map.h Fri Nov  2 15:55:58 2007
@@ -82,6 +82,8 @@
 
 void jk_map_dump(jk_map_t *m, jk_logger_t *l);
 
+int jk_map_copy(jk_map_t *src, jk_map_t *dst);
+
 /**
  *  Replace $(property) in value.
  *



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


Mime
View raw message