axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r495494 [5/8] - in /webservices/axis2/trunk/c/axiom: include/ src/om/
Date Fri, 12 Jan 2007 06:11:44 GMT
Modified: webservices/axis2/trunk/c/axiom/include/axiom_xml_reader.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/include/axiom_xml_reader.h?view=diff&rev=495494&r1=495493&r2=495494
==============================================================================
--- webservices/axis2/trunk/c/axiom/include/axiom_xml_reader.h (original)
+++ webservices/axis2/trunk/c/axiom/include/axiom_xml_reader.h Thu Jan 11 22:11:41 2007
@@ -14,13 +14,13 @@
  *   limitations under the License.
  *
  */
- 
+
 #ifndef AXIOM_XML_READER_H
 #define AXIOM_XML_READER_H
 
 /**
- *@file axiom_xml_reader.h   
- *@brief this is the parser abstraction layer for axis2 
+ *@file axiom_xml_reader.h
+ *@brief this is the parser abstraction layer for axis2
  */
 
 #include <axis2_env.h>
@@ -31,43 +31,43 @@
 {
 #endif
 
-typedef struct axiom_xml_reader_ops axiom_xml_reader_ops_t;
-typedef struct axiom_xml_reader axiom_xml_reader_t;
-
-/** 
-  * @defgroup axiom_parser parser
-  * @ingroup axiom
-  * @{
-  * @}
-  */
+    typedef struct axiom_xml_reader_ops axiom_xml_reader_ops_t;
+    typedef struct axiom_xml_reader axiom_xml_reader_t;
 
-/**
- * @defgroup axiom_xml_reader XML reader
- * @ingroup axiom_parser
- * @{
- */
+    /**
+      * @defgroup axiom_parser parser
+      * @ingroup axiom
+      * @{
+      * @}
+      */
+
+    /**
+     * @defgroup axiom_xml_reader XML reader
+     * @ingroup axiom_parser
+     * @{
+     */
 
-typedef enum axiom_xml_reader_event_types
-{
-    AXIOM_XML_READER_START_DOCUMENT = 0,
-    AXIOM_XML_READER_START_ELEMENT,
-    AXIOM_XML_READER_END_ELEMENT,
-    AXIOM_XML_READER_SPACE,
-    AXIOM_XML_READER_EMPTY_ELEMENT,
-    AXIOM_XML_READER_CHARACTER,
-    AXIOM_XML_READER_ENTITY_REFERENCE,
-    AXIOM_XML_READER_COMMENT,
-    AXIOM_XML_READER_PROCESSING_INSTRUCTION,
-    AXIOM_XML_READER_CDATA,
-    AXIOM_XML_READER_DOCUMENT_TYPE
-}axiom_xml_reader_event_types;
-
-  /**
-    * \brief AXIOM_XML_READER ops
-    * Encapsulator struct for ops of axiom_xml_reader
-    */
+    typedef enum axiom_xml_reader_event_types
+    {
+        AXIOM_XML_READER_START_DOCUMENT = 0,
+        AXIOM_XML_READER_START_ELEMENT,
+        AXIOM_XML_READER_END_ELEMENT,
+        AXIOM_XML_READER_SPACE,
+        AXIOM_XML_READER_EMPTY_ELEMENT,
+        AXIOM_XML_READER_CHARACTER,
+        AXIOM_XML_READER_ENTITY_REFERENCE,
+        AXIOM_XML_READER_COMMENT,
+        AXIOM_XML_READER_PROCESSING_INSTRUCTION,
+        AXIOM_XML_READER_CDATA,
+        AXIOM_XML_READER_DOCUMENT_TYPE
+    }axiom_xml_reader_event_types;
+
+    /**
+      * \brief AXIOM_XML_READER ops
+      * Encapsulator struct for ops of axiom_xml_reader
+      */
 
- struct axiom_xml_reader_ops
+    struct axiom_xml_reader_ops
     {
         /**
          * causes the reader to read the next parse event. 
@@ -77,78 +77,78 @@
          * @returns one of the events defined in 
          *          axiom_xml_reader_event_types
          */
-        
-        int (AXIS2_CALL *
-      next)(axiom_xml_reader_t *parser,
-              const axis2_env_t *env);
-      
-         /**
-         * free pull_parser
-         * @param parser axiom_xml_reader struct 
-         * @param env    axis2_environment MUST NOT be NULL 
-         * @returns axis2_status_code
-         */
-        
-        axis2_status_t (AXIS2_CALL *
-      free)(axiom_xml_reader_t *parser,
-              const axis2_env_t *env);
+
+        int(AXIS2_CALL *
+                next)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env);
+
+        /**
+        * free pull_parser
+        * @param parser axiom_xml_reader struct 
+        * @param env    axis2_environment MUST NOT be NULL 
+        * @returns axis2_status_code
+        */
+
+        axis2_status_t(AXIS2_CALL *
+                free)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env);
         /**
          * Get the Number of attributes in the current element 
          * @param parser axiom_xml_reader  
          * @param env    axis2_environment, MUST NOT be NULL.
          * @returns Number of attributes , AXIS2_FAILURE on error 
-         */  
-        
-        int (AXIS2_CALL *
-      get_attribute_count)(axiom_xml_reader_t *parser,
-                             const axis2_env_t *env);
-                      
-                                              
-       /** This is used to get an attribute's localname using an index relative to 
-         * current element.The iterations are not zero based. 
-         * To access the first attribute use 1 for parameter i
-         * @param parser parser struct 
-         * @param env environment struct
-         * @param i attribute index
-         * @returns the attribute localname 
-         *          caller must free the value using AXIOM_XML_READER_XML_FREE macro         
          */
-        axis2_char_t* (AXIS2_CALL *
-      get_attribute_name_by_number)(axiom_xml_reader_t *parser,
-                                      const axis2_env_t *env,
-                                      int i);
-                                                     
-       /** This is used to get an attribute's prefix using an index relative to 
-         * current element. The iterations are not zero based. 
-         * To access the first attribute use 1 for parameter i
-         * @param parser parser struct 
-         * @param env environment, MUST NOT be NULL
-         * @param i attribute index.
-         * @returns the attribute prefix, returns NULL on error,  
-         *          caller must free the value using AXIOM_XML_READER_XML_FREE macro         
-         */                                                     
-        
-        axis2_char_t* (AXIS2_CALL *
-      get_attribute_prefix_by_number)(axiom_xml_reader_t *parser,
-                                        const axis2_env_t *env,
-                                        int i);
-                                                     
-        /** get an attribute's value using an index relative to 
+
+        int(AXIS2_CALL *
+                get_attribute_count)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env);
+
+
+        /** This is used to get an attribute's localname using an index relative to
+          * current element.The iterations are not zero based. 
+          * To access the first attribute use 1 for parameter i
+          * @param parser parser struct 
+          * @param env environment struct
+          * @param i attribute index
+          * @returns the attribute localname 
+          *          caller must free the value using AXIOM_XML_READER_XML_FREE macro       
+          */
+        axis2_char_t*(AXIS2_CALL *
+                get_attribute_name_by_number)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env,
+                        int i);
+
+        /** This is used to get an attribute's prefix using an index relative to
+          * current element. The iterations are not zero based. 
+          * To access the first attribute use 1 for parameter i
+          * @param parser parser struct 
+          * @param env environment, MUST NOT be NULL
+          * @param i attribute index.
+          * @returns the attribute prefix, returns NULL on error,  
+          *          caller must free the value using AXIOM_XML_READER_XML_FREE macro       
+          */
+
+        axis2_char_t*(AXIS2_CALL *
+                get_attribute_prefix_by_number)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env,
+                        int i);
+
+        /** get an attribute's value using an index relative to
          * current element. The iterations are not zero based. 
          * To access the first attribute use 1 for parameter i
          * @param parser parser struct 
          * @param env environment, MUST NOT be NULL.
          * @param i attribute index
          * @returns the attribute value, returns NULL on error,
-         *          caller must free the value using AXIOM_XML_READER_XML_FREE macro         
-         */        
-                                             
-        axis2_char_t* (AXIS2_CALL *
-      get_attribute_value_by_number)(axiom_xml_reader_t *parser,
-                                       const axis2_env_t *env,
-                                       int i);
-        
-        /** get an attribute's namespace uri using an index relative to 
+         *          caller must free the value using AXIOM_XML_READER_XML_FREE macro        
+         */
+
+        axis2_char_t*(AXIS2_CALL *
+                get_attribute_value_by_number)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env,
+                        int i);
+
+        /** get an attribute's namespace uri using an index relative to
          * current element. The iterations are not zero based. 
          * To access the first attribute use 1 for parameter i
          * @param parser parser struct 
@@ -156,33 +156,33 @@
          * @param i attribute index
          * @returns the attribute value, returns NULL on error  
          *          caller must free the value using AXIOM_XML_READER_XML_FREE macro        
-         */ 
-        
-        axis2_char_t* (AXIS2_CALL *
-      get_attribute_namespace_by_number)(axiom_xml_reader_t *parser,
-                                           const axis2_env_t *env,
-                                           int i);
-                                 
-       /** returns the text value of current element
-         * @param parser pointer to parser
-         * @param env environment, MUST not be NULL
-         * @returns Text Value, NULL on error 
-         *          caller must free the value using AXIOM_XML_READER_XML_FREE macro 
-         */
-                                
-        axis2_char_t* (AXIS2_CALL *
-      get_value)(axiom_xml_reader_t *parser,
-                   const axis2_env_t *env);
-        
+         */
+
+        axis2_char_t*(AXIS2_CALL *
+                get_attribute_namespace_by_number)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env,
+                        int i);
+
+        /** returns the text value of current element
+          * @param parser pointer to parser
+          * @param env environment, MUST not be NULL
+          * @returns Text Value, NULL on error 
+          *          caller must free the value using AXIOM_XML_READER_XML_FREE macro 
+          */
+
+        axis2_char_t*(AXIS2_CALL *
+                get_value)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env);
+
         /**
          * Returns the namespace count of current element 
          * @param parser parser struct 
          * @param env environment
          * @returns namespace count of current element,
          */
