axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From din...@apache.org
Subject svn commit: r519261 [6/6] - in /webservices/axis2/trunk/c: guththila/samples/ guththila/src/ rampart/samples/authn_provider/ rampart/samples/callback/ rampart/samples/callback/htpasswd_callback/ rampart/samples/client/sec_echo/ rampart/samples/omxmlsec...
Date Sat, 17 Mar 2007 08:13:00 GMT
Modified: webservices/axis2/trunk/c/util/src/url.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/url.c?view=diff&rev=519261&r1=519260&r2=519261
==============================================================================
--- webservices/axis2/trunk/c/util/src/url.c (original)
+++ webservices/axis2/trunk/c/util/src/url.c Sat Mar 17 01:12:54 2007
@@ -31,8 +31,7 @@
 };
 
 AXIS2_EXTERN axis2_url_t * AXIS2_CALL
-axis2_url_create(
-    const axis2_env_t *env,
+axis2_url_create(const axis2_env_t *env,
     const axis2_char_t *protocol,
     const axis2_char_t *server,
     const int port,
@@ -43,21 +42,21 @@
     AXIS2_PARAM_CHECK(env->error, protocol, NULL);
 
     url = (axis2_url_t *)AXIS2_MALLOC(env->allocator,
-            sizeof(axis2_url_t));
+        sizeof(axis2_url_t));
 
-    if (NULL == url)
+    if (!url)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-    url->protocol = AXIS2_STRDUP(protocol, env);
+    url->protocol = axis2_strdup(protocol, env);
     url->server = NULL;
     url->path = NULL;
     url->port = port;
 
     if (server)
     {
-        url->server = (axis2_char_t *)AXIS2_STRDUP(server, env);
+        url->server = (axis2_char_t *)axis2_strdup(server, env);
     }
     /** if the path is not starting with / we have to make it so
      */
@@ -65,11 +64,11 @@
     {
         if (path[0] == '/')
         {
-            url->path = (axis2_char_t *)AXIS2_STRDUP(path, env);
+            url->path = (axis2_char_t *)axis2_strdup(path, env);
         }
         else
         {
-            url->path = AXIS2_STRACAT("/", path, env);
+            url->path = axis2_stracat("/", path, env);
         }
 
     }
@@ -100,62 +99,62 @@
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, str_url, NULL);
 
-    tmp_url_str = AXIS2_STRDUP(str_url, env);
-    if (NULL == tmp_url_str)
+    tmp_url_str = axis2_strdup(str_url, env);
+    if (!tmp_url_str)
     {
         return NULL;
     }
     protocol = tmp_url_str;
     server = strstr(tmp_url_str, "://");
-    if (NULL == server)
+    if (!server)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_ADDRESS,
-                AXIS2_FAILURE);
+            AXIS2_FAILURE);
         AXIS2_FREE(env->allocator, tmp_url_str);
         return NULL;
     }
-    if (AXIS2_STRLEN(server) < 3 * sizeof(axis2_char_t))
+    if (axis2_strlen(server) < 3 * sizeof(axis2_char_t))
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_ADDRESS,
-                AXIS2_FAILURE);
+            AXIS2_FAILURE);
         AXIS2_FREE(env->allocator, tmp_url_str);
         return NULL;
     }
     *server = '\0';
     server += 3 * sizeof(axis2_char_t); /* skip "://" part */
-    if (AXIS2_STRLEN(server) <= 0)
+    if (axis2_strlen(server) <= 0)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_ADDRESS,
-                AXIS2_FAILURE);
+            AXIS2_FAILURE);
         AXIS2_FREE(env->allocator, tmp_url_str);
         return NULL;
     }
     /* if the url is file:// thing we need the protocol and
      * path only
      */
