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 sa...@apache.org on 2005/10/18 05:59:13 UTC

svn commit: r326022 - in /webservices/axis2/trunk/c/include: axis2_error.h axis2_om_comment.h axis2_om_document.h axis2_om_element.h axis2_om_namespace.h axis2_om_node.h axis2_om_text.h

Author: samisa
Date: Mon Oct 17 20:59:00 2005
New Revision: 326022

URL: http://svn.apache.org/viewcvs?rev=326022&view=rev
Log:
Added changes related to envioronment

Added:
    webservices/axis2/trunk/c/include/axis2_om_element.h
Modified:
    webservices/axis2/trunk/c/include/axis2_error.h
    webservices/axis2/trunk/c/include/axis2_om_comment.h
    webservices/axis2/trunk/c/include/axis2_om_document.h
    webservices/axis2/trunk/c/include/axis2_om_namespace.h
    webservices/axis2/trunk/c/include/axis2_om_node.h
    webservices/axis2/trunk/c/include/axis2_om_text.h

Modified: webservices/axis2/trunk/c/include/axis2_error.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_error.h?rev=326022&r1=326021&r2=326022&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_error.h (original)
+++ webservices/axis2/trunk/c/include/axis2_error.h Mon Oct 17 20:59:00 2005
@@ -44,7 +44,9 @@
 typedef enum axis2_error_codes {
     AXIS2_ERROR_NONE = 0,
     AXIS2_ERROR_NO_MEMORY,
-    AXIS2_ERROR_INVALID_NULL_PARAMETER
+    AXIS2_ERROR_INVALID_NULL_PARAMETER,
+    AXIS2_ERROR_INVALID_ITERATOR_STATE,
+    AXIS2_ERROR_INVALID_NODE_TYPE
 } axis2_error_codes_t;
 
 

Modified: webservices/axis2/trunk/c/include/axis2_om_comment.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_comment.h?rev=326022&r1=326021&r2=326022&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_comment.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_comment.h Mon Oct 17 20:59:00 2005
@@ -23,11 +23,26 @@
  */
 
 #include <axis2_om_node.h>
+ 
+struct axis2_om_comment;
+struct axis2_om_comment_ops;
+    
+typedef struct axis2_om_comment_ops
+{
+  /**
+    * Free a axis2_comment struct
+    * @param comment pointer to the axis2_commnet 
+    *
+    */
+    axis2_status_t (*axis2_om_comment_ops_free)(axis2_environment_t *environment, struct axis2_om_comment *comment);
+
+} axis2_om_comment_ops_t;
 
-typedef struct axis2_om_comment_t
+typedef struct axis2_om_comment
 {
+    axis2_om_comment_ops_t *ops;
 	char *value;
-}axis2_om_comment_t;
+} axis2_om_comment_t;
 
 /**
  * Create a comment struct and stores in in a node struct and returns a pointer
@@ -39,30 +54,8 @@
  *        this node struct pointer
  * @return pointer to a node_t struct containing the comment struct
  */
-axis2_om_comment_t *axis2_om_comment_create(const char *value,axis2_om_node_t *comment_node);
-
-/**
- *	free a axis2_comment struct
- * @param comment pointer to the axis2_commnet 
- *
- */
-
-void axis2_om_comment_free(axis2_om_comment_t *comment);
-
-/**
- *  to get the value of a existing comment node	
- * @param comment_node pointer to comment node
- */
-
-char *axis2_om_comment_get_value(axis2_om_node_t *comment_node);
-
-/**
- *  to set the value of a existing comment node	
- * @param comment_node pointer to comment node
- */
-
-
-void axis2_om_comment_set_value(axis2_om_node_t *comment_node,const char *value);
+axis2_om_comment_t *axis2_om_comment_create(axis2_environment_t *environment, const axis2_char_t *value, axis2_om_node_t **comment_node);
 
+#define axis2_om_comment_free(environment, comment) ((comment)->ops->axis2_om_comment_ops_free(environment, comment))
 
-#endif // AXIS2_OM_COMMENT_H
+#endif /* AXIS2_OM_COMMENT_H */

Modified: webservices/axis2/trunk/c/include/axis2_om_document.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_document.h?rev=326022&r1=326021&r2=326022&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_document.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_document.h Mon Oct 17 20:59:00 2005
@@ -17,7 +17,9 @@
 #ifndef AXIS2_OM_DOCUMENT_H
 #define AXIS2_OM_DOCUMENT_H
 