-        int (AXIS2_CALL *
-      get_namespace_count)(axiom_xml_reader_t *parser,
-                             const axis2_env_t *env);
+        int(AXIS2_CALL *
+                get_namespace_count)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env);
         /**
          * access the namespace uri of the namespaces declared in current element 
          * using an index 
@@ -190,12 +190,12 @@
          * @param env environment 
          * @param i index
          * @returns namespace uri of corresponding namespace 
-         *          caller must free the value using AXIOM_XML_READER_XML_FREE macro         
+         *          caller must free the value using AXIOM_XML_READER_XML_FREE macro        
          */
-        axis2_char_t* (AXIS2_CALL *
-      get_namespace_uri_by_number)(axiom_xml_reader_t *parser,
-                                     const axis2_env_t *env,
-                                     int i);
+        axis2_char_t*(AXIS2_CALL *
+                get_namespace_uri_by_number)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env,
+                        int i);
         /**
          * access the namespace prefix of the namespaces declared in current element 
          * using an index 
@@ -203,68 +203,68 @@
          * @param env environment 
          * @param i index
          * @returns namespace prefix of corresponding namespace 
-         * caller must free the value using AXIOM_XML_READER_XML_FREE macro         
-         */                                               
-        axis2_char_t* (AXIS2_CALL *
-      get_namespace_prefix_by_number)(axiom_xml_reader_t *parser,
-                                        const axis2_env_t *env,
-                                        int i); 
+         * caller must free the value using AXIOM_XML_READER_XML_FREE macro        
+         */
+        axis2_char_t*(AXIS2_CALL *
+                get_namespace_prefix_by_number)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env,
+                        int i);
         /**
          * Used to obtain the current element prefix
          * @param parser parser struct 
          * @param env environment struct
          * @returns prefix , NULL on error 
          * caller must free the value using AXIOM_XML_READER_XML_FREE macro
-         */         
-        
-        axis2_char_t* (AXIS2_CALL *
-      get_prefix)(axiom_xml_reader_t *parser,
-                    const axis2_env_t *env);   
+         */
+
+        axis2_char_t*(AXIS2_CALL *
+                get_prefix)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env);
         /**
          *  Used to obtain the current element localname
          * @param parser parser struct 
          * @param env environment struct
          * @returns localname , NULL on error 
          *          caller must free the value using AXIOM_XML_READER_XML_FREE macro
-         */         
-        axis2_char_t* (AXIS2_CALL *
-      get_name)(axiom_xml_reader_t *parser,
-                  const axis2_env_t *env); 
+         */
+        axis2_char_t*(AXIS2_CALL *
+                get_name)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env);
         /**
          * Used to get the processingInstruction target
          * @param parser parser struct
          * @param env environment, MUST NOT be NULL.
          * @returns target value of processingInstruction
          *          caller must free the value using AXIOM_XML_READER_XML_FREE macro
-         */ 
-         
-         
-                
-        axis2_char_t* (AXIS2_CALL *
-      get_pi_target)(axiom_xml_reader_t *parser,
-                       const axis2_env_t *env);
+         */
+
+
+
+        axis2_char_t*(AXIS2_CALL *
+                get_pi_target)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env);
         /**
          *  gets the processingInstruction data
          *@param parser parser struct
          *@param env environment, MUST NOT be NULL.
          *@returns data of processingInstruction
          *          caller must free the value using AXIOM_XML_READER_XML_FREE macro
-         */        
+         */
 
 
-        axis2_char_t* (AXIS2_CALL *
-      get_pi_data)(axiom_xml_reader_t *parser,
-                     const axis2_env_t *env);
+        axis2_char_t*(AXIS2_CALL *
+                get_pi_data)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env);
         /**
          *  used to get the DTD 
          * @param parser pointer to pull parser struct
          * @param env environment, MUST NOT be NULL.
          * @return text of doctype declaration. NULL is returns of no data 
          *         exists.
-         */         
-        axis2_char_t* (AXIS2_CALL *
-      get_dtd)(axiom_xml_reader_t *parser,
-                 const axis2_env_t *env);                                                
+         */
+        axis2_char_t*(AXIS2_CALL *
+                get_dtd)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env);
         /**
          *  Free function , this function wraps the underlying parser's 
          *  xml free function. For freeing values obatined by calling
@@ -274,11 +274,11 @@
          * @param data data values to be destroyed
          * @return status of the op, AXIS2_SUCCESS on success,
          *                  AXIS2_FAILURE on error.
-         */         
-        axis2_status_t (AXIS2_CALL *
-      xml_free)(axiom_xml_reader_t *parser,
-                  const axis2_env_t *env,
-                  void *data);
+         */
+        axis2_status_t(AXIS2_CALL *
+                xml_free)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env,
+                        void *data);
 
         /**
          * get the char set encoding of the parser 
@@ -286,165 +286,165 @@
          * @param env environment
          * @returns char set encoding string or NULL in failure
          */
-                                   
-        axis2_char_t* (AXIS2_CALL *
-      get_char_set_encoding)(axiom_xml_reader_t *parser,
-                               const axis2_env_t *env);                                         
-        /** returns the namespace uri associated with current node */                                                   
-        axis2_char_t* (AXIS2_CALL *
-      get_namespace_uri)(axiom_xml_reader_t *parser,
-                           const axis2_env_t *env);
-                           
-        axis2_char_t* (AXIS2_CALL *
-        get_namespace_uri_by_prefix)(axiom_xml_reader_t *parser,
-                                     const axis2_env_t *env,
-                                     axis2_char_t *prefix);
-                                       
-                               
-    };
-     
-/** 
- * @brief axiom_xml_reader struct
-  *   Axis2 OM pull_parser
- */
-struct axiom_xml_reader
-{
-    axiom_xml_reader_ops_t *ops;  
-};    
 
-/**
- * create an instance of axiom_xml_reader to parse
- * a file using an xml document in a file system
- * @param env environment struct, must not be null
- * @param filename url of an xml document
- * @returns a pointer to xml_pull_parser_t struct
- *          NULL on error with error code set in the environment's error 
- */
+        axis2_char_t*(AXIS2_CALL *
+                get_char_set_encoding)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env);
+        /** returns the namespace uri associated with current node */
+        axis2_char_t*(AXIS2_CALL *
+                get_namespace_uri)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env);
+
+        axis2_char_t*(AXIS2_CALL *
+                get_namespace_uri_by_prefix)(axiom_xml_reader_t *parser,
+                        const axis2_env_t *env,
+                        axis2_char_t *prefix);
 
-AXIS2_EXTERN axiom_xml_reader_t * AXIS2_CALL
-axiom_xml_reader_create_for_file(const axis2_env_t *env,
-                                  char *filename,
-                                  const axis2_char_t *encoding);
-/**
- * This create an instance of axiom_xml_reader to 
- * parse a xml document in a buffer. It takes a callback 
- * function that takes a buffer and the size of the buffer
- * The user must implement a function that takes in buffer
- * and size and fill the buffer with specified size
- * with xml stream, parser will call this function to fill the 
- * buffer on the fly while parsing.
- * @param env environment MUST NOT be NULL.
- * @param read_input_callback() callback function that fills
- *         a char buffer with size @size
- *         @param buffer a character buffer
- *         @param size size of the buffer to be filled
- * @param encoding encoding scheme of the xml stream
- */
- 
-AXIS2_EXTERN axiom_xml_reader_t * AXIS2_CALL
-axiom_xml_reader_create_for_io(const axis2_env_t *env,
-                                    AXIS2_READ_INPUT_CALLBACK,
-                                    AXIS2_CLOSE_INPUT_CALLBACK,
-                                    void *ctx,
-                                    const axis2_char_t *encoding);
-
-/**
- * create an axiom_xml_reader_t using a buffer, which is the xml input
- * @param env environment, MUST not be NULL
- * @param buffer xml input string in a char buffer
- * @param size size of the @buffer
- * @param encoding encoding of the xml 
- * @return pointer to axiom_xml_reader_t struct on success , NULL otherwise
- */
-AXIS2_EXTERN axiom_xml_reader_t * AXIS2_CALL
-axiom_xml_reader_create_for_memory(const axis2_env_t *env,
-                                  void *container,
-                                  int size,
-                                  const axis2_char_t *encoding,
-                          int type);
 
-/**
- * init function initializes the parser 
- */
+    };
 
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axiom_xml_reader_init();
+    /**
+     * @brief axiom_xml_reader struct
+      *   Axis2 OM pull_parser
+     */
+    struct axiom_xml_reader
+    {
+        axiom_xml_reader_ops_t *ops;
+    };
 
-/**
- * parser cleanup function 
- */
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axiom_xml_reader_cleanup();
+    /**
+     * create an instance of axiom_xml_reader to parse
+     * a file using an xml document in a file system
+     * @param env environment struct, must not be null
+     * @param filename url of an xml document
+     * @returns a pointer to xml_pull_parser_t struct
+     *          NULL on error with error code set in the environment's error
+     */
+
+    AXIS2_EXTERN axiom_xml_reader_t * AXIS2_CALL
+    axiom_xml_reader_create_for_file(const axis2_env_t *env,
+            char *filename,
+            const axis2_char_t *encoding);
+    /**
+     * This create an instance of axiom_xml_reader to
+     * parse a xml document in a buffer. It takes a callback
+     * function that takes a buffer and the size of the buffer
+     * The user must implement a function that takes in buffer
+     * and size and fill the buffer with specified size
+     * with xml stream, parser will call this function to fill the
+     * buffer on the fly while parsing.
+     * @param env environment MUST NOT be NULL.
+     * @param read_input_callback() callback function that fills
+     *         a char buffer with size @size
+     *         @param buffer a character buffer
+     *         @param size size of the buffer to be filled
+     * @param encoding encoding scheme of the xml stream
+     */
+
+    AXIS2_EXTERN axiom_xml_reader_t * AXIS2_CALL
+    axiom_xml_reader_create_for_io(const axis2_env_t *env,
+            AXIS2_READ_INPUT_CALLBACK,
+            AXIS2_CLOSE_INPUT_CALLBACK,
+            void *ctx,
+            const axis2_char_t *encoding);
+
+    /**
+     * create an axiom_xml_reader_t using a buffer, which is the xml input
+     * @param env environment, MUST not be NULL
+     * @param buffer xml input string in a char buffer
+     * @param size size of the @buffer
+     * @param encoding encoding of the xml
+     * @return pointer to axiom_xml_reader_t struct on success , NULL otherwise
+     */
+    AXIS2_EXTERN axiom_xml_reader_t * AXIS2_CALL
+    axiom_xml_reader_create_for_memory(const axis2_env_t *env,
+            void *container,
+            int size,
+            const axis2_char_t *encoding,
+            int type);
+
+    /**
+     * init function initializes the parser
+     */
+
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axiom_xml_reader_init();
+
+    /**
+     * parser cleanup function
+     */
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axiom_xml_reader_cleanup();
 
 
-/********************************* Macros *************************************/
+    /********************************* Macros *************************************/
 
