axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r523922 - in /webservices/axis2/trunk/c/axiom/src/attachments: axiom_mime_output.h mime_output.c
Date Fri, 30 Mar 2007 03:36:04 GMT
Author: samisa
Date: Thu Mar 29 20:36:04 2007
New Revision: 523922

URL: http://svn.apache.org/viewvc?view=rev&rev=523922
Log:
Removed ops

Modified:
    webservices/axis2/trunk/c/axiom/src/attachments/axiom_mime_output.h
    webservices/axis2/trunk/c/axiom/src/attachments/mime_output.c

Modified: webservices/axis2/trunk/c/axiom/src/attachments/axiom_mime_output.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/attachments/axiom_mime_output.h?view=diff&rev=523922&r1=523921&r2=523922
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/attachments/axiom_mime_output.h (original)
+++ webservices/axis2/trunk/c/axiom/src/attachments/axiom_mime_output.h Thu Mar 29 20:36:04
2007
@@ -40,7 +40,6 @@
 /* This should be moved to header file later axis2_utils_defines.h*/    
 #define axis2_byte_t char
    
-typedef struct axiom_mime_output_ops axiom_mime_output_ops_t;
 typedef struct axiom_mime_output axiom_mime_output_t;   
    
 
@@ -49,27 +48,20 @@
   * @{
   */
 
-/** 
- * @brief Flow ops struct
- * Encapsulator struct for ops of axiom_mime_output
- */
-struct axiom_mime_output_ops
-{
-
-    axis2_byte_t* (AXIS2_CALL *complete)(axiom_mime_output_t *mime_output,
-                            const axis2_env_t *env, 
-                            axis2_byte_t **output_stream,
-                     int *output_stream_size,
-                            axis2_char_t *soap_body_buffer,
-                            axis2_array_list_t *binary_node_list,
-                            axis2_char_t *boundary, 
-                            axis2_char_t *content_id,
-                            axis2_char_t *char_set_encoding,
-                            const axis2_char_t *soap_content_type);
-
-    const axis2_char_t *(AXIS2_CALL *
-    get_content_type_for_mime)(
-        axiom_mime_output_t *mime_output, 
+    AXIS2_EXTERN axis2_byte_t* AXIS2_CALL
+    axiom_mime_output_complete(axiom_mime_output_t *mime_output,
+        const axis2_env_t *env, 
+        axis2_byte_t **output_stream,
+        int *output_stream_size,
+        axis2_char_t *soap_body_buffer,
+        axis2_array_list_t *binary_node_list,
+        axis2_char_t *boundary, 
+        axis2_char_t *content_id,
+        axis2_char_t *char_set_encoding,
+        const axis2_char_t *soap_content_type);
+
+    AXIS2_EXTERN const axis2_char_t *AXIS2_CALL
+    axiom_mime_output_get_content_type_for_mime(axiom_mime_output_t *mime_output, 
         const axis2_env_t *env, 
         axis2_char_t *boundary, 
         axis2_char_t *content_id, 
@@ -79,43 +71,24 @@
    /** Deallocate memory
      * @return status code
      */
-    void (AXIS2_CALL *free) (axiom_mime_output_t *mime_output,
-                            const axis2_env_t *env);
-
-};
-
-/** 
- * @brief Flow struct
- *   Flow  
- */ 
-struct axiom_mime_output
-{
-   axiom_mime_output_ops_t *ops;
-};
-
-/**
- * Creates mime_output struct
- * @return pointer to newly created mime_output
- */
-AXIS2_EXTERN axiom_mime_output_t * AXIS2_CALL 
-axiom_mime_output_create (const axis2_env_t *env);
-
-AXIS2_EXTERN const axis2_char_t * AXIS2_CALL
-axiom_mime_output_get_content_type_for_mime(axiom_mime_output_t *mime_output,
-        const axis2_env_t *env,
-        axis2_char_t *boundary,
-        axis2_char_t *content_id,
-        axis2_char_t *char_set_encoding,
-        const axis2_char_t *soap_content_type);
-
+    AXIS2_EXTERN void AXIS2_CALL
+    axiom_mime_output_free(axiom_mime_output_t *mime_output,
+        const axis2_env_t *env);
+
+    /**
+     * Creates mime_output struct
+     * @return pointer to newly created mime_output
+     */
+    AXIS2_EXTERN axiom_mime_output_t * AXIS2_CALL 
+    axiom_mime_output_create (const axis2_env_t *env);
 
-#define AXIOM_MIME_OUTPUT_FREE(mime_output, env) ((mime_output)->ops->free (mime_output,
env))
+#define AXIOM_MIME_OUTPUT_FREE(mime_output, env) axiom_mime_output_free (mime_output, env)
 
 #define AXIOM_MIME_OUTPUT_COMPLETE(mime_output, env, output_stream, output_stream_size, soap_body_buffer,
binary_node_list, boundary, content_id, char_set_encoding, soap_content_type) \
-((mime_output)->ops->complete(mime_output, env, output_stream, output_stream_size,
soap_body_buffer, binary_node_list, boundary, content_id, char_set_encoding, soap_content_type))
+axiom_mime_output_complete(mime_output, env, output_stream, output_stream_size, soap_body_buffer,
binary_node_list, boundary, content_id, char_set_encoding, soap_content_type)
 
 #define AXIOM_MIME_OUTPUT_GET_CONTENT_TYPE_FOR_MIME(mime_output, env, boundary, content_id,
