You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2005/10/19 04:53:17 UTC
svn commit: r326346 - in /webservices/axis2/trunk/c: include/
modules/xml/om/src/
Author: samisa
Date: Tue Oct 18 19:53:00 2005
New Revision: 326346
URL: http://svn.apache.org/viewcvs?rev=326346&view=rev
Log:
Added comments and corrected some errors
Modified:
webservices/axis2/trunk/c/include/axis2_om_attribute.h
webservices/axis2/trunk/c/include/axis2_om_comment.h
webservices/axis2/trunk/c/include/axis2_om_doctype.h
webservices/axis2/trunk/c/include/axis2_om_element.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_output.h
webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h
webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_element.c
webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_namespace.c
webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c
webservices/axis2/trunk/c/modules/xml/om/src/axis2_qname.c
Modified: webservices/axis2/trunk/c/include/axis2_om_attribute.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_attribute.h?rev=326346&r1=326345&r2=326346&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_attribute.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_attribute.h Tue Oct 18 19:53:00 2005
@@ -26,10 +26,22 @@
#include <axis2_om_namespace.h>
#include <axis2_om_output.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+/**
+ * @defgroup axis2_om_text OM Text
+ * @ingroup axis2_om
+ * @{
+ */
+
+/** @cond */
struct axis2_om_attribute;
struct axis2_om_attribute_ops;
+/** @endcond */
+
/** \struct axis2_om_attribute
* \brief OM attribute operations struct
@@ -40,6 +52,7 @@
{
/**
* Free an axis2_om_attribute struct
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
* @return Status code
*/
@@ -47,6 +60,7 @@
/**
* Creates and returns a qname struct for this attribute
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
* @param om_attribute
* @return returns null on error
*/
@@ -55,6 +69,7 @@
/**
* Serialize operation
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
* @param om_output OM output handler to be used in serializing
* @return Status code
*/
@@ -63,7 +78,11 @@
}axis2_om_attribute_ops_t;
-
+/** \struct axis2_om_attribute
+ * \brief OM attribute struct
+ *
+ * Handles the XML attribute in OM
+ */
typedef struct axis2_om_attribute
{
@@ -80,7 +99,7 @@
/**
* creates an om_attribute structure
- * @environment axis2_environment
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
* @param localname The local part of the attribute name
* @param value normalized attribute value
* @param ns The namespace name, if any, of the attribute
@@ -94,5 +113,10 @@
#define axis2_om_attribute_get_qname(environment, om_attribute) ((om_attribute)->ops->axis2_om_attribute_ops_get_qname(environment, om_attribute))
#define axis2_om_attribute_serialize(environment, om_attribute,om_ouput) ((om_attribute)->ops->axis2_om_attribute_ops_serialize(environment, om_attribute,om_output))
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
#endif /* AXIS2_OM_ATTRIBUTE_H */
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=326346&r1=326345&r2=326346&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_comment.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_comment.h Tue Oct 18 19:53:00 2005
@@ -23,24 +23,49 @@
*/
#include <axis2_om_node.h>
-
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup axis2_om_comment OM comment
+ * @ingroup axis2_om
+ * @{
+ */
+
+/** @cond */
struct axis2_om_comment;
struct axis2_om_comment_ops;
+/** @endcond */
+/** @struct axis2_om_comment_ops
+ * @brief OM comment operations struct
+ * Encapsulator struct for operations of axis2_om_comment_t
+ */
+
typedef struct axis2_om_comment_ops
{
/**
* Free a axis2_comment struct
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
* @param comment pointer to the axis2_commnet
- *
+ * @returns status code
*/
axis2_status_t (*axis2_om_comment_ops_free)(axis2_environment_t *environment, struct axis2_om_comment *comment);
} axis2_om_comment_ops_t;
+/** \struct axis2_om_comment
+ \brief OM comment struct
+
+ Handles the XML comment in OM
+*/
typedef struct axis2_om_comment
{
+ /** operations struct */
axis2_om_comment_ops_t *ops;
+ /** value */
char *value;
} axis2_om_comment_t;
@@ -57,5 +82,10 @@
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))
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
#endif /* AXIS2_OM_COMMENT_H */
Modified: webservices/axis2/trunk/c/include/axis2_om_doctype.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_doctype.h?rev=326346&r1=326345&r2=326346&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_doctype.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_doctype.h Tue Oct 18 19:53:00 2005
@@ -24,18 +24,42 @@
#include <axis2_om_node.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup axis2_om_text OM Text
+ * @ingroup axis2_om
+ * @{
+ */
+
+/** @cond */
struct axis2_om_doctype;
struct axis2_om_doctype_ops;
+/** @endcond */
+
+/** @struct axis2_om_doctype_ops
+ @brief OM doctype operations struct
+ Encapsulator struct for operations of axis2_om_doctype_t
+*/
typedef struct axis2_om_doctype_ops
{
/**
* free the axis2_om_doctype_t struct
- * param om_doc pointer to axis2_om_doctype_t struct
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @param om_doc pointer to axis2_om_doctype_t struct
+ * @returns status code
*/
axis2_status_t (*axis2_om_doctype_ops_free)(axis2_environment_t *environment, struct axis2_om_doctype *om_doctype);
} axis2_om_doctype_ops_t;
+/** \struct axis2_om_doctype
+ \brief OM doctype struct
+
+ Handles the XML document type in OM
+*/
typedef struct axis2_om_doctype
{
axis2_om_doctype_ops_t* ops;
@@ -47,15 +71,18 @@
* to the axis2_axis2_om_doctype_t struct
* the data_element field of node struct points to the acctual axis2_doctype_t struct
* The element type of axis2_om_node_t struct will be of type AXIS2_OM_DOCTYPE
- * param doctype The out paremeter that must be passed
- * return pointer to a axis2_om_node_t struct containing the doctype struct
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @param node This is an outparameter
+ * @return pointer to a axis2_om_node_t struct containing the doctype struct
*/
-
-
axis2_om_doctype_t *axis2_om_doctype_create(axis2_environment_t *environment, axis2_om_node_t *parent, const axis2_char_t *value, axis2_om_node_t **node);
#define axis2_om_doctype_free(environment, doctype) ((doctype)->ops->axis2_om_doctype_ops_free(environment, doctype))
+/** @} */
+#ifdef __cplusplus
+}
+#endif
#endif /* AXIS2_OM_DOCTYPE_H */
Modified: 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=326346&r1=326345&r2=326346&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_element.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_element.h Tue Oct 18 19:53:00 2005
@@ -23,66 +23,126 @@
#include <axis2_om_node.h>
#include <axis2_hash.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup axis2_om_element OM element
+ * @ingroup axis2_om
+ * @{
+ */
+
+/** @cond */
+
struct axis2_om_element;
struct axis2_om_element_ops;
+/** @endcond */
+
+/** @struct axis2_om_element_ops
+ @brief OM element operations struct
+
+ Encapsulator struct for operations of axis2_om_element_t
+*/
+
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
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @param node om_node containing an instance of om_element
+ * @param uri namespace uri
+ * @param prefix namespace prefix
+ * @return axis2_om_namespace_t pointer
*/
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 )
+ /**
+ * declare a namespace in current element (in the scope of this element )
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @param element axis2_om_element_struct pointer
+ * @param ns pointer to a om_namespace
+ * @return status code
*/
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
+ * find namespaces in the scope of current element
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @param element pointer to an om element
+ * @param prefix namespace prefix
+ * @param uri namespace uri
*/
+ 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_declared_namespace)(axis2_environment_t *environment, struct axis2_om_element *element, const axis2_char_t *uri,const axis2_char_t *prefix);*/
/**
- *
+ * Finds a namespace using qname
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+
*/
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 environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+
* @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
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @param element OM Element
+ * @qname Qname
+ * @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
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @param element OM element
+ * @returns status code
*
*/
axis2_status_t (*axis2_om_element_ops_free)(axis2_environment_t *environment, struct axis2_om_element *element);
+
+ /**
+ * serialize operation
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @param element OM Element
+ * @param om_output OM output
+ * @return status code
+ */
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);
-
+
+ /**
+ * serialize operation
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @param element OM Element
+ * @param om_output OM output
+ * @return status code
+ */
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;
+/** \struct axis2_om_element
+ \brief OM element struct
+
+ Handles the XML element in OM
+*/
+
+
typedef struct axis2_om_element{
axis2_om_element_ops_t *ops;
/** Element's namespace */
@@ -123,9 +183,16 @@
#define axis2_om_element_find_namespace_with_qname (environment, element, qname) ((element)->ops->axis2_om_element_ops_find_namespace_with_qname (environment, element, qname))
#define axis2_om_element_add_attribute(environment, element, attribute) ((element)->ops->axis2_om_element_ops_add_attribute(environment, element, attribute))
#define axis2_om_element_get_attribute(environment, element, qname) ((element)->ops->axis2_om_element_ops_get_attribute(environment, element, qname))
-#define axis2_om_element_free(environment, element) ((element)->ops->axis2_om_element_ops_free(environment, element);)
+#define axis2_om_element_find_declared_namespace(environment,element,uri,prefix) ((element)->ops->axis2_om_element_find_declared_namespace(environment,element,uri,prefix))
+#define axis2_om_element_free(environment, element) ((element)->ops->axis2_om_element_ops_free(environment, element))
#define axis2_om_element_serialize_start_part(environment, element, om_output) ((element)->ops->axis2_om_element_ops_serialize_start_part(environment, element, om_output))
#define axis2_om_element_serialize_end_part(environment, element, om_output) ((element)->ops->axis2_om_element_ops_serialize_end_part(environment, element, om_output))
+/** @} */
+
+
+#ifdef __cplusplus
+}
+#endif
#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=326346&r1=326345&r2=326346&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_namespace.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_namespace.h Tue Oct 18 19:53:00 2005
@@ -26,9 +26,21 @@
#include <axis2_environment.h>
#include <axis2_om_output.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup axis2_om_text OM Text
+ * @ingroup axis2_om
+ * @{
+ */
+
+/** @cond */
struct axis2_om_namespace;
struct axis2_om_namespace_ops;
-
+/** @endcond */
+
/** \struct axis2_om_namespace_ops_t
\brief OM Namespace operations struct
@@ -38,24 +50,27 @@
{
/**
* Free an om_namespcae
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
* @return Status code
*/
- axis2_status_t (*free)(axis2_environment_t *environment, struct axis2_om_namespace *om_namespace);
+ axis2_status_t (*axis2_om_namespace_ops_free)(axis2_environment_t *environment, struct axis2_om_namespace *om_namespace);
/**
* Compares two namepsaces
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
* @param om_namespace1 first namespase
* @param om_namespace2 second namespace to be compared
* @return true if the two namespaces are equal, false otherwise
*/
- axis2_bool_t (*equals)(axis2_environment_t *environment, struct axis2_om_namespace *om_namespace1, struct axis2_om_namespace *om_namespace2);
+ axis2_bool_t (*axis2_om_namespace_ops_equals)(axis2_environment_t *environment, struct axis2_om_namespace *om_namespace1, struct axis2_om_namespace *om_namespace2);
/**
* Serialize operation
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
* @param om_output OM output handler to be used in serializing
* @return Status code
*/
- axis2_status_t (*serialize)(axis2_environment_t *environment, struct axis2_om_namespace *om_namespace, axis2_om_output_t* om_output);
+ axis2_status_t (*axis2_om_namespace_ops_serialize)(axis2_environment_t *environment, struct axis2_om_namespace *om_namespace, axis2_om_output_t* om_output);
} axis2_om_namespace_ops_t;
@@ -88,8 +103,14 @@
axis2_om_namespace_t *axis2_om_namespace_create(axis2_environment_t *environment, const axis2_char_t *uri, const axis2_char_t *prefix);
-#define axis2_om_namespace_free(environment, om_namespace) ((om_namespace)->ops->free(environment, om_namespace))
-#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))
+#define axis2_om_namespace_free(environment, om_namespace) ((om_namespace)->ops->axis2_om_namespace_ops_free(environment, om_namespace))
+#define axis2_om_namespace_equals(environment, om_namespace1, om_namespace2) ((om_namespace1)->ops->axis2_om_namespace_ops_equals(environment, om_namespace1, om_namespace2))
+#define axis2_om_namespace_serialize(environment, om_namespace,om_output) ((om_namespace)->ops->axis2_om_namespace_ops_serialize(environment, om_namespace, om_output))
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
#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=326346&r1=326345&r2=326346&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_node.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_node.h Tue Oct 18 19:53:00 2005
@@ -23,10 +23,21 @@
*/
#include <axis2_environment.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup axis2_om_node OM Node
+ * @ingroup axis2_om
+ * @{
+ */
+
+/** @cond */
struct axis2_om_node;
struct axis2_om_node_ops;
typedef struct axis2_om_output axis2_om_output_t;
-
+/** @endcond */
/**
* Types used in OM
@@ -46,29 +57,34 @@
} axis2_om_types_t;
-/**
- * Encapsulator struct of axis2_om_node operations
- */
+/** @struct axis2_om_node_ops
+ @brief OM Node operations struct
+
+ Encapsulator struct for operations of axis2_om_node_t
+*/
typedef struct axis2_om_node_ops
{
/**
- * Free an om node and its all children
- * @return status code
+ * Free an om node and its all children
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @return status code
*/
axis2_status_t (*axis2_om_node_ops_free)(axis2_environment_t *environment,
struct axis2_om_node *om_node);
/**
* Add child node as child to parent
- * @param parent
- * @param child
- * @return status code
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @param parent
+ * @param child
+ * @return status code
*/
axis2_status_t (*axis2_om_node_ops_add_child)(axis2_environment_t *environment,
struct axis2_om_node *parent,struct axis2_om_node *child);
/**
* detach this node from the node and reset the links
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
* @return a pointer to detached node
*/
struct axis2_om_node *(*axis2_om_node_ops_detach)(axis2_environment_t *environment,
@@ -76,6 +92,7 @@
/**
* Inserts a sibling node after the current node
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
* @param current_node
* @param node_to_insert the node that will be inserted
* @return return status code
@@ -84,8 +101,9 @@
struct axis2_om_node *current_node,struct axis2_om_node *node_to_insert);
/**
- * Inserts a sibling node after the current node
- * @param current_node
+ * Inserts a sibling node after the current node
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @param current_node
* @param node_to_insert the node that will be inserted
* @return status code
*/
@@ -95,6 +113,7 @@
/**
* set a parent node to a given node
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
* @param child_node
* @param parent the node that will be set as parent
* @return status code
@@ -105,6 +124,7 @@
/** get the first child of a node
* returns the first child node of this node
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
* @param
* @return returns a pointer to first child if there is no child returns null
*/
@@ -113,6 +133,7 @@
/**
* get the next child of this node
* This function should only be called after a call to get_first_child function
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
* @param parent_node
* @return pointer to next child , if there isn't next child returns null
*/
@@ -121,7 +142,9 @@
/**
* serialize operation of node
- * @returns status code
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @returns status code
*/
axis2_status_t (*axis2_om_node_ops_serialize)(axis2_environment_t *environment,
@@ -166,6 +189,7 @@
/**
* Create a node struct.
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
* @return a pointer to node struct instance null otherwise
*/
@@ -183,7 +207,11 @@
#define axis2_om_node_get_next_child(environment, om_node) ((om_node)->ops->axis2_om_node_ops_get_next_child(environment, om_node))
#define axis2_om_node_serialize(environment, om_node, om_output) ((om_node)->ops->axis2_om_node_ops_serialize(environment, om_node, om_output))
+/** @} */
+#ifdef __cplusplus
+}
+#endif
#endif /* AXIS2_OM_NODE_H */
Modified: webservices/axis2/trunk/c/include/axis2_om_output.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_output.h?rev=326346&r1=326345&r2=326346&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_output.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_output.h Tue Oct 18 19:53:00 2005
@@ -17,28 +17,75 @@
#ifndef AXIS2_OM_OUTPUT_H
#define AXIS2_OM_OUTPUT_H
+/**
+ * @file axis2_om_output.h
+ * @brief interface of om xml writer
+ */
+
#include <axis2_defines.h>
#include <axis2_environment.h>
#include <axis2_om_node.h>
-
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup axis2_om_output OM_output
+ * @ingroup axis2_om
+ * @{
+ */
static const char* DEFAULT_CHAR_SET_ENCODING = "utf-8";
+
+/** \struct axis2_om_output
+ \brief OM Output struct
+
+ The XML writer interface struct of om
+*/
+
struct axis2_om_output {
+ /* The xml writer */
void *xml_writer;
+
axis2_bool_t do_optimize;
axis2_char_t *mime_boundary;
axis2_char_t *root_content_id;
int next_id;
axis2_bool_t is_soap_11;
axis2_char_t *char_set_encoding;
+ /* xml version */
axis2_char_t *xml_version;
+
axis2_bool_t ignore_xml_declaration;
};
+/**
+ * creates output struct and returns a pointer to newly created struct
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @param xml_writer XML_WRITER . IF null default xml writer(guththila writer ) will be created
+ * with stdout as the output stream
+ * @return om_output_t
+ */
axis2_om_output_t* axis2_create_om_output(axis2_environment_t *environment, void* xml_writer);
+/**
+ * Performs xml writing .
+ * Accepts variable number of args depending on the on type
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @param om_output OM OUTPUT
+ * @param type Type is one of the om_types e.g AXIS2_OM_ELEMENT
+ * @param no_of_args Number of arguments passed.
+ * @returns status code
+ */
+
axis2_status_t axis2_om_output_write(axis2_environment_t *environment, axis2_om_output_t *om_output, axis2_om_types_t type, int no_of_args, ... );
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
#endif /* AXIS2_OM_OUTPUT_H */
Modified: webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h?rev=326346&r1=326345&r2=326346&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h Tue Oct 18 19:53:00 2005
@@ -24,25 +24,68 @@
#include <axis2_om_node.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup axis2_om_text OM Text
+ * @ingroup axis2_om
+ * @{
+ */
+
+/** @cond */
struct axis2_om_processing_instruction;
struct axis2_om_processing_instruction_ops;
+/** @endcond */
+
+/** @struct axis2_om_processing_instruction_ops
+ @brief OM text operations struct
+ Encapsulator struct for operations of axis2_om_processing_instruction
+*/
typedef struct axis2_om_processing_instruction_ops
{
+ /**
+ * Free an instance of axis2_om_processing_instruction
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @param om_pi
+ * @returns Status code
+ */
axis2_status_t (*axis2_om_processing_instruction_ops_free)(axis2_environment_t *environment, struct axis2_om_processing_instruction *om_pi);
} axis2_om_processing_instruction_ops_t;
+/** \struct axis2_om_processing_instruction
+ \brief OM processing_instruction
+
+ Handles the XML processing instructions in OM
+*/
typedef struct axis2_om_processing_instruction {
+ /** operations struct */
axis2_om_processing_instruction_ops_t *ops;
+ /* PI target */
axis2_char_t *target;
+ /** PI value */
axis2_char_t *value;
} axis2_om_processing_instruction_t;
/**
- * creates axis2_om_processing_instruction and
- * @return a pointer to axis2_om_node_t struct containing PI
+ * creates axis2_om_processing_instruction
+ * @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
+ * @param target
+ * @param value
+ * @parent parent node
+ * @param node This is an outparameter , the created struct will be set as node's data_element
+ * @return a pointer to axis2_om_processing_instruction_t struct
*/
axis2_om_processing_instruction_t *axis2_om_processing_instruction_create(axis2_environment_t *environment, axis2_om_node_t *parent,const axis2_char_t *target,const axis2_char_t *value,axis2_om_node_t **node);
+
+#define axis2_om_processing_instruction_free(environment,pi) ((pi)->ops->axis2_om_processing_instruction_impl_free(environment,pi))
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
#endif /* AXIS2_OM_PI_H */
Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_element.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_element.c?rev=326346&r1=326345&r2=326346&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_element.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_element.c Tue Oct 18 19:53:00 2005
@@ -27,6 +27,9 @@
axis2_om_namespace_t *
axis2_om_element_impl_find_namespace_with_qname (axis2_environment_t *environment, axis2_om_node_t * element,
axis2_qname_t * qname);
+
+axis2_om_namespace_t *axis2_om_element_impl_find_declared_namespace(axis2_environment_t *environment, struct axis2_om_element *element, const axis2_char_t *uri,const axis2_char_t *prefix);
+
axis2_status_t axis2_om_element_impl_add_attribute(axis2_environment_t *environment, struct axis2_om_element *element, axis2_om_attribute_t *attribute);
axis2_om_attribute_t *axis2_om_element_impl_get_attribute(axis2_environment_t *environment, struct axis2_om_element *element, axis2_qname_t *qname);
axis2_status_t axis2_om_element_impl_free(axis2_environment_t *environment, struct axis2_om_element *element);
@@ -113,6 +116,7 @@
element->ops->axis2_om_element_ops_add_attribute = axis2_om_element_impl_add_attribute;
element->ops->axis2_om_element_ops_get_attribute = axis2_om_element_impl_get_attribute;
element->ops->axis2_om_element_ops_free = axis2_om_element_impl_free;
+ element->ops->axis2_om_element_ops_find_declared_namespace = axis2_om_element_impl_find_declared_namespace;
element->ops->axis2_om_element_ops_serialize_start_part = axis2_om_element_impl_serialize_start_part;
element->ops->axis2_om_element_ops_serialize_end_part = axis2_om_element_impl_serialize_end_part;
@@ -254,37 +258,39 @@
* can be used to retrive a prefix of a known namespace uri
*
*/
-/*axis2_om_namespace_t *
-axis2_om_element_find_declared_namespace (axis2_om_node_t * element,
- const axis2_char_t *uri, const axis2_char_t *prefix)
-{
- void *ns = NULL;
- axis2_hash_index_t *hashindex;
- axis2_om_element_t *element = NULL;
- if (!element || !ns
- || element->element_type != AXIS2_OM_ELEMENT)
+
+axis2_om_namespace_t *axis2_om_element_impl_find_declared_namespace(axis2_environment_t *environment, struct axis2_om_element *element, const axis2_char_t *uri,const axis2_char_t *prefix)
+{
+ axis2_hash_index_t *hash_index = NULL;
+ void *ns=NULL;
+ if(!element || !(element->namespaces))
{
return NULL;
- }
-
- element = (axis2_om_element_t *) (element->data_element);
- if (!prefix || strcmp (prefix, "") == 0)
+ }
+ if(!prefix || axis2_strcmp(environment->string,prefix,"") == 0)
{
- for (hashindex = axis2_hash_first (om_pool, element->namespaces);
- hashindex; hashindex = axis2_hash_next (hashindex))
+ for (hash_index = axis2_hash_first (environment, element->namespaces);
+ hash_index; hash_index = axis2_hash_next (hash_index))
{
- axis2_hash_this (hashindex, NULL, NULL, &ns);
- if (strcmp (((axis2_om_namespace_t *) (ns))->uri, uri))
+ axis2_hash_this (hash_index, NULL, NULL, &ns);
+ if (axis2_strcmp (environment->string ,((axis2_om_namespace_t *) (ns))->uri, uri))
{
return (axis2_om_namespace_t *) (ns);
}
}
+ return NULL;
}
- ns = axis2_hash_get (element->namespaces, prefix, APR_HASH_KEY_STRING);
- return (axis2_om_namespace_t *) ns;
+ ns = axis2_hash_get(element->namespaces,prefix,AXIS2_HASH_KEY_STRING);
+ if(ns)
+ return (axis2_om_namespace_t*)ns;
+ else
+ return NULL;
+
}
-*/
+
+
+
/*
* This will find a namespace with the given uri and prefix, in the scope of the docuemnt.
Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_namespace.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_namespace.c?rev=326346&r1=326345&r2=326346&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_namespace.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_namespace.c Tue Oct 18 19:53:00 2005
@@ -16,11 +16,11 @@
#include <axis2_om_namespace.h>
-axis2_status_t axis2_om_namespace_ops_free(axis2_environment_t *environment, axis2_om_namespace_t *om_namespace);
+axis2_status_t axis2_om_namespace_impl_free(axis2_environment_t *environment, axis2_om_namespace_t *om_namespace);
-axis2_bool_t axis2_om_namespace_ops_equals(axis2_environment_t *environment, axis2_om_namespace_t *ns1, axis2_om_namespace_t *ns2);
+axis2_bool_t axis2_om_namespace_impl_equals(axis2_environment_t *environment, axis2_om_namespace_t *ns1, axis2_om_namespace_t *ns2);
-axis2_status_t axis2_om_namespace_ops_serialize(axis2_environment_t *environment, axis2_om_namespace_t *om_namespace, axis2_om_output_t* om_output);
+axis2_status_t axis2_om_namespace_impl_serialize(axis2_environment_t *environment, axis2_om_namespace_t *om_namespace, axis2_om_output_t* om_output);
axis2_om_namespace_t *axis2_om_namespace_create(axis2_environment_t *environment,
const axis2_char_t *uri, const axis2_char_t *prefix)
@@ -77,16 +77,16 @@
return NULL;
}
- ns->ops->free = axis2_om_namespace_ops_free;
- ns->ops->equals = axis2_om_namespace_ops_equals;
- ns->ops->serialize = axis2_om_namespace_ops_serialize;
+ ns->ops->axis2_om_namespace_ops_free = axis2_om_namespace_impl_free;
+ ns->ops->axis2_om_namespace_ops_equals = axis2_om_namespace_impl_equals;
+ ns->ops->axis2_om_namespace_ops_serialize = axis2_om_namespace_impl_serialize;
return ns;
}
-axis2_status_t axis2_om_namespace_ops_free(axis2_environment_t *environment, struct axis2_om_namespace *om_namespace)
+axis2_status_t axis2_om_namespace_impl_free(axis2_environment_t *environment, struct axis2_om_namespace *om_namespace)
{
if (om_namespace)
{
@@ -110,9 +110,10 @@
axis2_free(environment->allocator, om_namespace);
}
+ return AXIS2_SUCCESS;
}
-axis2_bool_t axis2_om_namespace_ops_equals(axis2_environment_t *environment, axis2_om_namespace_t * ns1,
+axis2_bool_t axis2_om_namespace_impl_equals(axis2_environment_t *environment, axis2_om_namespace_t * ns1,
axis2_om_namespace_t * ns2)
{
int uris_differ = 0;
@@ -134,7 +135,7 @@
return (!uris_differ && !prefixes_differ);
}
-axis2_status_t axis2_om_namespace_ops_serialize(axis2_environment_t *environment, axis2_om_namespace_t *om_namespace, axis2_om_output_t* om_output)
+axis2_status_t axis2_om_namespace_impl_serialize(axis2_environment_t *environment, axis2_om_namespace_t *om_namespace, axis2_om_output_t* om_output)
{
int status = AXIS2_SUCCESS;
if (!om_namespace || !om_output)
Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c?rev=326346&r1=326345&r2=326346&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c Tue Oct 18 19:53:00 2005
@@ -26,7 +26,7 @@
axis2_status_t axis2_om_node_impl_insert_sibling_before(axis2_environment_t *environment ,axis2_om_node_t *node,axis2_om_node_t *node_to_insert);
axis2_om_node_t *axis2_om_node_impl_get_first_child(axis2_environment_t *environment,axis2_om_node_t *parent_node);
axis2_om_node_t *axis2_om_node_impl_get_next_child(axis2_environment_t *environment,axis2_om_node_t *parent_node);
-axis2_status_t *axis2_om_node_impl_serialize(axis2_environment_t *environment,axis2_om_node_t *om_node, axis2_om_output_t * om_output);
+axis2_status_t axis2_om_node_impl_serialize(axis2_environment_t *environment,axis2_om_node_t *om_node, axis2_om_output_t * om_output);
axis2_om_node_t *axis2_om_node_create(axis2_environment_t *environment)
@@ -81,7 +81,7 @@
}
if(node->first_child)
{
- while(!(node->first_child))
+ while(node->first_child)
{
axis2_om_node_t *node = NULL;
node = axis2_om_node_detach(environment,node->first_child);
@@ -112,6 +112,7 @@
}
axis2_free(environment->allocator,node->ops);
+ axis2_free(environment->allocator,node);
return AXIS2_SUCCESS;
}
@@ -291,14 +292,16 @@
return NULL;
}
-axis2_status_t *axis2_om_node_impl_serialize(axis2_environment_t *environment, axis2_om_node_t *om_node, axis2_om_output_t * om_output)
+axis2_status_t axis2_om_node_impl_serialize(axis2_environment_t *environment, axis2_om_node_t *om_node, axis2_om_output_t * om_output)
{
axis2_om_node_t *child_node = NULL;
int status = AXIS2_SUCCESS;
if (!om_node || !om_output)
- return AXIS2_ERROR_INVALID_NULL_PARAMETER;
-
+ {
+ environment->error->errorno = AXIS2_ERROR_INVALID_NULL_PARAMETER;
+ return AXIS2_FAILURE;
+ }
switch (om_node->node_type)
Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_qname.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_qname.c?rev=326346&r1=326345&r2=326346&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_qname.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_qname.c Tue Oct 18 19:53:00 2005
@@ -63,13 +63,7 @@
return AXIS2_FALSE;
}
- if(qn1 && qn2)
- {
- if( qn1 == qn2)
- {
- return AXIS2_TRUE;
- }
- }
+
if(qn1->localpart && qn2->localpart)
{
localparts_differ = axis2_strcmp(environment->string ,qn1->localpart , qn2->localpart);