-/** Macros corresponding to above declared function pointers */
+    /** Macros corresponding to above declared function pointers */
 
-/** causes the reader to read the next parse event.
- returns an integer which identifies the type of event just read. */
+    /** causes the reader to read the next parse event.
+     returns an integer which identifies the type of event just read. */
 #define AXIOM_XML_READER_NEXT(parser, env) \
         ((parser)->ops->next(parser, env))
-/** Free pull parser struct */
+    /** Free pull parser struct */
 #define AXIOM_XML_READER_FREE(parser, env) \
         ((parser)->ops->free(parser, env))
-/** Get the Number of attributes in an element */
+    /** Get the Number of attributes in an element */
 #define AXIOM_XML_READER_GET_ATTRIBUTE_COUNT(parser, env) \
         ((parser)->ops->get_attribute_count(parser, env))
-/** Get the localname of the attribute corresponding to index i */
+    /** Get the localname of the attribute corresponding to index i */
 #define AXIOM_XML_READER_GET_ATTRIBUTE_NAME_BY_NUMBER(parser, env, i) \
         ((parser)->ops->get_attribute_name_by_number(parser, env, i))
-/** Get value of attribute corresponding to index i */        
+    /** Get value of attribute corresponding to index i */
 #define AXIOM_XML_READER_GET_ATTRIBUTE_VALUE_BY_NUMBER(parser, env, i) \
         ((parser)->ops->get_attribute_value_by_number(parser,env, i))
-/** Get namespace uri of attribute corresponding to index i */
+    /** Get namespace uri of attribute corresponding to index i */
 #define AXIOM_XML_READER_GET_ATTRIBUTE_NAMESPACE_BY_NUMBER(parser, env, i) \
         ((parser)->ops->get_attribute_namespace_by_number(parser, env, i))
-/** get prefix of attribute corresponding to index i */
+    /** get prefix of attribute corresponding to index i */
 #define AXIOM_XML_READER_GET_ATTRIBUTE_PREFIX_BY_NUMBER(parser, env, i) \
         ((parser)->ops->get_attribute_prefix_by_number(parser, env, i))
-/** get the localname of element */
+    /** get the localname of element */
 #define AXIOM_XML_READER_GET_NAME(parser, env) \
         ((parser)->ops->get_name(parser, env))
-/** get value of element */
+    /** get value of element */
 #define AXIOM_XML_READER_GET_VALUE(parser, env) \
         ((parser)->ops->get_value(parser, env))
-/** get prefix of element */        
+    /** get prefix of element */
 #define AXIOM_XML_READER_GET_PREFIX(parser, env) \
         ((parser)->ops->get_prefix(parser, env))
-/** get the number of namespaces declared in an element */
+    /** get the number of namespaces declared in an element */
 #define AXIOM_XML_READER_GET_NAMESPACE_COUNT(parser, env) \
         ((parser)->ops->get_namespace_count(parser, env))
-/** get the elements namespace uri corresponding to index i */        
+    /** get the elements namespace uri corresponding to index i */
 #define AXIOM_XML_READER_GET_NAMESPACE_URI_BY_NUMBER(parser, env, i) \
         ((parser)->ops->get_namespace_uri_by_number(parser, env, i))
-/** get the elements namespace prefix corresponding to index i */        
+    /** get the elements namespace prefix corresponding to index i */
 #define AXIOM_XML_READER_GET_NAMESPACE_PREFIX_BY_NUMBER(parser, env, i) \
         ((parser)->ops->get_namespace_prefix_by_number(parser, env, i))
-/** get processing instruction data */        
+    /** get processing instruction data */
 #define AXIOM_XML_READER_GET_PI_DATA(parser, env) \
         ((parser)->ops->get_pi_data(parser, env))
-/** get processing instruction target */
+    /** get processing instruction target */
 #define AXIOM_XML_READER_GET_PI_TARGET(parser, env) \
         ((parser)->ops->get_pi_target(parser, env))
-/** get document type declaration text */        
+    /** get document type declaration text */
 #define AXIOM_XML_READER_GET_DTD(parser, env) \
         ((parser)->ops->get_dtd(parser, env))
-/** macro to free values returned by pull parser */        
+    /** macro to free values returned by pull parser */
 #define AXIOM_XML_READER_XML_FREE(parser, env, data) \
         ((parser)->ops->xml_free(parser, env, data))
-      
+
 #define AXIOM_XML_READER_GET_CHAR_SET_ENCODING(parser, env) \
-        ((parser)->ops->get_char_set_encoding(parser, env)) 
-        
+        ((parser)->ops->get_char_set_encoding(parser, env))
+
 #define AXIOM_XML_READER_GET_NAMESPACE_URI(parser, env) \
         ((parser)->ops->get_namespace_uri(parser, env))
-        
+
 #define AXIOM_XML_READER_GET_NAMESPACE_URI_BY_PREFIX(parser, env, prefix) \
-        ((parser)->ops->get_namespace_uri_by_prefix(parser, env, prefix))         
+        ((parser)->ops->get_namespace_uri_by_prefix(parser, env, prefix))
 
-/******************************* End Macros ***********************************/
-/** @} */
+    /******************************* End Macros ***********************************/
+    /** @} */
 
 
 #ifdef __cplusplus

Modified: webservices/axis2/trunk/c/axiom/include/axiom_xml_writer.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/include/axiom_xml_writer.h?view=diff&rev=495494&r1=495493&r2=495494
==============================================================================
--- webservices/axis2/trunk/c/axiom/include/axiom_xml_writer.h (original)
+++ webservices/axis2/trunk/c/axiom/include/axiom_xml_writer.h Thu Jan 11 22:11:41 2007
@@ -14,76 +14,76 @@
  *   limitations under the License.
  *
  */
- 
+
 #ifndef AXIOM_XML_WRITER_H
 #define AXIOM_XML_WRITER_H
 
 /**
- *@file axiom_xml_writer.h   
- *@brief this is the parser abstraction layer for axis2 
+ *@file axiom_xml_writer.h
+ *@brief this is the parser abstraction layer for axis2
  */
- 
- #include <axis2_env.h>
- 
- #ifdef __cplusplus
+
+#include <axis2_env.h>
+
+#ifdef __cplusplus
 extern "C"
 {
 #endif
-    
-typedef struct axiom_xml_writer_ops axiom_xml_writer_ops_t;    
-typedef struct axiom_xml_writer axiom_xml_writer_t;
 
-/**
- * @defgroup axiom_xml_writer XML writer
- * @ingroup axiom_parser
- * @{
- */
+    typedef struct axiom_xml_writer_ops axiom_xml_writer_ops_t;
+    typedef struct axiom_xml_writer axiom_xml_writer_t;
+
+    /**
+     * @defgroup axiom_xml_writer XML writer
+     * @ingroup axiom_parser
+     * @{
+     */
 
 
 
-  /**
-    * \brief axiom_xml_writer ops
-    * Encapsulator struct for ops of axiom_xml_writer
-    */
+    /**
+      * \brief axiom_xml_writer ops
+      * Encapsulator struct for ops of axiom_xml_writer
+      */
 
-     struct axiom_xml_writer_ops 
+    struct axiom_xml_writer_ops
     {
-       /**
-        * Free xml writer
-        * @param writer pointer to xml_writer struct to be freed
-        * @param env environment, MUST NOT be NULL.
-        * @returns status of the op. 
-        *       AXIS2_SUCCESS on success and AXIS2_FAILURE on error
-        */
-        
-        axis2_status_t (AXIS2_CALL *
-      free)(axiom_xml_writer_t *writer,
-              const axis2_env_t *env);
-       /**
-        *  Write a start tag to output stream with localname.
-        *  Internally the writer keeps track of the opened tags 
-        *  @param writer pointer to xml writer struct
-        *  @param env environment. MUST NOT be NULL.
-        *  @param localname localname of the tag, May not be NULL.
-        *  @return the status of the op, AXIS2_SUCCESS on success
-                    AXIS2_FAILURE on error.
-        */
-        axis2_status_t (AXIS2_CALL *
-      write_start_element)(axiom_xml_writer_t *writer,
-                             const axis2_env_t *env, 
-                      axis2_char_t *localname);
-       /**
-        *  write an end tag to the output relying on the internal
-        *  state of writer to determine the prefix and localname of
-        *  the element
-        *  @param writer xml_writer struct
-        *  @param env environment, MUST NOT be NULL.
-        *  @return status of the op. AXIS2_SUCCESS on success.
-        *           AXIS2_FAILURE on error.
-        */
-        axis2_status_t (AXIS2_CALL *
-      end_start_element)(axiom_xml_writer_t *writer,
-                           const axis2_env_t *env);
+        /**
+         * Free xml writer
+         * @param writer pointer to xml_writer struct to be freed
+         * @param env environment, MUST NOT be NULL.
+         * @returns status of the op. 
+         *       AXIS2_SUCCESS on success and AXIS2_FAILURE on error
+         */
+
+        axis2_status_t(AXIS2_CALL *
+                free)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env);
+        /**
+         *  Write a start tag to output stream with localname.
+         *  Internally the writer keeps track of the opened tags 
+         *  @param writer pointer to xml writer struct
+         *  @param env environment. MUST NOT be NULL.
+         *  @param localname localname of the tag, May not be NULL.
+         *  @return the status of the op, AXIS2_SUCCESS on success
+                     AXIS2_FAILURE on error.
+         */
+        axis2_status_t(AXIS2_CALL *
+                write_start_element)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *localname);
+        /**
+         *  write an end tag to the output relying on the internal
+         *  state of writer to determine the prefix and localname of
+         *  the element
+         *  @param writer xml_writer struct
+         *  @param env environment, MUST NOT be NULL.
+         *  @return status of the op. AXIS2_SUCCESS on success.
+         *           AXIS2_FAILURE on error.
+         */
+        axis2_status_t(AXIS2_CALL *
+                end_start_element)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env);
         /**
          * Write an element tag with localname and namespace uri 
          * @param writer pointer to xml writer struct
@@ -94,12 +94,12 @@
          * @returns status of the op, AXIS2_SUCCESS on success.
          *          AXIS2_FAILURE on error
          */