char_set_encoding, soap_content_type) \
-((mime_output)->ops->get_content_type_for_mime(mime_output, env, boundary, content_id,
char_set_encoding, soap_content_type))
+axiom_mime_output_get_content_type_for_mime(mime_output, env, boundary, content_id, char_set_encoding,
soap_content_type)
 
 /** @} */
 

Modified: webservices/axis2/trunk/c/axiom/src/attachments/mime_output.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/attachments/mime_output.c?view=diff&rev=523922&r1=523921&r2=523922
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/attachments/mime_output.c (original)
+++ webservices/axis2/trunk/c/axiom/src/attachments/mime_output.c Thu Mar 29 20:36:04 2007
@@ -25,133 +25,83 @@
 
 axis2_char_t AXIS2_CRLF[] =  { 13, 10 };
 
-typedef struct axiom_mime_output_impl
+struct axiom_mime_output
 {
-    axiom_mime_output_t mime_output;
-}
-axiom_mime_output_impl_t;
-
-#define AXIS2_INTF_TO_IMPL(mime_output) ((axiom_mime_output_impl_t *)(mime_output))
-
-
-axis2_status_t axis2_char_2_byte(const axis2_env_t *env, axis2_char_t *char_buffer, axis2_byte_t
**byte_buffer, int *byte_buffer_size);
-
-axis2_status_t
-axis2_char_2_byte(const axis2_env_t *env, axis2_char_t *char_buffer, axis2_byte_t **byte_buffer,
int *byte_buffer_size)
-{
-    int length;
-    int i = 0;
-    axis2_byte_t *bytes;
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
-    length = axis2_strlen(char_buffer);
-    bytes = AXIS2_MALLOC(env->allocator, length * sizeof(axis2_byte_t));
-
-    for (i = 0; i < length; i++)
-    {
-        bytes[i] = (axis2_byte_t) char_buffer[i];
-    }
-    *byte_buffer = bytes;
-    *byte_buffer_size = length;
-    return AXIS2_SUCCESS;
-}
+    int dummy;
+};
 
