axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r434389 - in /webservices/axis2/trunk/c: include/axis2_http_request_line.h modules/core/transport/http/http_request_line.c modules/core/transport/http/http_simple_response.c
Date Thu, 24 Aug 2006 12:43:36 GMT
Author: pini
Date: Thu Aug 24 05:43:35 2006
New Revision: 434389

URL: http://svn.apache.org/viewvc?rev=434389&view=rev
Log:
More fomatting fixes and parameter changes to const

Modified:
    webservices/axis2/trunk/c/include/axis2_http_request_line.h
    webservices/axis2/trunk/c/modules/core/transport/http/http_request_line.c
    webservices/axis2/trunk/c/modules/core/transport/http/http_simple_response.c

Modified: webservices/axis2/trunk/c/include/axis2_http_request_line.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_http_request_line.h?rev=434389&r1=434388&r2=434389&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_http_request_line.h (original)
+++ webservices/axis2/trunk/c/include/axis2_http_request_line.h Thu Aug 24 05:43:35 2006
@@ -48,49 +48,49 @@
      * HTTP Request Line ops struct
      * Encapsulator struct for ops of axis2_http_request_line
      */
-    AXIS2_DECLARE_DATA struct axis2_http_request_line_ops
+    struct axis2_http_request_line_ops
     {
         /**
-    * @param request_line pointer to request line
-    * @param env pointer to environment struct
-    */
-        axis2_char_t* (AXIS2_CALL *
-           get_method)(
-                    axis2_http_request_line_t *request_line,
+         * @param request_line pointer to request line
+         * @param env pointer to environment struct
+         */
+        axis2_char_t *(AXIS2_CALL *
+                get_method)(
+                    const axis2_http_request_line_t *request_line,
                     const axis2_env_t *env);
 
         /**
-    * @param request_line pointer to request line
-    * @param env pointer to environment struct
-    */
-        axis2_char_t* (AXIS2_CALL *
+         * @param request_line pointer to request line
+         * @param env pointer to environment struct
+         */
+        axis2_char_t *(AXIS2_CALL *
                 get_http_version)(
-                    axis2_http_request_line_t *request_line,
+                    const axis2_http_request_line_t *request_line,
                     const axis2_env_t *env);
 
         /**
-    * @param request_line pointer to request line
-    * @param env pointer to environment struct
-    */
-        axis2_char_t* (AXIS2_CALL *
+         * @param request_line pointer to request line
+         * @param env pointer to environment struct
+         */
+        axis2_char_t *(AXIS2_CALL *
                 get_uri)(
-                    axis2_http_request_line_t *request_line,
+                    const axis2_http_request_line_t *request_line,
                     const axis2_env_t *env);
 
         /**
-    * @param request_line pointer to request line
-    * @param env pointer to environment struct
-    */
-        axis2_char_t* (AXIS2_CALL *
+         * @param request_line pointer to request line
+         * @param env pointer to environment struct
+         */
+        axis2_char_t *(AXIS2_CALL *
                 to_string)(
                     axis2_http_request_line_t *request_line,
                     const axis2_env_t *env);
 
         /**
-    * @param request_line pointer to request line
-    * @param env pointer to environment struct
-    * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
-    */
+         * @param request_line pointer to request line
+         * @param env pointer to environment struct
+         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+         */
         axis2_status_t (AXIS2_CALL *
                 free)(
                     axis2_http_request_line_t *request_line,
@@ -101,7 +101,7 @@
      * @brief HTTP Reqest Line struct
      * Axis2 HTTP Request Line
      */
-    AXIS2_DECLARE_DATA struct axis2_http_request_line
+    struct axis2_http_request_line
     {
         axis2_http_request_line_ops_t *ops;
     };
@@ -112,7 +112,7 @@
      * @param uri pointer to uri
      * @param http_version pointer to http version
      */
-    AXIS2_EXTERN axis2_http_request_line_t * AXIS2_CALL
+    AXIS2_EXTERN axis2_http_request_line_t *AXIS2_CALL
     axis2_http_request_line_create(
         const axis2_env_t *env,
         const axis2_char_t *method,
@@ -123,10 +123,10 @@
      * @param env pointer to environment struct
      * @param str pointer to str
      */
-    AXIS2_EXTERN axis2_http_request_line_t* AXIS2_CALL
+    AXIS2_EXTERN axis2_http_request_line_t *AXIS2_CALL
     axis2_http_request_line_parse_line(
-            const axis2_env_t *env, 
-       const axis2_char_t *str);
+        const axis2_env_t *env,
+        const axis2_char_t *str);
 
 /********************* Start of function macros   ***************************/
 

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_request_line.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/http_request_line.c?rev=434389&r1=434388&r2=434389&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_request_line.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_request_line.c Thu Aug 24 05:43:35
2006
@@ -13,117 +13,116 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 #include <axis2_http_request_line.h>
 #include <axis2_string.h>
 #include <string.h>
 #include <axis2_http_transport.h>
 #include <stdio.h>
-/** 
+/**
  * @brief HTTP Request Line struct impl
  *   Axis2 HTTP Request Line impl  
  */
-typedef struct axis2_http_request_line_impl axis2_http_request_line_impl_t;  
-  
-struct axis2_http_request_line_impl
+
+typedef struct axis2_http_request_line_impl
 {
-   axis2_http_request_line_t request_line;
-   axis2_char_t *http_version;
+    axis2_http_request_line_t request_line;
+    axis2_char_t *http_version;
     axis2_char_t *method;
     axis2_char_t *uri;
-};
+}axis2_http_request_line_impl_t;
 
 #define AXIS2_INTF_TO_IMPL(request_line) \
                  ((axis2_http_request_line_impl_t *)(request_line))
 
 /***************************** Function headers *******************************/
 
-/*  
+/*
  *  This is just a function
  *  Not assciated with an ops struct
  */
-axis2_http_request_line_t* AXIS2_CALL 
+axis2_http_request_line_t* AXIS2_CALL
 axis2_http_request_line_parse_line(const axis2_env_t *env, const axis2_char_t *str);
 
-axis2_char_t* AXIS2_CALL 
-axis2_http_request_line_get_method(axis2_http_request_line_t *request_line, 
-                            const axis2_env_t *env);
+axis2_char_t* AXIS2_CALL
+axis2_http_request_line_get_method(const axis2_http_request_line_t *request_line,
+        const axis2_env_t *env);
 
-axis2_char_t* AXIS2_CALL 
+axis2_char_t* AXIS2_CALL
 axis2_http_request_line_get_http_version
-                            (axis2_http_request_line_t *request_line, 
-                            const axis2_env_t *env);
+(const axis2_http_request_line_t *request_line,
+        const axis2_env_t *env);
 
-axis2_char_t* AXIS2_CALL 
-axis2_http_request_line_get_uri(axis2_http_request_line_t *request_line, 
-                            const axis2_env_t *env);
-
-axis2_char_t* AXIS2_CALL 
-axis2_http_request_line_to_string(axis2_http_request_line_t *request_line, 
-                            const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL 
-axis2_http_request_line_free(axis2_http_request_line_t *request_line, 
-                            const axis2_env_t *env);                        
+axis2_char_t* AXIS2_CALL
+axis2_http_request_line_get_uri(const axis2_http_request_line_t *request_line,
+        const axis2_env_t *env);
+
+axis2_char_t* AXIS2_CALL
+axis2_http_request_line_to_string(axis2_http_request_line_t *request_line,
+        const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+axis2_http_request_line_free(axis2_http_request_line_t *request_line,
+        const axis2_env_t *env);
 /***************************** End of function headers ************************/
 
-AXIS2_EXTERN axis2_http_request_line_t * AXIS2_CALL 
-axis2_http_request_line_create(const axis2_env_t *env, 
-    const axis2_char_t *method, 
-    const axis2_char_t *uri, 
-    const axis2_char_t *http_version)
+AXIS2_EXTERN axis2_http_request_line_t * AXIS2_CALL
+axis2_http_request_line_create(const axis2_env_t *env,
+        const axis2_char_t *method,
+        const axis2_char_t *uri,
+        const axis2_char_t *http_version)
 {
     axis2_http_request_line_impl_t *request_line_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, method, NULL);
     AXIS2_PARAM_CHECK(env->error, uri, NULL);
     AXIS2_PARAM_CHECK(env->error, http_version, NULL);
-        
-    request_line_impl = (axis2_http_request_line_impl_t *)AXIS2_MALLOC 
-                        (env->allocator, sizeof(
+
+    request_line_impl = (axis2_http_request_line_impl_t *)AXIS2_MALLOC
+            (env->allocator, sizeof(
                         axis2_http_request_line_impl_t));
-   
+
     if(NULL == request_line_impl)
-   {
-      AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
-   }
+    }
     request_line_impl->method = (axis2_char_t *)AXIS2_STRDUP(method, env);
     request_line_impl->uri = (axis2_char_t *)AXIS2_STRDUP(uri, env);
     request_line_impl->http_version = (axis2_char_t *)AXIS2_STRDUP(
-                         http_version, env);
-     
+                http_version, env);
+
     request_line_impl->request_line.ops = AXIS2_MALLOC(env->allocator,
-        sizeof(axis2_http_request_line_ops_t));
+            sizeof(axis2_http_request_line_ops_t));
     if(NULL == request_line_impl->request_line.ops)
-   {
-      axis2_http_request_line_free((axis2_http_request_line_t*)
-                         request_line_impl, env);
+    {
+        axis2_http_request_line_free((axis2_http_request_line_t*)
+                request_line_impl, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
-   }
-    
+    }
+
     request_line_impl->request_line.ops->get_method =
-                        axis2_http_request_line_get_method;
+        axis2_http_request_line_get_method;
     request_line_impl->request_line.ops->get_http_version =
-                        axis2_http_request_line_get_http_version;
+        axis2_http_request_line_get_http_version;
     request_line_impl->request_line.ops->get_uri =
-                        axis2_http_request_line_get_uri;
+        axis2_http_request_line_get_uri;
     request_line_impl->request_line.ops->to_string =
-                        axis2_http_request_line_to_string;
+        axis2_http_request_line_to_string;
     request_line_impl->request_line.ops->free =
-                        axis2_http_request_line_free;
-   return &(request_line_impl->request_line);
+        axis2_http_request_line_free;
+    return &(request_line_impl->request_line);
 }
 
 axis2_status_t AXIS2_CALL
-axis2_http_request_line_free(axis2_http_request_line_t *request_line, 
-                        const axis2_env_t *env)
+axis2_http_request_line_free(axis2_http_request_line_t *request_line,
+        const axis2_env_t *env)
 {
     axis2_http_request_line_impl_t *request_line_impl = NULL;
-   AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     request_line_impl = AXIS2_INTF_TO_IMPL(request_line);
-    
+
     if(NULL != request_line_impl->method)
     {
         AXIS2_FREE(env->allocator, request_line_impl->method);
@@ -138,15 +137,15 @@
     {
         AXIS2_FREE(env->allocator, request_line_impl->http_version);
         request_line_impl->http_version = NULL;
-    }        
+    }
     if(NULL != request_line->ops)
         AXIS2_FREE(env->allocator, request_line->ops);
-    
-   AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(request_line));
-   return AXIS2_SUCCESS;
+
+    AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(request_line));
+    return AXIS2_SUCCESS;
 }
 
-AXIS2_EXTERN axis2_http_request_line_t* AXIS2_CALL 
+AXIS2_EXTERN axis2_http_request_line_t* AXIS2_CALL
 axis2_http_request_line_parse_line(const axis2_env_t *env, const axis2_char_t *str)
 {
     axis2_char_t *req_line = NULL;
@@ -156,38 +155,38 @@
     axis2_http_request_line_t *ret = NULL;
     axis2_char_t *tmp = NULL;
     int i = 0;
-    
+
     AXIS2_PARAM_CHECK(env->error, str, NULL);
-    
+
     tmp = AXIS2_STRSTR(str, AXIS2_HTTP_CRLF);
-   
-    
+
+
     if(NULL == tmp)
     {
-        AXIS2_ERROR_SET(env->error, 
-                        AXIS2_ERROR_INVALID_HTTP_HEADER_START_LINE, 
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error,
+                AXIS2_ERROR_INVALID_HTTP_HEADER_START_LINE,
+                AXIS2_FAILURE);
         return NULL;
     }
     i = tmp - str;
-    req_line = AXIS2_MALLOC(env->allocator, i * sizeof(axis2_char_t) +1);
+    req_line = AXIS2_MALLOC(env->allocator, i * sizeof(axis2_char_t) + 1);
     if(NULL == req_line)
     {
-       AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return NULL;        
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
     }
     memcpy(req_line, str, i * sizeof(axis2_char_t));
     req_line[i] = '\0';
     tmp = req_line;
-    
+
     method = tmp;
     tmp = strchr(tmp, ' ');
     if(NULL == tmp)
     {
         AXIS2_FREE(env->allocator, req_line);
-        AXIS2_ERROR_SET(env->error, 
-                    AXIS2_ERROR_INVALID_HTTP_HEADER_START_LINE, 
-                    AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error,
+                AXIS2_ERROR_INVALID_HTTP_HEADER_START_LINE,
+                AXIS2_FAILURE);
         return NULL;
     }
     *tmp++ = '\0';
@@ -196,81 +195,81 @@
     if(NULL == tmp)
     {
         AXIS2_FREE(env->allocator, req_line);
-        AXIS2_ERROR_SET(env->error, 
-                    AXIS2_ERROR_INVALID_HTTP_HEADER_START_LINE, 
-                    AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error,
+                AXIS2_ERROR_INVALID_HTTP_HEADER_START_LINE,
+                AXIS2_FAILURE);
         return NULL;
     }
     *tmp++ = '\0';
     http_version = tmp;
     ret = axis2_http_request_line_create(env, method, uri, http_version);
     AXIS2_FREE(env->allocator, req_line);
-    
-    return ret;    
+
+    return ret;
 }
 
 
-axis2_char_t* AXIS2_CALL 
-axis2_http_request_line_get_method(axis2_http_request_line_t *request_line, 
-                            const axis2_env_t *env)
+axis2_char_t* AXIS2_CALL
+axis2_http_request_line_get_method(const axis2_http_request_line_t *request_line,
+        const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
     return AXIS2_INTF_TO_IMPL(request_line)->method;
 }
 
 
-axis2_char_t* AXIS2_CALL 
+axis2_char_t* AXIS2_CALL
 axis2_http_request_line_get_http_version
-                            (axis2_http_request_line_t *request_line, 
-                            const axis2_env_t *env)
+(const axis2_http_request_line_t *request_line,
+        const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
     return AXIS2_INTF_TO_IMPL(request_line)->http_version;
 }
 
 
-axis2_char_t* AXIS2_CALL 
-axis2_http_request_line_get_uri(axis2_http_request_line_t *request_line, 
-                            const axis2_env_t *env)
+axis2_char_t* AXIS2_CALL
+axis2_http_request_line_get_uri(const axis2_http_request_line_t *request_line,
+        const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
     return AXIS2_INTF_TO_IMPL(request_line)->uri;
 }
 
 
-axis2_char_t* AXIS2_CALL 
-axis2_http_request_line_to_string(axis2_http_request_line_t *request_line, 
-                            const axis2_env_t *env)
+axis2_char_t* AXIS2_CALL
+axis2_http_request_line_to_string(axis2_http_request_line_t *request_line,
+        const axis2_env_t *env)
 {
     axis2_http_request_line_impl_t *req_line_impl = NULL;
     int alloc_len = 0;
     axis2_char_t *ret = NULL;
-    
+
     AXIS2_ENV_CHECK(env, NULL);
-    
+
     req_line_impl = AXIS2_INTF_TO_IMPL(
-                            request_line);
-    alloc_len = AXIS2_STRLEN(req_line_impl->method) + 
-                    AXIS2_STRLEN(req_line_impl->uri)+
-                    AXIS2_STRLEN(req_line_impl->http_version) + 6;
+                request_line);
+    alloc_len = AXIS2_STRLEN(req_line_impl->method) +
+            AXIS2_STRLEN(req_line_impl->uri) +
+            AXIS2_STRLEN(req_line_impl->http_version) + 6;
     /* 5 = 2 * spaces + '/' +CR + LF + '\0' */
 
-    ret = AXIS2_MALLOC(env->allocator, 
-                    alloc_len * sizeof(axis2_char_t));
+    ret = AXIS2_MALLOC(env->allocator,
+            alloc_len * sizeof(axis2_char_t));
     if(NULL == ret)
     {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); 
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
     if(req_line_impl->uri[0] != '/')
     {
-        sprintf(ret, "%s /%s %s%s", req_line_impl->method, req_line_impl->uri, 
-                    req_line_impl->http_version, AXIS2_HTTP_CRLF);
+        sprintf(ret, "%s /%s %s%s", req_line_impl->method, req_line_impl->uri,
+                req_line_impl->http_version, AXIS2_HTTP_CRLF);
     }
     else
     {
-        sprintf(ret, "%s %s %s%s", req_line_impl->method, req_line_impl->uri, 
-                    req_line_impl->http_version, AXIS2_HTTP_CRLF);
+        sprintf(ret, "%s %s %s%s", req_line_impl->method, req_line_impl->uri,
+                req_line_impl->http_version, AXIS2_HTTP_CRLF);
     }
     return ret;
 }

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_simple_response.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/http_simple_response.c?rev=434389&r1=434388&r2=434389&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_simple_response.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_simple_response.c Thu Aug 24
05:43:35 2006
@@ -27,16 +27,14 @@
 #define READ_SIZE 32
 
 
-typedef struct axis2_http_simple_response_impl 
-                                        axis2_http_simple_response_impl_t;  
-
-struct axis2_http_simple_response_impl
+typedef struct axis2_http_simple_response_impl
 {
-   axis2_http_simple_response_t simple_response;
-   axis2_http_status_line_t *status_line;
+    axis2_http_simple_response_t simple_response;
+    axis2_http_status_line_t *status_line;
     axis2_array_list_t *header_group;
     axis2_stream_t *stream;
-};
+}
+axis2_http_simple_response_impl_t;
 
 #define AXIS2_INTF_TO_IMPL(simple_response) \
                  ((axis2_http_simple_response_impl_t *)(simple_response))
@@ -44,105 +42,114 @@
 /***************************** Function headers *******************************/
 
 axis2_status_t AXIS2_CALL 
-axis2_http_simple_response_set_status_line 
-                        (struct axis2_http_simple_response *simple_response, 
-                        const axis2_env_t *env, const axis2_char_t *http_ver, 
-                        const int status_code, const axis2_char_t *phrase);
-    
-axis2_char_t* AXIS2_CALL 
-axis2_http_simple_response_get_phrase 
-                        (axis2_http_simple_response_t *simple_response, 
-                        const axis2_env_t *env);
+axis2_http_simple_response_set_status_line(
+    struct axis2_http_simple_response *simple_response, 
+    const axis2_env_t *env, 
+    const axis2_char_t *http_ver, 
+    const int status_code, 
+    const axis2_char_t *phrase);
+    
+axis2_char_t *AXIS2_CALL 
+axis2_http_simple_response_get_phrase(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env);
     
 int AXIS2_CALL 
-axis2_http_simple_response_get_status_code 
-                        (axis2_http_simple_response_t *simple_response, 
-                        const axis2_env_t *env);
-
-axis2_char_t* AXIS2_CALL 
-axis2_http_simple_response_get_http_version 
-                        (axis2_http_simple_response_t *simple_response, 
-                        const axis2_env_t *env);
-
-axis2_char_t* AXIS2_CALL 
-axis2_http_simple_response_get_status_line 
-                        (axis2_http_simple_response_t *simple_response, 
-                        const axis2_env_t *env);
+axis2_http_simple_response_get_status_code(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env);
+
+axis2_char_t *AXIS2_CALL 
+axis2_http_simple_response_get_http_version(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env);
+
+axis2_char_t *AXIS2_CALL 
+axis2_http_simple_response_get_status_line(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env);
 
 axis2_bool_t AXIS2_CALL 
-axis2_http_simple_response_contains_header 
-                    (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env, 
-                    const axis2_char_t *name);
-
-axis2_array_list_t* AXIS2_CALL 
-axis2_http_simple_response_get_headers 
-                    (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env);
-    
-axis2_http_header_t* AXIS2_CALL 
-axis2_http_simple_response_get_first_header
-                    (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env, 
-                    const axis2_char_t *str);
-    
-axis2_status_t AXIS2_CALL 
-axis2_http_simple_response_remove_headers 
-                    (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env, const axis2_char_t *str);
-    
-axis2_status_t AXIS2_CALL 
-axis2_http_simple_response_set_header 
-                    (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env, axis2_http_header_t* header);
-    
-const axis2_char_t* AXIS2_CALL 
-axis2_http_simple_response_get_charset
-                    (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env);
+axis2_http_simple_response_contains_header(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env, 
+    const axis2_char_t *name);
+
+axis2_array_list_t *AXIS2_CALL 
+axis2_http_simple_response_get_headers(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env);
+    
+axis2_http_header_t *AXIS2_CALL 
+axis2_http_simple_response_get_first_header(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env, 
+    const axis2_char_t *str);
+
+axis2_status_t AXIS2_CALL 
+axis2_http_simple_response_remove_headers(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env, 
+    const axis2_char_t *str);
+    
+axis2_status_t AXIS2_CALL 
+axis2_http_simple_response_set_header(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env, 
+    axis2_http_header_t *header);
+    
+const axis2_char_t *AXIS2_CALL 
+axis2_http_simple_response_get_charset(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env);
     
 axis2_ssize_t AXIS2_CALL 
-axis2_http_simple_response_get_content_length
-                    (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env);
-    
-const axis2_char_t* AXIS2_CALL 
-axis2_http_simple_response_get_content_type
-                    (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL 
-axis2_http_simple_response_set_body_string 
-                    (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env, axis2_char_t *str);
-    
-axis2_status_t AXIS2_CALL 
-axis2_http_simple_response_set_body_stream
-                    (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env, axis2_stream_t *stream);    
-
-axis2_stream_t* AXIS2_CALL 
-axis2_http_simple_response_get_body
-                    (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env);
+axis2_http_simple_response_get_content_length(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env);
+    
+const axis2_char_t *AXIS2_CALL 
+axis2_http_simple_response_get_content_type(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL 
+axis2_http_simple_response_set_body_string(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env, 
+    axis2_char_t *str);
+    
+axis2_status_t AXIS2_CALL 
+axis2_http_simple_response_set_body_stream(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env, 
+    axis2_stream_t *stream);    
+
+axis2_stream_t *AXIS2_CALL 
+axis2_http_simple_response_get_body(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env);
 
 axis2_ssize_t AXIS2_CALL 
-axis2_http_simple_response_get_body_bytes 
-                    (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env, axis2_char_t **buf);
+axis2_http_simple_response_get_body_bytes(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env, 
+    axis2_char_t **buf);
 
 axis2_status_t AXIS2_CALL 
-axis2_http_simple_response_free (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env);
+axis2_http_simple_response_free(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env);
                         
 /***************************** End of function headers ************************/
 
-AXIS2_EXTERN axis2_http_simple_response_t * AXIS2_CALL
-axis2_http_simple_response_create (const axis2_env_t *env,
-                        axis2_http_status_line_t *status_line,
-                        const axis2_http_header_t **http_headers,
-                        const axis2_ssize_t http_hdr_count,
-                        axis2_stream_t *content)
+AXIS2_EXTERN axis2_http_simple_response_t *AXIS2_CALL
+axis2_http_simple_response_create(
+    const axis2_env_t *env,
+    axis2_http_status_line_t *status_line,
+    const axis2_http_header_t **http_headers,
+    const axis2_ssize_t http_hdr_count,
+    axis2_stream_t *content)
 {
     axis2_http_simple_response_t *ret = NULL;
     axis2_http_simple_response_impl_t *simple_response_impl = NULL;
@@ -171,7 +178,7 @@
         for(i = 0; i < http_hdr_count; i++)
         {
             AXIS2_ARRAY_LIST_ADD(simple_response_impl->header_group, env, 
-                        (void*)http_headers[i]);
+                        (void *)http_headers[i]);
         }
     }
     simple_response_impl->stream = content;
@@ -180,8 +187,9 @@
 }
 
 
-AXIS2_EXTERN axis2_http_simple_response_t * AXIS2_CALL
-axis2_http_simple_response_create_default(const axis2_env_t *env)
+AXIS2_EXTERN axis2_http_simple_response_t *AXIS2_CALL
+axis2_http_simple_response_create_default(
+    const axis2_env_t *env)
 {
     axis2_http_simple_response_impl_t *simple_response_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
@@ -193,15 +201,15 @@
     simple_response_impl->simple_response.ops = AXIS2_MALLOC(env->allocator,
                         sizeof(axis2_http_simple_response_ops_t));
     if(NULL == simple_response_impl->simple_response.ops)
-   {
-      axis2_http_simple_response_free((axis2_http_simple_response_t*)
+    {
+        axis2_http_simple_response_free((axis2_http_simple_response_t *)
                                         simple_response_impl, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
-   }
-   simple_response_impl->status_line = NULL;
-   simple_response_impl->header_group = NULL;
-   simple_response_impl->stream = NULL;
+    }
+    simple_response_impl->status_line = NULL;
+    simple_response_impl->header_group = NULL;
+    simple_response_impl->stream = NULL;
    
     simple_response_impl->simple_response.ops->set_status_line = 
                         axis2_http_simple_response_set_status_line;
@@ -244,8 +252,9 @@
 }
 
 axis2_status_t AXIS2_CALL 
-axis2_http_simple_response_free (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env)
+axis2_http_simple_response_free(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env)
 {
     axis2_http_simple_response_impl_t *simple_response_impl = NULL;
    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -276,18 +285,20 @@
     if(NULL != simple_response->ops)
         AXIS2_FREE(env->allocator, simple_response->ops);
     
-   AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(simple_response));
+    AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(simple_response));
     /* Stream is not freed
      * Assumption : stream doesn't belong to the response
      */
-   return AXIS2_SUCCESS;
+    return AXIS2_SUCCESS;
 }
 
 axis2_status_t AXIS2_CALL 
-axis2_http_simple_response_set_status_line 
-                        (struct axis2_http_simple_response *simple_response, 
-                        const axis2_env_t *env, const axis2_char_t *http_ver, 
-                        const int status_code, const axis2_char_t *phrase)
+axis2_http_simple_response_set_status_line(
+    struct axis2_http_simple_response *simple_response, 
+    const axis2_env_t *env, 
+    const axis2_char_t *http_ver, 
+    const int status_code, 
+    const axis2_char_t *phrase)
 {
     axis2_char_t *tmp_status_line_str = NULL;
     axis2_http_simple_response_impl_t *simple_response_impl = NULL;
@@ -320,10 +331,10 @@
 }
 
 
-axis2_char_t* AXIS2_CALL 
-axis2_http_simple_response_get_phrase 
-                        (axis2_http_simple_response_t *simple_response, 
-                        const axis2_env_t *env)
+axis2_char_t *AXIS2_CALL 
+axis2_http_simple_response_get_phrase(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
     if(NULL == AXIS2_INTF_TO_IMPL(simple_response)->status_line)
@@ -336,9 +347,9 @@
 
 
 int AXIS2_CALL 
-axis2_http_simple_response_get_status_code 
-                        (axis2_http_simple_response_t *simple_response, 
-                        const axis2_env_t *env)
+axis2_http_simple_response_get_status_code(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     if(NULL == AXIS2_INTF_TO_IMPL(simple_response)->status_line)
@@ -350,10 +361,10 @@
 }
 
 
-axis2_char_t* AXIS2_CALL 
-axis2_http_simple_response_get_http_version 
-                        (axis2_http_simple_response_t *simple_response, 
-                        const axis2_env_t *env)
+axis2_char_t *AXIS2_CALL 
+axis2_http_simple_response_get_http_version(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
     if(NULL == AXIS2_INTF_TO_IMPL(simple_response)->status_line)
@@ -365,10 +376,10 @@
 }
 
 
-axis2_char_t* AXIS2_CALL 
-axis2_http_simple_response_get_status_line 
-                        (axis2_http_simple_response_t *simple_response, 
-                        const axis2_env_t *env)
+axis2_char_t *AXIS2_CALL 
+axis2_http_simple_response_get_status_line(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
     if(NULL == AXIS2_INTF_TO_IMPL(simple_response)->status_line)
@@ -379,22 +390,20 @@
                         simple_response)->status_line, env);
 }
 
-
-axis2_array_list_t* AXIS2_CALL 
-axis2_http_simple_response_get_headers
-                        (axis2_http_simple_response_t *simple_response, 
-                        const axis2_env_t *env)
+axis2_array_list_t *AXIS2_CALL 
+axis2_http_simple_response_get_headers(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
     return AXIS2_INTF_TO_IMPL(simple_response)->header_group;
 }
 
-
-axis2_http_header_t* AXIS2_CALL 
-axis2_http_simple_response_get_first_header
-                        (axis2_http_simple_response_t *simple_response, 
-                        const axis2_env_t *env, 
-                        const axis2_char_t *str)
+axis2_http_header_t *AXIS2_CALL 
+axis2_http_simple_response_get_first_header(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env, 
+    const axis2_char_t *str)
 {
     axis2_http_simple_response_impl_t *simple_response_impl = NULL;
     axis2_http_header_t *tmp_header = NULL;
@@ -435,9 +444,10 @@
 
 
 axis2_status_t AXIS2_CALL 
-axis2_http_simple_response_remove_headers
-                        (axis2_http_simple_response_t *simple_response, 
-                        const axis2_env_t *env, const axis2_char_t *str)
+axis2_http_simple_response_remove_headers(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env, 
+    const axis2_char_t *str)
 {
     axis2_array_list_t *header_group = NULL;
     axis2_http_header_t *tmp_header = NULL;
@@ -478,16 +488,17 @@
 }
 
 axis2_status_t AXIS2_CALL 
-axis2_http_simple_response_set_header 
-                    (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env, axis2_http_header_t* header)
+axis2_http_simple_response_set_header(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env, 
+    axis2_http_header_t *header)
 {
-   int i = 0;
-   int count = 0;
+    int i = 0;
+    int count = 0;
     axis2_http_header_t *tmp_header = NULL;
     axis2_char_t *tmp_name = NULL;
-   axis2_array_list_t *header_group = NULL;
-   axis2_http_simple_response_impl_t *simple_response_impl = NULL;
+    axis2_array_list_t *header_group = NULL;
+    axis2_http_simple_response_impl_t *simple_response_impl = NULL;
    
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, header, AXIS2_FAILURE);
@@ -521,16 +532,16 @@
             break;
         }
     }