+#include <axis2_environment.h>
 #include <axis2_om_node.h>
+#include <axis2_defines.h>
 
 /*typedef struct axis2_om_stax_builder_t axis2_om_stax_builder_t;*/
 
@@ -32,76 +34,80 @@
 #define CHAR_SET_ENCODING "UTF-8"
 #define XML_VERSION	"1.0"
 
-
-typedef struct axis2_om_document_t
+/** @cond */
+struct axis2_om_document;
+struct axis2_om_document_ops;
+/** @endcond */
+    
+/** @struct axis2_om_document_ops
+    @brief OM document operations struct
+
+    Encapsulator struct for operations of axis2_om_document_t
+*/
+typedef struct axis2_om_document_ops
 {
-	axis2_om_node_t *root_element;
-	axis2_om_node_t *last_child;
-	axis2_om_node_t *first_child;
-	int done;
-	axis2_om_stax_builder_t *builder;
-	char *char_set_encoding;
-	char *xml_version;
+  
+    /** 
+     *  Free axis2_om_document_t struct
+     *	@param document 
+     */
+    axis2_status_t (*axis2_om_document_ops_free)(axis2_environment_t *environment, struct axis2_om_document *document);
 
-}axis2_om_document_t;
+    /**
+     *	causes the parser to proceed if the xml input is not finised yet
+     *	@param document 
+     */
+    axis2_status_t (*axis2_om_document_ops_build_next)(axis2_environment_t *environment, struct axis2_om_document *document);
 
+    /**
+     *	adds the child node as a child to the back of the list
+     */
+    axis2_status_t (*axis2_om_document_ops_add_child)(axis2_environment_t *environment, struct axis2_om_document *document,axis2_om_node_t *child);
 
-/**
- *	creates and returns axis2_om_document returns null if there isn't enough memory
- *  @param root_ele pointer to document's root node IF NUll is parsed a document root
- *         will be set to NULL
- *  @param builder pointer to xml builder 
- */
+    /**
+     *	This cause the parser to proceed 	
+     *	@param document
+     *	@ returns The first 
+     */
+    axis2_om_node_t *(*axis2_om_document_ops_get_root_element)(axis2_environment_t *environment, struct axis2_om_document *document);
 
-axis2_om_document_t *axis2_om_document_create(axis2_om_node_t *root_ele,axis2_om_stax_builder_t *builder);
+    axis2_om_node_t *(*axis2_om_document_ops_get_next_sibling)(axis2_environment_t *environment, struct axis2_om_document *document);
 
-/** 
- *  Free axis2_om_document_t struct
- *	@param document 
- */
 
+    axis2_om_node_t *(*axis2_om_document_ops_get_first_child)(axis2_environment_t *environment, struct axis2_om_document *document);
 