-    if (0 == AXIS2_STRCASECMP(protocol, (const axis2_char_t *)"file"))
+    if (0 == axis2_strcasecmp(protocol, (const axis2_char_t *)"file"))
     {
         ret = axis2_url_create(env, protocol, NULL, 0, server);
         AXIS2_FREE(env->allocator, tmp_url_str);
         return ret;
     }
     port_str = strchr(server, ':');
-    if (NULL == port_str)
+    if (!port_str)
     {
-        if (0 == AXIS2_STRCASECMP(protocol, "http"))
+        if (0 == axis2_strcasecmp(protocol, "http"))
         {
             port = 80;
         }
-        if (0 == AXIS2_STRCASECMP(protocol, "ftp"))
+        if (0 == axis2_strcasecmp(protocol, "ftp"))
         {
             port = 20;
         }
-        if (0 == AXIS2_STRCASECMP(protocol, "smtp"))
+        if (0 == axis2_strcasecmp(protocol, "smtp"))
         {
             port = 25;
         }
         path = strchr(server, '/');
-        if (NULL == path)
+        if (!path)
         {
             /* No path - assume def path ('/') */
             params = strchr(server, '?');
@@ -186,13 +185,8 @@
     {
         *port_str++ = '\0';
         path = strchr(port_str, '/');
-        if (NULL == path)
+        if (!path)
         {
-            /*params = strchr(port_str, '?');
-            if (params)
-            {
-                *params = '\0';
-            }*/
             port = AXIS2_ATOI(port_str);
             /* here we have protocol + server + port + def path */
             ret = axis2_url_create(env, protocol, server, port, "/");
@@ -203,12 +197,7 @@
         {
             *path++ = '\0';
             port = AXIS2_ATOI(port_str);
-            /*params = strchr(path, '?');
-            if (params)
-            {
-                *params = '\0';
-            }*/
-            if (AXIS2_STRLEN(path) > 0)
+            if (axis2_strlen(path) > 0)
             {
                 /* here we have protocol + server + port + path */
                 ret = axis2_url_create(env, protocol, server, port, path);
@@ -262,13 +251,13 @@
     AXIS2_PARAM_CHECK(env->error, url, NULL);
 
     sprintf(port_str, "%d", url->port);
-    len = AXIS2_STRLEN(url->protocol) +
-            AXIS2_STRLEN(url->server) + AXIS2_STRLEN(url->path) +
-            strlen(port_str) + 7;
+    len = axis2_strlen(url->protocol) +
+        axis2_strlen(url->server) + axis2_strlen(url->path) +
+        strlen(port_str) + 7;
     external_form = (axis2_char_t*) AXIS2_MALLOC(env->allocator,
-            len);
+        len);
     sprintf(external_form, "%s://%s:%s%s", url->protocol, url->server,
-            port_str, url->path);
+        port_str, url->path);
     return external_form;
 }
 
@@ -285,7 +274,7 @@
         AXIS2_FREE(env->allocator, url->protocol);
         url->protocol = NULL;
     }
-    url->protocol = AXIS2_STRDUP(protocol, env);
+    url->protocol = axis2_strdup(protocol, env);
     return AXIS2_SUCCESS;
 }
 
@@ -294,7 +283,6 @@
 axis2_url_get_protocol(axis2_url_t *url, 
     const axis2_env_t *env)
 {
-    AXIS2_ENV_CHECK(env, NULL);
     return url->protocol;
 }
 
@@ -308,9 +296,8 @@
     if (url->server)
     {
         AXIS2_FREE(env->allocator, url->server);
-        url->server = NULL;
     }
-    url->server = AXIS2_STRDUP(server, env);
+    url->server = axis2_strdup(server, env);
     return AXIS2_SUCCESS;
 }
 
@@ -319,7 +306,6 @@
 axis2_url_get_server(axis2_url_t *url, 
     const axis2_env_t *env)
 {
-    AXIS2_ENV_CHECK(env, NULL);
     return url->server;
 }
 
@@ -338,7 +324,6 @@
 axis2_url_get_port(axis2_url_t *url, 
     const axis2_env_t *env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_CRITICAL_FAILURE);
     return url->port;
 }
 
