You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ka...@apache.org on 2007/03/22 13:50:09 UTC

svn commit: r521241 [1/2] - in /webservices/axis2/trunk/c/rampart: include/ src/omxmlsec/ src/util/

Author: kaushalye
Date: Thu Mar 22 05:50:04 2007
New Revision: 521241

URL: http://svn.apache.org/viewvc?view=rev&rev=521241
Log:
Applying patch in JIRA https://issues.apache.org/jira/browse/AXIS2C-558
Thanks Supun for the contribution.


Modified:
    webservices/axis2/trunk/c/rampart/include/oxs_buffer.h
    webservices/axis2/trunk/c/rampart/include/oxs_ctx.h
    webservices/axis2/trunk/c/rampart/include/oxs_key.h
    webservices/axis2/trunk/c/rampart/include/rampart_timestamp_token.h
    webservices/axis2/trunk/c/rampart/include/rampart_username_token.h
    webservices/axis2/trunk/c/rampart/src/omxmlsec/buffer.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/ctx.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/key.c
    webservices/axis2/trunk/c/rampart/src/util/rampart_sec_header_builder.c
    webservices/axis2/trunk/c/rampart/src/util/rampart_sec_header_processor.c
    webservices/axis2/trunk/c/rampart/src/util/timestamp_token.c
    webservices/axis2/trunk/c/rampart/src/util/username_token.c

Modified: webservices/axis2/trunk/c/rampart/include/oxs_buffer.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_buffer.h?view=diff&rev=521241&r1=521240&r2=521241
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_buffer.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_buffer.h Thu Mar 22 05:50:04 2007
@@ -27,6 +27,10 @@
 #include <axis2_defines.h>
 #include <axis2_env.h>
 #include <axis2_util.h>
+#include <oxs_axiom.h>
+#include <oxs_error.h>
+#include <oxs_constants.h>
+#include <stdio.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -50,25 +54,21 @@
         oxs_alloc_mode_double
     } oxs_AllocMode;
 
-    /** Type name for struct  oxs_buffer_ops */
-    typedef struct oxs_buffer_ops oxs_buffer_ops_t;
 
     /** Type name for struct  oxs_buffer */
     typedef struct oxs_buffer oxs_buffer_t;
 
-    struct oxs_buffer_ops
-    {
 		/**
 		*Free function of the buffer
 		*@buffer pointer to the OMXMLSec buffer struct
 		*@env pointer to environment struct
 		*@return AXIS2_SUCCESS on success, else AXIS2_FAILURE
 		*/		
-        axis2_status_t (AXIS2_CALL *
-                free)(
-                    oxs_buffer_t *buffer,
-                    const axis2_env_t *env
-                );
+		axis2_status_t AXIS2_CALL
+		oxs_buffer_free(
+			oxs_buffer_t *buffer,
+			const axis2_env_t *env
+		);
 		/**
 		*Removes the first (size) charcters from the buffer
 		*@buffer pointer to the OMXMLSec buffer struct
@@ -76,12 +76,12 @@
 		*@size number of characters to be removed
 		*@return AXIS2_SUCCESS on success, else AXIS2_FAILURE
 		*/	
-        axis2_status_t (AXIS2_CALL *
-                remove_head)(
-                    oxs_buffer_t *buffer,
-                    const axis2_env_t *env,
-                    int size
-                );
+		axis2_status_t AXIS2_CALL
+		oxs_buffer_remove_head(
+			oxs_buffer_t *buffer,
+			const axis2_env_t *env,
+			int size
+		);
 		/**
 		*Removes the last (size) charcters from the buffer
 		*@buffer pointer to the OMXMLSec buffer struct
@@ -89,12 +89,12 @@
 		*@size number of characters to be removed		
 		*@return AXIS2_SUCCESS on success, else AXIS2_FAILURE
 		*/	
-        axis2_status_t (AXIS2_CALL *
-                remove_tail)(
-                    oxs_buffer_t *buffer,
-                    const axis2_env_t *env,
-                    int size
-                );
+		axis2_status_t AXIS2_CALL
+		oxs_buffer_remove_tail(
+			oxs_buffer_t *buffer,
+			const axis2_env_t *env,
+			int size
+		);
 		/**
 		*populates the buffer using the @data set the @size as the useful length
 		*@buffer pointer to the OMXMLSec buffer struct
@@ -103,13 +103,13 @@
 		*@size the effective length of data
 		*@return AXIS2_SUCCESS on success, else AXIS2_FAILURE
 		*/	        
-        axis2_status_t (AXIS2_CALL *
-                populate)(
-                    oxs_buffer_t *buffer,
-                    const axis2_env_t *env,
-                    unsigned char *data,
-                    int size
-                );
+		axis2_status_t AXIS2_CALL
+		oxs_buffer_populate(
+			oxs_buffer_t *buffer,
+			const axis2_env_t *env,
+			unsigned char *data,
+			int size
+		);
 		/**
 		*Append data (to the end)
 		*@buffer pointer to the OMXMLSec buffer struct
@@ -118,13 +118,13 @@
 		*@size the effective length of data
 		*@return AXIS2_SUCCESS on success, else AXIS2_FAILURE
 		*/	
-        axis2_status_t (AXIS2_CALL *
-                append)(
-                    oxs_buffer_t *buffer,
-                    const axis2_env_t *env,
-                    unsigned char *data,
-                    int size
-                );
+		axis2_status_t AXIS2_CALL
+		oxs_buffer_append(
+			oxs_buffer_t *buffer,
+			const axis2_env_t *env,
+			unsigned char *data,
+			int size
+		);
 		/**
 		*Prepends data (to the front of the buffer)
 		*@buffer pointer to the OMXMLSec buffer struct
@@ -133,13 +133,13 @@
 		*@size the effective length of data
 		*@return AXIS2_SUCCESS on success, else AXIS2_FAILURE
 		*/	
-        axis2_status_t (AXIS2_CALL *
-                prepend)(
-                    oxs_buffer_t *buffer,
-                    const axis2_env_t *env,
-                    unsigned char *data,
-                    int size
-                );
+		axis2_status_t AXIS2_CALL
+		oxs_buffer_prepend(
+			oxs_buffer_t *buffer,
+			const axis2_env_t *env,
+			unsigned char *data,
+			int size
+		);
 		/**
 		*Reads a file specified by @filename
 		*@buffer pointer to the OMXMLSec buffer struct
@@ -147,12 +147,12 @@
 		*@filename The name of the file
 		*@return AXIS2_SUCCESS on success, else AXIS2_FAILURE
 		*/	
-        axis2_status_t (AXIS2_CALL *
-                read_file)(
-                    oxs_buffer_t *buffer,
-                    const axis2_env_t *env,
-                    const axis2_char_t *filename
-                );
+		axis2_status_t AXIS2_CALL
+		oxs_buffer_read_file(
+			oxs_buffer_t *buffer,
+			const axis2_env_t *env,
+			const axis2_char_t *filename
+		);
 		/**
 		*Sets the size
 		*@buffer pointer to the OMXMLSec buffer struct
@@ -160,12 +160,12 @@
 		*@size the value of the size
 		*@return AXIS2_SUCCESS on success, else AXIS2_FAILURE
 		*/	
-        axis2_status_t (AXIS2_CALL *
-                set_size)(
-                    oxs_buffer_t *buffer,
-                    const axis2_env_t *env,
-                    int size
-                );
+		axis2_status_t AXIS2_CALL
+		oxs_buffer_set_size(
+			oxs_buffer_t *buffer,
+			const axis2_env_t *env,
+			int size
+		);
 		/**
 		*Sets the maximum size of the buffer. Usually this will be allocated dynamically
 		*@buffer pointer to the OMXMLSec buffer struct
@@ -173,51 +173,47 @@
 		*@size the maximum size of the buffer
 		*@return AXIS2_SUCCESS on success, else AXIS2_FAILURE
 		*/	
-        axis2_status_t (AXIS2_CALL *
-                set_max_size)(
-                    oxs_buffer_t *buffer,
-                    const axis2_env_t *env,
-                    int size
-                );
+		axis2_status_t AXIS2_CALL
+		oxs_buffer_set_max_size(
+			oxs_buffer_t *buffer,
+			const axis2_env_t *env,
+			int size
+		);
 		/**
 		*Returns data
 		*@buffer pointer to the OMXMLSec buffer struct
 		*@env pointer to environment struct
 		*@return data in the buffer
 		*/	        
-        unsigned char* (AXIS2_CALL *
-                get_data)(
-                    oxs_buffer_t *buffer,
-                    const axis2_env_t *env
-                );
+		unsigned char* AXIS2_CALL
+		oxs_buffer_get_data(
+			oxs_buffer_t *buffer,
+			const axis2_env_t *env
+		);
 		/**
 		*Returns the effective length of the buffer
 		*@buffer pointer to the OMXMLSec buffer struct
 		*@env pointer to environment struct
 		*@return the effective length of the buffer as int
 		*/	
-        int (AXIS2_CALL *
-                get_size)(
-                    oxs_buffer_t *buffer,
-                    const axis2_env_t *env
-                );
+		int AXIS2_CALL
+		oxs_buffer_get_size(
+			oxs_buffer_t *buffer,
+			const axis2_env_t *env
+		);
 		/**
 		*Returns the maximum size of the buffer
 		*@buffer pointer to the OMXMLSec buffer struct
 		*@env pointer to environment struct
 		*@return the maximum size of the buffer
 		*/	
-        int (AXIS2_CALL *
-                get_max_size)(
-                    oxs_buffer_t *buffer,
-                    const axis2_env_t *env
-                );
-    };
-
-    struct oxs_buffer
-    {
-        oxs_buffer_ops_t *ops;
-    };
+		int AXIS2_CALL
+		oxs_buffer_get_max_size(
+			oxs_buffer_t *buffer,
+			const axis2_env_t *env
+		);
+
+
 
 AXIS2_EXTERN oxs_buffer_t *AXIS2_CALL
 oxs_buffer_create(const axis2_env_t *env);
@@ -225,40 +221,40 @@
 /*Macros*/
 
 #define OXS_BUFFER_FREE(buffer,env)\
-    ((buffer)->ops->free(buffer,env))
+    (oxs_buffer_free(buffer,env))
 
 #define OXS_BUFFER_REMOVE_HEAD(buffer,env, size)\
-    ((buffer)->ops->remove_head(buffer,env, size))
+    (oxs_buffer_remove_head(buffer,env, size))
 
 #define OXS_BUFFER_REMOVE_TAIL(buffer,env, size)\
-    ((buffer)->ops->remove_tail(buffer,env, size))
+    (oxs_buffer_remove_tail(buffer,env, size))
 
 #define OXS_BUFFER_POPULATE(buffer,env, data, size)\
-    ((buffer)->ops->populate(buffer,env, data, size))
+    (oxs_buffer_populate(buffer,env, data, size))
 
 #define OXS_BUFFER_APPEND(buffer,env, data, size)\
-    ((buffer)->ops->append(buffer,env, data, size))
+    (oxs_buffer_append(buffer,env, data, size))
 
 #define OXS_BUFFER_PREPEND(buffer,env, data, size)\
-    ((buffer)->ops->prepend(buffer,env, data, size))
+    (oxs_buffer_prepend(buffer,env, data, size))
 
 #define OXS_BUFFER_READ_FILE(buffer,env, file_name)\
-    ((buffer)->ops->read_file(buffer,env, file_name))
+    (oxs_buffer_read_file(buffer,env, file_name))
 
 #define OXS_BUFFER_SET_SIZE(buffer,env, size)\