-void axis2_free_om_document(axis2_om_document_t *document);
-
-/**
- *	causes the parser to proceed if the xml input is not finised yet
- *	@param document 
- */
-
-
-void axis2_om_document_build_next(axis2_om_document_t *document);
-
-/**
- *	adds the child node as a child to the back of the list
- */
-void axis2_om_document_add_child(axis2_om_document_t *document,axis2_om_node_t *child);
-
-/**
- *	This cause the parser to proceed 	
- *	@param document
- *	@ returns The first 
- */
+    axis2_om_node_t *(*axis2_om_document_ops_get_next_child)(axis2_environment_t *environment, struct axis2_om_document *document);
+} axis2_om_document_ops_t;
 
 
-axis2_om_node_t *axis2_om_document_get_root_element(axis2_om_document_t *document);
+typedef struct axis2_om_document
+{
+    axis2_om_document_ops_t *ops;
+	axis2_om_node_t *root_element;
+	axis2_om_node_t *last_child;
+	axis2_om_node_t *first_child;
+	axis2_bool_t done;
+	axis2_om_stax_builder_t *builder;
+	axis2_char_t *char_set_encoding;
+	axis2_char_t *xml_version;
 
-/**
- * set the CHAR SET ENCODING of this document
- */
-void axis2_document_set_char_set_encoding(axis2_om_document_t *char_set_encoding);
+}axis2_om_document_t;
 
 /**
- * set the xml version of this document
- */
-void axis2_document_set_xmlversion(axis2_om_document_t *document);
-
-
-axis2_om_node_t *axis2_om_document_get_next_sibling(axis2_om_document_t *document);
-
-
-axis2_om_node_t *axis2_om_document_get_first_child(axis2_om_document_t *document);
-
-axis2_om_node_t *axis2_om_document_get_current_child(axis2_om_document_t *document);
+    *	creates and returns axis2_om_document returns null if there isn't enough memory
+    *  @param root pointer to document's root node IF NUll is parsed a document root
+    *         will be set to NULL
+    *  @param builder pointer to xml builder 
+    */
+    axis2_om_document_t *axis2_om_document_ops_create(axis2_environment_t *environment, axis2_om_node_t *root,axis2_om_stax_builder_t *builder);
+
+#define axis2_om_document_free(environment, document) ((document)->ops->axis2_om_document_ops_free(environment, document))
+#define axis2_om_document_add_child(environment, document, child) ((document)->ops->axis2_om_document_ops_add_child(environment, document, child))
+#define axis2_om_document_build_next(environment, document) ((document)->ops->axis2_om_document_ops_build_next(environment, document))
+#define axis2_om_document_get_root_element(environment, document) ((document)->ops->axis2_om_document_ops_get_root_element(environment, document))
+#define axis2_om_document_get_next_sibling(environment, document) ((document)->ops->axis2_om_document_ops_get_next_sibling(environment, document))
+#define axis2_om_document_get_first_child(environment, document) ((document)->ops->axis2_om_document_ops_get_first_child(environment, document))
+#define axis2_om_document_get_next_child(environment, document) ((document)->ops->axis2_om_document_ops_get_next_child(environment, document))
 
 /*	to implement
  *	get first child with qname

Added: webservices/axis2/trunk/c/include/axis2_om_element.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_element.h?rev=326022&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_element.h (added)
+++ webservices/axis2/trunk/c/include/axis2_om_element.h Mon Oct 17 20:59:00 2005
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_OM_ELEMENT_H
+#define AXIS2_OM_ELEMENT_H
+
+#include <axis2_om_namespace.h>
+#include <axis2_om_attribute.h>
+#include <axis2_om_output.h>
+#include <axis2_om_node.h>
+#include <axis2_hash.h>
+
+struct axis2_om_element;
+struct axis2_om_element_ops;
+
+typedef struct axis2_om_element_ops
+{
+    /*
+    *	Find a namespace in the scope of the document 
+    *	start to find from current element and go up the hierarchy
+    */
+    
+    axis2_om_namespace_t *(*axis2_om_element_ops_find_namespace)( axis2_environment_t *environment, 
+                axis2_om_node_t *node, const axis2_char_t *uri,const axis2_char_t *prefix);
+    /*
+    declare a namespace in current element (in the scope of this element )
+    */
+    
+    axis2_status_t (*axis2_om_element_ops_declare_namespace)(axis2_environment_t *environment, struct axis2_om_element *element, axis2_om_namespace_t *ns);
+    /**
+     *	find namespaces in the scope of current element
+     */
+    
+    /*axis2_om_namespace_t *(*axis2_om_element_ops_find_declared_namespace)(axis2_environment_t *environment, struct axis2_om_element *element, const axis2_char_t *uri,const axis2_char_t *prefix);*/
+    /**
+     *
+     */
+    
+    axis2_om_namespace_t *(*axis2_om_element_ops_find_namespace_with_qname)(axis2_environment_t *environment, axis2_om_node_t *node, axis2_qname_t *qname);
+    
+    /**
+     *	add an attribute to current element
+     * @param ns namespace Optional
+     */
+    
+    axis2_status_t (*axis2_om_element_ops_add_attribute)(axis2_environment_t *environment, struct axis2_om_element *element, axis2_om_attribute_t *attribute);
+    
+    /**
+     *	return the requested attribute
+     */
+    
+    axis2_om_attribute_t *(*axis2_om_element_ops_get_attribute)(axis2_environment_t *environment, struct axis2_om_element *element, axis2_qname_t *qname);
+    
+    
+    /**
+     *	declare a namespace in the scope of this element
+     */
+    
+    /*axis2_om_namespace_t *(*axis2_om_element_ops_declare_namespace_with_ns_uri_prefix)(axis2_environment_t *environment, struct axis2_om_element *element, const axis2_char_t* uri,const axis2_char_t *prefix);*/
+    /**
+     *	Free Om element 
+     *
+     */
+    
+    axis2_status_t (*axis2_om_element_ops_free)(axis2_environment_t *environment, struct axis2_om_element *element);
+    
+    axis2_status_t (*axis2_om_element_ops_serialize_start_part)(axis2_environment_t *environment, struct axis2_om_element *element, axis2_om_output_t* om_output);
+    
+    axis2_status_t (*axis2_om_element_ops_serialize_end_part)(axis2_environment_t *environment, struct axis2_om_element *element, axis2_om_output_t* om_output);
+
+} axis2_om_element_ops_t;
+
+typedef struct axis2_om_element{
+	axis2_om_element_ops_t *ops;
+    /** Element's namespace */
+    axis2_om_namespace_t *ns;
+    /** Element's local name */
+	axis2_char_t *localname;	
+    /** List of attributes */
+	axis2_hash_t *attributes;     
+    /** List of namespaces */
+	axis2_hash_t *namespaces;		
+} axis2_om_element_t;
+
+
+/*
+*	Create an om element using localname and namespace and parent
+*@param localname can't be null
+*@param ns   namespace can be null
+*@param parent can be null
+*@return   Returns axis2_om_element_t pointer If there isn't enough memory null is returned
+*/
+axis2_om_element_t *axis2_om_element_create(axis2_environment_t *environment, axis2_om_node_t *parent,
+						const axis2_char_t *localname, axis2_om_namespace_t *ns,
+						axis2_om_node_t **node);
+
+/**
+ *	create an om element using a qname 
+ * @param qname
+ * @param parent 
+ * @return axis2_om_element_t pointer or NULL if there isn't enough memory
+ */
+
+
+axis2_om_element_t *axis2_om_element_create_with_qname(axis2_environment_t *environment, axis2_om_node_t *parent,axis2_qname_t *qname
+						,axis2_om_node_t **node);
+
+
+#endif	/* AXIS2_OM_ELEMENT_H */