-        axis2_status_t (AXIS2_CALL *
-      write_start_element_with_namespace)(axiom_xml_writer_t *writer,
-                                 const axis2_env_t *env,
-                                 axis2_char_t *localname,
-                                 axis2_char_t *namespace_uri);
-       
+        axis2_status_t(AXIS2_CALL *
+                write_start_element_with_namespace)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *localname,
+                        axis2_char_t *namespace_uri);
+
         /**
          * write a start tag to output
          * @param writer pointer to xml_writer struct
@@ -110,12 +110,12 @@
          * @return status of the op 
                    AXIS2_SUCCESS on success. AXIS2_FAILURE on error.
          */
-        axis2_status_t (AXIS2_CALL *
-      write_start_element_with_namespace_prefix)(axiom_xml_writer_t *writer,
-                                       const axis2_env_t *env,
-                                       axis2_char_t *localname,
-                                       axis2_char_t *namespace_uri,
-                                       axis2_char_t *prefix);       
+        axis2_status_t(AXIS2_CALL *
+                write_start_element_with_namespace_prefix)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *localname,
+                        axis2_char_t *namespace_uri,
+                        axis2_char_t *prefix);
         /**
          * write an element tag with localname 
          * @param writer xml_writer
@@ -123,11 +123,11 @@
          * @param localname localname 
          * @return status of the op AXIS2_SUCCESS on success,
          *                AXIS2_FAILURE on error.
-         */         
-        axis2_status_t (AXIS2_CALL *
-      write_empty_element)(axiom_xml_writer_t *writer,
-                           const axis2_env_t *env,
-                      axis2_char_t *localname);
+         */
+        axis2_status_t(AXIS2_CALL *
+                write_empty_element)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *localname);
         /**
          * write empty_element with localname and namespace uri.
          * @param writer xml writer
@@ -137,12 +137,12 @@
          * @return status of the op, AXIS2_SUCCESS on success,
          *               AXIS2_FAILURE on error.
          */
-        
-        axis2_status_t (AXIS2_CALL *
-      write_empty_element_with_namespace)(axiom_xml_writer_t *writer,
-                                 const axis2_env_t *env,
-                                 axis2_char_t *localname,
-                                 axis2_char_t *namespace_uri);
+
+        axis2_status_t(AXIS2_CALL *
+                write_empty_element_with_namespace)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *localname,
+                        axis2_char_t *namespace_uri);
         /**
          * write empty element with namespace uri and prefix 
          * @param writer xml_writer
@@ -153,12 +153,12 @@
          * @return status of the op, AXIS2_SUCCESS on success,
          *                    AXIS2_FAILURE on error.
          */
-        axis2_status_t (AXIS2_CALL *
-      write_empty_element_with_namespace_prefix)(axiom_xml_writer_t *writer,
-                                       const axis2_env_t *env,
-                                       axis2_char_t *localname,
-                                       axis2_char_t *namespace_uri,
-                                       axis2_char_t *prefix);
+        axis2_status_t(AXIS2_CALL *
+                write_empty_element_with_namespace_prefix)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *localname,
+                        axis2_char_t *namespace_uri,
+                        axis2_char_t *prefix);
         /**
          * write end tag with correct localname prefix resolved internally 
          * @param writer xml writer
@@ -166,9 +166,9 @@
          * @return status of the op, AXIS2_SUCCESS on success,
          *            AXIS2_FAILURE on failure 
          */
-        axis2_status_t (AXIS2_CALL *
-      write_end_element)(axiom_xml_writer_t *writer,
-                           const axis2_env_t *env);
+        axis2_status_t(AXIS2_CALL *
+                write_end_element)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env);
         /**
          * write end document
          * @param writer xml writer
@@ -176,9 +176,9 @@
          * @return status of the op AXIS2_SUCCESS on success,
          *              AXIS2_FAILURE on error.
          */
-        axis2_status_t (AXIS2_CALL *
-      write_end_document)(axiom_xml_writer_t *writer,
-                            const axis2_env_t *env);
+        axis2_status_t(AXIS2_CALL *
+                write_end_document)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env);
         /**
          * write attribute with localname and value
          * @param writer writer
@@ -188,11 +188,11 @@
          * @return status of the op AXIS2_SUCCESS on success,
          *                 AXIS2_FAILURE on error.
          */
-        axis2_status_t (AXIS2_CALL *
-      write_attribute)(axiom_xml_writer_t *writer,
-                   const axis2_env_t *env,
-                   axis2_char_t *localname,
-                   axis2_char_t *value);
+        axis2_status_t(AXIS2_CALL *
+                write_attribute)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *localname,
+                        axis2_char_t *value);
         /**
          *  @param writer
          *  @param env environment
@@ -202,12 +202,12 @@
          *  @return status code of the op AXIS2_SUCCESS on success,
          *                    AXIS2_FAILURE on error.
          */
-        axis2_status_t (AXIS2_CALL *
-      write_attribute_with_namespace)(axiom_xml_writer_t *writer,
-                                const axis2_env_t *env,
-                                axis2_char_t *localname,
-                                axis2_char_t *value,
-                                axis2_char_t *namespace_uri);
+        axis2_status_t(AXIS2_CALL *
+                write_attribute_with_namespace)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *localname,
+                        axis2_char_t *value,
+                        axis2_char_t *namespace_uri);
         /**
          * @param writer xml_writer
          * @param env environment
@@ -215,14 +215,14 @@
          * @param value text value of attribute
          * @param namespace uri namespaceuri
          * @param prefix prefix 
-         */         
-        axis2_status_t (AXIS2_CALL *
-      write_attribute_with_namespace_prefix)(axiom_xml_writer_t *writer,
-                                                  const axis2_env_t *env,
-                                                  axis2_char_t *localname,
-                                                  axis2_char_t *value,
-                                                  axis2_char_t *namespace_uri,
-                                                  axis2_char_t *prefix);
+         */
+        axis2_status_t(AXIS2_CALL *
+                write_attribute_with_namespace_prefix)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *localname,
+                        axis2_char_t *value,
+                        axis2_char_t *namespace_uri,
+                        axis2_char_t *prefix);
         /**
          * @param writer xml_writer
          * @param env environment
@@ -231,12 +231,12 @@
          * @return status of op AXIS2_SUCCESS on success,
          *               AXIS2_FAILURE on error.
          */
-        
-        axis2_status_t (AXIS2_CALL *
-      write_namespace)(axiom_xml_writer_t *writer,
-                   const axis2_env_t *env,
-                   axis2_char_t *prefix,
-                   axis2_char_t *namespace_uri);   
+
+        axis2_status_t(AXIS2_CALL *
+                write_namespace)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *prefix,
+                        axis2_char_t *namespace_uri);
         /**
          * @param writer xml_writer
          * @param env environment
@@ -245,10 +245,10 @@
          *               AXIS2_FAILURE on error.
          */
 
-        axis2_status_t (AXIS2_CALL *
-      write_default_namespace)(axiom_xml_writer_t *writer,
-                         const axis2_env_t *env,
-                         axis2_char_t *namespace_uri);  
+        axis2_status_t(AXIS2_CALL *
+                write_default_namespace)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *namespace_uri);
         /**
          * @param writer xml_writer
          * @param env environment
@@ -256,12 +256,12 @@
          * @return status of op AXIS2_SUCCESS on success,
          *               AXIS2_FAILURE on error.
          */
-                                                    
 
-        axis2_status_t (AXIS2_CALL *
-      write_comment)(axiom_xml_writer_t *writer,
-                  const axis2_env_t *env,
-                  axis2_char_t *value);
+
+        axis2_status_t(AXIS2_CALL *
+                write_comment)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *value);
         /**
          * @param writer xml_writer
          * @param env environment
@@ -271,11 +271,11 @@
          */
 
 
-        axis2_status_t (AXIS2_CALL *
-      write_processing_instruction)(axiom_xml_writer_t *writer,
-                              const axis2_env_t *env,
-                              axis2_char_t *target);
-                                   
+        axis2_status_t(AXIS2_CALL *
+                write_processing_instruction)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *target);
+
         /**
          * @param writer xml_writer
          * @param env environment
@@ -284,26 +284,26 @@
          * @return status of op AXIS2_SUCCESS on success,
          *               AXIS2_FAILURE on error.
          */
-                                   
-        axis2_status_t (AXIS2_CALL *
-      write_processing_instruction_data)(axiom_xml_writer_t *writer,
-                                 const axis2_env_t *env,
-                                 axis2_char_t *target,
-                                 axis2_char_t *data);
-         
+
+        axis2_status_t(AXIS2_CALL *
+                write_processing_instruction_data)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *target,
+                        axis2_char_t *data);
+
         /**
          * @param writer xml_writer
          * @param env environment
          * @param data  cdata
          * @return status of op AXIS2_SUCCESS on success,
          *               AXIS2_FAILURE on error.
-         */                                           
-        axis2_status_t (AXIS2_CALL *
-      write_cdata)(axiom_xml_writer_t *writer,
-                const axis2_env_t *env,
-                axis2_char_t *data);
-        
-         
+         */
+        axis2_status_t(AXIS2_CALL *
+                write_cdata)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *data);
+
+
         /**
          * @param writer xml_writer
          * @param env environment
@@ -311,12 +311,12 @@
          * @return status of op AXIS2_SUCCESS on success,
          *               AXIS2_FAILURE on error.
          */