-    ((buffer)->ops->set_size(buffer,env, size))
+    (oxs_buffer_set_size(buffer,env, size))
 
 #define OXS_BUFFER_SET_MAX_SIZE(buffer, env, size)\
-    ((buffer)->ops->set_max_size(buffer, env, size))
+    (oxs_buffer_set_max_size(buffer, env, size))
 
 #define OXS_BUFFER_GET_DATA(buffer,env)\
-    ((buffer)->ops->get_data(buffer,env))
+    (oxs_buffer_get_data(buffer,env))
 
 #define OXS_BUFFER_GET_SIZE(buffer,env)\
-    ((buffer)->ops->get_size(buffer,env))
+    (oxs_buffer_get_size(buffer,env))
 
 #define OXS_BUFFER_GET_MAX_SIZE(buffer,env)\
-    ((buffer)->ops->get_max_size(buffer,env))
+    (oxs_buffer_get_max_size(buffer,env))
 
 
 /** @} */

Modified: webservices/axis2/trunk/c/rampart/include/oxs_ctx.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_ctx.h?view=diff&rev=521241&r1=521240&r2=521241
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_ctx.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_ctx.h Thu Mar 22 05:50:04 2007
@@ -54,27 +54,24 @@
         OXS_CTX_MODE_ENCRYPTED_DATA = 0,
         OXS_CTX_MODE_ENCRYPTED_KEY
     } oxs_ctx_mode_t;
-
-    /** Type name for struct oxs_ctx_ops */
-    typedef struct oxs_ctx_ops oxs_ctx_ops_t;
+    
 
     /** Type name for struct oxs_ctx */
-    typedef struct oxs_ctx oxs_ctx_t;
+    typedef struct oxs_ctx_t oxs_ctx_t;
+
 
 
-    struct oxs_ctx_ops
-    {
         /**
          * Free function of the context
          * @param ctx The OMXMLSecurity context 
          * @param env pointer to environment struct
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-        free)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env
-                    );
+axis2_status_t AXIS2_CALL
+oxs_ctx_free(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env
+);
 
         /**
          * Returns the mode of the context
@@ -82,11 +79,11 @@
          * @param env pointer to environment struct
          * @return mode of the context 
          */
-        oxs_ctx_mode_t (AXIS2_CALL *
-        get_mode)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env
-                    );
+oxs_ctx_mode_t AXIS2_CALL
+oxs_ctx_get_mode(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env
+);
 
         /**
          * 
@@ -94,11 +91,12 @@
          * @param env pointer to environment struct
          * @return operation of the context 
          */
-        oxs_ctx_operation_t (AXIS2_CALL *
-        get_operation)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env
-                    );
+oxs_ctx_operation_t AXIS2_CALL
+oxs_ctx_get_operation(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env
+);
+
 
         /**
          * 
@@ -106,11 +104,11 @@
          * @param env pointer to environment struct
          * @return of the context 
          */
-        oxs_key_t *(AXIS2_CALL *
-        get_key)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env
-                    );
+oxs_key_t *AXIS2_CALL
+oxs_ctx_get_key(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env
+);
 
         /**
          * 
@@ -118,11 +116,11 @@
          * @param env pointer to environment struct
          * @return of the context 
          */
-        axis2_char_t *(AXIS2_CALL *
-        get_id)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env
-                    );
+axis2_char_t *AXIS2_CALL
+oxs_ctx_get_id(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env
+);
 
         /**
          * 
@@ -130,22 +128,22 @@
          * @param env pointer to environment struct
          * @return of the context 
          */
-        axis2_char_t *(AXIS2_CALL *
-        get_type)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env
-                    );
+axis2_char_t *AXIS2_CALL
+oxs_ctx_get_type(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env
+);
         /**
          * 
          * @param ctx The OMXMLSecurity context 
          * @param env pointer to environment struct
          * @return of the context 
          */
-        axis2_char_t *(AXIS2_CALL *
-        get_mime_type)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env
-                    );
+axis2_char_t *AXIS2_CALL
+oxs_ctx_get_mime_type(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env
+);
 
         /**
          * 
@@ -153,11 +151,11 @@
          * @param env pointer to environment struct
          * @return of the context 
          */
-        axis2_char_t *(AXIS2_CALL *
-        get_encoding)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env
-                    );
+axis2_char_t *AXIS2_CALL
+oxs_ctx_get_encoding(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env
+);
 
         /**
          * 
@@ -165,11 +163,11 @@
          * @param env pointer to environment struct
          * @return of the context 
          */
-        axis2_char_t *(AXIS2_CALL *
-        get_recipient)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env
-                    );
+axis2_char_t *AXIS2_CALL
+oxs_ctx_get_recipient(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env
+);
 
         /**
          * 
@@ -177,11 +175,11 @@
          * @param env pointer to environment struct
          * @return of the context 
          */
-        axis2_char_t *(AXIS2_CALL *
-        get_carried_key_name)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env
-                    );
+axis2_char_t *AXIS2_CALL
+oxs_ctx_get_carried_key_name(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env
+);
 
         /**
          * 
@@ -189,11 +187,11 @@
          * @param env pointer to environment struct
          * @return of the context 
          */
-        axis2_char_t *(AXIS2_CALL *
-        get_enc_mtd_algorithm)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env
-                    );
+axis2_char_t *AXIS2_CALL
+oxs_ctx_get_enc_mtd_algorithm(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env
+);
 
         /**
          * 
@@ -201,11 +199,11 @@
          * @param env pointer to environment struct
          * @return of the context 
          */
-        axis2_char_t *(AXIS2_CALL *
-        get_input_data)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env
-                    );
+axis2_char_t *AXIS2_CALL
+oxs_ctx_get_input_data(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env
+);
         /**
          * 
          * @param ctx The OMXMLSecurity context 
@@ -213,12 +211,12 @@
          * @param mode the mode of operation, EncryptedData/EncryptedKey
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-        set_mode)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env,
-                    oxs_ctx_mode_t mode
-                    );
+axis2_status_t AXIS2_CALL
+oxs_ctx_set_mode(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env,
+    oxs_ctx_mode_t mode
+);
 
         /**
          * 
@@ -227,12 +225,12 @@
          * @param operation the operation Encrypt/Decrypt/Sign/Verify
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-        set_operation)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env,
-                    oxs_ctx_operation_t operation
-                    );
+axis2_status_t AXIS2_CALL
+oxs_ctx_set_operation(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env,
+    oxs_ctx_operation_t operation
+);
 
         /**
          * 
@@ -241,12 +239,12 @@
          * @param key the key used
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-        set_key)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env,
-                    oxs_key_t *key
-                    );
+axis2_status_t AXIS2_CALL
+oxs_ctx_set_key(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env,
+    oxs_key_t *key
+);
         /**
          * 
          * @param ctx The OMXMLSecurity context 
@@ -254,12 +252,12 @@
          * @param id the id of the context 
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-        set_id)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env,
-                    axis2_char_t *id
-                    );
+axis2_status_t AXIS2_CALL
+oxs_ctx_set_id(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env,
+    axis2_char_t *id
+);
 
         /**
          * 
@@ -268,12 +266,12 @@
          * @param type ???Depricated?
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-        set_type)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env,
-                    axis2_char_t *type
-                    );
+axis2_status_t AXIS2_CALL
+oxs_ctx_set_type(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env,
+    axis2_char_t *type
+);
 
         /**
          * 
@@ -282,12 +280,13 @@
          * @param mime_type the mime type used
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-        set_mime_type)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env,
-                    axis2_char_t *mime_type
-                    );
+axis2_status_t AXIS2_CALL
+oxs_ctx_set_mime_type(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env,
+    axis2_char_t *mime_type
+);
+
 
         /**
          * 
@@ -296,12 +295,12 @@
          * @param encoding the encoding used
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-        set_encoding)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env,
-                    axis2_char_t *encoding
-                    );
+axis2_status_t AXIS2_CALL
+oxs_ctx_set_encoding(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env,
+    axis2_char_t *encoding
+);
 
         /**
          * 
@@ -310,12 +309,13 @@
          * @param recipient name of recipient
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-        set_recipient)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env,
-                    axis2_char_t *recipient
-                    );
+axis2_status_t AXIS2_CALL
+oxs_ctx_set_recipient(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env,
+    axis2_char_t *recipient
+);
+
 
         /**
          * 
@@ -324,12 +324,12 @@
          * @param carried_key_name the key name 
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-        set_carried_key_name)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env,
-                    axis2_char_t *carried_key_name
-                    );
+axis2_status_t AXIS2_CALL
+oxs_ctx_set_carried_key_name(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env,
+    axis2_char_t *carried_key_name
+);
 
         /**
          * 
@@ -338,13 +338,12 @@
          * @param enc_mtd_algorithm the encryption method algorithm
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-        set_enc_mtd_algorithm)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env,
-                    axis2_char_t *enc_mtd_algorithm
-                    );
-
+axis2_status_t AXIS2_CALL
+oxs_ctx_set_enc_mtd_algorithm(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env,
+    axis2_char_t *enc_mtd_algorithm
+);
         /**
          * 
          * @param ctx The OMXMLSecurity context 
@@ -352,19 +351,14 @@
          * @param input_data the input data
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-        set_input_data)(
-                    oxs_ctx_t *ctx,
-                    const axis2_env_t *env,
-                    axis2_char_t *input_data
-                    );
-    };
-    
-    struct oxs_ctx
-    {
-        /** operations of oxs_ctx */
-        oxs_ctx_ops_t *ops;
-    };
+axis2_status_t AXIS2_CALL
+oxs_ctx_set_input_data(
+    oxs_ctx_t *ctx,
+    const axis2_env_t *env,
+    axis2_char_t *input_data
+);
+  
+    
 
     /*Create function*/
     AXIS2_EXTERN oxs_ctx_t *AXIS2_CALL
@@ -373,73 +367,73 @@
 
 /**********************Macros******************************************/
 #define OXS_CTX_FREE(ctx, env) \
-        ((ctx)->ops->free(ctx, env) )
+        (oxs_ctx_free(ctx, env) )
     
 #define OXS_CTX_GET_MODE(ctx, env) \
-        ((ctx)->ops->get_mode(ctx, env) )
+        (oxs_ctx_get_mode(ctx, env) )
     
 #define OXS_CTX_GET_OPERATION(ctx, env) \
-        ((ctx)->ops->get_operation(ctx, env) )
+        (oxs_ctx_get_operation(ctx, env) )
     
 #define OXS_CTX_GET_KEY(ctx, env) \
-        ((ctx)->ops->get_key(ctx, env) )
+        (oxs_ctx_get_key(ctx, env) )
     
 #define OXS_CTX_GET_ID(ctx, env) \
-        ((ctx)->ops->get_id(ctx, env) )
+        (oxs_ctx_get_id(ctx, env) )
     
 #define OXS_CTX_GET_TYPE(ctx, env) \
-        ((ctx)->ops->get_type(ctx, env) )
+        (oxs_ctx_get_type(ctx, env) )
     
 #define OXS_CTX_GET_MIME_TYPE(ctx, env) \
-        ((ctx)->ops->get_mime_type(ctx, env) )
+        (oxs_ctx_get_mime_type(ctx, env) )
     
 #define OXS_CTX_GET_ENCODING(ctx, env) \
-        ((ctx)->ops->get_encoding(ctx, env) )
+        (oxs_ctx_get_encoding(ctx, env) )
     
 #define OXS_CTX_GET_RECIPIENT(ctx, env) \
