-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I have added "axis2_stracat(const axis2_char_t *s1, const axis2_char_t
*s2, axis2_env_t **env)" function.
Please apply the patch and commit the code.

- - Sahan

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iQEVAwUBQ6JzmKnIlEsDdb85AQIt8AgAkdZwV5hGer/dC6kNe6mc4gFwhTGOT2iF
z7+Nj6tanR6LZmQl1Uu6j00Lpq+TStCbH2dSibCAODxOvWht8tvcva6FkucLVTLV
j6CikgtACxSsaRreGYxPQMGU4Y6nFPXlX1Fz7P0wPMaXwcP52oszeykpZo+KK5oY
cE10cFz7bX1yEPnyLNOrlxNrFsLpVzyHmLZwHdxK/voGUKUzCBwjPLYZLBFZNTRb
W5VkbgY7j8/BWCAqcVkyyleBbu26pXmim13sMlV4RBCnanXGN9M0kCwFastq9npL
2y/EAPNehKvWtC+oVyF157xNYUV/XlWqi8vzWATqE4IXVGgmTzZYcQ==
=lMqd
-----END PGP SIGNATURE-----

Index: string.c
===================================================================
--- string.c    (revision 357140)
+++ string.c    (working copy)
@@ -42,6 +42,34 @@
     }
 }
 
+AXIS2_DECLARE(axis2_char_t*)
+axis2_stracat(const axis2_char_t *s1, const axis2_char_t *s2, axis2_env_t 
**env)
+{
+    axis2_char_t *ret = NULL;
+    int alloc_len = -1;
+
+    if(NULL == s1 && NULL == s2)
+    {
+        return NULL;
+    }
+    if(NULL == s1)
+    {
+        return (axis2_char_t*)AXIS2_STRDUP(s2, env);
+    }
+    if(NULL == s2)
+    {
+        return (axis2_char_t)AXIS2_STRDUP(s1, env);
+    }
+    alloc_len = axis2_strlen(s1) + axis2_strlen(s2) + 1;
+    ret = (axis2_char_t*)AXIS2_MALLOC((*env)->allocator,
+                    alloc_len*sizeof(axis2_char_t));
+    memcpy(ret, s1, axis2_strlen(s1)*sizeof(axis2_char_t));
+    memcpy((ret + axis2_strlen(s1)*sizeof(axis2_char_t)), s2,
+                    axis2_strlen(s2)*sizeof(axis2_char_t));
+    ret[alloc_len*sizeof(axis2_char_t)] = '\0';
+    return ret;
+}
+
 AXIS2_DECLARE(int)
 axis2_strcmp (const axis2_char_t * s1, const axis2_char_t * s2)
 {
Index: axis2_string.h
===================================================================
--- axis2_string.h      (revision 357140)
+++ axis2_string.h      (working copy)
@@ -41,10 +41,26 @@
     AXIS2_DECLARE(int)
     axis2_strlen(const axis2_char_t * s);
 
+    AXIS2_DECLARE(int)
+    axis2_strcasecmp(const axis2_char_t *s1, axis2_char_t *s2);
+
+    AXIS2_DECLARE(int)
+    axis2_strncasecmp(const axis2_char_t *s1, axis2_char_t *s2, int n);
+    
+    /* much similar to the strcat behaviour. But the difference is
+     * this allocates new memory to put the conatenated string rather than
+     * modifying the first argument. The user should free the allocated
+     * memory for the return value
+     */
+    AXIS2_DECLARE(axis2_char_t*)
+    axis2_stracat(const axis2_char_t *s1, const axis2_char_t *s2, axis2_env_t 
**env); 
+
 #define AXIS2_STRDUP(pts, env) axis2_strdup(pts, env)
 #define AXIS2_STRCMP(s1, s2) axis2_strcmp(s1, s2)
 #define AXIS2_STRLEN(s) axis2_strlen(s)
-
+#define AXIS2_STRCASECMP(s1,s2) axis2_strcasecmp(s1,s2)
+#define AXIS2_STRNCASECMP(s1,s2,n) axis2_strncasecmp(s1,s2,n)
+#define AXIS2_STRACAT(s1, s2, env) axis2_stracat(s1, s2, env)
 /** @} */
     
 #ifdef __cplusplus

Reply via email to