-        axis2_status_t (AXIS2_CALL *
-      write_dtd)(axiom_xml_writer_t *writer,
-               const axis2_env_t *env,
-               axis2_char_t *dtd); 
-        
-         
+        axis2_status_t(AXIS2_CALL *
+                write_dtd)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *dtd);
+
+
         /**
          * @param writer xml_writer
          * @param env environment
@@ -324,22 +324,22 @@
          * @return status of op AXIS2_SUCCESS on success,
          *               AXIS2_FAILURE on error.
          */
-        axis2_status_t (AXIS2_CALL *
-      write_entity_ref)(axiom_xml_writer_t *writer,
-                          const axis2_env_t *env,
-                          axis2_char_t *name); 
-         
+        axis2_status_t(AXIS2_CALL *
+                write_entity_ref)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *name);
+
         /**
          * @param writer xml_writer
          * @param env environment
          * @return status of op AXIS2_SUCCESS on success,
          *               AXIS2_FAILURE on error.
          */
-        axis2_status_t (AXIS2_CALL *
-      write_start_document)(axiom_xml_writer_t *writer,
-                              const axis2_env_t *env);  
-        
-         
+        axis2_status_t(AXIS2_CALL *
+                write_start_document)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env);
+
+
         /**
          * @param writer xml_writer
          * @param env environment
@@ -347,11 +347,11 @@
          * @return status of op AXIS2_SUCCESS on success,
          *               AXIS2_FAILURE on error.
          */
-        axis2_status_t (AXIS2_CALL *
-      write_start_document_with_version)(axiom_xml_writer_t *writer,
-                                           const axis2_env_t *env,
-                                           axis2_char_t *version);   
-         
+        axis2_status_t(AXIS2_CALL *
+                write_start_document_with_version)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *version);
+
         /**
          * @param writer xml_writer
          * @param env environment
@@ -360,24 +360,24 @@
          * @return status of op AXIS2_SUCCESS on success,
          *               AXIS2_FAILURE on error.
          */
-        axis2_status_t (AXIS2_CALL *
-      write_start_document_with_version_encoding)(axiom_xml_writer_t *writer,
-                                                    const axis2_env_t *env,
-                                                    axis2_char_t *version,
-                                                    axis2_char_t *encoding);
-         
+        axis2_status_t(AXIS2_CALL *
+                write_start_document_with_version_encoding)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *version,
+                        axis2_char_t *encoding);
+
         /**
          * @param writer xml_writer
          * @param env environment
          * @param text text 
          * @return status of op AXIS2_SUCCESS on success,
          *               AXIS2_FAILURE on error.
-         */                                         
-        axis2_status_t (AXIS2_CALL *
-      write_characters)(axiom_xml_writer_t *writer,
-                          const axis2_env_t *env,
-                          axis2_char_t *text);   
-         
+         */
+        axis2_status_t(AXIS2_CALL *
+                write_characters)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *text);
+
         /**
          * @param writer xml_writer
          * @param env environment
@@ -385,11 +385,11 @@
          * @return status of op AXIS2_SUCCESS on success,
          *               AXIS2_FAILURE on error.
          */
-       axis2_char_t* (AXIS2_CALL *
-      get_prefix)(axiom_xml_writer_t *writer,
-                   const axis2_env_t *env,
-                   axis2_char_t *uri);
-         
+        axis2_char_t*(AXIS2_CALL *
+                get_prefix)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *uri);
+
         /**
          * @param writer xml_writer
          * @param env environment
@@ -398,24 +398,24 @@
          * @return status of op AXIS2_SUCCESS on success,
          *               AXIS2_FAILURE on error.
          */
-       axis2_status_t (AXIS2_CALL *
-      set_prefix)(axiom_xml_writer_t *writer,
-                   const axis2_env_t *env,
-                   axis2_char_t *prefix,
-                   axis2_char_t *uri);
-         
+        axis2_status_t(AXIS2_CALL *
+                set_prefix)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *prefix,
+                        axis2_char_t *uri);
+
         /**
          * @param writer xml_writer
          * @param env environment
          * @param uri uri
          * @return status of op AXIS2_SUCCESS on success,
          *               AXIS2_FAILURE on error.
-         */                                                 
-       axis2_status_t (AXIS2_CALL *
-      set_default_prefix)(axiom_xml_writer_t *writer,
-                           const axis2_env_t *env,
-                           axis2_char_t *uri);                                                 
-         
+         */
+        axis2_status_t(AXIS2_CALL *
+                set_default_prefix)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *uri);
+
         /**
          * @param writer xml_writer
          * @param env environment
@@ -424,55 +424,55 @@
          * @return status of op AXIS2_SUCCESS on success,
          *               AXIS2_FAILURE on error.
          */
-        axis2_status_t (AXIS2_CALL *
-        write_encoded)(axiom_xml_writer_t *writer,
-                       const axis2_env_t *env,
-                       axis2_char_t *text,
-                       int in_attr);
-                                                 
-        void* (AXIS2_CALL *
-        get_xml)(axiom_xml_writer_t *writer,
-                 const axis2_env_t *env);                                                 
-
-        int (AXIS2_CALL *
-        get_type)(axiom_xml_writer_t *writer,
-                 const axis2_env_t *env);   
-
-        axis2_status_t (AXIS2_CALL *
-        write_raw)(axiom_xml_writer_t *writer,
-                   const axis2_env_t *env,
-                   axis2_char_t *content);
+        axis2_status_t(AXIS2_CALL *
+                write_encoded)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *text,
+                        int in_attr);
+
+        void*(AXIS2_CALL *
+                get_xml)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env);
+
+        int(AXIS2_CALL *
+                get_type)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env);
+
+        axis2_status_t(AXIS2_CALL *
+                write_raw)(axiom_xml_writer_t *writer,
+                        const axis2_env_t *env,
+                        axis2_char_t *content);
     };
 
-/** 
- * @brief axis2_pull_parser struct
-  *   Axis2 OM pull_parser
- */
+    /**
+     * @brief axis2_pull_parser struct
+      *   Axis2 OM pull_parser
+     */
 
-struct axiom_xml_writer
-{
-    axiom_xml_writer_ops_t *ops;    
-};    
+    struct axiom_xml_writer
+    {
+        axiom_xml_writer_ops_t *ops;
+    };
 
-/**
- *  create function for axiom_xml_writer
- *
- */
-AXIS2_EXTERN axiom_xml_writer_t * AXIS2_CALL
-axiom_xml_writer_create(const axis2_env_t *env,
-                        axis2_char_t *filename,
-                        axis2_char_t *encoding,
-                        int is_prefix_default,
-                        int compression);
-
-AXIS2_EXTERN axiom_xml_writer_t * AXIS2_CALL
-axiom_xml_writer_create_for_memory(const axis2_env_t *env,
-                                   axis2_char_t *encoding,
-                                   int is_prefix_default,
-                                   int compression,
-                           int type);
+    /**
+     *  create function for axiom_xml_writer
+     *
+     */
+    AXIS2_EXTERN axiom_xml_writer_t * AXIS2_CALL
+    axiom_xml_writer_create(const axis2_env_t *env,
+            axis2_char_t *filename,
+            axis2_char_t *encoding,
+            int is_prefix_default,
+            int compression);
+
+    AXIS2_EXTERN axiom_xml_writer_t * AXIS2_CALL
+    axiom_xml_writer_create_for_memory(const axis2_env_t *env,
+            axis2_char_t *encoding,
+            int is_prefix_default,
+            int compression,
+            int type);
 
-/********************** start macros *******************************************/
+    /********************** start macros *******************************************/
 
 #define AXIOM_XML_WRITER_FREE(writer, env) \
         ((writer)->ops->free(writer,env))
@@ -493,14 +493,14 @@
         writer, env, localname, namespace_uri, prefix) \
         ((writer)->ops->write_start_element_with_namespace_prefix(\
         writer,env,localname,namespace_uri,prefix))
-        
-        
+
+
 #define AXIOM_XML_WRITER_WRITE_EMPTY_ELEMENT(writer,env,localname) \
         ((writer)->ops->write_empty_element(writer,env,localname))
-        
+
 #define AXIOM_XML_WRITER_WRITE_EMPTY_ELEMENT_WITH_NAMESPACE(\
         writer, env,localname,namespace_uri) \
-        ((writer)->ops->write_empty_element_with_namespace(writer,env,localname,namespace_uri))       
+        ((writer)->ops->write_empty_element_with_namespace(writer,env,localname,namespace_uri))
 
 #define AXIOM_XML_WRITER_WRITE_EMPTY_ELEMENT_WITH_NAMESPACE_PREFIX(\
         writer, env, localname, namespace_uri, prefix) \
@@ -541,21 +541,21 @@
 
 #define AXIOM_XML_WRITER_WRITE_PROCESSING_INSTRUCTION_DATA(writer, env, target, data) \
         ((writer)->ops->write_processing_instruction_data(writer, env, target, data))
-        
+
 #define AXIOM_XML_WRITER_WRITE_CDATA(writer, env, data) \
-        ((writer)->ops->write_cdata(writer, env, data))        
+        ((writer)->ops->write_cdata(writer, env, data))
 
 #define AXIOM_XML_WRITER_WRITE_DTD(writer, env, dtd) \
-        ((writer)->ops->write_cdata(writer, env, dtd)) 
+        ((writer)->ops->write_cdata(writer, env, dtd))
 
 #define AXIOM_XML_WRITER_WRITE_ENTITY_REF(writer, env, entity_ref) \
-        ((writer)->ops->write_entity_ref(writer, env, entity_ref)) 
-        
+        ((writer)->ops->write_entity_ref(writer, env, entity_ref))
+
 #define AXIOM_XML_WRITER_WRITE_START_DOCUMENT(writer, env) \
-        ((writer)->ops->write_start_document(writer,env))        
+        ((writer)->ops->write_start_document(writer,env))
 
 #define AXIOM_XML_WRITER_WRITE_START_DOCUMENT_WITH_VERSION(writer, env, version) \