-        ((ctx)->ops->get_recipient(ctx, env) )
+        (oxs_ctx_get_recipient(ctx, env) )
     
 #define OXS_CTX_GET_CARRIED_KEY_NAME(ctx, env) \
-        ((ctx)->ops->get_carried_key_name(ctx, env) )
+        (oxs_ctx_get_carried_key_name(ctx, env) )
     
 #define OXS_CTX_GET_ENC_MTD_ALGORITHM(ctx, env) \
-        ((ctx)->ops->get_enc_mtd_algorithm(ctx, env) )
+        (oxs_ctx_get_enc_mtd_algorithm(ctx, env) )
     
 #define OXS_CTX_GET_INPUT_DATA(ctx, env) \
-        ((ctx)->ops->get_input_data(ctx, env) )
+        (oxs_ctx_get_input_data(ctx, env) )
     
 #define OXS_CTX_SET_MODE(ctx, env, mode) \
-        ((ctx)->ops->set_mode(ctx, env, mode) )
+        (oxs_ctx_set_mode(ctx, env, mode) )
     
 #define OXS_CTX_SET_OPERATION(ctx, env, operation) \
-        ((ctx)->ops->set_operation(ctx, env, operation) )
+        (oxs_ctx_set_operation(ctx, env, operation) )
     
 #define OXS_CTX_SET_KEY(ctx, env, key) \
-        ((ctx)->ops->set_key(ctx, env, key) )
+        (oxs_ctx_set_key(ctx, env, key) )
     
 #define OXS_CTX_SET_ID(ctx, env, id) \
-        ((ctx)->ops->set_id(ctx, env, id) )
+        (oxs_ctx_set_id(ctx, env, id) )
     
 #define OXS_CTX_SET_TYPE(ctx, env, type) \
-        ((ctx)->ops->set_type(ctx, env, type) )
+        (oxs_ctx_set_type(ctx, env, type) )
     
 #define OXS_CTX_SET_MIME_TYPE(ctx, env, mime_type) \
-        ((ctx)->ops->set_mime_type(ctx, env, mime_type) )
+        (oxs_ctx_set_mime_type(ctx, env, mime_type) )
     
 #define OXS_CTX_SET_ENCODING(ctx, env, encoding) \
-        ((ctx)->ops->set_encoding(ctx, env, encoding) )
+        (oxs_ctx_set_encoding(ctx, env, encoding) )
     
 #define OXS_CTX_SET_RECIPIENT(ctx, env, recipient) \
-        ((ctx)->ops->set_recipient(ctx, env, recipient) )
+        ((oxs_ctx_set_recipient(ctx, env, recipient) )
     
 #define OXS_CTX_SET_CARRIED_KEY_NAME(ctx, env, key_name) \
-        ((ctx)->ops->set_carried_key_name(ctx, env, key_name) )
+        (oxs_ctx_set_carried_key_name(ctx, env, key_name) )
     
 #define OXS_CTX_SET_ENC_MTD_ALGORITHM(ctx, env, enc_mtd_algorithm) \
-        ((ctx)->ops->set_enc_mtd_algorithm(ctx, env, enc_mtd_algorithm) )
+        (oxs_ctx_set_enc_mtd_algorithm(ctx, env, enc_mtd_algorithm) )
     
 #define OXS_CTX_SET_INPUT_DATA(ctx, env, input_data) \
-        ((ctx)->ops->set_input_data(ctx, env, input_data) )
+        (oxs_ctx_set_input_data(ctx, env, input_data) )
     
 
 

Modified: webservices/axis2/trunk/c/rampart/include/oxs_key.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/oxs_key.h?view=diff&rev=521241&r1=521240&r2=521241
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/oxs_key.h (original)
+++ webservices/axis2/trunk/c/rampart/include/oxs_key.h Thu Mar 22 05:50:04 2007
@@ -46,14 +46,9 @@
 
 #define OXS_KEY_DEFAULT_SIZE        64
 
-    /** Type name for struct  oxs_key_ops */
-    typedef struct oxs_key_ops oxs_key_ops_t;
-
     /** Type name for struct  oxs_key */
-    typedef struct oxs_key oxs_key_t;
+typedef struct oxs_key_t oxs_key_t;
 
-    struct oxs_key_ops
-    {
          /**
          * Gets data of the key.
          * @param key oxs_key ptr to key
@@ -61,40 +56,40 @@
          * @return data 
          */
 
-        unsigned char *(AXIS2_CALL *
-                get_data)(
-                    const oxs_key_t *key,
-                    const axis2_env_t *env);
+unsigned char *AXIS2_CALL
+oxs_key_get_data(
+    const oxs_key_t *key,
+    const axis2_env_t *env);
          /**
          * Gets the name of the key.
          * @param key oxs_key ptr to key
          * @param env pointer to environment struct
          * @return name of the key
          */
-        axis2_char_t *(AXIS2_CALL *
-                get_name)(
-                    const oxs_key_t *key,
-                    const axis2_env_t *env);
+axis2_char_t *AXIS2_CALL
+oxs_key_get_name(
+    const oxs_key_t *key,
+    const axis2_env_t *env);
          /**
          * Gets the size of the key.
          * @param key oxs_key ptr to key
          * @param env pointer to environment struct
          * @return size of the key
          */
-        int (AXIS2_CALL *
-                get_size)(
-                    const oxs_key_t *key,
-                    const axis2_env_t *env);
+int AXIS2_CALL
+oxs_key_get_size(
+    const oxs_key_t *key,
+    const axis2_env_t *env);
          /**
          * Gets the usage of the key.
          * @param key oxs_key ptr to key
          * @param env pointer to environment struct
          * @return usage of the key
          */
-        int (AXIS2_CALL *
-                get_usage)(
-                    const oxs_key_t *key,
-                    const axis2_env_t *env);
+int AXIS2_CALL
+oxs_key_get_usage(
+    const oxs_key_t *key,
+    const axis2_env_t *env);
         
 
          /**
@@ -104,11 +99,11 @@
          * @param name name of the key
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-                set_name)(
-                    oxs_key_t *key,
-                    const axis2_env_t *env,
-                    axis2_char_t *name);
+axis2_status_t AXIS2_CALL
+oxs_key_set_name(
+    oxs_key_t *key,
+    const axis2_env_t *env,
+    axis2_char_t *name);
 
 
          /**
@@ -118,11 +113,11 @@
          * @param usage usage of the key
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-                set_usage)(
-                    oxs_key_t *key,
-                    const axis2_env_t *env,
-                    int usage);
+axis2_status_t AXIS2_CALL
+oxs_key_set_usage(
+    oxs_key_t *key,
+    const axis2_env_t *env,
+    int usage);
 
          /**
          * Free function for key.
@@ -130,11 +125,11 @@
          * @param env pointer to environment struct
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-                free)(
-                    oxs_key_t *key,
-                    const axis2_env_t *env
-                );
+axis2_status_t AXIS2_CALL
+oxs_key_free(
+    oxs_key_t *key,
+    const axis2_env_t *env
+);
 
          /**
          * Populate a key.
@@ -146,15 +141,14 @@
          * @param usage usage of the key
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-                populate)(
-                    oxs_key_t *key,
-                    const axis2_env_t *env,
-                    unsigned char *data,
-                    axis2_char_t *name,
-                    int size,
-                    int usage
-                );
+axis2_status_t AXIS2_CALL
+oxs_key_populate(
+    oxs_key_t *key,
+    const axis2_env_t *env,
+    unsigned char *data,
+    axis2_char_t *name,
+    int size,
+    int usage);
         
          /**
          * Read a key from a file.
@@ -162,12 +156,11 @@
          * @param env pointer to environment struct
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-                read_from_file)(
-                    oxs_key_t *key,
-                    const axis2_env_t *env,
-                    axis2_char_t *file_name
-                );
+axis2_status_t AXIS2_CALL
+oxs_key_read_from_file(
+    oxs_key_t *key,
+    const axis2_env_t *env,
+    axis2_char_t *file_name);
         
          /**
          * Fill the key for the given algo.
@@ -175,18 +168,11 @@
          * @param env pointer to environment struct
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-                for_algo)(
-                    oxs_key_t *key,
-                    const axis2_env_t *env,
-                    axis2_char_t *key_algo
-                );
-    };
-
-    struct oxs_key
-    {
-        oxs_key_ops_t *ops;
-    };
+axis2_status_t AXIS2_CALL
+oxs_key_for_algo(oxs_key_t *key,
+        const axis2_env_t *env,
+        axis2_char_t *key_algo);
+
 
 AXIS2_EXTERN oxs_key_t *AXIS2_CALL
 oxs_key_create(const axis2_env_t *env);
@@ -195,34 +181,34 @@
 
 
 #define OXS_KEY_GET_DATA(key,env)\
-    ((key)->ops->get_data(key,env))
+    (oxs_key_get_data(key, env))
 
 #define OXS_KEY_GET_NAME(key,env)\
-    ((key)->ops->get_name(key,env))
+	(oxs_key_get_name(key, env))
 
 #define OXS_KEY_GET_SIZE(key,env)\
-    ((key)->ops->get_size(key,env))
+	(oxs_key_get_size(key, env))
 
 #define OXS_KEY_GET_USAGE(key,env)\
-    ((key)->ops->get_usage(key,env))
+	(oxs_key_get_usage(key, env))
 
 #define OXS_KEY_SET_NAME(key,env, name)\
-    ((key)->ops->set_name(key, env, name))
+    (oxs_key_set_name(key, env, name))
 
 #define OXS_KEY_SET_USAGE(key,env, usage)\
-    ((key)->ops->set_usage(key, env, usage))
+    (oxs_key_set_usage(key, env, usage))
 
 #define OXS_KEY_FREE(key,env)\
-    ((key)->ops->free(key, env))
+    (oxs_key_free(key, env))
 
 #define OXS_KEY_POPULATE(key,env, data, name, size, usage)\
-    ((key)->ops->populate(key, env, data, name, size, usage))
+    (oxs_key_populate(key, env, data, name, size, usage))
 
 #define OXS_KEY_READ_FROM_FILE(key,env, file_name)\
-    ((key)->ops->read_from_file(key, env, file_name))
+    (oxs_key_read_from_file(key, env, file_name))
 
 #define OXS_KEY_FOR_ALGO(key,env, key_algo)\
-    ((key)->ops->for_algo(key, env, key_algo))
+    (oxs_key_for_algo(key, env, key_algo))
 
 /** @} */
 #ifdef __cplusplus

Modified: webservices/axis2/trunk/c/rampart/include/rampart_timestamp_token.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/rampart_timestamp_token.h?view=diff&rev=521241&r1=521240&r2=521241
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/rampart_timestamp_token.h (original)
+++ webservices/axis2/trunk/c/rampart/include/rampart_timestamp_token.h Thu Mar 22 05:50:04 2007
@@ -32,19 +32,6 @@
 #include <axis2_env.h>
 #include <rampart_constants.h>
 
-    /** Type name for struct rampart_timestamp_token_ops */
-    typedef struct rampart_timestamp_token_ops rampart_timestamp_token_ops_t;
-    /** Type name for struct rampart_timestamp_token */
-    typedef struct rampart_timestamp_token rampart_timestamp_token_t;
-    /**
-     * Test ops struct
-     * Encapsulator struct for ops of rampart_timestamp_token
-     */
-    struct rampart_timestamp_token_ops
-    {
-        axis2_status_t (AXIS2_CALL *
-        free)(rampart_timestamp_token_t *timestamp_token,
-            const axis2_env_t *env);
         /**
          * Builds timestamp token.
          * @param env pointer to environment struct
@@ -55,13 +42,12 @@
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
        
-        axis2_status_t (AXIS2_CALL *
-        build)(rampart_timestamp_token_t *timestamp_token,
-            const axis2_env_t *env,
-            axiom_node_t *sec_node,
-            const  axiom_namespace_t *sec_ns_obj,
-            int ttl
-            );
+axis2_status_t AXIS2_CALL
+rampart_timestamp_token_build(
+        const axis2_env_t *env,
+        axiom_node_t *sec_node,
+        const  axiom_namespace_t *sec_ns_obj,
+        int ttl);
         /**
          * Validates time stamp token. Validation is based in expiration time of the
          * Expired element.
@@ -69,42 +55,13 @@
          * @param ts_node Timestamp node
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
         */
-        axis2_status_t (AXIS2_CALL *
-        validate)(rampart_timestamp_token_t *timestamp_token,
-            const axis2_env_t *env,
-            axis2_msg_ctx_t *msg_ctx,
-            axiom_node_t *ts_node);
-    };
+axis2_status_t AXIS2_CALL
+rampart_timestamp_token_validate(
+        const axis2_env_t *env,
+        axis2_msg_ctx_t *msg_ctx,
+        axiom_node_t *ts_node );
 
-    /**
-     * rampart_timestamp_token struct
-     */
-    struct rampart_timestamp_token
-    {
-        /** Operations of timestamp_token */
-        rampart_timestamp_token_ops_t *ops;
-    };
 
-    /**
-     * Creates timestamp_token struct
-     * @param env pointer to environment struct
-     * @return pointer to newly created timestamp_token
-     */
-    AXIS2_EXTERN rampart_timestamp_token_t *AXIS2_CALL
-    rampart_timestamp_token_create (
-        const axis2_env_t *env);
-
-/*************************** Function macros **********************************/
-#define RAMPART_TIMESTAMP_TOKEN_FREE(timestamp_token, env) \
-        ((timestamp_token)->ops->free(timestamp_token, env))
-
-#define RAMPART_TIMESTAMP_TOKEN_BUILD(timestamp_token, env, sec_node, sec_ns_obj, ttl) \
-        ((timestamp_token)->ops->build(timestamp_token, env, sec_node, sec_ns_obj, ttl))
-
-#define RAMPART_TIMESTAMP_TOKEN_VALIDATE(timestamp_token, env, msg_ctx, ts_node) \
-        ((timestamp_token)->ops->validate(timestamp_token, env, msg_ctx, ts_node))
-
-/** @} */
 #ifdef __cplusplus
 }
 #endif

Modified: webservices/axis2/trunk/c/rampart/include/rampart_username_token.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/include/rampart_username_token.h?view=diff&rev=521241&r1=521240&r2=521241
==============================================================================
--- webservices/axis2/trunk/c/rampart/include/rampart_username_token.h (original)
+++ webservices/axis2/trunk/c/rampart/include/rampart_username_token.h Thu Mar 22 05:50:04 2007
@@ -34,19 +34,7 @@
 #include <rampart_crypto_util.h>
 #include <rampart_action.h>
 #include <rampart_context.h>
-    /** Type name for struct rampart_username_token_ops */
-    typedef struct rampart_username_token_ops rampart_username_token_ops_t;
-    /** Type name for struct rampart_username_token */
-    typedef struct rampart_username_token rampart_username_token_t;
-    /**
-     * Rampart username token ops struct
-     * Encapsulator struct for ops of rampart_username_token
-     */
-    struct rampart_username_token_ops
-    {
-        axis2_status_t (AXIS2_CALL *
-        free)(rampart_username_token_t *username_token,
-            const axis2_env_t *env);
+    
         /**
          * Build a username token according to the given parameters.
          * These parameter are taken from the action collection and message context
@@ -67,13 +55,12 @@
             );
 */        
 
-        axis2_status_t (AXIS2_CALL *
-        build)(rampart_username_token_t *username_token,
-            const axis2_env_t *env,
-            rampart_context_t *rampart_context,
-            axiom_node_t *sec_node,
-            axiom_namespace_t *sec_ns_obj
-            );
+axis2_status_t AXIS2_CALL
+rampart_username_token_build(
+        const axis2_env_t *env,
+        rampart_context_t *rampart_context,
+        axiom_node_t *sec_node,
+        axiom_namespace_t *sec_ns_obj);
         /*                            
          * Validates the given username token
          * @param env pointer to environment struct
@@ -82,49 +69,13 @@
          * @param actions collection of actions
          * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
          */
-        axis2_status_t (AXIS2_CALL *
-        validate)(rampart_username_token_t *username_token,
-            const axis2_env_t *env,
-            axis2_msg_ctx_t *msg_ctx,
-            axiom_node_t *ut_node,
-            rampart_context_t *rampart_context
-            );
-    };
-    
-    /**
-     * rampart_username_token struct
-     */
-    struct rampart_username_token
-    {
-        /** Operations of username_token */
-        rampart_username_token_ops_t *ops;
-    };
-
-    /**
-     * Creates username_token struct
-     * @param env pointer to environment struct
-     * @return pointer to newly created username_token
-     */
-    AXIS2_EXTERN rampart_username_token_t *AXIS2_CALL
-    rampart_username_token_create (
-        const axis2_env_t *env);
-
-/*************************** Function macros **********************************/
-#define RAMPART_USERNAME_TOKEN_FREE(username_token, env) \
-        ((username_token)->ops->free(username_token, env))    
-/*
-#define RAMPART_USERNAME_TOKEN_BUILD(username_token, env, ctx, actions, sec_node, sec_ns_obj) \
-        ((username_token)->ops->build(username_token, env, ctx, actions, sec_node, sec_ns_obj))    
-*/
-
-#define RAMPART_USERNAME_TOKEN_BUILD(username_token, env,rampart_context,sec_node, sec_ns_obj) \
-        ((username_token)->ops->build(username_token, env,rampart_context,sec_node, sec_ns_obj))
-
-
-#define RAMPART_USERNAME_TOKEN_VALIDATE(username_token, env, msg_ctx, ut_node, rampart_context) \
-        ((username_token)->ops->validate(username_token, env, msg_ctx, ut_node, rampart_context))    
+axis2_status_t AXIS2_CALL
+rampart_username_token_validate(
+        const axis2_env_t *env,
+        axis2_msg_ctx_t *msg_ctx,
+        axiom_node_t *ut_node,
+        rampart_context_t *rampart_context);
 
-/** @} */
 #ifdef __cplusplus
 }
 #endif

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/buffer.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/buffer.c?view=diff&rev=521241&r1=521240&r2=521241
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/buffer.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/buffer.c Thu Mar 22 05:50:04 2007
@@ -25,172 +25,46 @@
 
 
 