Modified: webservices/axis2/trunk/c/include/axis2_om_namespace.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_namespace.h?rev=326022&r1=326021&r2=326022&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_namespace.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_namespace.h Mon Oct 17 20:59:00 2005
@@ -92,4 +92,4 @@
 #define axis2_om_namespace_equals(environment, om_namespace1, om_namespace2) ((om_namespace1)->ops->equals(environment, om_namespace1, om_namespace2))
 #define axis2_om_namespace_serialize(environment, om_namespace,om_output) ((om_namespace)->ops->serialize(environment, om_namespace, om_output))
 
-#endif	// AXIS2_OM_NAMESPACE
+#endif	/* AXIS2_OM_NAMESPACE */

Modified: webservices/axis2/trunk/c/include/axis2_om_node.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_node.h?rev=326022&r1=326021&r2=326022&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_node.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_node.h Mon Oct 17 20:59:00 2005
@@ -34,15 +34,15 @@
 
 
 typedef enum axis2_om_types_t {
-    AXIS2_OM_INVALID = -1,
-	AXIS2_OM_DOCUMENT = 10,
-	AXIS2_OM_ELEMENT = 20,
-	AXIS2_OM_DOCTYPE = 30,
-	AXIS2_OM_COMMENT = 40,
-	AXIS2_OM_ATTRIBUTE = 50,
-	AXIS2_OM_NAMESPACE = 60,
-	AXIS2_OM_PROCESSING_INSTRUCTION = 70,
-	AXIS2_OM_TEXT = 80
+    AXIS2_OM_INVALID = 0,
+	AXIS2_OM_DOCUMENT,
+	AXIS2_OM_ELEMENT,
+	AXIS2_OM_DOCTYPE,
+	AXIS2_OM_COMMENT,
+	AXIS2_OM_ATTRIBUTE,
+	AXIS2_OM_NAMESPACE,
+	AXIS2_OM_PROCESSING_INSTRUCTION,
+	AXIS2_OM_TEXT
 } axis2_om_types_t;
 
 

Modified: webservices/axis2/trunk/c/include/axis2_om_text.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_text.h?rev=326022&r1=326021&r2=326022&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_text.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_text.h Mon Oct 17 20:59:00 2005
@@ -66,8 +66,6 @@
     * @return Status code
     */
     int (*serialize)(axis2_environment_t *environment, const struct axis2_om_text *om_text, axis2_om_output_t* om_output);
-		
-	int k;
 } axis2_om_text_ops_t;
     
 /** \struct axis2_om_text