-   AXIS2_ARRAY_LIST_ADD(simple_response_impl->header_group, env, 
-                  (void*)header);
+    AXIS2_ARRAY_LIST_ADD(simple_response_impl->header_group, env, 
+                  (void *)header);
     return AXIS2_SUCCESS;
 }
 
 
-const axis2_char_t* AXIS2_CALL 
-axis2_http_simple_response_get_charset
-                        (axis2_http_simple_response_t *simple_response, 
-                        const axis2_env_t *env)
+const axis2_char_t *AXIS2_CALL 
+axis2_http_simple_response_get_charset(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env)
 {
     axis2_http_header_t *tmp_header = NULL;
     AXIS2_ENV_CHECK(env, NULL);
@@ -553,9 +564,9 @@
 
 
 axis2_ssize_t AXIS2_CALL 
-axis2_http_simple_response_get_content_length
-                        (axis2_http_simple_response_t *simple_response, 
-                        const axis2_env_t *env)
+axis2_http_simple_response_get_content_length(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env)
 {
     axis2_http_header_t *tmp_header = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -569,10 +580,10 @@
 }
 
 
-const axis2_char_t* AXIS2_CALL 
-axis2_http_simple_response_get_content_type
-                        (axis2_http_simple_response_t *simple_response, 
-                        const axis2_env_t *env)
+const axis2_char_t *AXIS2_CALL 
+axis2_http_simple_response_get_content_type(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env)
 {
     axis2_http_header_t *tmp_header = NULL;
     AXIS2_ENV_CHECK(env, NULL);
@@ -586,32 +597,34 @@
 
 
 axis2_status_t AXIS2_CALL 
-axis2_http_simple_response_set_body_string 
-                    (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env, axis2_char_t *str)
+axis2_http_simple_response_set_body_string(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env, 
+    axis2_char_t *str)
 {
-   axis2_stream_t *body_stream = NULL;
+    axis2_stream_t *body_stream = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, str, AXIS2_FAILURE);
     
-   body_stream = AXIS2_INTF_TO_IMPL(simple_response)->stream;
-   if(NULL == body_stream)
-   {
-      body_stream = axis2_stream_create_basic(env);
-      if(NULL == body_stream)
-      {
-         return AXIS2_FAILURE;
-      }
-      AXIS2_INTF_TO_IMPL(simple_response)->stream = body_stream;
-   }
-   AXIS2_STREAM_WRITE(body_stream, env, str, AXIS2_STRLEN(str));
+    body_stream = AXIS2_INTF_TO_IMPL(simple_response)->stream;
+    if(NULL == body_stream)
+    {
+        body_stream = axis2_stream_create_basic(env);
+        if(NULL == body_stream)
+        {
+            return AXIS2_FAILURE;
+        }
+        AXIS2_INTF_TO_IMPL(simple_response)->stream = body_stream;
+    }
+    AXIS2_STREAM_WRITE(body_stream, env, str, AXIS2_STRLEN(str));
     return AXIS2_SUCCESS;
 }
     
 axis2_status_t AXIS2_CALL 
-axis2_http_simple_response_set_body_stream
-                    (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env, axis2_stream_t *stream)
+axis2_http_simple_response_set_body_stream(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env, 
+    axis2_stream_t *stream)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     /*
@@ -623,12 +636,10 @@
     return AXIS2_SUCCESS;
 }
 
-
-
-axis2_stream_t* AXIS2_CALL 
-axis2_http_simple_response_get_body
-                        (axis2_http_simple_response_t *simple_response, 
-                        const axis2_env_t *env)
+axis2_stream_t *AXIS2_CALL 
+axis2_http_simple_response_get_body(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
     return AXIS2_INTF_TO_IMPL(simple_response)->stream;
@@ -636,66 +647,67 @@
 
 
 axis2_ssize_t AXIS2_CALL 
-axis2_http_simple_response_get_body_bytes
-                        (axis2_http_simple_response_t *simple_response, 
-                        const axis2_env_t *env, axis2_char_t **buffer)
-{
-   axis2_http_simple_response_impl_t *response_impl = NULL;
-   axis2_stream_t *tmp_stream = NULL;
-   int return_size = -1;
+axis2_http_simple_response_get_body_bytes(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env, 
+    axis2_char_t **buffer)
+{
+    axis2_http_simple_response_impl_t *response_impl = NULL;
+    axis2_stream_t *tmp_stream = NULL;
+    int return_size = -1;
    
-   AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
    
    
-   response_impl = AXIS2_INTF_TO_IMPL(simple_response);
+    response_impl = AXIS2_INTF_TO_IMPL(simple_response);
     if(NULL == response_impl->stream)
-   {
-      AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_BODY, AXIS2_FAILURE);
-      return -1;
-   }
-   tmp_stream = axis2_stream_create_basic(env);
-   while(1)
-   {
-      int read = 0;
-      int write = 0;
-   /*   int READ_SIZE = 32; */
-      char buf[READ_SIZE];
-      read = AXIS2_STREAM_READ(response_impl->stream, env, buf, READ_SIZE);
-      if(read < 0)
-      {
-         break;
-      }
-      write = AXIS2_STREAM_WRITE(tmp_stream, env, buf, read);
-      if(read < (READ_SIZE -1))
-      {
-         break;
-      }
-   }
-   return_size = AXIS2_STREAM_BASIC_GET_LEN(tmp_stream, env);
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_BODY, AXIS2_FAILURE);
+        return -1;
+    }
+    tmp_stream = axis2_stream_create_basic(env);
+    while(1)
+    {
+        int read = 0;
+        int write = 0;
+        /*   int READ_SIZE = 32; */
+        char buf[READ_SIZE];
+        read = AXIS2_STREAM_READ(response_impl->stream, env, buf, READ_SIZE);
+        if(read < 0)
+        {
+            break;
+        }
+        write = AXIS2_STREAM_WRITE(tmp_stream, env, buf, read);
+        if(read < (READ_SIZE -1))
+        {
+            break;
+        }
+    }
+    return_size = AXIS2_STREAM_BASIC_GET_LEN(tmp_stream, env);
    
