axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r434373 - in /webservices/axis2/trunk/c: include/axis2_http_header.h modules/core/transport/http/http_header.c
Date Thu, 24 Aug 2006 11:39:17 GMT
Author: pini
Date: Thu Aug 24 04:39:17 2006
New Revision: 434373

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

Modified:
    webservices/axis2/trunk/c/include/axis2_http_header.h
    webservices/axis2/trunk/c/modules/core/transport/http/http_header.c

Modified: webservices/axis2/trunk/c/include/axis2_http_header.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_http_header.h?rev=434373&r1=434372&r2=434373&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_http_header.h (original)
+++ webservices/axis2/trunk/c/include/axis2_http_header.h Thu Aug 24 04:39:17 2006
@@ -49,40 +49,40 @@
      * HTTP Header ops struct
      * Encapsulator struct for ops of axis2_http_header
      */
-    AXIS2_DECLARE_DATA struct axis2_http_header_ops
+    struct axis2_http_header_ops
     {
         /**
-    * @param header pointer to header
-    * @param env pointer to environment struct
-    */
-        axis2_char_t* (AXIS2_CALL *
+         * @param header pointer to header
+         * @param env pointer to environment struct
+         */
+        axis2_char_t *(AXIS2_CALL *
                 to_external_form)(
                     axis2_http_header_t *header,
                     const axis2_env_t *env);
 
         /**
-    * @param header pointer to header
-    * @param env pointer to environment struct
-    */
-        axis2_char_t* (AXIS2_CALL *
+         * @param header pointer to header
+         * @param env pointer to environment struct
+         */
+        axis2_char_t *(AXIS2_CALL *
                 get_name)(
-                    axis2_http_header_t *header,
+                    const axis2_http_header_t *header,
                     const axis2_env_t *env);
 
         /**
-    * @param header pointer to header
-    * @param env pointer to environment struct
-    */
-        axis2_char_t* (AXIS2_CALL *
+         * @param header pointer to header
+         * @param env pointer to environment struct
+         */
+        axis2_char_t *(AXIS2_CALL *
                 get_value)(
-                    axis2_http_header_t *header,
+                    const axis2_http_header_t *header,
                     const axis2_env_t *env);
 
         /**
-    * @param header pointer to header
-    * @param env pointer to environment struct
-    * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
-    */
+         * @param header pointer to header
+         * @param env pointer to environment struct
+         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+         */
         axis2_status_t (AXIS2_CALL *
                 free)(
                     axis2_http_header_t *header,
@@ -90,11 +90,12 @@
     };
 
     /**
-     * @brief HTTP Header struct
-     *    Axis2 HTTP Header
+     * HTTP Header struct
+     * Axis2 HTTP Header
      */
     AXIS2_DECLARE_DATA struct axis2_http_header
     {
+        /** Operations of http sender */
         axis2_http_header_ops_t *ops;
     };
 
@@ -104,7 +105,7 @@
      * @param name pointer to name
      * @param value pointer to value
      */
-    AXIS2_EXTERN axis2_http_header_t * AXIS2_CALL
+    AXIS2_EXTERN axis2_http_header_t *AXIS2_CALL
     axis2_http_header_create (
         const axis2_env_t *env,
         const axis2_char_t *name,
@@ -114,10 +115,10 @@
      * @param env pointer to environment struct
      * @param str pointer to str
      */
-    AXIS2_EXTERN axis2_http_header_t * AXIS2_CALL AXIS2_CALL
+    AXIS2_EXTERN axis2_http_header_t *AXIS2_CALL AXIS2_CALL
     axis2_http_header_create_by_str (
-        const axis2_env_t *env, 
-   const axis2_char_t *str);
+        const axis2_env_t *env,
+        const axis2_char_t *str);
 
 /************************** Start of function macros **************************/
 
@@ -131,7 +132,7 @@
 #define AXIS2_HTTP_HEADER_GET_NAME(header, env) \
                                 ((header)->ops->get_name(header, env))
 
-/** Gets the value.
+/** Get value.
     @sa axis2_http_header_ops#get_value */
 #define AXIS2_HTTP_HEADER_GET_VALUE(header, env) \
                                 ((header)->ops->get_value(header, env))

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_header.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/http_header.c?rev=434373&r1=434372&r2=434373&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_header.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_header.c Thu Aug 24 04:39:17
2006
@@ -13,134 +13,146 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 #include <axis2_http_header.h>
 #include <axis2_string.h>
 #include <axis2_http_transport.h>
 #include <stdio.h>
 #include <string.h>
 
-/** 
+/**
  * @brief HTTP Header struct impl
  *   Axis2 HTTP Header impl  
  */
-typedef struct axis2_http_header_impl axis2_http_header_impl_t;  
-  
-struct axis2_http_header_impl
+
+typedef struct axis2_http_header_impl
 {
-   axis2_http_header_t http_header;
-   axis2_char_t *name;
+    axis2_http_header_t http_header;
+    axis2_char_t *name;
     axis2_char_t *value;
-};
+}
+axis2_http_header_impl_t;
 
 #define AXIS2_INTF_TO_IMPL(http_header) \
                 ((axis2_http_header_impl_t *)(http_header))
 
 /***************************** Function headers *******************************/
-axis2_char_t* AXIS2_CALL 
-axis2_http_header_to_external_form (axis2_http_header_t *header, 
-                const axis2_env_t *env);
-    
-axis2_char_t* AXIS2_CALL 
-axis2_http_header_get_name (axis2_http_header_t *header, const axis2_env_t *env);
-    
-axis2_char_t* AXIS2_CALL 
-axis2_http_header_get_value (axis2_http_header_t *header, const axis2_env_t *env);
-    
-axis2_status_t AXIS2_CALL 
-axis2_http_header_free (axis2_http_header_t *header, const axis2_env_t *env);           
            
+axis2_char_t *AXIS2_CALL
+axis2_http_header_to_external_form(
+    axis2_http_header_t *header,
+    const axis2_env_t *env);
+
+axis2_char_t *AXIS2_CALL
+axis2_http_header_get_name(
+    const axis2_http_header_t *header, 
+    const axis2_env_t *env);
+
+axis2_char_t *AXIS2_CALL
+axis2_http_header_get_value(
+    const axis2_http_header_t *header, 
+    const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+axis2_http_header_free(
+    axis2_http_header_t *header, 
+    const axis2_env_t *env);
 
 /***************************** End of function headers ************************/
 
-AXIS2_EXTERN axis2_http_header_t * AXIS2_CALL
-axis2_http_header_create (const axis2_env_t *env, 
-    const axis2_char_t *name, 
+AXIS2_EXTERN axis2_http_header_t *AXIS2_CALL
+axis2_http_header_create(
+    const axis2_env_t *env,
+    const axis2_char_t *name,
     const axis2_char_t *value)
 {
     axis2_http_header_impl_t *http_header_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_ENV_CHECK(env, NULL);
-        
-    http_header_impl =  (axis2_http_header_impl_t *)AXIS2_MALLOC 
-                        (env->allocator, sizeof(
+
+    http_header_impl =  (axis2_http_header_impl_t *)AXIS2_MALLOC
+            (env->allocator, sizeof(
                         axis2_http_header_impl_t));
-   
+
     if(NULL == http_header_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;
-   }
+    }
     http_header_impl->name = (axis2_char_t *)AXIS2_STRDUP(name, env);
     http_header_impl->value = (axis2_char_t *)AXIS2_STRDUP(value, env);
-     
+
     http_header_impl->http_header.ops = AXIS2_MALLOC(env->allocator,
-        sizeof(axis2_http_header_ops_t));
+            sizeof(axis2_http_header_ops_t));
     if(NULL == http_header_impl->http_header.ops)
-   {
-      axis2_http_header_free((axis2_http_header_t*)
-                         http_header_impl, env);
+    {
+        axis2_http_header_free((axis2_http_header_t *)
+                http_header_impl, env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
-   }
-    
-    http_header_impl->http_header.ops->to_external_form = 
-                        axis2_http_header_to_external_form;
+    }
+
+    http_header_impl->http_header.ops->to_external_form =
+        axis2_http_header_to_external_form;
     http_header_impl->http_header.ops->get_name = axis2_http_header_get_name;
     http_header_impl->http_header.ops->get_value = axis2_http_header_get_value;
     http_header_impl->http_header.ops->free = axis2_http_header_free;
-                        
-   return &(http_header_impl->http_header);
+
+    return &(http_header_impl->http_header);
 }
 
-AXIS2_EXTERN axis2_http_header_t * AXIS2_CALL AXIS2_CALL
-axis2_http_header_create_by_str (const axis2_env_t *env, const axis2_char_t *str)
+AXIS2_EXTERN axis2_http_header_t *AXIS2_CALL AXIS2_CALL
+axis2_http_header_create_by_str(
+    const axis2_env_t *env, 
+    const axis2_char_t *str)
 {
-   axis2_char_t *tmp_str = NULL;
-   axis2_char_t *ch = NULL;
-   axis2_char_t *ch2 = NULL;
-   axis2_http_header_t *ret = NULL;
-   AXIS2_ENV_CHECK(env, NULL);
-    AXIS2_ENV_CHECK(env, NULL);
-   
-   tmp_str = AXIS2_STRDUP(str, env);
-   if(NULL == tmp_str)
-   {
-      return NULL;
-   }
-   /* remove trailing \r\n */
-   if('\r' == tmp_str[AXIS2_STRLEN(tmp_str)-2])
-   {
-      tmp_str[AXIS2_STRLEN(tmp_str)-2] = '\0';
-   }
-   
-   ch = strchr((const char*)tmp_str, ':');
-   if(NULL == ch)
-   {
-      AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HEADER, 
-                  AXIS2_FAILURE);
-      AXIS2_FREE(env->allocator, tmp_str);
-      return NULL;
-   }
-   ch2 = ch + sizeof(axis2_char_t);
-   /* skip spaces */
-   while(' ' == *ch2)
-   {
-      ch2 += sizeof(axis2_char_t);
-   }
-   *ch = '\0';
-   ret = axis2_http_header_create(env, tmp_str, ch2);
-   AXIS2_FREE(env->allocator, tmp_str);
-   return ret;   
+    axis2_char_t *tmp_str = NULL;
+    axis2_char_t *ch = NULL;
+    axis2_char_t *ch2 = NULL;
+    axis2_http_header_t *ret = NULL;
+    AXIS2_ENV_CHECK(env, NULL);
+    AXIS2_ENV_CHECK(env, NULL);
+
+    tmp_str = AXIS2_STRDUP(str, env);
+    if(NULL == tmp_str)
+    {
+        return NULL;
+    }
+    /* remove trailing \r\n */
+    if('\r' == tmp_str[AXIS2_STRLEN(tmp_str)-2])
+    {
+        tmp_str[AXIS2_STRLEN(tmp_str)-2] = '\0';
+    }
+
+    ch = strchr((const char *)tmp_str, ':');
+    if(NULL == ch)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_HEADER,
+                AXIS2_FAILURE);
+        AXIS2_FREE(env->allocator, tmp_str);
+        return NULL;
+    }
+    ch2 = ch + sizeof(axis2_char_t);
+    /* skip spaces */
+    while(' ' == *ch2)
+    {
+        ch2 += sizeof(axis2_char_t);
+    }
+    *ch = '\0';
+    ret = axis2_http_header_create(env, tmp_str, ch2);
+    AXIS2_FREE(env->allocator, tmp_str);
+    return ret;
 }
 
-axis2_status_t AXIS2_CALL 
-axis2_http_header_free (axis2_http_header_t *header, const axis2_env_t *env)
+axis2_status_t AXIS2_CALL
+axis2_http_header_free(
+    axis2_http_header_t *header, 
+    const axis2_env_t *env)
 {
     axis2_http_header_impl_t *http_header_impl = NULL;
-   AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     http_header_impl = AXIS2_INTF_TO_IMPL(header);
-    
+
     if(NULL != http_header_impl->name)
     {
         AXIS2_FREE(env->allocator, http_header_impl->name);
@@ -153,41 +165,46 @@
     }
     if(NULL != header->ops)
         AXIS2_FREE(env->allocator, header->ops);
-    
-   AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(header));
-   return AXIS2_SUCCESS;
+
+    AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(header));
+    return AXIS2_SUCCESS;
 }
 
 
-axis2_char_t* AXIS2_CALL 
-axis2_http_header_to_external_form (axis2_http_header_t *header, 
-                const axis2_env_t *env)
+axis2_char_t *AXIS2_CALL
+axis2_http_header_to_external_form(
+    axis2_http_header_t *header,
+    const axis2_env_t *env)
 {
     axis2_http_header_impl_t *http_header_impl = NULL;
     axis2_ssize_t len = 0;
     axis2_char_t *external_form = NULL;
     AXIS2_ENV_CHECK(env, NULL);
     http_header_impl = AXIS2_INTF_TO_IMPL(header);
-    len = AXIS2_STRLEN(http_header_impl->name) + 
-                AXIS2_STRLEN(http_header_impl->value) + 8;
-    external_form = (axis2_char_t*) AXIS2_MALLOC(env->allocator,
-                len);
-    sprintf(external_form, "%s: %s%s", http_header_impl->name, 
-                http_header_impl->value, AXIS2_HTTP_CRLF);
+    len = AXIS2_STRLEN(http_header_impl->name) +
+            AXIS2_STRLEN(http_header_impl->value) + 8;
+    external_form = (axis2_char_t *) AXIS2_MALLOC(env->allocator,
+            len);
+    sprintf(external_form, "%s: %s%s", http_header_impl->name,
+            http_header_impl->value, AXIS2_HTTP_CRLF);
     return external_form;
 }
 
 
-axis2_char_t* AXIS2_CALL 
-axis2_http_header_get_name (axis2_http_header_t *header, const axis2_env_t *env)
+axis2_char_t *AXIS2_CALL
+axis2_http_header_get_name(
+    const axis2_http_header_t *header, 
+    const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
     return AXIS2_INTF_TO_IMPL(header)->name;
 }
 
 
-axis2_char_t* AXIS2_CALL 
-axis2_http_header_get_value (axis2_http_header_t *header, const axis2_env_t *env)
+axis2_char_t *AXIS2_CALL
+axis2_http_header_get_value(
+    const axis2_http_header_t *header, 
+    const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
     return AXIS2_INTF_TO_IMPL(header)->value;



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