-        ((writer)->ops->write_start_document_with_version(writer, env, version)) 
+        ((writer)->ops->write_start_document_with_version(writer, env, version))
 
 #define AXIOM_XML_WRITER_WRITE_START_DOCUMENT_WITH_VERSION_ENCODING(\
         writer, env,  version, encoding) \
@@ -563,7 +563,7 @@
         writer, env, version, encoding))
 
 #define AXIOM_XML_WRITER_WRITE_CHARACTERS(writer, env, text) \
-        ((writer)->ops->write_characters(writer, env, text)) 
+        ((writer)->ops->write_characters(writer, env, text))
 
 #define AXIOM_XML_WRITER_GET_PREFIX(writer, env, uri) \
         ((writer)->ops->get_prefix(writer, env, uri))
@@ -576,17 +576,17 @@
 
 #define AXIOM_XML_WRITER_WRITE_ENCODED(writer, env, text, in_attr) \
         ((writer)->ops->write_encoded(writer, env, text, in_attr))
-        
+
 #define AXIOM_XML_WRITER_GET_XML(writer, env) \
-        ((writer)->ops->get_xml(writer, env))        
+        ((writer)->ops->get_xml(writer, env))
 
 #define AXIOM_XML_WRITER_GET_TYPE(writer, env) \
-        ((writer)->ops->get_type(writer, env)) 
+        ((writer)->ops->get_type(writer, env))
 
 #define AXIOM_XML_WRITER_WRITE_RAW(writer, env, content) \
-        ((writer)->ops->write_raw(writer, env, content)) 
+        ((writer)->ops->write_raw(writer, env, content))
 
-/** @} */
+    /** @} */
 
 
 #ifdef __cplusplus

Modified: webservices/axis2/trunk/c/axiom/src/om/om_attribute.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_attribute.c?view=diff&rev=495494&r1=495493&r2=495494
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_attribute.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_attribute.c Thu Jan 11 22:11:41 2007
@@ -19,11 +19,8 @@
 #include <string.h>
 #include <axis2_utils_defines.h>
 
-/*********************************** axiom_attribute_impl_t ************************/
-
-typedef struct axiom_attribute_impl
+struct axiom_attribute
 {
-    axiom_attribute_t om_attribute;
     /** localname of this attribute  */
     axis2_char_t *localname;
     /** value of this attribute */
@@ -32,160 +29,139 @@
     axiom_namespace_t *ns;
     /** store qname here */
     axis2_qname_t *qname;
-
-}
-axiom_attribute_impl_t;
-
-static const axiom_attribute_ops_t axiom_attribute_ops_var = {
-    0
+    int ref;
 };
 