-typedef struct oxs_buffer_impl
+struct oxs_buffer
 {
-    oxs_buffer_t buffer;
-
     unsigned char* data;
     unsigned int size;
     unsigned int max_size;
     oxs_AllocMode alloc_mode;
-}
-oxs_buffer_impl_t;
-
-/** Interface to implementation conversion macro */
-#define AXIS2_INTF_TO_IMPL(oxs_buffer) ((oxs_buffer_impl_t *)oxs_buffer)
-
-/******** function headers ***************/
-
-/*private functions*/
-static void
-oxs_buffer_init_ops(
-    oxs_buffer_t *buffer);
-
-/*public functions*/
-
-axis2_status_t AXIS2_CALL
-oxs_buffer_free(
-    oxs_buffer_t *buffer,
-    const axis2_env_t *env
-);
-
-axis2_status_t AXIS2_CALL
-oxs_buffer_remove_head(
-    oxs_buffer_t *buffer,
-    const axis2_env_t *env,
-    int size
-);
-
-axis2_status_t AXIS2_CALL
-oxs_buffer_remove_tail(
-    oxs_buffer_t *buffer,
-    const axis2_env_t *env,
-    int size
-);
-
-axis2_status_t AXIS2_CALL
-oxs_buffer_populate(
-    oxs_buffer_t *buffer,
-    const axis2_env_t *env,
-    unsigned char *data,
-    int size
-);
-
-axis2_status_t AXIS2_CALL
-oxs_buffer_append(
-    oxs_buffer_t *buffer,
-    const axis2_env_t *env,
-    unsigned char *data,
-    int size
-);
-
-axis2_status_t AXIS2_CALL
-oxs_buffer_prepend(
-    oxs_buffer_t *buffer,
-    const axis2_env_t *env,
-    unsigned char *data,
-    int size
-);
-
-axis2_status_t AXIS2_CALL
-oxs_buffer_read_file(
-    oxs_buffer_t *buffer,
-    const axis2_env_t *env,
-    const axis2_char_t *filename
-);
-
-axis2_status_t AXIS2_CALL
-oxs_buffer_set_size(
-    oxs_buffer_t *buffer,
-    const axis2_env_t *env,
-    int size
-);
-
-axis2_status_t AXIS2_CALL
-oxs_buffer_set_max_size(
-    oxs_buffer_t *buffer,
-    const axis2_env_t *env,
-    int size
-);
-
-unsigned char* AXIS2_CALL
-oxs_buffer_get_data(
-    oxs_buffer_t *buffer,
-    const axis2_env_t *env
-);
-
-int AXIS2_CALL
-oxs_buffer_get_size(
-    oxs_buffer_t *buffer,
-    const axis2_env_t *env
-);
-
-int AXIS2_CALL
-oxs_buffer_get_max_size(
-    oxs_buffer_t *buffer,
-    const axis2_env_t *env
-);
+};
 
 
 /******************** end of function headers *****************/
-static void
-oxs_buffer_init_ops(
-    oxs_buffer_t *buffer)
-{
-    buffer->ops->free  = oxs_buffer_free ;
-    buffer->ops->remove_head  = oxs_buffer_remove_head ;
-    buffer->ops->remove_tail  = oxs_buffer_remove_tail ;
-    buffer->ops->populate  = oxs_buffer_populate ;
-    buffer->ops->append  = oxs_buffer_append ;
-    buffer->ops->prepend  = oxs_buffer_prepend ;
-    buffer->ops->read_file = oxs_buffer_read_file ;
-    buffer->ops->set_size  = oxs_buffer_set_size ;
-    buffer->ops->set_max_size  = oxs_buffer_set_max_size ;
-    buffer->ops->get_data  = oxs_buffer_get_data ;
-    buffer->ops->get_size  = oxs_buffer_get_size ;
-    buffer->ops->get_max_size  = oxs_buffer_get_max_size ;
-}
 
 AXIS2_EXTERN oxs_buffer_t *AXIS2_CALL
 oxs_buffer_create(const axis2_env_t *env)
 {
-    oxs_buffer_impl_t *buffer_impl = NULL;
+    oxs_buffer_t *buffer = NULL;
     axis2_status_t status = AXIS2_FAILURE;
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    buffer_impl = AXIS2_MALLOC(env->allocator, sizeof(oxs_buffer_impl_t));
-    if (!buffer_impl)
+    buffer = AXIS2_MALLOC(env->allocator, sizeof(oxs_buffer_t));
+    if (!buffer)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    buffer_impl->data = NULL;
-    buffer_impl->size = 0;
-    buffer_impl->max_size = 0;
-    buffer_impl->alloc_mode = oxs_alloc_mode_double;
+    buffer->data = NULL;
+    buffer->size = 0;
+    buffer->max_size = 0;
+    buffer->alloc_mode = oxs_alloc_mode_double;
 
-    status = oxs_buffer_set_max_size(&(buffer_impl->buffer), env, OXS_BUFFER_INITIAL_SIZE);
+    status = oxs_buffer_set_max_size(buffer, env, OXS_BUFFER_INITIAL_SIZE);
     if (status == AXIS2_FAILURE)
     {
         oxs_error(env, ERROR_LOCATION, OXS_ERROR_DEFAULT,
                 "oxs_buffer_set_max_size");
         return NULL;
-    }
+    }    
 
