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/21 10:29:47 UTC
svn commit: r327117 [2/2] - in /webservices/axis2/trunk/c: include/
modules/util/src/
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=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_document.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_document.h Fri Oct 21 01:28:57 2005
@@ -38,7 +38,7 @@
struct axis2_om_document;
struct axis2_om_document_ops;
/** @endcond */
-
+
/** @struct axis2_om_document_ops
@brief OM document operations struct
@@ -46,52 +46,81 @@
*/
typedef struct axis2_om_document_ops
{
-
+
/**
* 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_status_t (*axis2_om_document_ops_free) (axis2_environment_t *
+ environment,
+ struct axis2_om_document *
+ document);
/**
* causes the parser to proceed if the xml input is not finised yet
* @param document
*/
- axis2_om_node_t *(*axis2_om_document_ops_build_next)(axis2_environment_t *environment, struct axis2_om_document *document);
+ axis2_om_node_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);
+ axis2_status_t (*axis2_om_document_ops_add_child) (axis2_environment_t *
+ environment,
+ struct
+ axis2_om_document *
+ 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_root_element)(axis2_environment_t *environment, struct axis2_om_document *document);
-
- axis2_om_node_t *(*axis2_om_document_ops_get_next_sibling)(axis2_environment_t *environment, struct axis2_om_document *document);
-
-
- axis2_om_node_t *(*axis2_om_document_ops_get_first_child)(axis2_environment_t *environment, struct axis2_om_document *document);
-
- axis2_om_node_t *(*axis2_om_document_ops_get_next_child)(axis2_environment_t *environment, struct axis2_om_document *document);
+ axis2_om_node_t
+ *(*axis2_om_document_ops_get_root_element) (axis2_environment_t *
+ environment,
+ struct axis2_om_document *
+ document);
+
+ axis2_om_node_t
+ *(*axis2_om_document_ops_get_next_sibling) (axis2_environment_t *
+ environment,
+ struct axis2_om_document *
+ document);
+
+
+ axis2_om_node_t
+ *(*axis2_om_document_ops_get_first_child) (axis2_environment_t *
+ environment,
+ struct axis2_om_document *
+ document);
+
+ 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;
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;
+ 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;
-}axis2_om_document_t;
+} axis2_om_document_t;
/**
* creates and returns axis2_om_document returns null if there isn't enough memory
@@ -99,7 +128,11 @@
* 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);
+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))
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=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_element.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_element.h Fri Oct 21 01:28:57 2005
@@ -24,7 +24,8 @@
#include <axis2_hash.h>
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
/**
@@ -35,8 +36,8 @@
/** @cond */
-struct axis2_om_element;
-struct axis2_om_element_ops;
+ struct axis2_om_element;
+ struct axis2_om_element_ops;
/** @endcond */
/** @struct axis2_om_element_ops
@@ -46,20 +47,25 @@
*/
-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);
+ 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 )
* @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
@@ -67,9 +73,11 @@
* @param ns pointer to a om_namespace
* @return status code
*/
-
- axis2_status_t (*axis2_om_element_ops_declare_namespace)(axis2_environment_t *environment, axis2_om_node_t *node, axis2_om_namespace_t *ns);
-
+
+ axis2_status_t (*axis2_om_element_ops_declare_namespace)
+ (axis2_environment_t * environment, axis2_om_node_t * node,
+ axis2_om_namespace_t * ns);
+
/**
* find namespaces in the scope of current element
* @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
@@ -77,34 +85,49 @@
* @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);
-
+
+ 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);
-
+
+ axis2_status_t (*axis2_om_element_ops_add_attribute)
+ (axis2_environment_t * environment,
+ struct axis2_om_element * element,
+ axis2_om_attribute_t * 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);
-
+
+ axis2_om_attribute_t
+ *(*axis2_om_element_ops_get_attribute) (axis2_environment_t *
+ environment,
+ struct axis2_om_element *
+ element,
+ axis2_qname_t * qname);
+
/**
* Free Om element
* @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
@@ -112,29 +135,38 @@
* @returns status code
*
*/
-
- axis2_status_t (*axis2_om_element_ops_free)(axis2_environment_t *environment, struct axis2_om_element *element);
-
+
+ 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);
-
+ */
+
+ 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_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;
+ } axis2_om_element_ops_t;
/** \struct axis2_om_element
\brief OM element struct
@@ -143,17 +175,18 @@
*/
-typedef struct axis2_om_element{
- axis2_om_element_ops_t *ops;
+ typedef struct axis2_om_element
+ {
+ axis2_om_element_ops_t *ops;
/** Element's namespace */
- axis2_om_namespace_t *ns;
+ axis2_om_namespace_t *ns;
/** Element's local name */
- axis2_char_t *localname;
+ axis2_char_t *localname;
/** List of attributes */
- axis2_hash_t *attributes;
+ axis2_hash_t *attributes;
/** List of namespaces */
- axis2_hash_t *namespaces;
-} axis2_om_element_t;
+ axis2_hash_t *namespaces;
+ } axis2_om_element_t;
/*
@@ -163,9 +196,13 @@
*@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);
+ 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
@@ -175,8 +212,12 @@
*/
-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);
+ 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);
#define axis2_om_element_find_namespace(environment, node, uri, prefix) (((axis2_om_element_t*)(node->data_element))->ops->axis2_om_element_ops_find_namespace(environment, node, uri, prefix))
#define axis2_om_element_declare_namespace(environment, node, ns) (((axis2_om_element_t*)(node->data_element))->ops->axis2_om_element_ops_declare_namespace(environment, node, ns) )
@@ -195,4 +236,4 @@
}
#endif
-#endif /* AXIS2_OM_ELEMENT_H */
+#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=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_namespace.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_namespace.h Fri Oct 21 01:28:57 2005
@@ -27,7 +27,8 @@
#include <axis2_om_output.h>
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
/**
@@ -37,8 +38,8 @@
*/
/** @cond */
-struct axis2_om_namespace;
-struct axis2_om_namespace_ops;
+ struct axis2_om_namespace;
+ struct axis2_om_namespace_ops;
/** @endcond */
/** \struct axis2_om_namespace_ops_t
@@ -46,14 +47,18 @@
Encapsulator struct for operations of axis2_om_namespace_t
*/
-typedef struct axis2_om_namespace_ops
-{
+ typedef struct axis2_om_namespace_ops
+ {
/**
* Free an om_namespcae
* @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
* @return Status code
*/
- axis2_status_t (*axis2_om_namespace_ops_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
@@ -62,7 +67,14 @@
* @param om_namespace2 second namespace to be compared
* @return true if the two namespaces are equal, false otherwise
*/
- axis2_bool_t (*axis2_om_namespace_ops_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
@@ -70,29 +82,33 @@
* @param om_output OM output handler to be used in serializing
* @return Status code
*/
- 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_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;
+ } axis2_om_namespace_ops_t;
/** \struct axis2_om_namespace_t
\brief OM namespace struct
Handles the XML namespace in OM
*/
-typedef struct axis2_om_namespace {
+ typedef struct axis2_om_namespace
+ {
/**
* OM text related operations
*/
- axis2_om_namespace_ops_t* ops;
+ axis2_om_namespace_ops_t *ops;
/**
* OM namespace URI
*/
- axis2_char_t *uri;
+ axis2_char_t *uri;
/**
* OM namespace prefix
*/
- axis2_char_t *prefix;
-} axis2_om_namespace_t;
+ axis2_char_t *prefix;
+ } axis2_om_namespace_t;
/**
* Creates an axis2_om_namespace_t struct
@@ -101,7 +117,11 @@
* @return a pointer to newly created axis2_om_namespace_t struct
*/
-axis2_om_namespace_t *axis2_om_namespace_create(axis2_environment_t *environment, const axis2_char_t *uri, const axis2_char_t *prefix);
+ 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->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))
@@ -113,4 +133,4 @@
}
#endif
-#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=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_node.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_node.h Fri Oct 21 01:28:57 2005
@@ -24,7 +24,8 @@
#include <axis2_environment.h>
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
/**
@@ -34,9 +35,9 @@
*/
/** @cond */
-struct axis2_om_node;
-struct axis2_om_node_ops;
-typedef struct axis2_om_output axis2_om_output_t;
+ struct axis2_om_node;
+ struct axis2_om_node_ops;
+ typedef struct axis2_om_output axis2_om_output_t;
/** @endcond */
/**
@@ -44,34 +45,37 @@
*/
-typedef enum axis2_om_types_t {
- 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;
+ typedef enum axis2_om_types_t
+ {
+ 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;
/** @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
-{
+*/
+
+ typedef struct axis2_om_node_ops
+ {
/**
* 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);
+ 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 environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
@@ -79,17 +83,24 @@
* @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);
-
+ 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,
- struct axis2_om_node *om_node);
-
+ struct axis2_om_node *(*axis2_om_node_ops_detach) (axis2_environment_t
+ * environment,
+ struct
+ axis2_om_node *
+ om_node);
+
/**
* Inserts a sibling node after the current node
* @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
@@ -97,9 +108,11 @@
* @param node_to_insert the node that will be inserted
* @return return status code
*/
- axis2_status_t (*axis2_om_node_ops_insert_sibling_after)(axis2_environment_t *environment,
- struct axis2_om_node *current_node,struct axis2_om_node *node_to_insert);
-
+ axis2_status_t (*axis2_om_node_ops_insert_sibling_after)
+ (axis2_environment_t * environment,
+ struct axis2_om_node * current_node,
+ struct axis2_om_node * node_to_insert);
+
/**
* Inserts a sibling node after the current node
* @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
@@ -108,9 +121,11 @@
* @return status code
*/
- axis2_status_t (*axis2_om_node_ops_insert_sibling_before)(axis2_environment_t *environment,
- struct axis2_om_node *current_node,struct axis2_om_node *node_to_insert);
-
+ axis2_status_t (*axis2_om_node_ops_insert_sibling_before)
+ (axis2_environment_t * environment,
+ struct axis2_om_node * current_node,
+ struct axis2_om_node * node_to_insert);
+
/**
* set a parent node to a given node
* @param environment Environment .MUST NOT be NULL, if NULL behaviour is undefined.
@@ -119,17 +134,24 @@
* @return status code
*/
- axis2_status_t (*axis2_om_node_ops_set_parent)(axis2_environment_t *environment,
- struct axis2_om_node *child_node,struct axis2_om_node *parent_node);
-
+ axis2_status_t (*axis2_om_node_ops_set_parent) (axis2_environment_t
+ * environment,
+ struct axis2_om_node
+ * child_node,
+ struct axis2_om_node
+ * parent_node);
+
/** 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
*/
- struct axis2_om_node *(*axis2_om_node_ops_get_first_child)(axis2_environment_t *environment,
- struct axis2_om_node *parent_node);
+ struct axis2_om_node
+ *(*axis2_om_node_ops_get_first_child) (axis2_environment_t *
+ environment,
+ struct axis2_om_node *
+ parent_node);
/**
* get the next child of this node
* This function should only be called after a call to get_first_child function
@@ -137,21 +159,28 @@
* @param parent_node
* @return pointer to next child , if there isn't next child returns null
*/
- struct axis2_om_node *(*axis2_om_node_ops_get_next_child)(axis2_environment_t *environment,
- struct axis2_om_node *parent_node);
-
+ struct axis2_om_node
+ *(*axis2_om_node_ops_get_next_child) (axis2_environment_t *
+ environment,
+ struct axis2_om_node *
+ parent_node);
+
/**
* serialize operation of node
* @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,
- struct axis2_om_node *om_node, axis2_om_output_t * om_output);
+
+ axis2_status_t (*axis2_om_node_ops_serialize) (axis2_environment_t *
+ environment,
+ struct axis2_om_node
+ * om_node,
+ axis2_om_output_t *
+ om_output);
-}axis2_om_node_ops_t;
+ } axis2_om_node_ops_t;
/**
@@ -167,25 +196,26 @@
*
*/
-typedef struct axis2_om_node{
+ typedef struct axis2_om_node
+ {
/** operations of this struct */
- axis2_om_node_ops_t *ops;
+ axis2_om_node_ops_t *ops;
/** links that maintain the tree */
- struct axis2_om_node *parent;
- struct axis2_om_node *prev_sibling;
- struct axis2_om_node *next_sibling;
- struct axis2_om_node *first_child;
- struct axis2_om_node *current_child;
- struct axis2_om_node *last_child;
-
- /** indicate the type stored in data_element */
- axis2_om_types_t node_type;
- /** done true means that this node is completely built , false otherwise */
- int done;
-
- /** instances of om struct types will be stored here */
- void* data_element;
-} axis2_om_node_t;
+ struct axis2_om_node *parent;
+ struct axis2_om_node *prev_sibling;
+ struct axis2_om_node *next_sibling;
+ struct axis2_om_node *first_child;
+ struct axis2_om_node *current_child;
+ struct axis2_om_node *last_child;
+
+ /** indicate the type stored in data_element */
+ axis2_om_types_t node_type;
+ /** done true means that this node is completely built , false otherwise */
+ int done;
+
+ /** instances of om struct types will be stored here */
+ void *data_element;
+ } axis2_om_node_t;
/**
* Create a node struct.
@@ -193,7 +223,7 @@
* @return a pointer to node struct instance null otherwise
*/
-axis2_om_node_t *axis2_om_node_create(axis2_environment_t *environment);
+ axis2_om_node_t *axis2_om_node_create (axis2_environment_t * environment);
#define axis2_om_node_free(environment,om_node) ((om_node)->ops->axis2_om_node_ops_free(environment,om_node))
#define axis2_om_node_add_child(environment,parent,child) ((parent)->ops->axis2_om_node_ops_add_child(environment,parent,child))
@@ -214,4 +244,4 @@
#endif
-#endif /* AXIS2_OM_NODE_H */
+#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=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_output.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_output.h Fri Oct 21 01:28:57 2005
@@ -27,7 +27,8 @@
#include <axis2_om_node.h>
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
/**
@@ -36,7 +37,7 @@
* @{
*/
-static const char* DEFAULT_CHAR_SET_ENCODING = "utf-8";
+ static const char *DEFAULT_CHAR_SET_ENCODING = "utf-8";
/** \struct axis2_om_output
@@ -45,21 +46,22 @@
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;
-};
+ 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.
@@ -68,7 +70,8 @@
* @return om_output_t
*/
-axis2_om_output_t* axis2_create_om_output(axis2_environment_t *environment, void* xml_writer);
+ axis2_om_output_t *axis2_create_om_output (axis2_environment_t *
+ environment, void *xml_writer);
/**
* Performs xml writing .
@@ -80,7 +83,10 @@
* @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, ... );
+ 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, ...);
/** @} */
@@ -88,4 +94,4 @@
}
#endif
-#endif /* AXIS2_OM_OUTPUT_H */
+#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=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h Fri Oct 21 01:28:57 2005
@@ -25,7 +25,8 @@
#include <axis2_om_node.h>
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
/**
@@ -35,39 +36,42 @@
*/
/** @cond */
-struct axis2_om_processing_instruction;
-struct axis2_om_processing_instruction_ops;
+ 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
-{
+ 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;
+ 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 {
+ typedef struct axis2_om_processing_instruction
+ {
/** operations struct */
- axis2_om_processing_instruction_ops_t *ops;
- /* PI target */
- axis2_char_t *target;
+ axis2_om_processing_instruction_ops_t *ops;
+ /* PI target */
+ axis2_char_t *target;
/** PI value */
- axis2_char_t *value;
-} axis2_om_processing_instruction_t;
+ axis2_char_t *value;
+ } axis2_om_processing_instruction_t;
/**
* creates axis2_om_processing_instruction
@@ -77,9 +81,15 @@
* @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);
+ 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))
@@ -88,4 +98,4 @@
}
#endif
-#endif /* AXIS2_OM_PI_H */
+#endif /* AXIS2_OM_PI_H */
Modified: webservices/axis2/trunk/c/include/axis2_om_stax_builder.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_stax_builder.h?rev=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_stax_builder.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_stax_builder.h Fri Oct 21 01:28:57 2005
@@ -36,22 +36,27 @@
* move parser forward and reacts to events
*/
-axis2_om_node_t *(*axis2_om_stax_builder_ops_next)(axis2_environment_t *environment, axis2_om_stax_builder_t *builder);
-
-axis2_status_t (*axis2_om_stax_builder_ops_discard_current_element)(axis2_environment_t *environment, axis2_om_stax_builder_t *builder);
+ axis2_om_node_t *(*axis2_om_stax_builder_ops_next) (axis2_environment_t *
+ environment,
+ axis2_om_stax_builder_t
+ * builder);
+
+ axis2_status_t (*axis2_om_stax_builder_ops_discard_current_element)
+ (axis2_environment_t * environment,
+ axis2_om_stax_builder_t * builder);
} axis2_om_stax_builder_ops_t;
struct axis2_om_stax_builder
{
- axis2_om_stax_builder_ops_t *ops;
- void *parser;
- axis2_om_node_t *lastnode;
- axis2_om_document_t *document;
- axis2_bool_t done;
- axis2_bool_t parser_accessed;
- axis2_bool_t cache;
+ axis2_om_stax_builder_ops_t *ops;
+ void *parser;
+ axis2_om_node_t *lastnode;
+ axis2_om_document_t *document;
+ axis2_bool_t done;
+ axis2_bool_t parser_accessed;
+ axis2_bool_t cache;
};
/**
@@ -60,7 +65,9 @@
* [ Guththila ]
*/
-axis2_om_stax_builder_t *axis2_om_stax_builder_create(axis2_environment_t *environment, void *parser);
+axis2_om_stax_builder_t *axis2_om_stax_builder_create (axis2_environment_t *
+ environment,
+ void *parser);
#define axis2_om_stax_builder_next(environment, builder) ((builder)->ops->axis2_om_stax_builder_ops_next(environment, builder))
#define axis2_om_stax_builder_discard_current_element(environment, builder) ((builder)->ops->axis2_om_stax_builder_ops_discard_current_element(environment, builder))
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=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_text.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_text.h Fri Oct 21 01:28:57 2005
@@ -14,6 +14,12 @@
* limitations under the License.
*/
+/** @defgroup axis2_om AXIOM (Axis Object Model)
+ * @ingroup axis2
+ * @{
+ */
+
+/** @} */
#ifndef AXIS2_OM_TEXT_H
#define AXIS2_OM_TEXT_H
@@ -26,16 +32,10 @@
#include <axis2_om_node.h>
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
-/** @defgroup axis2_om AXIOM (Axis Object Model)
- * @ingroup axis2
- * @{
- */
-
-/** @} */
-
/**
* @defgroup axis2_om_text OM Text
* @ingroup axis2_om
@@ -43,63 +43,72 @@
*/
/** @cond */
-struct axis2_om_text;
-struct axis2_om_text_ops;
+ struct axis2_om_text;
+ struct axis2_om_text_ops;
/** @endcond */
-
+
/** @struct axis2_om_text_ops
@brief OM text operations struct
Encapsulator struct for operations of axis2_om_text_t
*/
-typedef struct axis2_om_text_ops
-{
+ typedef struct axis2_om_text_ops
+ {
/**
* Free an axis2_om_text_t structure
* @return Status code
*/
- axis2_status_t (*axis2_om_text_ops_free)(axis2_environment_t *environment, struct axis2_om_text *om_text);
-
+ axis2_status_t (*axis2_om_text_ops_free) (axis2_environment_t *
+ environment,
+ struct axis2_om_text *
+ om_text);
+
/**
* Serialize operation
* @param om_output OM output handler to be used in serializing
* @return Status code
*/
- axis2_status_t (*axis2_om_text_ops_serialize)(axis2_environment_t *environment, const struct axis2_om_text *om_text, axis2_om_output_t* om_output);
-} axis2_om_text_ops_t;
-
+ axis2_status_t (*axis2_om_text_ops_serialize) (axis2_environment_t *
+ environment,
+ const struct
+ axis2_om_text *
+ om_text,
+ axis2_om_output_t *
+ om_output);
+ } axis2_om_text_ops_t;
+
/** \struct axis2_om_text
\brief OM Text struct
Handles the XML text in OM
*/
-typedef struct axis2_om_text
-{
+ typedef struct axis2_om_text
+ {
/**
* OM text related operations
*/
- axis2_om_text_ops_t* ops;
-
+ axis2_om_text_ops_t *ops;
+
/**
* Text value
- */
- axis2_char_t *value;
-
+ */
+ axis2_char_t *value;
+
/**
* The following fields are for MTOM
*/
- /*axis2_om_namespace_t *ns;*/
- axis2_char_t *mime_type;
- int optimize;
- axis2_char_t *localname;
- int is_binary;
- axis2_char_t *content_id;
- /*axis2_om_attribute_t *attribute;*/
-} axis2_om_text_t;
+ /*axis2_om_namespace_t *ns; */
+ axis2_char_t *mime_type;
+ int optimize;
+ axis2_char_t *localname;
+ int is_binary;
+ axis2_char_t *content_id;
+ /*axis2_om_attribute_t *attribute; */
+ } axis2_om_text_t;
/**
- * Create a text struct and stores it in a node struct and returns a pointer
+ * Creates a text struct and stores it in a node struct and returns a pointer
* to the newly created text struct
* @param environment Environment. MUST NOT be NULL, if NULL behaviour is undefined.
* @param parent Parent of the new node. If null newly created node becomes a root node
@@ -109,8 +118,10 @@
* @return pointer to newly created text struct
*/
-axis2_om_text_t *axis2_om_text_create(axis2_environment_t *environment, axis2_om_node_t *parent,const axis2_char_t *value
- ,axis2_om_node_t **node);
+ axis2_om_text_t *axis2_om_text_create (axis2_environment_t * environment,
+ axis2_om_node_t * parent,
+ const axis2_char_t * value,
+ axis2_om_node_t ** node);
#define axis2_om_text_serialize(environment, om_text, om_output) ((om_text)->ops->axis2_om_text_ops_serialize(environment, om_text, om_output))
#define axis2_om_text_free(environment, om_text) ((om_text)->ops->axis2_om_text_ops_free(environment, om_text))
@@ -121,4 +132,4 @@
}
#endif
-#endif /* AXIS2_OM_TEXT_H */
+#endif /* AXIS2_OM_TEXT_H */
Modified: webservices/axis2/trunk/c/include/axis2_qname.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_qname.h?rev=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_qname.h (original)
+++ webservices/axis2/trunk/c/include/axis2_qname.h Fri Oct 21 01:28:57 2005
@@ -26,7 +26,8 @@
#include <axis2_environment.h>
-static const axis2_char_t XML_NAMESPACE_URI[] ="http://www.w3c.org/XML/1998/namespace";
+static const axis2_char_t XML_NAMESPACE_URI[] =
+ "http://www.w3c.org/XML/1998/namespace";
struct axis2_qname;
struct axis2_qname_ops;
@@ -36,9 +37,10 @@
/**
* Free a qname struct
* @return Status code
- */
- axis2_status_t (*axis2_qname_ops_free)(axis2_environment_t *environment,struct axis2_qname *qname);
-
+ */
+ axis2_status_t (*axis2_qname_ops_free) (axis2_environment_t * environment,
+ struct axis2_qname * qname);
+
/**
* Compare two qnames
* prefix is ignored when comparing
@@ -46,26 +48,28 @@
* @return true if qname1 equals qname2, false otherwise
*/
- axis2_bool_t (*axis2_qname_ops_equals)(axis2_environment_t *environment,struct axis2_qname *qname1,struct axis2_qname *qname2);
+ axis2_bool_t (*axis2_qname_ops_equals) (axis2_environment_t * environment,
+ struct axis2_qname * qname1,
+ struct axis2_qname * qname2);
-}axis2_qname_ops_t;
+} axis2_qname_ops_t;
typedef struct axis2_qname
{
/** operations related to qname */
- axis2_qname_ops_t *ops;
-
+ axis2_qname_ops_t *ops;
+
/** localpart of qname is mandatory */
-
+
axis2_char_t *localpart;
-
+
/** namespace uri is optional */
axis2_char_t *namespace_uri;
-
+
/** prefix mandatory */
axis2_char_t *prefix;
-
-}axis2_qname_t;
+
+} axis2_qname_t;
/**
* creates a qname struct
@@ -78,7 +82,10 @@
* @return a pointer to newly created qname struct
*/
-axis2_qname_t *axis2_qname_create(axis2_environment_t *environment ,const axis2_char_t *localpart,const axis2_char_t *namespace_uri, const axis2_char_t *prefix);
+axis2_qname_t *axis2_qname_create (axis2_environment_t * environment,
+ const axis2_char_t * localpart,
+ const axis2_char_t * namespace_uri,
+ const axis2_char_t * prefix);
#define axis2_qname_free(environment,qname) ((qname)->ops->axis2_qname_ops_free(environment,qname))
Modified: webservices/axis2/trunk/c/include/axis2_stream.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_stream.h?rev=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_stream.h (original)
+++ webservices/axis2/trunk/c/include/axis2_stream.h Fri Oct 21 01:28:57 2005
@@ -20,28 +20,69 @@
#include <axis2_allocator.h>
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
-struct axis2_stream;
-struct axis2_stream_ops;
+ struct axis2_stream;
+ struct axis2_stream_ops;
-typedef struct axis2_stream_ops {
- int (*axis2_stream_read)(void *buffer, size_t count);
- int (*axis2_stream_write)(const void *buffer, size_t count);
-} axis2_stream_ops_t;
-
-typedef struct axis2_stream {
- struct axis2_stream_ops *ops;
-} axis2_stream_t;
+/**
+ * @defgroup axis2_stream Stream
+ * @ingroup axis2_util
+ * @{
+ */
+
+ /**
+ * \brief Axis2 stream operations struct
+ *
+ * Encapsulator struct for operations of axis2_stream
+ */
+ typedef struct axis2_stream_ops
+ {
+ /**
+ * reads from stream
+ * @param buffer buffer into which the content is to be read
+ * @param size size of the buffer
+ * @return satus of the operation. AXIS2_SUCCESS on success else AXIS2_FAILURE
+ */
+ AXIS2_DECLARE(axis2_status_t) (*axis2_stream_ops_read) (void *buffer, size_t count);
+ /**
+ * writes into stream
+ * @param buffer buffer to be written
+ * @param size size of the buffer
+ * @return satus of the operation. AXIS2_SUCCESS on success else AXIS2_FAILURE
+ */
+ AXIS2_DECLARE(axis2_status_t) (*axis2_stream_ops_write) (const void *buffer, size_t count);
+ } axis2_stream_ops_t;
+
+ /**
+ * \brief Axis2 Stream struct
+ *
+ * Stream is the encapsulating struct for all stream related operations
+ */
+ typedef struct axis2_stream
+ {
+ /** Stream related operations */
+ struct axis2_stream_ops *ops;
+ } axis2_stream_t;
+
+ /**
+ * Creates a stream struct
+ * @param allocator allocator to be used. Mandatory, cannot be NULL
+ * @param operations operations struct. Optional, can be NULL. If null default operations would be assigned.
+ * @return pointer to the newly created log struct
+ */
+ AXIS2_DECLARE(axis2_stream_t *) axis2_stream_create (axis2_allocator_t * allocator,
+ axis2_stream_ops_t * operations);
-axis2_stream_t *axis2_stream_create(axis2_allocator_t* allocator, axis2_stream_ops_t* operations);
-
-#define axis2_stream_read(stream, buffer, count) ((stream)->ops->axis2_stream_read(buffer, count))
-#define axis2_stream_write(stream, buffer, count) ((stream)->ops->axis2_stream_write(buffer, count))
+#define axis2_stream_read(stream, buffer, count) ((stream)->ops->axis2_stream_ops_read(buffer, count))
+#define axis2_stream_write(stream, buffer, count) ((stream)->ops->axis2_stream_ops_write(buffer, count))
+/** @} */
+
#ifdef __cplusplus
}
#endif
-
-#endif /* AXIS2_STREAM_H */
+
+#endif /* AXIS2_STREAM_H */
Modified: webservices/axis2/trunk/c/include/axis2_string.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_string.h?rev=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_string.h (original)
+++ webservices/axis2/trunk/c/include/axis2_string.h Fri Oct 21 01:28:57 2005
@@ -21,30 +21,55 @@
#include <axis2_allocator.h>
#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct axis2_string
+extern "C"
{
- void* (*axis2_string_strdup)(const void *ptr);
- int (*axis2_string_strcmp)(const axis2_char_t *s1, const axis2_char_t *s2);
-}axis2_string_t;
+#endif
/**
-* if the parsed string is null a default string is created
-* otherwise the parsed string is returned. If there isn't enough
-* memory for allocation NULL is returned.
-* @param string user defined allcator
-*/
+ * @defgroup axis2_string String
+ * @ingroup axis2_util
+ * @{
+ */
+
+/**
+ * \brief Axis2 string operations
+ *
+ * Encapsulator for string handling routines
+ */
+ typedef struct axis2_string
+ {
+ /**
+ * duplicates the given string
+ * @param ptr string to be duplicated
+ * @return pointer to the duplicated string
+ */
+ AXIS2_DECLARE(void *) (*axis2_string_strdup) (const void *ptr);
+ /**
+ * compares the given two strings
+ * @param s1 first string to be compared
+ * @param s2 second string to be compared
+ * @return 0 if the two strings are equal, else non zero
+ */
+ AXIS2_DECLARE(int) (*axis2_string_strcmp) (const axis2_char_t * s1,
+ const axis2_char_t * s2);
+ } axis2_string_t;
+
+ /**
+ * Creates) a string struct
+ * @param allocator allocator to be used. Mandatory, cannot be NULL
+ * @param string user defined string. Optional, can be NULL. If NULL, a default string will be returned.
+ * @return pointer to newly created string. NULL on error.
+ */
+ AXIS2_DECLARE(axis2_string_t *) axis2_string_create (axis2_allocator_t * allocator,
+ axis2_string_t * string);
-axis2_string_t *
- axis2_string_create(axis2_allocator_t *allocator, axis2_string_t *string);
-
#define axis2_strdup(string, ptr) ((string)->axis2_string_strdup(ptr))
#define axis2_strcmp(string, s1, s2) ((string)->axis2_string_strcmp(s1, s2))
+/** @} */
+
#ifdef __cplusplus
}
#endif
-#endif /* AXIS2_STRING_H */
+#endif /* AXIS2_STRING_H */
Modified: webservices/axis2/trunk/c/modules/util/src/axis2_allocator.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/src/axis2_allocator.c?rev=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/src/axis2_allocator.c (original)
+++ webservices/axis2/trunk/c/modules/util/src/axis2_allocator.c Fri Oct 21 01:28:57 2005
@@ -16,24 +16,23 @@
#include <axis2_allocator.h>
#include <stdlib.h>
-#include <string.h>
-axis2_allocator_t *axis2_allocator_init(
- axis2_allocator_t *allocator)
+axis2_allocator_t *
+axis2_allocator_init (axis2_allocator_t * allocator)
{
- if(allocator)
+ if (allocator)
return allocator;
-
+
else
{
- allocator = (axis2_allocator_t*)malloc(sizeof(axis2_allocator_t));
- if(allocator)
+ allocator = (axis2_allocator_t *) malloc (sizeof (axis2_allocator_t));
+ if (allocator)
{
allocator->axis2_allocator_malloc = malloc;
allocator->axis2_allocator_realloc = realloc;
allocator->axis2_allocator_free = free;
return allocator;
}
- }
+ }
return NULL;
}
Modified: webservices/axis2/trunk/c/modules/util/src/axis2_environment.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/src/axis2_environment.c?rev=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/src/axis2_environment.c (original)
+++ webservices/axis2/trunk/c/modules/util/src/axis2_environment.c Fri Oct 21 01:28:57 2005
@@ -16,13 +16,18 @@
#include <axis2_environment.h>
-axis2_environment_t *axis2_environment_create(axis2_allocator_t *allocator, axis2_error_t *error, axis2_stream_t *stream, axis2_log_t *log, axis2_string_t *string)
+axis2_environment_t *
+axis2_environment_create (axis2_allocator_t * allocator,
+ axis2_error_t * error, axis2_stream_t * stream,
+ axis2_log_t * log, axis2_string_t * string)
{
axis2_environment_t *environment;
if (!allocator)
return NULL;
- environment = (axis2_environment_t*)axis2_malloc(allocator, sizeof(axis2_environment_t));
+ environment =
+ (axis2_environment_t *) axis2_malloc (allocator,
+ sizeof (axis2_environment_t));
if (!environment)
return NULL;
@@ -30,25 +35,24 @@
environment->allocator = allocator;
if (!error)
- environment->error = axis2_error_create(allocator);
+ environment->error = axis2_error_create (allocator);
else
environment->error = error;
if (!stream)
- environment->stream = axis2_stream_create(allocator, NULL);
+ environment->stream = axis2_stream_create (allocator, NULL);
else
environment->stream = stream;
if (!log)
- environment->log = axis2_log_create(allocator, NULL);
+ environment->log = axis2_log_create (allocator, NULL);
else
environment->log = log;
if (!string)
- environment->string = axis2_string_create(allocator, NULL);
+ environment->string = axis2_string_create (allocator, NULL);
else
environment->string = string;
return environment;
}
-
Modified: webservices/axis2/trunk/c/modules/util/src/axis2_error.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/src/axis2_error.c?rev=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/src/axis2_error.c (original)
+++ webservices/axis2/trunk/c/modules/util/src/axis2_error.c Fri Oct 21 01:28:57 2005
@@ -16,33 +16,39 @@
#include <axis2_error.h>
-axis2_char_t *axis2_error_ops_get_message();
+axis2_char_t * axis2_error_impl_get_message ();
-axis2_char_t *axis2_error_ops_get_message()
-{
- return "This is the default error code";
-}
-
-axis2_error_t *axis2_error_create(axis2_allocator_t* allocator)
+axis2_error_t *
+axis2_error_create (axis2_allocator_t * allocator)
{
axis2_error_t *error;
if (!allocator)
return NULL;
-
- error = (axis2_error_t*)axis2_malloc(allocator, sizeof(axis2_error_t ));
+
+ error =
+ (axis2_error_t *) axis2_malloc (allocator, sizeof (axis2_error_t));
if (!error)
return NULL;
-
- error->ops = (axis2_error_ops_t*)axis2_malloc(allocator, sizeof(axis2_error_ops_t));
+
+ error->ops =
+ (axis2_error_ops_t *) axis2_malloc (allocator,
+ sizeof (axis2_error_ops_t));
if (!error->ops)
{
- axis2_free(allocator, error);
+ axis2_free (allocator, error);
return NULL;
}
-
- error->ops->get_message = axis2_error_ops_get_message;
-
+
+ error->ops->axis2_error_ops_get_message = axis2_error_impl_get_message;
+
return error;
+}
+
+axis2_char_t *
+axis2_error_impl_get_message ()
+{
+ /** TODO: Need to fill in the error message list and get the error from that list */
+ return "This is the default error code";
}
Modified: webservices/axis2/trunk/c/modules/util/src/axis2_hash.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/src/axis2_hash.c?rev=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/src/axis2_hash.c (original)
+++ webservices/axis2/trunk/c/modules/util/src/axis2_hash.c Fri Oct 21 01:28:57 2005
@@ -31,12 +31,13 @@
typedef struct axis2_hash_entry_t axis2_hash_entry_t;
-struct axis2_hash_entry_t {
+struct axis2_hash_entry_t
+{
axis2_hash_entry_t *next;
- unsigned int hash;
- const void *key;
- axis2_ssize_t klen;
- const void *val;
+ unsigned int hash;
+ const void *key;
+ axis2_ssize_t klen;
+ const void *val;
};
/*
@@ -46,10 +47,11 @@
* hash entry to be freed or otherwise mangled between calls to
* axis2_hash_next().
*/
-struct axis2_hash_index_t {
- axis2_hash_t *ht;
- axis2_hash_entry_t *this, *next;
- unsigned int index;
+struct axis2_hash_index_t
+{
+ axis2_hash_t *ht;
+ axis2_hash_entry_t *this, *next;
+ unsigned int index;
};
/*
@@ -59,45 +61,50 @@
* The count of hash entries may be greater depending on the chosen
* collision rate.
*/
-struct axis2_hash_t {
- axis2_environment_t *environment;
- axis2_hash_entry_t **array;
- axis2_hash_index_t iterator; /* For axis2_hash_first(NULL, ...) */
- unsigned int count, max;
- axis2_hashfunc_t hash_func;
- axis2_hash_entry_t *free; /* List of recycled entries */
+struct axis2_hash_t
+{
+ axis2_environment_t *environment;
+ axis2_hash_entry_t **array;
+ axis2_hash_index_t iterator; /* For axis2_hash_first(NULL, ...) */
+ unsigned int count, max;
+ axis2_hashfunc_t hash_func;
+ axis2_hash_entry_t *free; /* List of recycled entries */
};
-#define INITIAL_MAX 15 /* tunable == 2^n - 1 */
+#define INITIAL_MAX 15 /* tunable == 2^n - 1 */
/*
* Hash creation functions.
*/
-static axis2_hash_entry_t **alloc_array(axis2_hash_t *ht, unsigned int max)
+static axis2_hash_entry_t **
+alloc_array (axis2_hash_t * ht, unsigned int max)
{
- return memset (axis2_malloc(ht->environment->allocator,
- sizeof(*ht->array) * (max + 1)), 0, sizeof(*ht->array) * (max + 1) );
+ return memset (axis2_malloc (ht->environment->allocator,
+ sizeof (*ht->array) * (max + 1)), 0,
+ sizeof (*ht->array) * (max + 1));
}
-axis2_hash_t *axis2_hash_make(axis2_environment_t *environment)
+axis2_hash_t *
+axis2_hash_make (axis2_environment_t * environment)
{
axis2_hash_t *ht;
- ht = axis2_malloc(environment->allocator, sizeof(axis2_hash_t));
+ ht = axis2_malloc (environment->allocator, sizeof (axis2_hash_t));
ht->environment = environment;
ht->free = NULL;
ht->count = 0;
ht->max = INITIAL_MAX;
- ht->array = alloc_array(ht, ht->max);
+ ht->array = alloc_array (ht, ht->max);
ht->hash_func = axis2_hashfunc_default;
return ht;
}
-axis2_hash_t *axis2_hash_make_custom(axis2_environment_t *environment,
- axis2_hashfunc_t hash_func)
+axis2_hash_t *
+axis2_hash_make_custom (axis2_environment_t * environment,
+ axis2_hashfunc_t hash_func)
{
- axis2_hash_t *ht = axis2_hash_make(environment);
+ axis2_hash_t *ht = axis2_hash_make (environment);
ht->hash_func = hash_func;
return ht;
}
@@ -107,10 +114,12 @@
* Hash iteration functions.
*/
-axis2_hash_index_t *axis2_hash_next(axis2_hash_index_t *hi)
+axis2_hash_index_t *
+axis2_hash_next (axis2_hash_index_t * hi)
{
hi->this = hi->next;
- while (!hi->this) {
+ while (!hi->this)
+ {
if (hi->index > hi->ht->max)
return NULL;
@@ -120,11 +129,12 @@
return hi;
}
-axis2_hash_index_t *axis2_hash_first(axis2_environment_t *environment, axis2_hash_t *ht)
+axis2_hash_index_t *
+axis2_hash_first (axis2_environment_t * environment, axis2_hash_t * ht)
{
axis2_hash_index_t *hi;
if (environment)
- hi = axis2_malloc(environment->allocator, sizeof(*hi));
+ hi = axis2_malloc (environment->allocator, sizeof (*hi));
else
hi = &ht->iterator;
@@ -132,17 +142,19 @@
hi->index = 0;
hi->this = NULL;
hi->next = NULL;
- return axis2_hash_next(hi);
+ return axis2_hash_next (hi);
}
-void axis2_hash_this(axis2_hash_index_t *hi,
- const void **key,
- axis2_ssize_t *klen,
- void **val)
-{
- if (key) *key = hi->this->key;
- if (klen) *klen = hi->this->klen;
- if (val) *val = (void *)hi->this->val;
+void
+axis2_hash_this (axis2_hash_index_t * hi,
+ const void **key, axis2_ssize_t * klen, void **val)
+{
+ if (key)
+ *key = hi->this->key;
+ if (klen)
+ *klen = hi->this->klen;
+ if (val)
+ *val = (void *) hi->this->val;
}
@@ -150,15 +162,17 @@
* Expanding a hash table
*/
-static void expand_array(axis2_hash_t *ht)
+static void
+expand_array (axis2_hash_t * ht)
{
axis2_hash_index_t *hi;
axis2_hash_entry_t **new_array;
unsigned int new_max;
new_max = ht->max * 2 + 1;
- new_array = alloc_array(ht, new_max);
- for (hi = axis2_hash_first(NULL, ht); hi; hi = axis2_hash_next(hi)) {
+ new_array = alloc_array (ht, new_max);
+ for (hi = axis2_hash_first (NULL, ht); hi; hi = axis2_hash_next (hi))
+ {
unsigned int i = hi->this->hash & new_max;
hi->this->next = new_array[i];
new_array[i] = hi->this;
@@ -167,13 +181,14 @@
ht->max = new_max;
}
-unsigned int axis2_hashfunc_default(const char *char_key, axis2_ssize_t *klen)
+unsigned int
+axis2_hashfunc_default (const char *char_key, axis2_ssize_t * klen)
{
unsigned int hash = 0;
- const unsigned char *key = (const unsigned char *)char_key;
+ const unsigned char *key = (const unsigned char *) char_key;
const unsigned char *p;
axis2_ssize_t i;
-
+
/*
* This is the popular `times 33' hash algorithm which is used by
* perl and also appears in Berkeley DB. This is one of the best
@@ -211,15 +226,19 @@
*
* -- Ralf S. Engelschall <rs...@engelschall.com>
*/
-
- if (*klen == AXIS2_HASH_KEY_STRING) {
- for (p = key; *p; p++) {
+
+ if (*klen == AXIS2_HASH_KEY_STRING)
+ {
+ for (p = key; *p; p++)
+ {
hash = hash * 33 + *p;
}
*klen = p - key;
}
- else {
- for (p = key, i = *klen; i; i--, p++) {
+ else
+ {
+ for (p = key, i = *klen; i; i--, p++)
+ {
hash = hash * 33 + *p;
}
}
@@ -237,22 +256,21 @@
* that hash entries can be removed.
*/
-static axis2_hash_entry_t **find_entry(axis2_hash_t *ht,
- const void *key,
- axis2_ssize_t klen,
- const void *val)
+static axis2_hash_entry_t **
+find_entry (axis2_hash_t * ht,
+ const void *key, axis2_ssize_t klen, const void *val)
{
axis2_hash_entry_t **hep, *he;
unsigned int hash;
- hash = ht->hash_func(key, &klen);
+ hash = ht->hash_func (key, &klen);
/* scan linked list */
for (hep = &ht->array[hash & ht->max], he = *hep;
- he; hep = &he->next, he = *hep) {
+ he; hep = &he->next, he = *hep)
+ {
if (he->hash == hash
- && he->klen == klen
- && memcmp(he->key, key, klen) == 0)
+ && he->klen == klen && memcmp (he->key, key, klen) == 0)
break;
}
if (he || !val)
@@ -262,41 +280,43 @@
if ((he = ht->free) != NULL)
ht->free = he->next;
else
- he = axis2_malloc(ht->environment->allocator, sizeof(*he));
+ he = axis2_malloc (ht->environment->allocator, sizeof (*he));
he->next = NULL;
he->hash = hash;
- he->key = key;
+ he->key = key;
he->klen = klen;
- he->val = val;
+ he->val = val;
*hep = he;
ht->count++;
return hep;
}
-axis2_hash_t *axis2_hash_copy(axis2_environment_t *environment,
- const axis2_hash_t *orig)
+axis2_hash_t *
+axis2_hash_copy (axis2_environment_t * environment, const axis2_hash_t * orig)
{
axis2_hash_t *ht;
axis2_hash_entry_t *new_vals;
unsigned int i, j;
- ht = axis2_malloc(environment->allocator, sizeof(axis2_hash_t) +
- sizeof(*ht->array) * (orig->max + 1) +
- sizeof(axis2_hash_entry_t) * orig->count);
+ ht = axis2_malloc (environment->allocator, sizeof (axis2_hash_t) +
+ sizeof (*ht->array) * (orig->max + 1) +
+ sizeof (axis2_hash_entry_t) * orig->count);
ht->environment = environment;
ht->free = NULL;
ht->count = orig->count;
ht->max = orig->max;
ht->hash_func = orig->hash_func;
- ht->array = (axis2_hash_entry_t **)((char *)ht + sizeof(axis2_hash_t));
+ ht->array = (axis2_hash_entry_t **) ((char *) ht + sizeof (axis2_hash_t));
- new_vals = (axis2_hash_entry_t *)((char *)(ht) + sizeof(axis2_hash_t) +
- sizeof(*ht->array) * (orig->max + 1));
+ new_vals = (axis2_hash_entry_t *) ((char *) (ht) + sizeof (axis2_hash_t) +
+ sizeof (*ht->array) * (orig->max + 1));
j = 0;
- for (i = 0; i <= ht->max; i++) {
+ for (i = 0; i <= ht->max; i++)
+ {
axis2_hash_entry_t **new_entry = &(ht->array[i]);
axis2_hash_entry_t *orig_entry = orig->array[i];
- while (orig_entry) {
+ while (orig_entry)
+ {
*new_entry = &new_vals[j++];
(*new_entry)->hash = orig_entry->hash;
(*new_entry)->key = orig_entry->key;
@@ -310,27 +330,27 @@
return ht;
}
-void *axis2_hash_get(axis2_hash_t *ht,
- const void *key,
- axis2_ssize_t klen)
+void *
+axis2_hash_get (axis2_hash_t * ht, const void *key, axis2_ssize_t klen)
{
axis2_hash_entry_t *he;
- he = *find_entry(ht, key, klen, NULL);
+ he = *find_entry (ht, key, klen, NULL);
if (he)
- return (void *)he->val;
+ return (void *) he->val;
else
return NULL;
}
-void axis2_hash_set(axis2_hash_t *ht,
- const void *key,
- axis2_ssize_t klen,
- const void *val)
+void
+axis2_hash_set (axis2_hash_t * ht,
+ const void *key, axis2_ssize_t klen, const void *val)
{
axis2_hash_entry_t **hep;
- hep = find_entry(ht, key, klen, val);
- if (*hep) {
- if (!val) {
+ hep = find_entry (ht, key, klen, val);
+ if (*hep)
+ {
+ if (!val)
+ {
/* delete entry */
axis2_hash_entry_t *old = *hep;
*hep = (*hep)->next;
@@ -338,81 +358,92 @@
ht->free = old;
--ht->count;
}
- else {
+ else
+ {
/* replace entry */
(*hep)->val = val;
/* check that the collision rate isn't too high */
- if (ht->count > ht->max) {
- expand_array(ht);
+ if (ht->count > ht->max)
+ {
+ expand_array (ht);
}
}
}
/* else key not present and val==NULL */
}
-unsigned int axis2_hash_count(axis2_hash_t *ht)
+unsigned int
+axis2_hash_count (axis2_hash_t * ht)
{
return ht->count;
}
-axis2_hash_t *axis2_hash_overlay(axis2_environment_t *environment,
- const axis2_hash_t *overlay,
- const axis2_hash_t *base)
-{
- return axis2_hash_merge(environment, overlay, base, NULL, NULL);
-}
-
-axis2_hash_t *axis2_hash_merge(axis2_environment_t *environment,
- const axis2_hash_t *overlay,
- const axis2_hash_t *base,
- void * (*merger)(axis2_environment_t *environment,
- const void *key,
- axis2_ssize_t klen,
- const void *h1_val,
- const void *h2_val,
- const void *data),
- const void *data)
+axis2_hash_t *
+axis2_hash_overlay (axis2_environment_t * environment,
+ const axis2_hash_t * overlay, const axis2_hash_t * base)
+{
+ return axis2_hash_merge (environment, overlay, base, NULL, NULL);
+}
+
+axis2_hash_t *
+axis2_hash_merge (axis2_environment_t * environment,
+ const axis2_hash_t * overlay,
+ const axis2_hash_t * base,
+ void *(*merger) (axis2_environment_t * environment,
+ const void *key,
+ axis2_ssize_t klen,
+ const void *h1_val,
+ const void *h2_val,
+ const void *data), const void *data)
{
axis2_hash_t *res;
axis2_hash_entry_t *new_vals = NULL;
axis2_hash_entry_t *iter;
axis2_hash_entry_t *ent;
- unsigned int i,j,k;
+ unsigned int i, j, k;
#if AXIS2_POOL_DEBUG
/* we don't copy keys and values, so it's necessary that
* overlay->a.environment and base->a.environment have a life span at least
* as long as p
*/
- if (!axis2_environment_is_ancestor(overlay->environment, p)) {
- fprintf(stderr,
- "axis2_hash_merge: overlay's environment is not an ancestor of p\n");
- abort();
- }
- if (!axis2_environment_is_ancestor(base->environment, p)) {
- fprintf(stderr,
- "axis2_hash_merge: base's environment is not an ancestor of p\n");
- abort();
+ if (!axis2_environment_is_ancestor (overlay->environment, p))
+ {
+ fprintf (stderr,
+ "axis2_hash_merge: overlay's environment is not an ancestor of p\n");
+ abort ();
+ }
+ if (!axis2_environment_is_ancestor (base->environment, p))
+ {
+ fprintf (stderr,
+ "axis2_hash_merge: base's environment is not an ancestor of p\n");
+ abort ();
}
#endif
- res = axis2_malloc(environment->allocator, sizeof(axis2_hash_t));
+ res = axis2_malloc (environment->allocator, sizeof (axis2_hash_t));
res->environment = environment;
res->free = NULL;
res->hash_func = base->hash_func;
res->count = base->count;
res->max = (overlay->max > base->max) ? overlay->max : base->max;
- if (base->count + overlay->count > res->max) {
+ if (base->count + overlay->count > res->max)
+ {
res->max = res->max * 2 + 1;
}
- res->array = alloc_array(res, res->max);
- if (base->count + overlay->count) {
- new_vals = axis2_malloc(environment->allocator, sizeof(axis2_hash_entry_t) *
- (base->count + overlay->count));
+ res->array = alloc_array (res, res->max);
+ if (base->count + overlay->count)
+ {
+ new_vals =
+ axis2_malloc (environment->allocator,
+ sizeof (axis2_hash_entry_t) * (base->count +
+ overlay->count));
}
j = 0;
- for (k = 0; k <= base->max; k++) {
- for (iter = base->array[k]; iter; iter = iter->next) {
+ for (k = 0; k <= base->max; k++)
+ {
+ for (iter = base->array[k]; iter; iter = iter->next)
+ {
i = iter->hash & res->max;
new_vals[j].klen = iter->klen;
new_vals[j].key = iter->key;
@@ -424,23 +455,31 @@
}
}
- for (k = 0; k <= overlay->max; k++) {
- for (iter = overlay->array[k]; iter; iter = iter->next) {
+ for (k = 0; k <= overlay->max; k++)
+ {
+ for (iter = overlay->array[k]; iter; iter = iter->next)
+ {
i = iter->hash & res->max;
- for (ent = res->array[i]; ent; ent = ent->next) {
+ for (ent = res->array[i]; ent; ent = ent->next)
+ {
if ((ent->klen == iter->klen) &&
- (memcmp(ent->key, iter->key, iter->klen) == 0)) {
- if (merger) {
- ent->val = (*merger)(environment, iter->key, iter->klen,
- iter->val, ent->val, data);
+ (memcmp (ent->key, iter->key, iter->klen) == 0))
+ {
+ if (merger)
+ {
+ ent->val =
+ (*merger) (environment, iter->key, iter->klen,
+ iter->val, ent->val, data);
}
- else {
+ else
+ {
ent->val = iter->val;
}
break;
}
}
- if (!ent) {
+ if (!ent)
+ {
new_vals[j].klen = iter->klen;
new_vals[j].key = iter->key;
new_vals[j].val = iter->val;
@@ -454,4 +493,3 @@
}
return res;
}
-
Modified: webservices/axis2/trunk/c/modules/util/src/axis2_log.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/src/axis2_log.c?rev=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/src/axis2_log.c (original)
+++ webservices/axis2/trunk/c/modules/util/src/axis2_log.c Fri Oct 21 01:28:57 2005
@@ -17,47 +17,50 @@
#include <axis2_log.h>
#include <stdio.h>
-int axis2_log_ops_write(const void *buffer, size_t count);
+axis2_status_t axis2_log_impl_write (const void *buffer, size_t count);
-axis2_log_t *axis2_log_create(axis2_allocator_t* allocator, axis2_log_ops_t* operations)
-{
+axis2_log_t *
+axis2_log_create (axis2_allocator_t * allocator, axis2_log_ops_t * operations)
+{
axis2_log_t *log;
if (!allocator)
return NULL;
- log = (axis2_log_t*)axis2_malloc(allocator, sizeof(axis2_log_t));
+ log = (axis2_log_t *) axis2_malloc (allocator, sizeof (axis2_log_t));
if (!log)
return NULL;
-
+
if (operations)
log->ops = operations;
else
{
- log->ops = (axis2_log_ops_t*)axis2_malloc(allocator, sizeof(axis2_log_ops_t));
+ log->ops =
+ (axis2_log_ops_t *) axis2_malloc (allocator,
+ sizeof (axis2_log_ops_t));
if (!log->ops)
{
- axis2_free(allocator, log);
+ axis2_free (allocator, log);
return NULL;
}
-
- log->ops->write = axis2_log_ops_write;
+
+ log->ops->axis2_log_ops_write = axis2_log_impl_write;
}
-
+
return log;
}
-int axis2_log_ops_write(const void *buffer, size_t count)
+axis2_status_t
+axis2_log_impl_write (const void *buffer, size_t count)
{
int i;
if (!buffer)
return -1;
-
- i =0;
- for(i = 0; i < count; i++)
- fprintf(stderr, "%c", ((axis2_char_t*)buffer)[i]);
- printf("\n");
+
+ i = 0;
+ for (i = 0; i < count; i++)
+ fprintf (stderr, "%c", ((axis2_char_t *) buffer)[i]);
+ printf ("\n");
return 0;
}
-
Modified: webservices/axis2/trunk/c/modules/util/src/axis2_stream.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/src/axis2_stream.c?rev=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/src/axis2_stream.c (original)
+++ webservices/axis2/trunk/c/modules/util/src/axis2_stream.c Fri Oct 21 01:28:57 2005
@@ -17,61 +17,67 @@
#include <axis2_stream.h>
#include <stdio.h>
-int axis2_stream_ops_read (void *buffer, size_t count);
-int axis2_stream_ops_write(const void *buffer, size_t count);
-
-axis2_stream_t *axis2_stream_create(axis2_allocator_t* allocator, axis2_stream_ops_t* operations)
+axis2_status_t axis2_stream_impl_write (const void *buffer, size_t count);
+axis2_status_t axis2_stream_impl_read (void *buffer, size_t count);
+axis2_stream_t *
+axis2_stream_create (axis2_allocator_t * allocator,
+ axis2_stream_ops_t * operations)
{
axis2_stream_t *stream;
if (!allocator)
return NULL;
- stream = (axis2_stream_t*)axis2_malloc(allocator, sizeof(axis2_stream_t));
+ stream =
+ (axis2_stream_t *) axis2_malloc (allocator, sizeof (axis2_stream_t));
if (!stream)
return NULL;
-
+
if (operations)
stream->ops = operations;
else
{
- stream->ops = (axis2_stream_ops_t*)axis2_malloc(allocator, sizeof(axis2_stream_ops_t));
+ stream->ops =
+ (axis2_stream_ops_t *) axis2_malloc (allocator,
+ sizeof (axis2_stream_ops_t));
if (!stream->ops)
{
- axis2_free(allocator, stream);
+ axis2_free (allocator, stream);
return NULL;
}
-
- stream->ops->axis2_stream_read = axis2_stream_ops_read;
- stream->ops->axis2_stream_write = axis2_stream_ops_write;
+
+ stream->ops->axis2_stream_ops_read = axis2_stream_impl_read;
+ stream->ops->axis2_stream_ops_write = axis2_stream_impl_write;
}
-
+
return stream;
}
-int axis2_stream_ops_read (void *buffer, size_t count)
+axis2_status_t
+axis2_stream_impl_read (void *buffer, size_t count)
{
int i;
if (!buffer)
return -1;
i = 0;
- for(i = 0; i < count -1; i++ )
+ for (i = 0; i < count - 1; i++)
{
- ((axis2_char_t*)buffer)[i] = 'a';
+ ((axis2_char_t *) buffer)[i] = 'a';
}
- ((axis2_char_t*)buffer)[i] = '\0';
+ ((axis2_char_t *) buffer)[i] = '\0';
return 0;
}
-int axis2_stream_ops_write(const void *buffer, size_t count)
+axis2_status_t
+axis2_stream_impl_write (const void *buffer, size_t count)
{
- int i ;
+ int i;
if (!buffer)
return -1;
-
- i =0;
- for(i = 0; i < count; i++)
- printf("%c", ((axis2_char_t*)buffer)[i]);
+
+ i = 0;
+ for (i = 0; i < count; i++)
+ printf ("%c", ((axis2_char_t *) buffer)[i]);
return 0;
}
Modified: webservices/axis2/trunk/c/modules/util/src/axis2_string.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/src/axis2_string.c?rev=327117&r1=327116&r2=327117&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/src/axis2_string.c (original)
+++ webservices/axis2/trunk/c/modules/util/src/axis2_string.c Fri Oct 21 01:28:57 2005
@@ -18,40 +18,44 @@
#include <stdlib.h>
#include <string.h>
-void* axis2_string_ops_strdup(const void* ptr)
+void *
+axis2_string_ops_strdup (const void *ptr)
{
if (ptr)
- return (void*)strdup(ptr);
+ return (void *) strdup (ptr);
else
return NULL;
}
-int axis2_string_ops_strcmp(const axis2_char_t *s1, const axis2_char_t *s2)
+int
+axis2_string_ops_strcmp (const axis2_char_t * s1, const axis2_char_t * s2)
{
if (s1 && s2)
- return strcmp(s1, s2);
+ return strcmp (s1, s2);
else
return -1;
}
-axis2_string_t *axis2_string_create(axis2_allocator_t *allocator,
- axis2_string_t *string)
+axis2_string_t *
+axis2_string_create (axis2_allocator_t * allocator, axis2_string_t * string)
{
- if(string)
+ if (string)
return string;
if (!allocator)
return NULL;
-
+
else
{
- string = (axis2_string_t*)axis2_malloc(allocator, sizeof(axis2_string_t));
- if(string)
+ string =
+ (axis2_string_t *) axis2_malloc (allocator,
+ sizeof (axis2_string_t));
+ if (string)
{
string->axis2_string_strdup = axis2_string_ops_strdup;
string->axis2_string_strcmp = axis2_string_ops_strcmp;
return string;
}
- }
+ }
return NULL;
}