-/***************************************** macro *******************************/
-
-#define AXIS2_INTF_TO_IMPL(om_attr) ((axiom_attribute_impl_t*)om_attr)
-
-
-/*************************************** ***************************************/
-
 AXIS2_EXTERN axiom_attribute_t* AXIS2_CALL
 axiom_attribute_create(const axis2_env_t *env,
         const axis2_char_t * localname,
         const axis2_char_t * value,
         axiom_namespace_t * ns)
 {
-    axiom_attribute_impl_t *attribute_impl = NULL;
+    axiom_attribute_t *attribute = NULL;
 
     AXIS2_ENV_CHECK(env, NULL);
     /* localname is mandatory */
     AXIS2_PARAM_CHECK(env->error, localname, NULL);
 
-    attribute_impl = (axiom_attribute_impl_t *) AXIS2_MALLOC(env->allocator,
-            sizeof(axiom_attribute_impl_t));
-    if (!attribute_impl)
+    attribute = (axiom_attribute_t *) AXIS2_MALLOC(env->allocator,
+            sizeof(axiom_attribute_t));
+    if (!attribute)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
     /**  initialize fields */
-    attribute_impl->localname = NULL;
-    attribute_impl->value     = NULL;
-    attribute_impl->ns        = NULL;
-    attribute_impl->om_attribute.ops = &axiom_attribute_ops_var;
-    attribute_impl->qname = NULL;
+    attribute->localname = NULL;
+    attribute->value     = NULL;
+    attribute->ns        = NULL;
+    attribute->qname = NULL;
 
-    attribute_impl->localname = (axis2_char_t*) AXIS2_STRDUP(localname, env);
-    if (!(attribute_impl->localname))
+    attribute->localname = (axis2_char_t*) AXIS2_STRDUP(localname, env);
+    if (!(attribute->localname))
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_FREE(env->allocator, attribute_impl);
+        AXIS2_FREE(env->allocator, attribute);
         return NULL;
     }
     if (value)
     {
-        attribute_impl->value = (axis2_char_t*) AXIS2_STRDUP(value, env);
-        if (!(attribute_impl->value))
+        attribute->value = (axis2_char_t*) AXIS2_STRDUP(value, env);
+        if (!(attribute->value))
         {
             AXIS2_ERROR_SET(env->error , AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-            AXIS2_FREE(env->allocator, attribute_impl->localname);
-            AXIS2_FREE(env->allocator, attribute_impl);
+            AXIS2_FREE(env->allocator, attribute->localname);
+            AXIS2_FREE(env->allocator, attribute);
             return NULL;
         }
     }
-    attribute_impl->ns = ns;
+    attribute->ns = ns;
 
-    attribute_impl->om_attribute.ref = 0;
+    attribute->ref = 0;
 
-    return &(attribute_impl->om_attribute);
+    return attribute;
 }
 
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axiom_attribute_free(axiom_attribute_t *om_attribute,
+axiom_attribute_free(axiom_attribute_t *attribute,
         const axis2_env_t *env)
 {
-    axiom_attribute_impl_t *attribute_impl = NULL;
-
-    if (--om_attribute->ref > 0)
+    if (--attribute->ref > 0)
 	  return AXIS2_SUCCESS;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    attribute_impl = AXIS2_INTF_TO_IMPL(om_attribute);
 
-    if (attribute_impl->localname)
+    if (attribute->localname)
     {
-        AXIS2_FREE(env->allocator, attribute_impl->localname);
-        attribute_impl->localname = NULL;
+        AXIS2_FREE(env->allocator, attribute->localname);
+        attribute->localname = NULL;
     }
-    if (attribute_impl->value)
+    if (attribute->value)
     {
-        AXIS2_FREE(env->allocator, attribute_impl->value);
-        attribute_impl->value = NULL;
+        AXIS2_FREE(env->allocator, attribute->value);
+        attribute->value = NULL;
     }
-    if (attribute_impl->qname)
+    if (attribute->qname)
     {
-        AXIS2_QNAME_FREE(attribute_impl->qname, env);
-        attribute_impl->qname = NULL;
+        AXIS2_QNAME_FREE(attribute->qname, env);
+        attribute->qname = NULL;
     }
     
-    AXIS2_FREE(env->allocator, attribute_impl);
+    AXIS2_FREE(env->allocator, attribute);
 
     return AXIS2_SUCCESS;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axiom_attribute_free_void_arg(
-    void *om_attribute,
+    void *attribute,
     const axis2_env_t *env)
 {
     axiom_attribute_t *om_attribute_l = NULL;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    om_attribute_l = (axiom_attribute_t *) om_attribute;
+    om_attribute_l = (axiom_attribute_t *) attribute;
     return axiom_attribute_free(om_attribute_l, env);
 }
 
 
 AXIS2_EXTERN axis2_qname_t * AXIS2_CALL
-axiom_attribute_get_qname(axiom_attribute_t *om_attribute,
+axiom_attribute_get_qname(axiom_attribute_t *attribute,
         const axis2_env_t *env)
 {
     axis2_qname_t *qname = NULL;
-    axiom_attribute_impl_t *attribute_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    attribute_impl = AXIS2_INTF_TO_IMPL(om_attribute);
-    if (!(attribute_impl->qname))
+    if (!(attribute->qname))
     {
-        if (attribute_impl->ns)
+        if (attribute->ns)
         {
             qname = axis2_qname_create(env,
-                    attribute_impl->localname,
-                    AXIOM_NAMESPACE_GET_URI(attribute_impl->ns, env),
-                    AXIOM_NAMESPACE_GET_PREFIX(attribute_impl->ns, env));
+                    attribute->localname,
+                    AXIOM_NAMESPACE_GET_URI(attribute->ns, env),
+                    AXIOM_NAMESPACE_GET_PREFIX(attribute->ns, env));
         }
         else
         {
-            qname = axis2_qname_create(env, attribute_impl->localname,
+            qname = axis2_qname_create(env, attribute->localname,
                     NULL,  NULL);
         }
-        attribute_impl->qname = qname;
+        attribute->qname = qname;
         return qname;
     }
-    return attribute_impl->qname;
+    return attribute->qname;
 }
 
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axiom_attribute_serialize(axiom_attribute_t *om_attribute,
+axiom_attribute_serialize(axiom_attribute_t *attribute,
         const axis2_env_t *env,
         axiom_output_t *om_output)
 {
     int status = AXIS2_SUCCESS;
-    axiom_attribute_impl_t *attribute = NULL;
-
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, om_output, AXIS2_FAILURE);
-    attribute = AXIS2_INTF_TO_IMPL(om_attribute);
 
     if (attribute->ns)
     {
@@ -217,49 +193,47 @@
 }
 
 AXIS2_EXTERN axis2_char_t* AXIS2_CALL
-axiom_attribute_get_localname(axiom_attribute_t *om_attribute,
+axiom_attribute_get_localname(axiom_attribute_t *attribute,
         const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return AXIS2_INTF_TO_IMPL(om_attribute)->localname;
+    return attribute->localname;
 
 }
 
 AXIS2_EXTERN axis2_char_t* AXIS2_CALL
-axiom_attribute_get_value(axiom_attribute_t *om_attribute,
+axiom_attribute_get_value(axiom_attribute_t *attribute,
         const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return AXIS2_INTF_TO_IMPL(om_attribute)->value;
+    return attribute->value;
 }
 
 AXIS2_EXTERN axiom_namespace_t* AXIS2_CALL
-axiom_attribute_get_namespace(axiom_attribute_t *om_attribute,
+axiom_attribute_get_namespace(axiom_attribute_t *attribute,
         const axis2_env_t *env)
 {
     AXIS2_ENV_CHECK(env, NULL);
-    return AXIS2_INTF_TO_IMPL(om_attribute)->ns;
+    return attribute->ns;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axiom_attribute_set_localname(axiom_attribute_t *om_attribute,
+axiom_attribute_set_localname(axiom_attribute_t *attribute,
         const axis2_env_t *env,
         const axis2_char_t *localname)
 {
-    axiom_attribute_impl_t *attr_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE);
-    attr_impl = AXIS2_INTF_TO_IMPL(om_attribute);
 
-    if ((attr_impl->localname))
+    if ((attribute->localname))
     {
-        AXIS2_FREE(env->allocator, attr_impl->localname);
-        attr_impl->localname = NULL;
+        AXIS2_FREE(env->allocator, attribute->localname);
+        attribute->localname = NULL;
     }
 
-    attr_impl->localname = (axis2_char_t*)AXIS2_STRDUP(localname, env);
+    attribute->localname = (axis2_char_t*)AXIS2_STRDUP(localname, env);
 
-    if (!(attr_impl->localname))
+    if (!(attribute->localname))
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return AXIS2_FAILURE;
@@ -269,23 +243,21 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axiom_attribute_set_value(axiom_attribute_t *om_attribute,
+axiom_attribute_set_value(axiom_attribute_t *attribute,
         const axis2_env_t *env,
         const axis2_char_t *value)
 {
-    axiom_attribute_impl_t *attr_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE);
 
-    attr_impl = AXIS2_INTF_TO_IMPL(om_attribute);
-    if (attr_impl->value)
+    if (attribute->value)
     {
-        AXIS2_FREE(env->allocator, attr_impl->value);
-        attr_impl->value = NULL;
+        AXIS2_FREE(env->allocator, attribute->value);
+        attribute->value = NULL;
     }
 
-    attr_impl->value = (axis2_char_t*)AXIS2_STRDUP(value, env);
-    if (!(attr_impl->value))
+    attribute->value = (axis2_char_t*)AXIS2_STRDUP(value, env);
+    if (!(attribute->value))
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return AXIS2_FAILURE;
@@ -294,36 +266,42 @@
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axiom_attribute_set_namespace(axiom_attribute_t *om_attribute,
+axiom_attribute_set_namespace(axiom_attribute_t *attribute,
         const axis2_env_t *env,
         axiom_namespace_t *om_namespace)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_FUNC_PARAM_CHECK(om_namespace, env, AXIS2_FAILURE);
-    AXIS2_INTF_TO_IMPL(om_attribute)->ns = om_namespace;
+    attribute->ns = om_namespace;
     return AXIS2_SUCCESS;
 }
 
 AXIS2_EXTERN axiom_attribute_t* AXIS2_CALL
-axiom_attribute_clone(axiom_attribute_t *om_attribute,
+axiom_attribute_clone(axiom_attribute_t *attribute,
         const axis2_env_t *env)
 {
-    axiom_attribute_impl_t *attr_impl = NULL;
     axiom_attribute_t *cloned_attr    = NULL;
-    if (!om_attribute) return NULL;
+    if (!attribute) return NULL;
     AXIS2_ENV_CHECK(env, NULL);
 
-    attr_impl = AXIS2_INTF_TO_IMPL(om_attribute);
-
     /** namespace is not cloned since it is a shollow copy*/
     cloned_attr = axiom_attribute_create(env,
-            attr_impl->localname,
-            attr_impl->value,
-            attr_impl->ns);
+            attribute->localname,
+            attribute->value,
+            attribute->ns);
     if (cloned_attr)
     {
         return cloned_attr;
     }
     return NULL;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL 
+axiom_attribute_increment_ref(struct axiom_attribute *om_attribute,
+    const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    om_attribute->ref++;
+    return AXIS2_SUCCESS;
 }
 

Modified: webservices/axis2/trunk/c/axiom/src/om/om_children_iterator.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_children_iterator.c?view=diff&rev=495494&r1=495493&r2=495494
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_children_iterator.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_children_iterator.c Thu Jan 11 22:11:41 2007
@@ -17,64 +17,43 @@
 
 #include <axiom_children_iterator.h>
 
-/************** function prototypes *************************************/
-
-/*************** end function prototypes **********************************/
-
-typedef struct axiom_children_iterator_impl_t
+struct axiom_children_iterator
 {
-    axiom_children_iterator_t iterator;
     axiom_node_t *first_child;
     axiom_node_t *current_child;
     axiom_node_t *last_child;
     axis2_bool_t next_called;
     axis2_bool_t remove_called;
-}
-axiom_children_iterator_impl_t;
-
-static const axiom_children_iterator_ops_t axiom_children_iterator_ops_var = {
-    0
 };
 
-/***************** end impl struct ****************************************/
-
-#define AXIS2_INTF_TO_IMPL(iterator) \
-        ((axiom_children_iterator_impl_t *)iterator)
-
-/**************** end macro ***********************************************/
-
-
-
 AXIS2_EXTERN  axiom_children_iterator_t * AXIS2_CALL
 axiom_children_iterator_create(const axis2_env_t *env,
         axiom_node_t *current_child)
 {
-    axiom_children_iterator_impl_t *iterator_impl = NULL;
+    axiom_children_iterator_t *iterator = NULL;
     AXIS2_ENV_CHECK(env, NULL);
 
-    iterator_impl = (axiom_children_iterator_impl_t *)AXIS2_MALLOC(
+    iterator = (axiom_children_iterator_t *)AXIS2_MALLOC(
                 env->allocator,
-                sizeof(axiom_children_iterator_impl_t));
+                sizeof(axiom_children_iterator_t));
 
-    if (!iterator_impl)
+    if (!iterator)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    iterator_impl->current_child = NULL;
-    iterator_impl->last_child    = NULL;
-    iterator_impl->first_child    = NULL;
-
-    iterator_impl->next_called = AXIS2_FALSE;
-    iterator_impl->remove_called = AXIS2_FALSE;
+    iterator->current_child = NULL;
+    iterator->last_child    = NULL;
+    iterator->first_child    = NULL;
 
-    iterator_impl->first_child = current_child;
-    iterator_impl->current_child = current_child;
+    iterator->next_called = AXIS2_FALSE;
+    iterator->remove_called = AXIS2_FALSE;
 
-    iterator_impl->iterator.ops = &axiom_children_iterator_ops_var;
+    iterator->first_child = current_child;
+    iterator->current_child = current_child;
 
-    return &(iterator_impl->iterator);
+    return iterator;
 }
 
 
@@ -84,7 +63,7 @@
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(iterator));
+    AXIS2_FREE(env->allocator, iterator);
     return AXIS2_SUCCESS;
 }
 
@@ -92,27 +71,25 @@
 axiom_children_iterator_remove(axiom_children_iterator_t *iterator,
         const axis2_env_t *env)
 {
-    axiom_children_iterator_impl_t *iterator_impl = NULL;
     axiom_node_t *om_node = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    iterator_impl = AXIS2_INTF_TO_IMPL(iterator);
 
-    if (!(iterator_impl->next_called))
+    if (!(iterator->next_called))
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_ITERATOR_NEXT_METHOD_HAS_NOT_YET_BEEN_CALLED, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    if (iterator_impl->remove_called)
+    if (iterator->remove_called)
     {
         AXIS2_ERROR_SET(env->error,
                 AXIS2_ERROR_ITERATOR_REMOVE_HAS_ALREADY_BEING_CALLED, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    iterator_impl->remove_called = AXIS2_TRUE;
+    iterator->remove_called = AXIS2_TRUE;
 
-    if (!(iterator_impl->last_child))
+    if (!(iterator->last_child))
         return AXIS2_FAILURE;
-    om_node = AXIOM_NODE_DETACH(iterator_impl->last_child, env);
+    om_node = AXIOM_NODE_DETACH(iterator->last_child, env);
     if (om_node)
     {
         AXIOM_NODE_FREE_TREE(om_node, env);
@@ -125,29 +102,25 @@
 axiom_children_iterator_has_next(axiom_children_iterator_t *iterator,
         const axis2_env_t *env)
 {
-    axiom_children_iterator_impl_t *iterator_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    iterator_impl = AXIS2_INTF_TO_IMPL(iterator);
 
-    return (iterator_impl->current_child) ? AXIS2_TRUE : AXIS2_FALSE;
+    return (iterator->current_child) ? AXIS2_TRUE : AXIS2_FALSE;
 }
 
 AXIS2_EXTERN axiom_node_t* AXIS2_CALL
 axiom_children_iterator_next(axiom_children_iterator_t *iterator,
         const axis2_env_t *env)
 {
-    axiom_children_iterator_impl_t *iterator_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    iterator_impl = AXIS2_INTF_TO_IMPL(iterator);
 
-    iterator_impl->next_called = AXIS2_TRUE;
-    iterator_impl->remove_called = AXIS2_FALSE;
-    if (iterator_impl->current_child)
+    iterator->next_called = AXIS2_TRUE;
+    iterator->remove_called = AXIS2_FALSE;
+    if (iterator->current_child)
     {
-        iterator_impl->last_child = iterator_impl->current_child;
-        iterator_impl->current_child = AXIOM_NODE_GET_NEXT_SIBLING(
-                    iterator_impl->current_child, env);
-        return iterator_impl->last_child;
+        iterator->last_child = iterator->current_child;
+        iterator->current_child = AXIOM_NODE_GET_NEXT_SIBLING(
+                    iterator->current_child, env);
+        return iterator->last_child;
     }
     return NULL;
 }
@@ -156,11 +129,9 @@
 axiom_children_iterator_reset(axiom_children_iterator_t *iterator,
         const axis2_env_t *env)
 {
-    axiom_children_iterator_impl_t *iterator_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    iterator_impl = AXIS2_INTF_TO_IMPL(iterator);
 
-    iterator_impl->current_child = iterator_impl->first_child;
+    iterator->current_child = iterator->first_child;
     return AXIS2_SUCCESS;
 }
 

Modified: webservices/axis2/trunk/c/axiom/src/om/om_children_qname_iterator.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_children_qname_iterator.c?view=diff&rev=495494&r1=495493&r2=495494
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_children_qname_iterator.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_children_qname_iterator.c Thu Jan 11 22:11:41 2007
@@ -18,18 +18,13 @@
 #include <axiom_children_qname_iterator.h>
 #include <axiom_element.h>
 
-/************** function prototypes *************************************/
-
 static axis2_bool_t AXIS2_CALL
 axiom_children_qname_iterator_qname_matches(const axis2_env_t *env,
         axis2_qname_t *element_qname,
                 axis2_qname_t *qname_to_match);
 
-/****************** impl struct ***********************************************/
-
-typedef struct axiom_children_qname_iterator_impl_t
+struct axiom_children_qname_iterator
 {
-    axiom_children_qname_iterator_t iterator;
     axiom_node_t *current_child;
     axiom_node_t *last_child;
     axis2_bool_t next_called;
@@ -38,78 +33,62 @@
     axis2_bool_t need_to_move_forward;
     axis2_bool_t matching_node_found;
 
-}
-axiom_children_qname_iterator_impl_t;
-
-static const axiom_children_qname_iterator_ops_t axiom_children_qname_iterator_ops_var = {
-    0
 };
 
-/*************************** Macro *********************************************/
-
-#define AXIS2_INTF_TO_IMPL(iterator) \
-        ((axiom_children_qname_iterator_impl_t*)iterator)
-
-/*******************************************************************************/
-
 AXIS2_EXTERN axiom_children_qname_iterator_t * AXIS2_CALL
 axiom_children_qname_iterator_create(const axis2_env_t *env,
         axiom_node_t *current_child,
         axis2_qname_t *given_qname)
 {
-    axiom_children_qname_iterator_impl_t *iterator_impl = NULL;
+    axiom_children_qname_iterator_t *iterator = NULL;
 
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, current_child, NULL);
 
-    iterator_impl = (axiom_children_qname_iterator_impl_t*)AXIS2_MALLOC(
+    iterator = (axiom_children_qname_iterator_t*)AXIS2_MALLOC(
                 env->allocator,
-                sizeof(axiom_children_qname_iterator_impl_t));
+                sizeof(axiom_children_qname_iterator_t));
 
-    if (!iterator_impl)
+    if (!iterator)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    iterator_impl->iterator.ops = &axiom_children_qname_iterator_ops_var;
-    iterator_impl->current_child = NULL;
-    iterator_impl->last_child = NULL;
-    iterator_impl->need_to_move_forward = AXIS2_TRUE;
-    iterator_impl->matching_node_found = AXIS2_FALSE;
-    iterator_impl->next_called = AXIS2_FALSE;
-    iterator_impl->remove_called = AXIS2_FALSE;
-    iterator_impl->given_qname = NULL;
+    iterator->current_child = NULL;
+    iterator->last_child = NULL;
+    iterator->need_to_move_forward = AXIS2_TRUE;
+    iterator->matching_node_found = AXIS2_FALSE;
+    iterator->next_called = AXIS2_FALSE;
+    iterator->remove_called = AXIS2_FALSE;
+    iterator->given_qname = NULL;
 
-    iterator_impl->current_child = current_child;
+    iterator->current_child = current_child;
     if (given_qname)
     {
-        iterator_impl->given_qname = AXIS2_QNAME_CLONE(given_qname, env);
-        if (!(iterator_impl->given_qname))
+        iterator->given_qname = AXIS2_QNAME_CLONE(given_qname, env);
+        if (!(iterator->given_qname))
         {
-            AXIOM_CHILDREN_QNAME_ITERATOR_FREE(&(iterator_impl->iterator), env);
+            AXIOM_CHILDREN_QNAME_ITERATOR_FREE(iterator, env);
             return NULL;
         }
     }
     
-    return &(iterator_impl->iterator);
+    return iterator;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axiom_children_qname_iterator_free(axiom_children_qname_iterator_t *iterator,
         const axis2_env_t *env)
 {
-    axiom_children_qname_iterator_impl_t *iterator_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    iterator_impl = AXIS2_INTF_TO_IMPL(iterator);
-
-    if (iterator_impl->given_qname)
+    if (iterator->given_qname)
     {
-        AXIS2_QNAME_FREE(iterator_impl->given_qname, env);
-        iterator_impl->given_qname = NULL;
+        AXIS2_QNAME_FREE(iterator->given_qname, env);
+        iterator->given_qname = NULL;
     }
-    AXIS2_FREE(env->allocator, iterator_impl);
+    AXIS2_FREE(env->allocator, iterator);
     return AXIS2_SUCCESS;
 }
 
@@ -117,28 +96,26 @@
 axiom_children_qname_iterator_remove(axiom_children_qname_iterator_t *iterator,
         const axis2_env_t *env)
 {
-    axiom_children_qname_iterator_impl_t *iterator_impl = NULL;
     axiom_node_t *last_child = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    iterator_impl = AXIS2_INTF_TO_IMPL(iterator);
 
-    if (!(iterator_impl->next_called))
+    if (!(iterator->next_called))
     {
         AXIS2_ERROR_SET(env->error,
                 AXIS2_ERROR_ITERATOR_NEXT_METHOD_HAS_NOT_YET_BEEN_CALLED, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    if (iterator_impl->remove_called)
+    if (iterator->remove_called)
     {
         AXIS2_ERROR_SET(env->error,
                 AXIS2_ERROR_ITERATOR_REMOVE_HAS_ALREADY_BEING_CALLED, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    iterator_impl->remove_called = AXIS2_TRUE;
+    iterator->remove_called = AXIS2_TRUE;
 
-    if (!(iterator_impl->last_child))
+    if (!(iterator->last_child))
         return AXIS2_FAILURE;
-    last_child = AXIOM_NODE_DETACH(iterator_impl->last_child, env);
+    last_child = AXIOM_NODE_DETACH(iterator->last_child, env);
     if (last_child)
     {
         AXIOM_NODE_FREE_TREE(last_child, env);
@@ -152,52 +129,49 @@
 (axiom_children_qname_iterator_t *iterator,
         const axis2_env_t *env)
 {
-    axiom_children_qname_iterator_impl_t *iterator_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FALSE);
 
-    iterator_impl = AXIS2_INTF_TO_IMPL(iterator);
-
-    while (iterator_impl->need_to_move_forward)
+    while (iterator->need_to_move_forward)
     {
-        if (iterator_impl->current_child)
+        if (iterator->current_child)
         {
             axiom_element_t *om_element = NULL;
-            if (AXIOM_NODE_GET_NODE_TYPE(iterator_impl->current_child, env) == AXIOM_ELEMENT)
+            if (AXIOM_NODE_GET_NODE_TYPE(iterator->current_child, env) == AXIOM_ELEMENT)
             {
                 om_element = (axiom_element_t *)AXIOM_NODE_GET_DATA_ELEMENT(
-                            iterator_impl->current_child, env);
+                            iterator->current_child, env);
             }
 
             if (om_element &&
                     axiom_children_qname_iterator_qname_matches(env,
-                            AXIOM_ELEMENT_GET_QNAME(om_element, env, iterator_impl->current_child),
-                            iterator_impl->given_qname))
+                            AXIOM_ELEMENT_GET_QNAME(om_element, env, iterator->current_child),
+                            iterator->given_qname))
             {
-                iterator_impl->matching_node_found = AXIS2_TRUE;
-                iterator_impl->need_to_move_forward = AXIS2_FALSE;
+                iterator->matching_node_found = AXIS2_TRUE;
+                iterator->need_to_move_forward = AXIS2_FALSE;
 
             }
             else
             {
-                iterator_impl->current_child = AXIOM_NODE_GET_NEXT_SIBLING(iterator_impl->current_child, env);
-                if (iterator_impl->current_child)
+                iterator->current_child = AXIOM_NODE_GET_NEXT_SIBLING(iterator->current_child, env);
+                if (iterator->current_child)
                 {
-                    iterator_impl->need_to_move_forward = AXIS2_TRUE;
-                    iterator_impl->matching_node_found = AXIS2_TRUE;
+                    iterator->need_to_move_forward = AXIS2_TRUE;
+                    iterator->matching_node_found = AXIS2_TRUE;
                 }
                 else
                 {
-                    iterator_impl->need_to_move_forward = AXIS2_FALSE;
-                    iterator_impl->matching_node_found = AXIS2_FALSE;
+                    iterator->need_to_move_forward = AXIS2_FALSE;
+                    iterator->matching_node_found = AXIS2_FALSE;
                 }
             }
         }
         else
         {
-            iterator_impl->need_to_move_forward = AXIS2_FALSE;
+            iterator->need_to_move_forward = AXIS2_FALSE;
         }
     }
-    return iterator_impl->matching_node_found;
+    return iterator->matching_node_found;
 
 }
 
@@ -205,23 +179,20 @@
 axiom_children_qname_iterator_next(axiom_children_qname_iterator_t *iterator,
         const axis2_env_t *env)
 {
-    axiom_children_qname_iterator_impl_t *iterator_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
 
-    iterator_impl = AXIS2_INTF_TO_IMPL(iterator);
-
-    iterator_impl->need_to_move_forward = AXIS2_TRUE;
-    iterator_impl->matching_node_found = AXIS2_FALSE;
-    iterator_impl->next_called = AXIS2_TRUE;
-    iterator_impl->remove_called = AXIS2_FALSE;
+    iterator->need_to_move_forward = AXIS2_TRUE;
+    iterator->matching_node_found = AXIS2_FALSE;
+    iterator->next_called = AXIS2_TRUE;
+    iterator->remove_called = AXIS2_FALSE;
 
-    iterator_impl->last_child = iterator_impl->current_child;
-    if (iterator_impl->current_child)
+    iterator->last_child = iterator->current_child;
+    if (iterator->current_child)
     {
-        iterator_impl->current_child =
-            AXIOM_NODE_GET_NEXT_SIBLING(iterator_impl->current_child, env);
+        iterator->current_child =
+            AXIOM_NODE_GET_NEXT_SIBLING(iterator->current_child, env);
     }
-    return iterator_impl->last_child;
+    return iterator->last_child;
 }
 
 static axis2_bool_t AXIS2_CALL



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