-void AXIS2_CALL
-axiom_mime_output_free(axiom_mime_output_t *mime_output, const axis2_env_t *env);
+static axis2_status_t 
+axis2_char_2_byte(const axis2_env_t *env, 
+    axis2_char_t *char_buffer, 
+    axis2_byte_t **byte_buffer, 
+    int *byte_buffer_size);
+
+static axiom_mime_body_part_t *
+axis2_create_mime_body_part(axiom_text_t *text, 
+    const axis2_env_t *env);
+
+static axis2_status_t
+axis2_write_body_part(axiom_mime_output_t *mime_output, 
+    const axis2_env_t *env,
+    axis2_byte_t **output_stream, 
+    int *output_stream_size,
+    axiom_mime_body_part_t *part, 
+    axis2_char_t *boundary);
+
+static axis2_status_t 
+axis2_write_mime_boundary(axiom_mime_output_t *mime_output, 
+    const axis2_env_t *env,
+    axis2_byte_t **output_stream, 
+    int *output_stream_size,
+    axis2_char_t *boundary);
+
+static axis2_status_t 
+axis2_write_finish_writing_mime(axiom_mime_output_t *mime_output, 
+    const axis2_env_t *env,
+    axis2_byte_t **output_stream, 
+    int *output_stream_size, 
+    axis2_char_t *boundary);
 
-axis2_byte_t * AXIS2_CALL
-axiom_mime_output_complete(axiom_mime_output_t *mime_output,
-        const axis2_env_t *env,
-        axis2_byte_t **output_stream,
-        int *output_stream_size,
-        axis2_char_t *soap_body_buffer,
-        axis2_array_list_t *binary_node_list,
-        axis2_char_t *boundary,
-        axis2_char_t *content_id,
-        axis2_char_t *char_set_encoding,
-        const axis2_char_t *soap_content_type);
-axis2_status_t AXIS2_CALL
+static axis2_status_t 
 axis2_start_writing_mime(axiom_mime_output_t *mime_output,
-        const axis2_env_t *env, axis2_byte_t **output_stream,
-        int *output_stream_size, axis2_char_t *boundary);
-
-axiom_mime_body_part_t * AXIS2_CALL
-axis2_create_mime_body_part(axiom_text_t *text, const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_write_body_part(axiom_mime_output_t *mime_output, const axis2_env_t *env,
-        axis2_byte_t **output_stream, int *output_stream_size,
-        axiom_mime_body_part_t *part, axis2_char_t *boundary);
-
-axis2_status_t AXIS2_CALL
-axis2_write_mime_boundary(axiom_mime_output_t *mime_output, const axis2_env_t *env,
-        axis2_byte_t **output_stream, int *output_stream_size,
-        axis2_char_t *boundary);
-
-axis2_status_t AXIS2_CALL
-axis2_write_finish_writing_mime(axiom_mime_output_t *mime_output, const axis2_env_t *env,
-        axis2_byte_t **output_stream, int *output_stream_size, axis2_char_t *boundary);
-
-
-/************************** End of Function headers ************************/
+    const axis2_env_t *env, 
+    axis2_byte_t **output_stream,
+    int *output_stream_size, 
+    axis2_char_t *boundary);
 
 AXIS2_EXTERN axiom_mime_output_t * AXIS2_CALL
 axiom_mime_output_create(const axis2_env_t *env)
 {
-    axiom_mime_output_impl_t *mime_output_impl = NULL;
-
+    axiom_mime_output_t *mime_output = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    mime_output_impl = (axiom_mime_output_impl_t *) AXIS2_MALLOC(env->allocator,
-            sizeof(axiom_mime_output_impl_t));
-
-    if (! mime_output_impl)
-    {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return NULL;
-    }
-
-    mime_output_impl->mime_output.ops = NULL;
+    mime_output = (axiom_mime_output_t *) AXIS2_MALLOC(env->allocator,
+            sizeof(axiom_mime_output_t));
 
-    mime_output_impl->mime_output.ops = AXIS2_MALLOC(env->allocator,
-            sizeof(axiom_mime_output_ops_t));
-    if (! mime_output_impl->mime_output.ops)
+    if (! mime_output)
     {
-        axiom_mime_output_free(&(mime_output_impl->mime_output), env);
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    mime_output_impl->mime_output.ops->free =  axiom_mime_output_free;
-    mime_output_impl->mime_output.ops->complete = axiom_mime_output_complete;
-    mime_output_impl->mime_output.ops->get_content_type_for_mime = axiom_mime_output_get_content_type_for_mime;
-    return &(mime_output_impl->mime_output);
+    return mime_output;
 }
 
-void AXIS2_CALL
+AXIS2_EXTERN void AXIS2_CALL
 axiom_mime_output_free(axiom_mime_output_t *mime_output, 
     const axis2_env_t *env)
 {
-    axiom_mime_output_impl_t *mime_output_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    mime_output_impl = AXIS2_INTF_TO_IMPL(mime_output);
-
-    if (mime_output->ops)
-    {
-        AXIS2_FREE(env->allocator, mime_output->ops);
-        mime_output->ops = NULL;
-    }
 
-    if (mime_output_impl)
+    if (mime_output)
     {
-        AXIS2_FREE(env->allocator, mime_output_impl);
-        mime_output_impl = NULL;
+        AXIS2_FREE(env->allocator, mime_output);
+        mime_output = NULL;
     }
     return;
 }
 
 
-axis2_byte_t * AXIS2_CALL
+AXIS2_EXTERN axis2_byte_t * AXIS2_CALL
 axiom_mime_output_complete(axiom_mime_output_t *mime_output,
         const axis2_env_t *env,
         axis2_byte_t **output_stream,
@@ -348,7 +298,7 @@
     return stream_buffer;
 }
 
-axis2_status_t AXIS2_CALL
+static axis2_status_t 
 axis2_start_writing_mime(axiom_mime_output_t *mime_output,
         const axis2_env_t *env, axis2_byte_t **output_stream,
         int *output_stream_size, axis2_char_t *boundary)
@@ -357,7 +307,7 @@
     return axis2_write_mime_boundary(mime_output, env, output_stream, output_stream_size,
boundary);
 }
 