-   if(return_size > 0)
-   {
-      *buffer = (char *)AXIS2_MALLOC(env->allocator, sizeof(char)*
+    if(return_size > 0)
+    {
+        *buffer = (char *)AXIS2_MALLOC(env->allocator, sizeof(char)*
                   (return_size +1));
-      return_size = AXIS2_STREAM_READ(tmp_stream, env, *buffer, 
+        return_size = AXIS2_STREAM_READ(tmp_stream, env, *buffer, 
                   return_size + 1);
-   }
-   AXIS2_STREAM_FREE(tmp_stream, env);
+    }
+    AXIS2_STREAM_FREE(tmp_stream, env);
     return return_size;    
 }
 
 axis2_bool_t AXIS2_CALL 
-axis2_http_simple_response_contains_header 
-                    (axis2_http_simple_response_t *simple_response, 
-                    const axis2_env_t *env, 
-                    const axis2_char_t *name)
+axis2_http_simple_response_contains_header(
+    axis2_http_simple_response_t *simple_response, 
+    const axis2_env_t *env, 
+    const axis2_char_t *name)
 {
     axis2_char_t *header_name = NULL;
-   axis2_http_simple_response_impl_t *simple_response_impl = NULL;
-   int count = 0;
-   int i = 0;
+    axis2_http_simple_response_impl_t *simple_response_impl = NULL;
+    int count = 0;
+    int i = 0;
    
-   AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, name, AXIS2_FAILURE);
     simple_response_impl = AXIS2_INTF_TO_IMPL(
                         simple_response);                 



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