-
-    buffer_impl->buffer.ops =  AXIS2_MALLOC(env->allocator, sizeof(oxs_buffer_ops_t));
-    if (!buffer_impl->buffer.ops)
-    {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        oxs_buffer_free(&(buffer_impl->buffer), env);
-        return NULL;
-    }
-
-    oxs_buffer_init_ops(&(buffer_impl->buffer));
-
-    return &(buffer_impl->buffer);
+    return buffer;
 
 }
 
@@ -199,27 +73,17 @@
     oxs_buffer_t *buffer,
     const axis2_env_t *env
 )
-{
-    oxs_buffer_impl_t *buffer_impl = NULL;
-
+{    
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    buffer_impl = AXIS2_INTF_TO_IMPL(buffer);
-
-    if (buffer_impl->data)
+    if (buffer->data)
     {
-        AXIS2_FREE(env->allocator,  buffer_impl->data);
-        buffer_impl->data = NULL;
+        AXIS2_FREE(env->allocator,  buffer->data);
+        buffer->data = NULL;
     }
 
-    if (buffer_impl->buffer.ops)
-    {
-        AXIS2_FREE(env->allocator, buffer_impl->buffer.ops);
-        buffer_impl->buffer.ops = NULL;
-    }
-
-    AXIS2_FREE(env->allocator,  buffer_impl);
-    buffer_impl = NULL;
+    AXIS2_FREE(env->allocator,  buffer);
+    buffer = NULL;
 
     return AXIS2_SUCCESS;
 }
@@ -231,38 +95,35 @@
     int size
 )
 {
-    oxs_buffer_impl_t *buffer_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    buffer_impl = AXIS2_INTF_TO_IMPL(buffer);
 
     /*If the size to be removed is less than the buffer size*/
-    if (size < buffer_impl->size)
+    if (size < buffer->size)
     {
-        if (!buffer_impl->data)
+        if (!buffer->data)
         {
             oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                     "oxs_buffer_remove_head failed. data is NULL");
             return  AXIS2_FAILURE;
         }
-        buffer_impl->size -= size;
-        memmove(buffer_impl->data, buffer_impl->data + size, buffer_impl->size);
+        buffer->size -= size;
+        memmove(buffer->data, buffer->data + size, buffer->size);
     }
     else
     {
-        buffer_impl->size = 0;
+        buffer->size = 0;
     }
 
     /*If the buffer size is less than the max_size.*/
-    if (buffer_impl->size < buffer_impl->max_size)
+    if (buffer->size < buffer->max_size)
     {
-        if (!buffer_impl->data)
+        if (!buffer->data)
         {
             oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                     "oxs_buffer_remove_head failed");
             return  AXIS2_FAILURE;
         }
-        memset(buffer_impl->data + buffer_impl->size, 0, buffer_impl->max_size - buffer_impl->size);
+        memset(buffer->data + buffer->size, 0, buffer->max_size - buffer->size);
     }
 
     return AXIS2_SUCCESS;
@@ -275,28 +136,25 @@
     int size
 )
 {
-    oxs_buffer_impl_t *buffer_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    buffer_impl = AXIS2_INTF_TO_IMPL(buffer);
 
-    if (size < buffer_impl->size)
+    if (size < buffer->size)
     {
-        buffer_impl->size -= size;
+        buffer->size -= size;
     }
     else
     {
-        buffer_impl->size = 0;
+        buffer->size = 0;
     }
-    if (buffer_impl->size < buffer_impl->max_size)
+    if (buffer->size < buffer->max_size)
     {
-        if (buffer_impl->data)
+        if (buffer->data)
         {
             oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                     "");
             return  AXIS2_FAILURE;
         }
-        memset(buffer_impl->data + buffer_impl->size, 0, buffer_impl->max_size - buffer_impl->size);
+        memset(buffer->data + buffer->size, 0, buffer->max_size - buffer->size);
     }
 
 
@@ -311,14 +169,11 @@
     int size
 )
 {
-    oxs_buffer_impl_t *buffer_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    buffer_impl = AXIS2_INTF_TO_IMPL(buffer);
 
     if (size > 0)
     {
-        oxs_buffer_set_max_size(&(buffer_impl->buffer), env, size);
+        oxs_buffer_set_max_size(buffer, env, size);
         if (!data)
         {
             oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
@@ -326,8 +181,8 @@
             return AXIS2_FAILURE;
         }
 
-        memcpy(buffer_impl->data, data, size);
-        buffer_impl->size = size;
+        memcpy(buffer->data, data, size);
+        buffer->size = size;
     }
 
     return AXIS2_SUCCESS;
@@ -341,14 +196,11 @@
     int size
 )
 {
-    oxs_buffer_impl_t *buffer_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    buffer_impl = AXIS2_INTF_TO_IMPL(buffer);
 
     if (size > 0)
     {
-        oxs_buffer_set_max_size(&(buffer_impl->buffer), env,  buffer_impl->size + size);
+        oxs_buffer_set_max_size(buffer, env,  buffer->size + size);
         if (!data)
         {
             oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
@@ -356,8 +208,8 @@
             return AXIS2_FAILURE;
         }
 
-        memcpy(buffer_impl->data + buffer_impl->size, data, size);
-        buffer_impl->size += size;
+        memcpy(buffer->data + buffer->size, data, size);
+        buffer->size += size;
     }
 
     return AXIS2_SUCCESS;
@@ -371,10 +223,7 @@
     int size
 )
 {
-    oxs_buffer_impl_t *buffer_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    buffer_impl = AXIS2_INTF_TO_IMPL(buffer);
 
     if (size > 0)
     {
@@ -385,11 +234,11 @@
             return AXIS2_FAILURE;
         }
 
-        buffer_impl->max_size = buffer_impl->size + size;
+        buffer->max_size = buffer->size + size;
 
-        memmove(buffer_impl->data + size, buffer_impl->data, buffer_impl->size);
-        memcpy(buffer_impl->data, data, size);
-        buffer_impl->size += size;
+        memmove(buffer->data + size, buffer->data, buffer->size);
+        memcpy(buffer->data, data, size);
+        buffer->size += size;
     }
 
     return AXIS2_SUCCESS;
@@ -402,15 +251,12 @@
     const axis2_char_t *filename
 )
 {
-    oxs_buffer_impl_t *buffer_impl = NULL;
     unsigned char fbuffer[1024];
     FILE* f;
     int  len;
     axis2_status_t status = AXIS2_FAILURE;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    buffer_impl = AXIS2_INTF_TO_IMPL(buffer);
-
 
     f = fopen(filename, "rb");
     if (f == NULL)
@@ -432,7 +278,7 @@
             fclose(f);
             return AXIS2_FAILURE;
         }
-        status = oxs_buffer_append(&(buffer_impl->buffer), env, fbuffer, len);
+        status = oxs_buffer_append(buffer, env, fbuffer, len);
         if (status == AXIS2_FAILURE)
         {
             fclose(f);
@@ -456,11 +302,9 @@
     int size
 )
 {
-    oxs_buffer_impl_t *buffer_impl = NULL;
     axis2_status_t status = AXIS2_FAILURE;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    buffer_impl = AXIS2_INTF_TO_IMPL(buffer);
 
     /*First we need to make sure that the max size has a value greater or equal value*/
     status = oxs_buffer_set_max_size(buffer, env,  size);
@@ -471,7 +315,7 @@
         return AXIS2_FAILURE;
     }
     /*Now set the size*/
-    buffer_impl->size = size;
+    buffer->size = size;
 
     return AXIS2_SUCCESS;
 }
@@ -483,19 +327,17 @@
     int size
 )
 {
-    oxs_buffer_impl_t *buffer_impl = NULL;
     unsigned char* new_data;
     unsigned int new_size = 0;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    buffer_impl = AXIS2_INTF_TO_IMPL(buffer);
 
-    if (size <= buffer_impl->max_size)
+    if (size <= buffer->max_size)
     {
         return AXIS2_SUCCESS;
     }
 
-    switch (buffer_impl->alloc_mode)
+    switch (buffer->alloc_mode)
     {
         case oxs_alloc_mode_exact:
             new_size = size + 8;
@@ -511,17 +353,17 @@
     }
 
     /*If there are data already then use realloc instead of malloc*/
-    if (buffer_impl->data)
+    if (buffer->data)
     {
 #if 0        
         new_data = (unsigned char*)AXIS2_REALLOC(env->allocator, buffer_impl->data, new_size);
 #else
 
         /*Assign extra amnt of memory*/
-        new_data = (unsigned char*)AXIS2_MALLOC(env->allocator, new_size + buffer_impl->max_size);
+        new_data = (unsigned char*)AXIS2_MALLOC(env->allocator, new_size + buffer->max_size);
         
         /*Copy to newdata*/
-        new_data = memcpy(new_data, buffer_impl->data, buffer_impl->size);
+        new_data = memcpy(new_data, buffer->data, buffer->size);
     
 #endif
     }
@@ -537,18 +379,18 @@
         return AXIS2_FAILURE;
     }
 
-    buffer_impl->data = new_data;
-    buffer_impl->max_size = new_size;
+    buffer->data = new_data;
+    buffer->max_size = new_size;
 
-    if (buffer_impl->size < buffer_impl->max_size)
+    if (buffer->size < buffer->max_size)
     {
-        if (buffer_impl->data == NULL)
+        if (buffer->data == NULL)
         {
             oxs_error(env, ERROR_LOCATION, OXS_ERROR_INVALID_DATA,
                     "");
             return AXIS2_FAILURE;
         }
-        memset(buffer_impl->data + buffer_impl->size, 0, buffer_impl->max_size - buffer_impl->size);
+        memset(buffer->data + buffer->size, 0, buffer->max_size - buffer->size);
     }
 
     return AXIS2_SUCCESS;
@@ -560,12 +402,9 @@
     const axis2_env_t *env
 )
 {
-    oxs_buffer_impl_t *buffer_impl = NULL;
-
     AXIS2_ENV_CHECK(env, NULL);
-    buffer_impl = AXIS2_INTF_TO_IMPL(buffer);
 
-    return buffer_impl->data;
+    return buffer->data;
 }
 
 int AXIS2_CALL
@@ -574,12 +413,9 @@
     const axis2_env_t *env
 )
 {
-    oxs_buffer_impl_t *buffer_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    buffer_impl = AXIS2_INTF_TO_IMPL(buffer);
 
-    return buffer_impl->size;
+    return buffer->size;
 }
 
 int AXIS2_CALL
@@ -588,11 +424,8 @@
     const axis2_env_t *env
 )
 {
-    oxs_buffer_impl_t *buffer_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    buffer_impl = AXIS2_INTF_TO_IMPL(buffer);
 
-    return buffer_impl->max_size;
+    return buffer->max_size;
 }
 

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/ctx.c?view=diff&rev=521241&r1=521240&r2=521241
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/ctx.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/ctx.c Thu Mar 22 05:50:04 2007
@@ -21,10 +21,8 @@
 #include <oxs_ctx.h>
 
 