@@ -352,9 +337,8 @@
     if (url->path)
     {
         AXIS2_FREE(env->allocator, url->path);
-        url->path = NULL;
     }
-    url->path = AXIS2_STRDUP(path, env);
+    url->path = axis2_strdup(path, env);
     return AXIS2_SUCCESS;
 }
 
@@ -363,7 +347,6 @@
 axis2_url_get_path(axis2_url_t *url, 
     const axis2_env_t *env)
 {
-    AXIS2_ENV_CHECK(env, NULL);
     return url->path;
 }
 
@@ -374,9 +357,9 @@
     AXIS2_ENV_CHECK(env, NULL);
 
     return axis2_url_create(env, url->protocol,
-            url->server,
-            url->port,
-            url->path);
+        url->server,
+        url->port,
+        url->path);
 }
 
 AXIS2_EXTERN axis2_uri_t *AXIS2_CALL

Modified: webservices/axis2/trunk/c/util/src/utils.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/utils.c?view=diff&rev=519261&r1=519260&r2=519261
==============================================================================
--- webservices/axis2/trunk/c/util/src/utils.c (original)
+++ webservices/axis2/trunk/c/util/src/utils.c Sat Mar 17 01:12:54 2007
@@ -23,7 +23,7 @@
 
 AXIS2_EXTERN axis2_char_t** AXIS2_CALL
 axis2_parse_request_url_for_svc_and_op(const axis2_env_t *env,
-        const axis2_char_t *request)
+    const axis2_char_t *request)
 
 {
     axis2_char_t **ret = NULL;
@@ -32,7 +32,7 @@
     int i = 0;
     AXIS2_ENV_CHECK(env, NULL);
     ret  = AXIS2_MALLOC(env->allocator,
-            2 * (sizeof(axis2_char_t *)));
+        2 * (sizeof(axis2_char_t *)));
     memset(ret, 0, 2*sizeof(axis2_char_t*));
     tmp = (axis2_char_t *)request;
 
@@ -40,17 +40,19 @@
     while (1)
     {
         tmp = strstr(tmp, AXIS2_REQUEST_URL_PREFIX);
-        if (NULL == tmp)
+        if (!tmp)
+	{
             break;
+	}
         else
         {
             service_str = tmp;
-            tmp += AXIS2_STRLEN(AXIS2_REQUEST_URL_PREFIX);
+            tmp += axis2_strlen(AXIS2_REQUEST_URL_PREFIX);
         }
     }
     if (service_str)
     {
-        service_str += AXIS2_STRLEN(AXIS2_REQUEST_URL_PREFIX);
+        service_str += axis2_strlen(AXIS2_REQUEST_URL_PREFIX);
         if ('\0' != *service_str)
         {
             service_str++; /*to remove the leading '/' */
@@ -72,19 +74,19 @@
                     {
                         i = tmp - service_str;
                         ret[1] = AXIS2_MALLOC(env->allocator,
-                                i * sizeof(char) + 1);
+                            i * sizeof(char) + 1);
                         strncpy(ret[1], service_str, i);
                         ret[1][i] = '\0';
                     }
                     else
                     {
-                        ret[1] = AXIS2_STRDUP(service_str, env);
+                        ret[1] = axis2_strdup(service_str, env);
                     }
                 }
             }
             else
             {
-                ret[0] = AXIS2_STRDUP(service_str, env);
+                ret[0] = axis2_strdup(service_str, env);
             }
         }
     }

Modified: webservices/axis2/trunk/c/util/src/uuid_gen.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/uuid_gen.c?view=diff&rev=519261&r1=519260&r2=519261
==============================================================================
--- webservices/axis2/trunk/c/util/src/uuid_gen.c (original)
+++ webservices/axis2/trunk/c/util/src/uuid_gen.c Sat Mar 17 01:12:54 2007
@@ -25,10 +25,10 @@
 
     axis2_char_t *str = AXIS2_MALLOC(env->allocator, 40 * sizeof(char));
     axis2_platform_uuid_gen(str);