-axis2_status_t AXIS2_CALL
+static axis2_status_t 
 axis2_write_mime_boundary(axiom_mime_output_t *mime_output, const axis2_env_t *env,
         axis2_byte_t **output_stream, int *output_stream_size,
         axis2_char_t *boundary)
@@ -395,7 +345,7 @@
     return AXIS2_SUCCESS;
 }
 
-axiom_mime_body_part_t * AXIS2_CALL
+static axiom_mime_body_part_t *
 axis2_create_mime_body_part(axiom_text_t *text, const axis2_env_t *env)
 {
     axiom_data_handler_t *data_handler = NULL;
@@ -429,7 +379,7 @@
     return mime_body_part;
 }
 
-axis2_status_t AXIS2_CALL
+static axis2_status_t 
 axis2_write_body_part(axiom_mime_output_t *mime_output, const axis2_env_t *env,
         axis2_byte_t **output_stream, int *output_stream_size,
         axiom_mime_body_part_t *part, axis2_char_t *boundary)
@@ -481,7 +431,7 @@
 
 }
 
-axis2_status_t AXIS2_CALL
+static axis2_status_t 
 axis2_write_finish_writing_mime(axiom_mime_output_t *mime_output, const axis2_env_t *env,
         axis2_byte_t **output_stream, int *output_stream_size, axis2_char_t *boundary)
 {
@@ -591,4 +541,27 @@
     }
 
     return content_type_string;
+}
+
+static axis2_status_t
+axis2_char_2_byte(const axis2_env_t *env, 
+    axis2_char_t *char_buffer, 
+    axis2_byte_t **byte_buffer, 
+    int *byte_buffer_size)
+{
+    int length;
+    int i = 0;
+    axis2_byte_t *bytes;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    length = axis2_strlen(char_buffer);
+    bytes = AXIS2_MALLOC(env->allocator, length * sizeof(axis2_byte_t));
+
+    for (i = 0; i < length; i++)
+    {
+        bytes[i] = (axis2_byte_t) char_buffer[i];
+    }
+    *byte_buffer = bytes;
+    *byte_buffer_size = length;
+    return AXIS2_SUCCESS;
 }



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