-typedef struct oxs_ctx_impl
-{
-    oxs_ctx_t ctx;
-
+struct oxs_ctx_t
+{    
     /*Encryption mode*/
     oxs_ctx_mode_t mode;
 
@@ -48,239 +46,37 @@
     /*Used  in decryption process to keep the data to be decrypted*/
     axis2_char_t*           input_data;
 
-}
-oxs_ctx_impl_t;
-
-
-/** Interface to implementation conversion macro */
-#define AXIS2_INTF_TO_IMPL(oxs_ctx) ((oxs_ctx_impl_t *)oxs_ctx)
+};
 
 /******************* function headers ******************************/
-/* private functions */
-static void
-oxs_ctx_init_ops(
-    oxs_ctx_t *ctx);
-
-/*public functions*/
-axis2_status_t AXIS2_CALL
-oxs_ctx_free(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env
-);
-
-oxs_ctx_mode_t AXIS2_CALL
-oxs_ctx_get_mode(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env
-);
-
-oxs_ctx_operation_t AXIS2_CALL
-oxs_ctx_get_operation(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env
-);
-
-oxs_key_t *AXIS2_CALL
-oxs_ctx_get_key(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env
-);
-
-axis2_char_t *AXIS2_CALL
-oxs_ctx_get_id(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env
-);
-
-axis2_char_t *AXIS2_CALL
-oxs_ctx_get_type(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env
-);
-
-axis2_char_t *AXIS2_CALL
-oxs_ctx_get_mime_type(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env
-);
-
-axis2_char_t *AXIS2_CALL
-oxs_ctx_get_encoding(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env
-);
-
-axis2_char_t *AXIS2_CALL
-oxs_ctx_get_recipient(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env
-);
-
-axis2_char_t *AXIS2_CALL
-oxs_ctx_get_carried_key_name(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env
-);
-
-axis2_char_t *AXIS2_CALL
-oxs_ctx_get_enc_mtd_algorithm(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env
-);
-
-axis2_char_t *AXIS2_CALL
-oxs_ctx_get_input_data(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env
-);
-axis2_status_t AXIS2_CALL
-oxs_ctx_set_mode(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env,
-    oxs_ctx_mode_t mode
-);
-
-axis2_status_t AXIS2_CALL
-oxs_ctx_set_operation(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env,
-    oxs_ctx_operation_t operation
-);
-
-axis2_status_t AXIS2_CALL
-oxs_ctx_set_key(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env,
-    oxs_key_t *key
-);
-
-axis2_status_t AXIS2_CALL
-oxs_ctx_set_id(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env,
-    axis2_char_t *id
-);
-
-axis2_status_t AXIS2_CALL
-oxs_ctx_set_type(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env,
-    axis2_char_t *type
-);
-
-axis2_status_t AXIS2_CALL
-oxs_ctx_set_mime_type(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env,
-    axis2_char_t *mime_type
-);
-
-axis2_status_t AXIS2_CALL
-oxs_ctx_set_encoding(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env,
-    axis2_char_t *encoding
-);
-
-axis2_status_t AXIS2_CALL
-oxs_ctx_set_recipient(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env,
-    axis2_char_t *recipient
-);
-
-axis2_status_t AXIS2_CALL
-oxs_ctx_set_carried_key_name(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env,
-    axis2_char_t *carried_key_name
-);
-
-axis2_status_t AXIS2_CALL
-oxs_ctx_set_enc_mtd_algorithm(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env,
-    axis2_char_t *enc_mtd_algorithm
-);
-
-axis2_status_t AXIS2_CALL
-oxs_ctx_set_input_data(
-    oxs_ctx_t *ctx,
-    const axis2_env_t *env,
-    axis2_char_t *input_data
-);
-
-/******************* end of function headers ******************************/
 AXIS2_EXTERN oxs_ctx_t *AXIS2_CALL
 oxs_ctx_create(const axis2_env_t *env)
 {
-    oxs_ctx_impl_t *ctx_impl = NULL;
+    oxs_ctx_t *ctx = NULL;
     AXIS2_ENV_CHECK(env, NULL);
 
-    ctx_impl = AXIS2_MALLOC(env->allocator, sizeof(oxs_ctx_impl_t));
-    if (!ctx_impl)
+    ctx = AXIS2_MALLOC(env->allocator, sizeof(oxs_ctx_t));
+    if (!ctx)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    ctx_impl->mode  = -1;
-    ctx_impl->operation  = -1;
-    ctx_impl->key  = NULL;
-    ctx_impl->id  = NULL;
-    ctx_impl->type  = NULL;
-    ctx_impl->mime_type  = NULL;
-    ctx_impl->encoding  = NULL;
-    ctx_impl->recipient  = NULL;
-    ctx_impl->carried_key_name  = NULL;
-    ctx_impl->enc_mtd_algorithm  = NULL;
-    ctx_impl->input_data  = NULL;
+    ctx->mode  = -1;
+    ctx->operation  = -1;
+    ctx->key  = NULL;
+    ctx->id  = NULL;
+    ctx->type  = NULL;
+    ctx->mime_type  = NULL;
+    ctx->encoding  = NULL;
+    ctx->recipient  = NULL;
+    ctx->carried_key_name  = NULL;
+    ctx->enc_mtd_algorithm  = NULL;
+    ctx->input_data  = NULL;
 
-
-    ctx_impl->ctx.ops =  AXIS2_MALLOC(env->allocator, sizeof(oxs_ctx_ops_t));
-    if (!ctx_impl->ctx.ops)
-    {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        oxs_ctx_free(&(ctx_impl->ctx), env);
-        return NULL;
-    }
-
-    oxs_ctx_init_ops(&(ctx_impl->ctx));
-
-    return &(ctx_impl->ctx);
+    return ctx;
 }
 
-/* private functions */
-static void
-oxs_ctx_init_ops(
-    oxs_ctx_t *ctx)
-{
-    ctx->ops->free = oxs_ctx_free ;
-
-    ctx->ops->get_mode = oxs_ctx_get_mode ;
-    ctx->ops->get_operation = oxs_ctx_get_operation ;
-    ctx->ops->get_key = oxs_ctx_get_key;
-    ctx->ops->get_id = oxs_ctx_get_id ;
-    ctx->ops->get_type = oxs_ctx_get_type ;
-    ctx->ops->get_mime_type = oxs_ctx_get_mime_type ;
-    ctx->ops->get_encoding = oxs_ctx_get_encoding ;
-    ctx->ops->get_recipient = oxs_ctx_get_recipient ;
-    ctx->ops->get_carried_key_name = oxs_ctx_get_carried_key_name ;
-    ctx->ops->get_enc_mtd_algorithm = oxs_ctx_get_enc_mtd_algorithm ;
-    ctx->ops->get_input_data = oxs_ctx_get_input_data ;
-
-    ctx->ops->set_mode = oxs_ctx_set_mode ;
-    ctx->ops->set_operation = oxs_ctx_set_operation ;
-    ctx->ops->set_key = oxs_ctx_set_key;
-    ctx->ops->set_id = oxs_ctx_set_id ;
-    ctx->ops->set_type = oxs_ctx_set_type ;
-    ctx->ops->set_mime_type = oxs_ctx_set_mime_type ;
-    ctx->ops->set_encoding = oxs_ctx_set_encoding ;
-    ctx->ops->set_recipient = oxs_ctx_set_recipient ;
-    ctx->ops->set_carried_key_name = oxs_ctx_set_carried_key_name ;
-    ctx->ops->set_enc_mtd_algorithm = oxs_ctx_set_enc_mtd_algorithm ;
-    ctx->ops->set_input_data = oxs_ctx_set_input_data ;
-}
 
 /*public functions*/
 axis2_status_t AXIS2_CALL
@@ -288,64 +84,60 @@
         const axis2_env_t *env
             )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-
-
-    if (ctx_impl->id)
+    if (ctx->id)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->id);
-        ctx_impl->id = NULL;
+        AXIS2_FREE(env->allocator, ctx->id);
+        ctx->id = NULL;
     }
 
-    if (ctx_impl->type)
+    if (ctx->type)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->type);
-        ctx_impl->type = NULL;
+        AXIS2_FREE(env->allocator, ctx->type);
+        ctx->type = NULL;
     }
 
-    if (ctx_impl->mime_type)
+    if (ctx->mime_type)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->mime_type);
-        ctx_impl->mime_type = NULL;
+        AXIS2_FREE(env->allocator, ctx->mime_type);
+        ctx->mime_type = NULL;
     }
 
-    if (ctx_impl->encoding)
+    if (ctx->encoding)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->encoding);
-        ctx_impl->encoding = NULL;
+        AXIS2_FREE(env->allocator, ctx->encoding);
+        ctx->encoding = NULL;
     }
 
-    if (ctx_impl->recipient)
+    if (ctx->recipient)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->recipient);
-        ctx_impl->recipient = NULL;
+        AXIS2_FREE(env->allocator, ctx->recipient);
+        ctx->recipient = NULL;
     }
 
-    if (ctx_impl->carried_key_name)
+    if (ctx->carried_key_name)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->carried_key_name);
-        ctx_impl->carried_key_name = NULL;
+        AXIS2_FREE(env->allocator, ctx->carried_key_name);
+        ctx->carried_key_name = NULL;
     }
 
-    if (ctx_impl->enc_mtd_algorithm)
+    if (ctx->enc_mtd_algorithm)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->enc_mtd_algorithm);
-        ctx_impl->enc_mtd_algorithm = NULL;
+        AXIS2_FREE(env->allocator, ctx->enc_mtd_algorithm);
+        ctx->enc_mtd_algorithm = NULL;
     }
 
-    if (ctx_impl->input_data)
+    if (ctx->input_data)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->input_data);
-        ctx_impl->input_data = NULL;
+        AXIS2_FREE(env->allocator, ctx->input_data);
+        ctx->input_data = NULL;
     }
 
     /*TODO free nodes and key*/
 
-    AXIS2_FREE(env->allocator,  ctx_impl);
-    ctx_impl = NULL;
+    AXIS2_FREE(env->allocator,  ctx);
+    ctx = NULL;
 
     return AXIS2_SUCCESS;
 }
@@ -356,11 +148,9 @@
     const axis2_env_t *env
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
 
-    return ctx_impl->mode ;
+    return ctx->mode ;
 }
 
 oxs_ctx_operation_t AXIS2_CALL
@@ -369,11 +159,9 @@
     const axis2_env_t *env
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
 
-    return ctx_impl->operation ;
+    return ctx->operation ;
 }
 
 
@@ -383,11 +171,9 @@
     const axis2_env_t *env
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
 
-    return ctx_impl->key ;
+    return ctx->key ;
 }
 
 
@@ -397,11 +183,9 @@
     const axis2_env_t *env
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
 
-    return ctx_impl->id ;
+    return ctx->id ;
 }
 
 
@@ -411,11 +195,9 @@
     const axis2_env_t *env
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
 
-    return ctx_impl->type ;
+    return ctx->type ;
 }
 
 
@@ -425,11 +207,9 @@
     const axis2_env_t *env
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
 
-    return ctx_impl->mime_type ;
+    return ctx->mime_type ;
 }
 
 
@@ -439,11 +219,9 @@
     const axis2_env_t *env
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
 
-    return ctx_impl->encoding ;
+    return ctx->encoding ;
 }
 
 
@@ -453,11 +231,9 @@
     const axis2_env_t *env
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
 
-    return ctx_impl->recipient ;
+    return ctx->recipient ;
 }
 
 
@@ -467,11 +243,9 @@
     const axis2_env_t *env
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
 
-    return ctx_impl->carried_key_name ;
+    return ctx->carried_key_name ;
 }
 
 
@@ -481,11 +255,9 @@
     const axis2_env_t *env
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
 