-    if (str == NULL)
+    if (!str)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_UUID_GEN_FAILED,
-                AXIS2_FAILURE);
+            AXIS2_FAILURE);
         return NULL;
     }
     return str;

Modified: webservices/axis2/trunk/c/util/test/util/test_string.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/test/util/test_string.c?view=diff&rev=519261&r1=519260&r2=519261
==============================================================================
--- webservices/axis2/trunk/c/util/test/util/test_string.c (original)
+++ webservices/axis2/trunk/c/util/test/util/test_string.c Sat Mar 17 01:12:54 2007
@@ -22,13 +22,13 @@
 
 void test_strltrim(const axis2_env_t *env)
 {
-    axis2_char_t *s = AXIS2_STRDUP("    abcd efgh    ", env);
+    axis2_char_t *s = axis2_strdup("    abcd efgh    ", env);
     axis2_char_t *trimmed = NULL;
-    trimmed = AXIS2_STRLTRIM(env, s, " \t\r\n");
-    if (0 == AXIS2_STRCMP(trimmed, "abcd efgh    "))
-        printf("AXIS2_STRLTRIM successful\n");
+    trimmed = axis2_strltrim(env, s, " \t\r\n");
+    if (0 == axis2_strcmp(trimmed, "abcd efgh    "))
+        printf("axis2_strltrim successful\n");
     else
-        printf("AXIS2_STRLTRIM failed [%s]\n", trimmed);
+        printf("axis2_strltrim failed [%s]\n", trimmed);
     if (trimmed)
         AXIS2_FREE(env->allocator, trimmed);
     if (s)
@@ -37,13 +37,13 @@
 
 void test_strrtrim(const axis2_env_t *env)
 {
-    axis2_char_t *s = AXIS2_STRDUP("abcd efgh    ", env);
+    axis2_char_t *s = axis2_strdup("abcd efgh    ", env);
     axis2_char_t *trimmed = NULL;
-    trimmed = AXIS2_STRRTRIM(env, s, " \t\r\n");
-    if (0 == AXIS2_STRCMP(trimmed, "    abcd efgh"))
-        printf("AXIS2_STRRTRIM successful\n");
+    trimmed = axis2_strrtrim(env, s, " \t\r\n");
+    if (0 == axis2_strcmp(trimmed, "    abcd efgh"))
+        printf("axis2_strrtrim successful\n");
     else
-        printf("AXIS2_STRRTRIM failed [%s]\n", trimmed);
+        printf("axis2_strrtrim failed [%s]\n", trimmed);
     if (trimmed)
         AXIS2_FREE(env->allocator, trimmed);
     if (s)
@@ -52,13 +52,13 @@
 
 void test_strtrim(const axis2_env_t *env)
 {
-    axis2_char_t *s = AXIS2_STRDUP("    abcd efgh    ", env);
+    axis2_char_t *s = axis2_strdup("    abcd efgh    ", env);
     axis2_char_t *trimmed = NULL;
-    trimmed = AXIS2_STRTRIM(env, s, " \t\r\n");
-    if (0 == AXIS2_STRCMP(trimmed, "abcd efgh"))
-        printf("AXIS2_STRTRIM successful\n");
+    trimmed = axis2_strtrim(env, s, " \t\r\n");
+    if (0 == axis2_strcmp(trimmed, "abcd efgh"))
+        printf("axis2_strtrim successful\n");
     else
-        printf("AXIS2_STRTRIM failed [%s]\n", trimmed);
+        printf("axis2_strtrim failed [%s]\n", trimmed);
     if (trimmed)
         AXIS2_FREE(env->allocator, trimmed);
     if (s)

Modified: webservices/axis2/trunk/c/util/test/util/test_util.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/test/util/test_util.c?view=diff&rev=519261&r1=519260&r2=519261
==============================================================================
--- webservices/axis2/trunk/c/util/test/util/test_util.c (original)
+++ webservices/axis2/trunk/c/util/test/util/test_util.c Sat Mar 17 01:12:54 2007
@@ -63,10 +63,10 @@
     a4 = (a *) AXIS2_MALLOC(env->allocator, sizeof(a));
 
 
-    a1->value = AXIS2_STRDUP("value1", env);
-    a2->value = AXIS2_STRDUP("value2", env);
-    a3->value = AXIS2_STRDUP("value3", env);
-    a4->value = AXIS2_STRDUP("value4", env);
+    a1->value = axis2_strdup("value1", env);
+    a2->value = axis2_strdup("value2", env);
+    a3->value = axis2_strdup("value3", env);
+    a4->value = axis2_strdup("value4", env);
 
     ht = axis2_hash_make(env);
 
@@ -116,7 +116,7 @@
     axis2_error_t *error = axis2_error_create(allocator);
     const axis2_env_t *env = axis2_env_create_with_error(allocator, error);
 
-    axis2_char_t *pathname = AXIS2_STRDUP("/tmp/test/", env);
+    axis2_char_t *pathname = axis2_strdup("/tmp/test/", env);
 
     axis2_array_list_t *arr_folders = axis2_dir_handler_list_service_or_module_dirs(env,
pathname);
     if (arr_folders == NULL)
@@ -146,8 +146,8 @@
   */
 int test_file_diff(const axis2_env_t *env)
 {
-  /*  axis2_char_t *expected_file_name = AXIS2_STRDUP("expected", env);
-    axis2_char_t *actual_file_name = AXIS2_STRDUP("actual", env);*/
+  /*  axis2_char_t *expected_file_name = axis2_strdup("expected", env);
+    axis2_char_t *actual_file_name = axis2_strdup("actual", env);*/
     return 0;
 }
 
@@ -161,31 +161,31 @@
     printf("list size %d\n", axis2_array_list_size(al, env));
 
     entry = (a *) AXIS2_MALLOC(env->allocator, sizeof(a));
-    entry->value = AXIS2_STRDUP("value1", env);
+    entry->value = axis2_strdup("value1", env);
     axis2_array_list_add(al, env, (void*)entry);
 
     entry = (a *) AXIS2_MALLOC(env->allocator, sizeof(a));
-    entry->value = AXIS2_STRDUP("value2", env);
+    entry->value = axis2_strdup("value2", env);
     axis2_array_list_add(al, env, (void*)entry);
 
     entry = (a *) AXIS2_MALLOC(env->allocator, sizeof(a));
-    entry->value = AXIS2_STRDUP("value3", env);
+    entry->value = axis2_strdup("value3", env);
     axis2_array_list_add(al, env, (void*)entry);
 
     entry = (a *) AXIS2_MALLOC(env->allocator, sizeof(a));
-    entry->value = AXIS2_STRDUP("value4", env);
+    entry->value = axis2_strdup("value4", env);
     axis2_array_list_add(al, env, (void*)entry);
 
     entry = (a *) AXIS2_MALLOC(env->allocator, sizeof(a));
-    entry->value = AXIS2_STRDUP("value5", env);
+    entry->value = axis2_strdup("value5", env);
     axis2_array_list_add(al, env, (void*)entry);
 
     entry = (a *) AXIS2_MALLOC(env->allocator, sizeof(a));
-    entry->value = AXIS2_STRDUP("value6", env);
+    entry->value = axis2_strdup("value6", env);
     axis2_array_list_add(al, env, (void*)entry);
 
     entry = (a *) AXIS2_MALLOC(env->allocator, sizeof(a));
-    entry->value = AXIS2_STRDUP("value7", env);
+    entry->value = axis2_strdup("value7", env);
     axis2_array_list_set(al, env, 3, (void*)entry);
     axis2_array_list_remove(al, env, 2);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message