-    return ctx_impl->enc_mtd_algorithm ;
+    return ctx->enc_mtd_algorithm ;
 }
 
 
@@ -495,11 +267,9 @@
     const axis2_env_t *env
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
 
-    return ctx_impl->input_data ;
+    return ctx->input_data ;
 }
 
 
@@ -510,11 +280,9 @@
     oxs_ctx_mode_t mode
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-    ctx_impl->mode = mode ;
+    ctx->mode = mode ;
 
     return AXIS2_SUCCESS;
 }
@@ -526,11 +294,9 @@
     oxs_ctx_operation_t operation
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-    ctx_impl->operation = operation ;
+    ctx->operation = operation ;
 
     return AXIS2_SUCCESS;
 }
@@ -542,16 +308,14 @@
     oxs_key_t *key
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-    if (ctx_impl->key)
+    if (ctx->key)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->key);
-        ctx_impl->key = NULL;
+        AXIS2_FREE(env->allocator, ctx->key);
+        ctx->key = NULL;
     }
-    ctx_impl->key = key;
+    ctx->key = key;
 
     return AXIS2_SUCCESS;
 }
@@ -563,17 +327,15 @@
     axis2_char_t *id
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, id, AXIS2_FAILURE);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-    if (ctx_impl->id)
+    if (ctx->id)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->id);
-        ctx_impl->id = NULL;
+        AXIS2_FREE(env->allocator, ctx->id);
+        ctx->id = NULL;
     }
-    ctx_impl->id = axis2_strdup(id, env);
+    ctx->id = axis2_strdup(id, env);
 
     return AXIS2_SUCCESS;
 }
@@ -585,17 +347,15 @@
     axis2_char_t *type
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, type, AXIS2_FAILURE);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-    if (ctx_impl->type)
+    if (ctx->type)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->type);
-        ctx_impl->type = NULL;
+        AXIS2_FREE(env->allocator, ctx->type);
+        ctx->type = NULL;
     }
-    ctx_impl->type = axis2_strdup(type, env);
+    ctx->type = axis2_strdup(type, env);
 
     return AXIS2_SUCCESS;
 }
@@ -607,17 +367,15 @@
     axis2_char_t *mime_type
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, mime_type, AXIS2_FAILURE);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-    if (ctx_impl->mime_type)
+    if (ctx->mime_type)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->mime_type);
-        ctx_impl->mime_type = NULL;
+        AXIS2_FREE(env->allocator, ctx->mime_type);
+        ctx->mime_type = NULL;
     }
-    ctx_impl->mime_type = axis2_strdup(mime_type, env);
+    ctx->mime_type = axis2_strdup(mime_type, env);
 
     return AXIS2_SUCCESS;
 }
@@ -629,17 +387,15 @@
     axis2_char_t *encoding
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, encoding, AXIS2_FAILURE);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-    if (ctx_impl->encoding)
+    if (ctx->encoding)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->encoding);
-        ctx_impl->encoding = NULL;
+        AXIS2_FREE(env->allocator, ctx->encoding);
+        ctx->encoding = NULL;
     }
-    ctx_impl->encoding = axis2_strdup(encoding, env);
+    ctx->encoding = axis2_strdup(encoding, env);
 
     return AXIS2_SUCCESS;
 }
@@ -651,17 +407,15 @@
     axis2_char_t *recipient
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, recipient, AXIS2_FAILURE);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-    if (ctx_impl->recipient)
+    if (ctx->recipient)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->recipient);
-        ctx_impl->recipient = NULL;
+        AXIS2_FREE(env->allocator, ctx->recipient);
+        ctx->recipient = NULL;
     }
-    ctx_impl->recipient = axis2_strdup(recipient, env);
+    ctx->recipient = axis2_strdup(recipient, env);
 
     return AXIS2_SUCCESS;
 }
@@ -673,17 +427,15 @@
     axis2_char_t *carried_key_name
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, carried_key_name, AXIS2_FAILURE);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-    if (ctx_impl->carried_key_name)
+    if (ctx->carried_key_name)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->carried_key_name);
-        ctx_impl->carried_key_name = NULL;
+        AXIS2_FREE(env->allocator, ctx->carried_key_name);
+        ctx->carried_key_name = NULL;
     }
-    ctx_impl->carried_key_name = axis2_strdup(carried_key_name, env);
+    ctx->carried_key_name = axis2_strdup(carried_key_name, env);
 
     return AXIS2_SUCCESS;
 }
@@ -695,17 +447,15 @@
     axis2_char_t *enc_mtd_algorithm
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, enc_mtd_algorithm, AXIS2_FAILURE);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-    if (ctx_impl->enc_mtd_algorithm)
+    if (ctx->enc_mtd_algorithm)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->enc_mtd_algorithm);
-        ctx_impl->enc_mtd_algorithm = NULL;
+        AXIS2_FREE(env->allocator, ctx->enc_mtd_algorithm);
+        ctx->enc_mtd_algorithm = NULL;
     }
-    ctx_impl->enc_mtd_algorithm = axis2_strdup(enc_mtd_algorithm, env);
+    ctx->enc_mtd_algorithm = axis2_strdup(enc_mtd_algorithm, env);
 
     return AXIS2_SUCCESS;
 }
@@ -717,17 +467,15 @@
     axis2_char_t *input_data
 )
 {
-    oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, input_data, AXIS2_FAILURE);
 
-    ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
-    if (ctx_impl->input_data)
+    if (ctx->input_data)
     {
-        AXIS2_FREE(env->allocator, ctx_impl->input_data);
-        ctx_impl->input_data = NULL;
+        AXIS2_FREE(env->allocator, ctx->input_data);
+        ctx->input_data = NULL;
     }
-    ctx_impl->input_data = axis2_strdup(input_data, env) ;
+    ctx->input_data = axis2_strdup(input_data, env) ;
 
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/key.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/key.c?view=diff&rev=521241&r1=521240&r2=521241
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/key.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/key.c Thu Mar 22 05:50:04 2007
@@ -24,97 +24,12 @@
 #include <openssl_cipher_property.h>
 #include <openssl_util.h>
 
-typedef struct oxs_key_impl
+struct oxs_key_t
 {
-    oxs_key_t key;
-
-
     oxs_buffer_t *buf;
     axis2_char_t *name;
-    int            usage;
-}
-oxs_key_impl_t;
-
-/** Interface to implementation conversion macro */
-#define AXIS2_INTF_TO_IMPL(oxs_key) ((oxs_key_impl_t *)oxs_key)
-
-/******** function headers ***************/
-
-/*private functions*/
-static void
-oxs_key_init_ops(
-    oxs_key_t *key);
-
-/*Public functions*/
-unsigned char *AXIS2_CALL
-oxs_key_get_data(
-    const oxs_key_t *key,
-    const axis2_env_t *env);
-
-axis2_char_t *AXIS2_CALL
-oxs_key_get_name(
-    const oxs_key_t *key,
-    const axis2_env_t *env);
-
-int AXIS2_CALL
-oxs_key_get_size(
-    const oxs_key_t *key,
-    const axis2_env_t *env);
-
-int AXIS2_CALL
-oxs_key_get_usage(
-    const oxs_key_t *key,
-    const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-oxs_key_set_data(
-    oxs_key_t *key,
-    const axis2_env_t *env,
-    unsigned char *data);
-
-axis2_status_t AXIS2_CALL
-oxs_key_set_name(
-    oxs_key_t *key,
-    const axis2_env_t *env,
-    axis2_char_t *name);
-
-axis2_status_t AXIS2_CALL
-oxs_key_set_size(
-    oxs_key_t *key,
-    const axis2_env_t *env,
-    int size);
-
-axis2_status_t AXIS2_CALL
-oxs_key_set_usage(
-    oxs_key_t *key,
-    const axis2_env_t *env,
-    int usage);
-
-axis2_status_t AXIS2_CALL
-oxs_key_free(
-    oxs_key_t *key,
-    const axis2_env_t *env
-);
-
-axis2_status_t AXIS2_CALL
-oxs_key_populate(
-    oxs_key_t *key,
-    const axis2_env_t *env,
-    unsigned char *data,
-    axis2_char_t *name,
-    int size,
-    int usage);
-
-axis2_status_t AXIS2_CALL
-oxs_key_read_from_file(
-    oxs_key_t *key,
-    const axis2_env_t *env,
-    axis2_char_t *file_name);
-
-axis2_status_t AXIS2_CALL
-oxs_key_for_algo(oxs_key_t *key,
-        const axis2_env_t *env,
-        axis2_char_t *key_algo);
+    int           usage;
+};
 
 /******************** end of function headers *****************/
 
@@ -122,13 +37,10 @@
 oxs_key_get_data(
     const oxs_key_t *key,
     const axis2_env_t *env)
-{
-    oxs_key_impl_t *key_impl = NULL;
-    AXIS2_ENV_CHECK(env, NULL);
-    key_impl = AXIS2_INTF_TO_IMPL(key);
-
-    return OXS_BUFFER_GET_DATA(key_impl->buf, env);
+{    
+    AXIS2_ENV_CHECK(env, NULL);    
 
+    return OXS_BUFFER_GET_DATA(key->buf, env);
 }
 
 axis2_char_t *AXIS2_CALL
@@ -136,11 +48,9 @@
     const oxs_key_t *key,
     const axis2_env_t *env)
 {
-    oxs_key_impl_t *key_impl = NULL;
-    AXIS2_ENV_CHECK(env, NULL);
-    key_impl = AXIS2_INTF_TO_IMPL(key);
+    AXIS2_ENV_CHECK(env, NULL);    
 
-    return key_impl->name;
+    return key->name;
 
 }
 
@@ -149,12 +59,9 @@
     const oxs_key_t *key,
     const axis2_env_t *env)
 {
-    oxs_key_impl_t *key_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    key_impl = AXIS2_INTF_TO_IMPL(key);
     
-    return OXS_BUFFER_GET_SIZE(key_impl->buf, env);
-
+    return OXS_BUFFER_GET_SIZE(key->buf, env);
 }
 
 int AXIS2_CALL
@@ -162,12 +69,9 @@
     const oxs_key_t *key,
     const axis2_env_t *env)
 {
-    oxs_key_impl_t *key_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    key_impl = AXIS2_INTF_TO_IMPL(key);
-
-    return key_impl->usage;
 
+    return key->usage;
 }
 
 
@@ -178,20 +82,17 @@
     const axis2_env_t *env,
     axis2_char_t *name)
 {
-    oxs_key_impl_t *oxs_key_impl = NULL;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, name, AXIS2_FAILURE);
-    oxs_key_impl = AXIS2_INTF_TO_IMPL(key);
 
-    if (oxs_key_impl->name)
+    if (key->name)
     {
-        AXIS2_FREE(env->allocator, oxs_key_impl->name);
-        oxs_key_impl->name = NULL;
+        AXIS2_FREE(env->allocator, key->name);
+        key->name = NULL;
     }
-    oxs_key_impl->name = axis2_strdup(name, env);
+    key->name = axis2_strdup(name, env);
     return AXIS2_SUCCESS;
-
 }
 
 
@@ -201,67 +102,35 @@
     const axis2_env_t *env,
     int usage)
 {
-    oxs_key_impl_t *oxs_key_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    oxs_key_impl = AXIS2_INTF_TO_IMPL(key);
 
-    oxs_key_impl->usage = usage;
+    key->usage = usage;
     return AXIS2_SUCCESS;
 
 }
 
 
 
-static void
-oxs_key_init_ops(
-    oxs_key_t *key)
-{
-    key->ops->get_data  = oxs_key_get_data ;
-    key->ops->get_name  = oxs_key_get_name;
-    key->ops->get_size  = oxs_key_get_size;
-    key->ops->get_usage = oxs_key_get_usage;
-    key->ops->set_name  = oxs_key_set_name;
-    key->ops->set_usage = oxs_key_set_usage;
-    key->ops->free      = oxs_key_free;
-    key->ops->populate  = oxs_key_populate;
-    key->ops->read_from_file = oxs_key_read_from_file;
-    key->ops->for_algo  = oxs_key_for_algo;
-}
-
-
 AXIS2_EXTERN oxs_key_t *AXIS2_CALL
 oxs_key_create(const axis2_env_t *env)
 {
-    oxs_key_impl_t *key_impl = NULL;
-
+	oxs_key_t *key = NULL;
     AXIS2_ENV_CHECK(env, NULL);
 
-    key_impl = AXIS2_MALLOC(env->allocator, sizeof(oxs_key_impl_t));
-    if (!key_impl)
+    if (!key)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    key_impl->buf = NULL;
-    key_impl->name = NULL;
-    key_impl->usage = -1;
+    key->buf = NULL;
+    key->name = NULL;
+    key->usage = -1;
     
     /*additionally we need to create a buffer to keep data*/
-    key_impl->buf = oxs_buffer_create(env);
-
-    key_impl->key.ops =  AXIS2_MALLOC(env->allocator, sizeof(oxs_key_ops_t));
-    if (!key_impl->key.ops)
-    {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        oxs_key_free(&(key_impl->key), env);
-        return NULL;
-    }
-
-    oxs_key_init_ops(&(key_impl->key));
-    return &(key_impl->key);
+    key->buf = oxs_buffer_create(env);
 
+    return key;
 }
 
 
@@ -269,19 +138,15 @@
 oxs_key_free(oxs_key_t *key,
         const axis2_env_t *env)
 {
-    oxs_key_impl_t *key_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    key_impl = AXIS2_INTF_TO_IMPL(key);
+    OXS_BUFFER_FREE(key->buf, env);
+    key->buf = NULL;
+    AXIS2_FREE(env->allocator,  key->name);
+    key->name = NULL;
 
-    OXS_BUFFER_FREE(key_impl->buf, env);
-    key_impl->buf = NULL;
-    AXIS2_FREE(env->allocator,  key_impl->name);
-    key_impl->name = NULL;
-
-    AXIS2_FREE(env->allocator,  key_impl);
-    key_impl = NULL;
+    AXIS2_FREE(env->allocator,  key);
+    key = NULL;
 
     return AXIS2_SUCCESS;
 }
@@ -294,17 +159,14 @@
         int size,
         int usage)
 {
-    oxs_key_impl_t *key_impl = NULL;
     int ret;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    key_impl = AXIS2_INTF_TO_IMPL(key);
-
     ret = OXS_KEY_SET_NAME(key, env, name);
     ret = OXS_KEY_SET_USAGE(key, env, usage);
 
-    ret = OXS_BUFFER_POPULATE(key_impl->buf, env, data, size);
+    ret = OXS_BUFFER_POPULATE(key->buf, env, data, size);
 
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/rampart/src/util/rampart_sec_header_builder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/rampart_sec_header_builder.c?view=diff&rev=521241&r1=521240&r2=521241
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/rampart_sec_header_builder.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/rampart_sec_header_builder.c Thu Mar 22 05:50:04 2007
@@ -109,16 +109,14 @@
         /*Timestamp Inclusion*/
         if(rampart_context_is_include_timestamp(rampart_context,env))
         {
-            rampart_timestamp_token_t *timestamp_token = NULL;
             int ttl = -1;
             AXIS2_LOG_INFO(env->log, "[rampart][shb]  building Timestamp Token");
             AXIS2_LOG_INFO(env->log, "[rampart][shb]  Using default timeToLive value %d",
                 RAMPART_TIMESTAMP_TOKEN_DEFAULT_TIME_TO_LIVE);
            /*ttl = RAMPART_TIMESTAMP_TOKEN_DEFAULT_TIME_TO_LIVE;*/
             ttl = rampart_context_get_ttl(rampart_context,env);
-            
-            timestamp_token = rampart_timestamp_token_create(env);
-            status = RAMPART_TIMESTAMP_TOKEN_BUILD(timestamp_token, env,
+                        
+            status = rampart_timestamp_token_build(env,
                              sec_node, sec_ns_obj, ttl);
             if (status == AXIS2_FAILURE)
             {
@@ -133,14 +131,12 @@
         {            
             if(rampart_context_is_include_username_token(rampart_context,env))
             {
-                rampart_username_token_t *username_token = NULL;
-
-                username_token = rampart_username_token_create(env);
+                
         /*Now we are passing rampart_context here so inside this method  
         relevant parameters are extracted. */
 
                 AXIS2_LOG_INFO(env->log, "[rampart][shb]  building UsernmaeToken");
-                status = RAMPART_USERNAME_TOKEN_BUILD(username_token,
+                status =rampart_username_token_build(
                                 env,
                                 rampart_context,
                                 sec_node,

Modified: webservices/axis2/trunk/c/rampart/src/util/rampart_sec_header_processor.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/rampart_sec_header_processor.c?view=diff&rev=521241&r1=521240&r2=521241
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/rampart_sec_header_processor.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/rampart_sec_header_processor.c Thu Mar 22 05:50:04 2007
@@ -112,7 +112,6 @@
     rampart_context_t *rampart_context,
     axiom_node_t *sec_node)
 {
-    rampart_timestamp_token_t *timestamp_token = NULL;
     axis2_status_t valid_ts = AXIS2_FAILURE;
     axiom_node_t *ts_node = NULL;
 
@@ -140,8 +139,8 @@
             return AXIS2_FAILURE;
         }
         
-        timestamp_token = rampart_timestamp_token_create(env);
-        valid_ts = RAMPART_TIMESTAMP_TOKEN_VALIDATE(timestamp_token, env, msg_ctx, ts_node);
+
+        valid_ts = rampart_timestamp_token_validate(env, msg_ctx, ts_node);
 
         if (valid_ts)
         {
@@ -163,7 +162,6 @@
     rampart_context_t *rampart_context,
     axiom_node_t *sec_node)
 {
-    rampart_username_token_t *username_token = NULL;
     axis2_status_t valid_user = AXIS2_FAILURE;
     axiom_node_t *ut_node = NULL;
 
@@ -190,10 +188,9 @@
             AXIS2_LOG_INFO(env->log, "[rampart][shp] Error in the security header");
             return AXIS2_FAILURE;
         }
-
-        username_token = rampart_username_token_create(env);
+        
         AXIS2_LOG_INFO(env->log, "[rampart][shp] Validating UsernameToken");
-        valid_user = RAMPART_USERNAME_TOKEN_VALIDATE(username_token, env,
+        valid_user = rampart_username_token_validate(env,
                             msg_ctx, ut_node, rampart_context);    
     }
     if (valid_user)

Modified: webservices/axis2/trunk/c/rampart/src/util/timestamp_token.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/util/timestamp_token.c?view=diff&rev=521241&r1=521240&r2=521241
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/util/timestamp_token.c (original)
+++ webservices/axis2/trunk/c/rampart/src/util/timestamp_token.c Thu Mar 22 05:50:04 2007
@@ -29,106 +29,9 @@
 #include <rampart_sec_processed_result.h>
 #include <oxs_axiom.h>
 
-typedef struct rampart_timestamp_token_impl
-{
-    rampart_timestamp_token_t timestamp_token;
-}
-rampart_timestamp_token_impl_t;
-
-/** Interface to implementation conversion macro */
-#define AXIS2_INTF_TO_IMPL(timestamp_token) ((rampart_timestamp_token_impl_t *)timestamp_token)
-
-/*************************** Function headers *********************************/
-/** private functions */
-static void
-rampart_timestamp_token_init_ops(
-    rampart_timestamp_token_t *timestamp_token);
-
-
-/** public functions*/
-axis2_status_t AXIS2_CALL
-rampart_timestamp_token_free(rampart_timestamp_token_t *timestamp_token,
-        const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-rampart_timestamp_token_build(rampart_timestamp_token_t *timestamp_token,
-        const axis2_env_t *env,
-        axiom_node_t *sec_node,
-        const  axiom_namespace_t *sec_ns_obj,
-        int ttl);
-
-axis2_status_t AXIS2_CALL
-rampart_timestamp_token_validate(rampart_timestamp_token_t *timestamp_token,
-        const axis2_env_t *env,
-        axis2_msg_ctx_t *msg_ctx,
-        axiom_node_t *ts_node );
-
-/*************************** end of function headers *********************************/
-static void
-rampart_timestamp_token_init_ops(
-    rampart_timestamp_token_t *timestamp_token)
-{
-    timestamp_token->ops->free = rampart_timestamp_token_free;
-    timestamp_token->ops->build = rampart_timestamp_token_build;
-    timestamp_token->ops->validate = rampart_timestamp_token_validate;
-}
-rampart_timestamp_token_t *AXIS2_CALL
-rampart_timestamp_token_create(
-    const axis2_env_t *env)
-{
-    rampart_timestamp_token_impl_t *timestamp_token_impl = NULL;
-
-    AXIS2_ENV_CHECK(env, NULL);
-
-    timestamp_token_impl = (rampart_timestamp_token_impl_t *) AXIS2_MALLOC(env->allocator,
-            sizeof(rampart_timestamp_token_impl_t));
-
-    if (! timestamp_token_impl)
-    {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return NULL;
-    }
-
-    timestamp_token_impl->timestamp_token.ops = AXIS2_MALLOC(env->allocator,
-            sizeof(rampart_timestamp_token_ops_t));
-    if (! timestamp_token_impl->timestamp_token.ops)
-    {
-        rampart_timestamp_token_free(&(timestamp_token_impl->timestamp_token), env);
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return NULL;
-    }
-
-    rampart_timestamp_token_init_ops(&(timestamp_token_impl->timestamp_token));
-
-    return &(timestamp_token_impl->timestamp_token);
-
-}
-
-axis2_status_t AXIS2_CALL
-rampart_timestamp_token_free(rampart_timestamp_token_t *timestamp_token,
-        const axis2_env_t *env)
-{
-    rampart_timestamp_token_impl_t *timestamp_token_impl = NULL;
-
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    timestamp_token_impl = AXIS2_INTF_TO_IMPL(timestamp_token);
-
-    if (timestamp_token->ops)
-    {
-        AXIS2_FREE(env->allocator, timestamp_token->ops);
-        timestamp_token->ops = NULL;
-    }
-    if (timestamp_token_impl)
-    {
-        AXIS2_FREE(env->allocator, timestamp_token_impl);
-        timestamp_token_impl = NULL;
-    }
-    return AXIS2_SUCCESS;
-
-}
 
 axis2_status_t AXIS2_CALL
-rampart_timestamp_token_build(rampart_timestamp_token_t *timestamp_token,
+rampart_timestamp_token_build(
         const axis2_env_t *env,
         axiom_node_t *sec_node,
         const  axiom_namespace_t *sec_ns_obj,
@@ -183,7 +86,7 @@
 }/*rampart_build_timestamp_token*/
 
 axis2_status_t AXIS2_CALL
-rampart_timestamp_token_validate(rampart_timestamp_token_t *timestamp_token,
+rampart_timestamp_token_validate(
         const axis2_env_t *env,
         axis2_msg_ctx_t *msg_ctx,
         axiom_node_t *ts_node )



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