You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by na...@apache.org on 2006/05/15 11:31:15 UTC
svn commit: r406594 [3/8] - in
/webservices/axis2/trunk/c/modules/xml/xml_schema: ./ include/xml_schema/
Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema_xpath.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema_xpath.h?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema_xpath.h (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema_xpath.h Mon May 15 02:31:10 2006
@@ -57,6 +57,14 @@
axis2_xml_schema_annotated_t *(AXIS2_CALL *
get_base_impl) (void *xpath,
axis2_env_t **env);
+
+ axis2_xml_schema_types_t (AXIS2_CALL *
+ type)(void *xpath,
+ axis2_env_t **env);
+
+ axis2_hash_t* (AXIS2_CALL *
+ super_objs)(void *xpath,
+ axis2_env_t **env);
axis2_char_t *(AXIS2_CALL *
get_xpath)(void *xpath,
@@ -85,14 +93,15 @@
/**
* This method is internal to Axis2 C. It is called from Child Constructor
- */
+
AXIS2_DECLARE(axis2_status_t)
axis2_xml_schema_xpath_resolve_methods(
axis2_xml_schema_xpath_t *xpath,
axis2_env_t **env,
axis2_xml_schema_xpath_t *xpath_impl,
axis2_hash_t *methods);
-
+ */
+
#define AXIS2_XML_SCHEMA_XPATH_FREE(xpath, env) \
(((axis2_xml_schema_xpath_t *) xpath)->ops->\
free(xpath, env))
@@ -100,6 +109,14 @@
#define AXIS2_XML_SCHEMA_XPATH_GET_BASE_IMPL(xpath, env) \
(((axis2_xml_schema_xpath_t *) xpath)->ops->\
get_base_impl(xpath, env))
+
+#define AXIS2_XML_SCHEMA_XPATH_TYPE(xpath, env) \
+ (((axis2_xml_schema_xpath_t *) xpath)->ops->\
+ type(xpath, env))
+
+#define AXIS2_XML_SCHEMA_XPATH_SUPER_OBJS(xpath, env) \
+ (((axis2_xml_schema_xpath_t *) xpath)->ops->\
+ super_objs(xpath, env))
#define AXIS2_XML_SCHEMA_XPATH_GET_XPATH(xpath, env) \
(((axis2_xml_schema_xpath_t *) xpath)->ops->\
Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_severity_type.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_severity_type.h?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_severity_type.h (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_severity_type.h Mon May 15 02:31:10 2006
@@ -60,6 +60,14 @@
axis2_array_list_t *(AXIS2_CALL *
get_values)(void *severity,
axis2_env_t **env);
+
+ axis2_hash_t* (AXIS2_CALL *
+ super_objs)(void *severity,
+ axis2_env_t **env);
+
+ axis2_xml_schema_types_t (AXIS2_CALL*
+ type)(void *severity,
+ axis2_env_t **env);
};
@@ -73,15 +81,7 @@
axis2_xml_severity_type_create(axis2_env_t **env,
axis2_char_t* value);
-/**
- * This method is internal to Axis2 C. It is called from Child Constructor
- */
-AXIS2_DECLARE(axis2_status_t)
-axis2_xml_severity_type_resolve_methods(
- axis2_xml_severity_type_t *severity,
- axis2_env_t **env,
- axis2_xml_severity_type_t *severity_impl,
- axis2_hash_t *methods);
+/***************************** Macros ******************************************/
#define AXIS2_XML_SEREVITY_TYPE_FREE(severity, env) \
(((axis2_xml_severity_type_t *) severity)->ops->free(severity, env))
@@ -91,6 +91,12 @@
#define AXIS2_XML_SEREVITY_TYPE_GET_VALUES(severity, env) \
(((axis2_xml_severity_type_t *) severity)->ops->values(severity, env))
+
+#define AXIS2_XML_SEREVITY_TYPE_TYPE(severity, env) \
+ (((axis2_xml_severity_type_t *) severity)->ops->type(severity, env))
+
+#define AXIS2_XML_SEREVITY_TYPE_SUPER_OBJS(severity, env) \
+ (((axis2_xml_severity_type_t *) severity)->ops->super_objs(severity, env))
/** @} */
#ifdef __cplusplus
Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_tokenized_type.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_tokenized_type.h?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_tokenized_type.h (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_tokenized_type.h Mon May 15 02:31:10 2006
@@ -57,6 +57,14 @@
axis2_array_list_t *(AXIS2_CALL *
get_values)(void *tokenized_type,
axis2_env_t **env);
+
+ axis2_hash_t* (AXIS2_CALL *
+ super_objs)(void *tokenized_type,
+ axis2_env_t **env);
+
+ axis2_xml_schema_types_t (AXIS2_CALL *
+ type)(void *tokenized_type,
+ axis2_env_t **env);
};
@@ -70,15 +78,7 @@
axis2_xml_tokenized_type_create(axis2_env_t **env,
axis2_char_t* value);
-/**
- * This method is internal to Axis2 C. It is called from Child Constructor
- */
-AXIS2_DECLARE(axis2_status_t)
-axis2_xml_tokenized_type_resolve_methods(
- axis2_xml_tokenized_type_t *tokenized_type,
- axis2_env_t **env,
- axis2_xml_tokenized_type_t *tokenized_type_impl,
- axis2_hash_t *methods);
+/********************** Macros **************************************************************/
#define AXIS2_XML_TOKENIZED_TYPE_FREE(tokenized_type, env) \
(((axis2_xml_tokenized_type_t *) tokenized_type)->ops->free(tokenized_type, env))
@@ -88,7 +88,12 @@
#define AXIS2_XML_TOKENIZED_TYPE_GET_VALUES(tokenized_type, env) \
(((axis2_xml_tokenized_type_t *) tokenized_type)->ops->values(tokenized_type, env))
+
+#define AXIS2_XML_TOKENIZED_TYPE_SUPER_OBJS(tokenized_type, env) \
+ (((axis2_xml_tokenized_type_t *) tokenized_type)->ops->super_objs(tokenized_type, env))
+#define AXIS2_XML_TOKENIZED_TYPE_TYPE(tokenized_type, env) \
+ (((axis2_xml_tokenized_type_t *) tokenized_type)->ops->type(tokenized_type, env))
/** @} */
#ifdef __cplusplus
}
Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema.c?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema.c Mon May 15 02:31:10 2006
@@ -51,7 +51,7 @@
axis2_bool_t is_compiled;
axis2_char_t *target_namespc;
axis2_char_t *version;
- axis2_hash_t *namespcs;
+ axis2_hash_t *namespaces_map;
axis2_char_t *schema_ns_prefix;
axis2_xml_schema_collection_t *parent;
};
@@ -229,7 +229,7 @@
schema_impl->final_default = NULL;
schema_impl->items = NULL;
schema_impl->includes = NULL;
- schema_impl->namespcs = NULL;
+ schema_impl->namespaces_map = NULL;
schema_impl->elements = NULL;
schema_impl->attr_groups = NULL;
schema_impl->attrs = NULL;
@@ -677,13 +677,27 @@
axis2_char_t *prefix)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
+ AXIS2_PARAM_CHECK((*env)->error, prefix, NULL);
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(NULL != ht_super)
+ {
+
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
+ "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ if(!schema_impl)
+ return NULL;
+ }
+ if(NULL != schema_impl->namespaces_map)
+ {
+ void *result = NULL;
+ result = axis2_hash_get(schema_impl->namespaces_map, prefix,
+ AXIS2_HASH_KEY_STRING);
+ if(NULL != result)
+ return (axis2_char_t *)result ;
+ }
return NULL;
}
@@ -692,14 +706,18 @@
axis2_env_t **env)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
- return NULL;
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(NULL != ht_super)
+ {
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
+ "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ if(!schema_impl)
+ return NULL;
+ }
+ return schema_impl->element_form_default;
}
axis2_status_t AXIS2_CALL
@@ -708,13 +726,22 @@
axis2_xml_schema_form_t *value)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(NULL != ht_super)
+ {
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
+ "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ if(!schema_impl)
+ return AXIS2_FAILURE;
+ }
+ if(NULL != schema_impl->attr_form_default)
+ {
+ /** TODO free*/
+ }
+ schema_impl->attr_form_default = value;
return AXIS2_SUCCESS;
}
@@ -723,14 +750,19 @@
axis2_env_t **env)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(NULL != ht_super)
+ {
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
+ "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ if(!schema_impl)
+ return NULL;
+ }
+ return schema_impl->attr_groups;
- return NULL;
}
axis2_xml_schema_obj_table_t *AXIS2_CALL
@@ -738,14 +770,18 @@
axis2_env_t **env)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
- return NULL;
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(NULL != ht_super)
+ {
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
+ "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ if(!schema_impl)
+ return NULL;
+ }
+ return schema_impl->attrs;
}
axis2_xml_schema_derivation_method_t *AXIS2_CALL
@@ -753,14 +789,18 @@
axis2_env_t **env)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
+ axis2_hash_t *ht_super = NULL;
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
- return NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(NULL != ht_super)
+ {
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
+ "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ if(!schema_impl)
+ return NULL;
+ }
+ return schema_impl->block_default;
}
axis2_status_t AXIS2_CALL
@@ -769,13 +809,23 @@
axis2_xml_schema_derivation_method_t *block_default)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(NULL != ht_super)
+ {
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
+ "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ if(!schema_impl)
+ return AXIS2_FAILURE;
+ }
+ if(NULL != schema_impl->block_default)
+ {
+
+ }
+ schema_impl->block_default = block_default;
return AXIS2_SUCCESS;
}
@@ -784,14 +834,18 @@
axis2_env_t **env)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
- return NULL;
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(NULL != ht_super)
+ {
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
+ "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ if(!schema_impl)
+ return NULL;
+ }
+ return schema_impl->element_form_default;
}
axis2_status_t AXIS2_CALL
@@ -800,13 +854,17 @@
axis2_xml_schema_form_t *element_form_default)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
-
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
+ axis2_hash_t *ht_super = NULL;
+ AXIS2_PARAM_CHECK((*env)->error, element_form_default, AXIS2_FAILURE);
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(NULL != ht_super)
+ {
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
+ "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ if(!schema_impl)
+ return AXIS2_FAILURE;
+ }
+ schema_impl->element_form_default = element_form_default;
return AXIS2_SUCCESS;
}
@@ -815,14 +873,18 @@
axis2_env_t **env)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
- return NULL;
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(NULL != ht_super)
+ {
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
+ "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ if(!schema_impl)
+ return NULL;
+ }
+ return schema_impl->elements;
}
axis2_xml_schema_element_t *AXIS2_CALL
@@ -831,13 +893,22 @@
axis2_qname_t *qname)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
+ axis2_hash_t *ht_super = NULL;
+ AXIS2_PARAM_CHECK((*env)->error, qname, NULL);
- AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(NULL != ht_super)
+ {
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
+ "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ if(!schema_impl)
+ return NULL;
+ }
+ if(NULL != schema_impl->elements)
+ {
+ return AXIS2_XML_SCHEMA_OBJ_TABLE_GET_ITEM(
+ schema_impl->elements, env, qname);
+ }
return NULL;
}
@@ -847,13 +918,22 @@
axis2_qname_t *qname)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
-
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
+ AXIS2_PARAM_CHECK((*env)->error,qname, NULL);
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(NULL != ht_super)
+ {
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
+ "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ if(!schema_impl)
+ return NULL;
+ }
+ if(NULL != schema_impl->schema_types)
+ {
+ return AXIS2_XML_SCHEMA_OBJ_TABLE_GET_ITEM(
+ schema_impl->schema_types, env, qname);
+ }
return NULL;
}
@@ -862,14 +942,16 @@
axis2_env_t **env)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
-
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(!ht_super)
+ return NULL;
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
"AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
- return NULL;
+ if(!schema_impl)
+ return NULL;
+ return schema_impl->final_default;
}
axis2_status_t AXIS2_CALL
@@ -878,13 +960,19 @@
axis2_xml_schema_derivation_method_t *final_default)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
-
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(!ht_super)
+ return AXIS2_FAILURE;
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
+ "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ if(!schema_impl)
+ return AXIS2_FAILURE;
+ if(NULL != schema_impl->final_default)
+ {
+ }
+ schema_impl->final_default = final_default;
return AXIS2_SUCCESS;
}
@@ -893,14 +981,16 @@
axis2_env_t **env)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
-
- AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
+ axis2_hash_t *ht_super = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(!ht_super)
+ return NULL;
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
"AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
- return NULL;
+ if(!schema_impl)
+ return NULL;
+ return schema_impl->groups;
}
axis2_xml_schema_obj_collection_t *AXIS2_CALL
@@ -908,21 +998,34 @@
axis2_env_t **env)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
-
- AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
+ axis2_hash_t *ht_super = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(!ht_super)
+ return NULL;
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
"AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
- return NULL;
+ if(!schema_impl)
+ return NULL;
+
+ return schema_impl->includes;
}
axis2_bool_t AXIS2_CALL
axis2_xml_schema_is_compiled(void *schema,
axis2_env_t **env)
{
- return AXIS2_FALSE;
+ axis2_xml_schema_impl_t *schema_impl = NULL;
+ axis2_hash_t *ht_super = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(!ht_super)
+ return AXIS2_FAILURE;
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
+ "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ if(!schema_impl)
+ return AXIS2_FAILURE;
+ return schema_impl->is_compiled;
}
axis2_xml_schema_obj_collection_t *AXIS2_CALL
@@ -930,15 +1033,16 @@
axis2_env_t **env)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
-
- AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
+ axis2_hash_t *ht_super = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(!ht_super)
+ return NULL;
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
"AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
- return NULL;
-
+ if(!schema_impl)
+ return NULL;
+ return schema_impl->items;
}
axis2_xml_schema_obj_table_t *AXIS2_CALL
@@ -946,14 +1050,16 @@
axis2_env_t **env)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
-
- AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
+ axis2_hash_t *ht_super = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(!ht_super)
+ return NULL;
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
"AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
- return NULL;
+ if(!schema_impl)
+ return NULL;
+ return schema_impl->notations;
}
axis2_xml_schema_obj_table_t *AXIS2_CALL
@@ -961,29 +1067,33 @@
axis2_env_t **env)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
-
- AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
+ axis2_hash_t *ht_super = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(!ht_super)
+ return NULL;
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
"AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
- return NULL;
+ if(!schema_impl)
+ return NULL;
+ return schema_impl->schema_types;
+
}
axis2_char_t *AXIS2_CALL
axis2_xml_schema_get_target_namespace(void *schema,
axis2_env_t **env)
-{
- axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
-
- AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
+{ axis2_xml_schema_impl_t *schema_impl = NULL;
+ axis2_hash_t *ht_super = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(!ht_super)
+ return NULL;
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
"AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
- return NULL;
+ if(!schema_impl)
+ return NULL;
+ return schema_impl->target_namespc;
}
axis2_status_t AXIS2_CALL
@@ -992,13 +1102,23 @@
axis2_char_t *target_namespc)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
-
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ axis2_hash_t *ht_super = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(!ht_super)
+ return AXIS2_FAILURE;
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
+ "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
+ if(!schema_impl)
+ return AXIS2_FAILURE;
+ if(NULL != schema_impl->target_namespc)
+ {
+ AXIS2_FREE((*env)->allocator, schema_impl->target_namespc);
+ schema_impl->target_namespc = NULL;
+ }
+ schema_impl->target_namespc = AXIS2_STRDUP(target_namespc, env);
+
return AXIS2_SUCCESS;
}
@@ -1007,14 +1127,16 @@
axis2_env_t **env)
{
axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
-
- AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
+ axis2_hash_t *ht_super = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ ht_super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+ if(!ht_super)
+ return NULL;
+ schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
"AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
- return NULL;
+ if(!schema_impl)
+ return NULL;
+ return schema_impl->version;
}
axis2_status_t AXIS2_CALL
@@ -1022,16 +1144,8 @@
axis2_env_t **env,
axis2_validation_event_handler_t *veh)
{
- axis2_xml_schema_impl_t *schema_impl = NULL;
- axis2_hash_t *super = NULL;
-
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
- schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
+ /** TODO */
return AXIS2_SUCCESS;
-
}
axis2_status_t AXIS2_CALL
@@ -1077,6 +1191,7 @@
axis2_xml_schema_get_prefix_to_namespace_map(void *schema,
axis2_env_t **env)
{
+
axis2_xml_schema_impl_t *schema_impl = NULL;
axis2_hash_t *super = NULL;
@@ -1095,12 +1210,17 @@
{
axis2_xml_schema_impl_t *schema_impl = NULL;
axis2_hash_t *super = NULL;
-
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, map, AXIS2_FAILURE);
super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
"AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
+
+ if(NULL != schema_impl->namespaces_map)
+ {
+ /** TODO */
+ }
+ schema_impl->namespaces_map = map;
return AXIS2_SUCCESS;
}
@@ -1109,13 +1229,30 @@
axis2_env_t **env,
axis2_xml_schema_type_t *type)
{
+
+ axis2_qname_t *qname = NULL;
axis2_xml_schema_impl_t *schema_impl = NULL;
axis2_hash_t *super = NULL;
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, type, AXIS2_FAILURE);
+
super = AXIS2_XML_SCHEMA_SUPER_OBJS(schema, env);
+
schema_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
"AXIS2_XML_SCHEMA", AXIS2_HASH_KEY_STRING));
-
+
+ qname = AXIS2_XML_SCHEMA_TYPE_GET_QNAME(type, env);
+ if(NULL != qname && NULL != schema_impl->schema_types)
+ {
+ if(AXIS2_XML_SCHEMA_OBJ_TABLE_CONTAINS(schema_impl->schema_types,
+ env, qname))
+ {
+ /* TODO set error */
+ return AXIS2_FAILURE;
+ }
+ AXIS2_XML_SCHEMA_OBJ_TABLE_ADD(schema_impl->schema_types, env, qname,
+ type);
+ }
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_all.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_all.c?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_all.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_all.c Mon May 15 02:31:10 2006
@@ -240,3 +240,12 @@
return all_impl->items;
}
+axis2_xml_schema_group_base_t *AXIS2_CALL
+axis2_xml_schema_all_get_base_impl(
+ void *all,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_all_impl_t *schema_all = NULL;
+ schema_all = AXIS2_INTF_TO_IMPL(all);
+ return schema_all->base;
+}
\ No newline at end of file
Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_annotated.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_annotated.c?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_annotated.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_annotated.c Mon May 15 02:31:10 2006
@@ -32,7 +32,7 @@
axis2_xml_schema_types_t obj_type;
- axis2_hash_t *super;
+ axis2_hash_t *ht_super;
axis2_hash_t *methods;
@@ -96,6 +96,8 @@
axis2_array_list_t *
unhandled_attrs);
+/******************* implementation functions ********************************/
+
AXIS2_DECLARE(axis2_xml_schema_annotated_t *)
axis2_xml_schema_annotated_create(axis2_env_t **env)
{
@@ -113,7 +115,7 @@
annotated_impl->schema_obj = NULL;
annotated_impl->obj_type = AXIS2_XML_SCHEMA_ANNOTATED;
- annotated_impl->super = NULL;
+ annotated_impl->ht_super = NULL;
annotated_impl->methods = NULL;
annotated_impl->id = NULL;
annotated_impl->annotation = NULL;
@@ -183,15 +185,15 @@
return NULL;
}
- annotated_impl->super = axis2_hash_make(env);
- if(!annotated_impl->super)
+ annotated_impl->ht_super = axis2_hash_make(env);
+ if(!annotated_impl->ht_super)
{
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- axis2_hash_set(annotated_impl->super, "AXIS2_XML_SCHEMA_ANNOTATED", AXIS2_HASH_KEY_STRING,
+ axis2_hash_set(annotated_impl->ht_super, "AXIS2_XML_SCHEMA_ANNOTATED", AXIS2_HASH_KEY_STRING,
&(annotated_impl->annotated) );
- axis2_hash_set(annotated_impl->super, "AXIS2_XML_SCHEMA_OBJ", AXIS2_HASH_KEY_STRING,
+ axis2_hash_set(annotated_impl->ht_super, "AXIS2_XML_SCHEMA_OBJ", AXIS2_HASH_KEY_STRING,
annotated_impl->schema_obj );
status = axis2_xml_schema_obj_resolve_methods(
@@ -203,7 +205,7 @@
axis2_status_t AXIS2_CALL
axis2_xml_schema_annotated_free(void *annotated,
- axis2_env_t **env)
+ axis2_env_t **env)
{
axis2_xml_schema_annotated_impl_t *annotated_impl = NULL;
@@ -229,10 +231,10 @@
annotated_impl->unhandled_attrs = NULL;
}
- if(NULL != annotated_impl->super)
+ if(NULL != annotated_impl->ht_super)
{
- axis2_hash_free(annotated_impl->super, env);
- annotated_impl->super = NULL;
+ axis2_hash_free(annotated_impl->ht_super, env);
+ annotated_impl->ht_super = NULL;
}
if(NULL != annotated_impl->methods)
@@ -268,10 +270,7 @@
void *annotated,
axis2_env_t **env)
{
- axis2_xml_schema_annotated_impl_t *annotated_impl = NULL;
- annotated_impl = AXIS2_INTF_TO_IMPL(annotated);
-
- return annotated_impl->super;
+ return AXIS2_INTF_TO_IMPL(annotated)->ht_super;
}
axis2_xml_schema_types_t AXIS2_CALL
@@ -279,19 +278,14 @@
void *annotated,
axis2_env_t **env)
{
- axis2_xml_schema_annotated_impl_t *annotated_impl = NULL;
- annotated_impl = AXIS2_INTF_TO_IMPL(annotated);
-
- return annotated_impl->obj_type;
+ return AXIS2_INTF_TO_IMPL(annotated)->obj_type;
}
axis2_xml_schema_obj_t *AXIS2_CALL
axis2_xml_schema_annotated_get_base_impl(void *annotated,
axis2_env_t **env)
{
- axis2_xml_schema_annotated_impl_t *annotated_impl = NULL;
- annotated_impl = AXIS2_INTF_TO_IMPL(annotated);
- return annotated_impl->schema_obj;
+ return AXIS2_INTF_TO_IMPL(annotated)->schema_obj;
}
AXIS2_DECLARE(axis2_status_t)
@@ -301,17 +295,16 @@
axis2_xml_schema_annotated_t *annotated_impl,
axis2_hash_t *methods)
{
- axis2_xml_schema_annotated_impl_t *annotated_impl_l = NULL;
+ axis2_xml_schema_annotated_impl_t *sch_annotated_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, annotated_impl, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
- annotated_impl_l = (axis2_xml_schema_annotated_impl_t *) annotated_impl;
-
+ sch_annotated_impl = (axis2_xml_schema_annotated_impl_t *) annotated_impl;
+
annotated->ops = AXIS2_MALLOC((*env)->allocator,
sizeof(axis2_xml_schema_annotated_ops_t));
-
if(!annotated->ops)
{
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -319,49 +312,49 @@
}
annotated->ops->free = axis2_hash_get(methods, "free",
AXIS2_HASH_KEY_STRING);
- annotated->ops->super_objs =
- annotated_impl_l->annotated.ops->super_objs;
+
+ annotated->ops->super_objs = axis2_hash_get(methods, "super_objs",
+ AXIS2_HASH_KEY_STRING);
+
annotated->ops->type = axis2_hash_get(methods, "type",
AXIS2_HASH_KEY_STRING);
annotated->ops->get_id = axis2_hash_get(methods, "get_id",
AXIS2_HASH_KEY_STRING);
if(!annotated->ops->get_id)
- annotated->ops->get_id =
- annotated_impl_l->annotated.ops->get_id;
+ annotated->ops->get_id = sch_annotated_impl->annotated.ops->get_id;
annotated->ops->set_id = axis2_hash_get(methods, "set_id",
AXIS2_HASH_KEY_STRING);
if(!annotated->ops->set_id)
annotated->ops->set_id =
- annotated_impl_l->annotated.ops->set_id;
+ sch_annotated_impl->annotated.ops->set_id;
annotated->ops->get_annotation = axis2_hash_get(methods, "get_annotation",
AXIS2_HASH_KEY_STRING);
if(!annotated->ops->get_annotation)
- annotated->ops->get_annotation =
- annotated_impl_l->annotated.ops->get_annotation;
+ annotated->ops->get_annotation = sch_annotated_impl->annotated.ops->get_annotation;
annotated->ops->set_annotation = axis2_hash_get(methods, "set_annotation",
AXIS2_HASH_KEY_STRING);
if(!annotated->ops->set_annotation)
annotated->ops->set_annotation =
- annotated_impl_l->annotated.ops->set_annotation;
+ sch_annotated_impl->annotated.ops->set_annotation;
annotated->ops->get_unhandled_attrs = axis2_hash_get(methods,
"get_unhandled_attrs", AXIS2_HASH_KEY_STRING);
if(!annotated->ops->get_unhandled_attrs)
annotated->ops->get_unhandled_attrs =
- annotated_impl_l->annotated.ops->get_unhandled_attrs;
+ sch_annotated_impl->annotated.ops->get_unhandled_attrs;
annotated->ops->set_unhandled_attrs = axis2_hash_get(methods,
"set_unhandled_attrs", AXIS2_HASH_KEY_STRING);
if(!annotated->ops->set_unhandled_attrs)
annotated->ops->set_unhandled_attrs =
- annotated_impl_l->annotated.ops->set_unhandled_attrs;
+ sch_annotated_impl->annotated.ops->set_unhandled_attrs;
return axis2_xml_schema_obj_resolve_methods(&(annotated->base),
- env, annotated_impl_l->schema_obj, methods);
+ env, sch_annotated_impl->schema_obj, methods);
}
axis2_char_t *AXIS2_CALL
@@ -369,12 +362,19 @@
axis2_env_t **env)
{
axis2_xml_schema_annotated_impl_t *annotated_impl = NULL;
- axis2_hash_t *super = NULL;
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_ANNOTATED_SUPER_OBJS(annotated, env);
- annotated_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA_ANNOTATED", AXIS2_HASH_KEY_STRING));
+ ht_super = AXIS2_XML_SCHEMA_ANNOTATED_SUPER_OBJS(annotated, env);
+ if(NULL != ht_super)
+ {
+ annotated_impl = (axis2_xml_schema_annotated_impl_t*)
+ axis2_hash_get(ht_super, "AXIS2_XML_SCHEMA_ANNOTATED",
+ AXIS2_HASH_KEY_STRING);
+ if(!annotated_impl)
+ return NULL;
+ }
+
return annotated_impl->id;
}
@@ -384,12 +384,20 @@
axis2_char_t *id)
{
axis2_xml_schema_annotated_impl_t *annotated_impl = NULL;
- axis2_hash_t *super = NULL;
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- super = AXIS2_XML_SCHEMA_ANNOTATED_SUPER_OBJS(annotated, env);
- annotated_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA_ANNOTATED", AXIS2_HASH_KEY_STRING));
+ AXIS2_PARAM_CHECK((*env)->error, id,AXIS2_FAILURE );
+
+ ht_super = AXIS2_XML_SCHEMA_ANNOTATED_SUPER_OBJS(annotated, env);
+ if(NULL != ht_super)
+ {
+ annotated_impl = (axis2_xml_schema_annotated_impl_t*)
+ axis2_hash_get(ht_super, "AXIS2_XML_SCHEMA_ANNOTATED",
+ AXIS2_HASH_KEY_STRING);
+ if(!annotated_impl)
+ return AXIS2_FAILURE;
+ }
if(annotated_impl->id)
{
AXIS2_FREE((*env)->allocator, annotated_impl->id);
@@ -405,13 +413,17 @@
axis2_env_t **env)
{
axis2_xml_schema_annotated_impl_t *annotated_impl = NULL;
- axis2_hash_t *super = NULL;
-
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_ANNOTATED_SUPER_OBJS(annotated, env);
- annotated_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA_ANNOTATED", AXIS2_HASH_KEY_STRING));
- return annotated_impl->annotation;
+ ht_super = AXIS2_XML_SCHEMA_ANNOTATED_SUPER_OBJS(annotated, env);
+ if(NULL != ht_super)
+ {
+ annotated_impl = (axis2_xml_schema_annotated_impl_t*)
+ axis2_hash_get(ht_super, "AXIS2_XML_SCHEMA_ANNOTATED",
+ AXIS2_HASH_KEY_STRING);
+ if(!annotated_impl)
+ return NULL;
+ } return annotated_impl->annotation;
}
axis2_status_t AXIS2_CALL
@@ -421,16 +433,22 @@
annotation)
{
axis2_xml_schema_annotated_impl_t *annotated_impl = NULL;
- axis2_hash_t *super = NULL;
-
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- super = AXIS2_XML_SCHEMA_ANNOTATED_SUPER_OBJS(annotated, env);
- annotated_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA_ANNOTATED", AXIS2_HASH_KEY_STRING));
+ ht_super = AXIS2_XML_SCHEMA_ANNOTATED_SUPER_OBJS(annotated, env);
+ if(NULL != ht_super)
+ {
+ annotated_impl = (axis2_xml_schema_annotated_impl_t*)
+ axis2_hash_get(ht_super, "AXIS2_XML_SCHEMA_ANNOTATED",
+ AXIS2_HASH_KEY_STRING);
+ if(!annotated_impl)
+ return AXIS2_FAILURE;
+ }
if(NULL != annotated_impl->annotation)
{
- /* TODO Free annotation */
+ /* TODO Free annotation
AXIS2_XML_SCHEMA_ANNOTATED_FREE(annotated_impl->annotation, env);
+ */
}
annotated_impl->annotation = annotation;
return AXIS2_SUCCESS;
@@ -442,12 +460,17 @@
axis2_env_t **env)
{
axis2_xml_schema_annotated_impl_t *annotated_impl = NULL;
- axis2_hash_t *super = NULL;
-
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_ANNOTATED_SUPER_OBJS(annotated, env);
- annotated_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA_ANNOTATED", AXIS2_HASH_KEY_STRING));
+ ht_super = AXIS2_XML_SCHEMA_ANNOTATED_SUPER_OBJS(annotated, env);
+ if(NULL != ht_super)
+ {
+ annotated_impl = (axis2_xml_schema_annotated_impl_t*)
+ axis2_hash_get(ht_super, "AXIS2_XML_SCHEMA_ANNOTATED",
+ AXIS2_HASH_KEY_STRING);
+ if(!annotated_impl)
+ return NULL;
+ }
return annotated_impl->unhandled_attrs;
}
@@ -458,12 +481,17 @@
unhandled_attrs)
{
axis2_xml_schema_annotated_impl_t *annotated_impl = NULL;
- axis2_hash_t *super = NULL;
-
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- super = AXIS2_XML_SCHEMA_ANNOTATED_SUPER_OBJS(annotated, env);
- annotated_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA_ANNOTATED", AXIS2_HASH_KEY_STRING));
+ ht_super = AXIS2_XML_SCHEMA_ANNOTATED_SUPER_OBJS(annotated, env);
+ if(NULL != ht_super)
+ {
+ annotated_impl = (axis2_xml_schema_annotated_impl_t*)
+ axis2_hash_get(ht_super, "AXIS2_XML_SCHEMA_ANNOTATED",
+ AXIS2_HASH_KEY_STRING);
+ if(!annotated_impl)
+ return AXIS2_FAILURE;
+ }
if(annotated_impl->unhandled_attrs)
{
/* TODO Free unhandled_attrs */
Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_annotation.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_annotation.c?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_annotation.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_annotation.c Mon May 15 02:31:10 2006
@@ -26,20 +26,24 @@
struct axis2_xml_schema_annotation_impl
{
axis2_xml_schema_annotation_t annotation;
+
axis2_xml_schema_types_t obj_type;
- axis2_hash_t *super;
+
+ axis2_hash_t *ht_super;
+
axis2_hash_t *methods;
axis2_xml_schema_obj_t *schema_obj;
axis2_hash_t *items;
-
};
+
#define AXIS2_INTF_TO_IMPL(annotation) \
((axis2_xml_schema_annotation_impl_t *) annotation)
/*************** function prototypes *****************************************/
+
axis2_status_t AXIS2_CALL
axis2_xml_schema_annotation_free(
void *annotation,
@@ -80,7 +84,7 @@
}
annotation_impl->schema_obj = NULL;
annotation_impl->obj_type = AXIS2_XML_SCHEMA_ANNOTATION;
- annotation_impl->super = NULL;
+ annotation_impl->ht_super = NULL;
annotation_impl->methods = NULL;
annotation_impl->items = NULL;
annotation_impl->annotation.base.ops = NULL;
@@ -97,12 +101,16 @@
annotation_impl->annotation.ops->free =
axis2_xml_schema_annotation_free;
+
annotation_impl->annotation.ops->super_objs =
axis2_xml_schema_annotation_super_objs;
+
annotation_impl->annotation.ops->type =
axis2_xml_schema_annotation_type;
+
annotation_impl->annotation.ops->get_base_impl =
axis2_xml_schema_annotation_get_base_impl;
+
annotation_impl->annotation.ops->get_items =
axis2_xml_schema_annotation_get_items;
@@ -121,12 +129,15 @@
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
+
axis2_hash_set(annotation_impl->methods, "free",
AXIS2_HASH_KEY_STRING, axis2_xml_schema_annotation_free);
+
axis2_hash_set(annotation_impl->methods, "super_objs",
AXIS2_HASH_KEY_STRING, axis2_xml_schema_annotation_super_objs);
axis2_hash_set(annotation_impl->methods, "type",
AXIS2_HASH_KEY_STRING, axis2_xml_schema_annotation_type);
+
axis2_hash_set(annotation_impl->methods, "get_items",
AXIS2_HASH_KEY_STRING, axis2_xml_schema_annotation_get_items);
@@ -139,8 +150,8 @@
return NULL;
}
- annotation_impl->super = axis2_hash_make(env);
- if(!annotation_impl->super)
+ annotation_impl->ht_super = axis2_hash_make(env);
+ if(!annotation_impl->ht_super)
{
axis2_xml_schema_annotation_free(&(annotation_impl->annotation), env);
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -148,6 +159,7 @@
}
axis2_hash_set(annotation_impl->methods, "AXIS2_XML_SCHEMA_ANNOTATION",
AXIS2_HASH_KEY_STRING, &(annotation_impl->annotation));
+
axis2_hash_set(annotation_impl->methods, "AXIS2_XML_SCHEMA_OBJ",
AXIS2_HASH_KEY_STRING, annotation_impl->schema_obj);
@@ -156,6 +168,7 @@
return &(annotation_impl->annotation);
}
+
axis2_status_t AXIS2_CALL
axis2_xml_schema_annotation_free(void *annotation,
axis2_env_t **env)
@@ -171,10 +184,10 @@
annotation_impl->items = NULL;
}
- if(NULL != annotation_impl->super)
+ if(NULL != annotation_impl->ht_super)
{
- axis2_hash_free(annotation_impl->super, env);
- annotation_impl->super = NULL;
+ axis2_hash_free(annotation_impl->ht_super, env);
+ annotation_impl->ht_super = NULL;
}
if(NULL != annotation_impl->methods)
@@ -207,63 +220,52 @@
return AXIS2_SUCCESS;
}
+
axis2_xml_schema_obj_t *AXIS2_CALL
axis2_xml_schema_annotation_get_base_impl(void *annotation,
axis2_env_t **env)
{
axis2_xml_schema_annotation_impl_t *annotation_impl = NULL;
-
- AXIS2_ENV_CHECK(env, NULL);
annotation_impl = AXIS2_INTF_TO_IMPL(annotation);
-
return annotation_impl->schema_obj;
}
-AXIS2_DECLARE(axis2_status_t)
-axis2_xml_schema_annotation_resolve_methods(
- axis2_xml_schema_annotation_t *annotation,
- axis2_env_t **env,
- axis2_xml_schema_annotation_t *annotation_impl,
- axis2_hash_t *methods)
-{
- axis2_xml_schema_annotation_impl_t *annotation_impl_l = NULL;
-
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, annotation_impl, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
-
- annotation_impl_l = (axis2_xml_schema_annotation_impl_t *) annotation_impl;
-
- annotation->ops = AXIS2_MALLOC((*env)->allocator,
- sizeof(axis2_xml_schema_annotation_ops_t));
- annotation->ops->free = axis2_hash_get(methods, "free",
- AXIS2_HASH_KEY_STRING);
- annotation->ops->super_objs = axis2_hash_get(methods, "super_objs",
- AXIS2_HASH_KEY_STRING);
- annotation->ops->type = axis2_hash_get(methods, "type",
- AXIS2_HASH_KEY_STRING);
-
- annotation->ops->get_items = axis2_hash_get(methods, "get_items",
- AXIS2_HASH_KEY_STRING);
- if(!annotation->ops->get_items)
- annotation->ops->get_items =
- annotation_impl_l->annotation.ops->get_items;
-
- return axis2_xml_schema_obj_resolve_methods(&(annotation->base),
- env, annotation_impl_l->schema_obj, methods);
-}
-
axis2_hash_t *AXIS2_CALL
axis2_xml_schema_annotation_get_items(void *annotation,
axis2_env_t **env)
{
+ /*
axis2_xml_schema_annotation_impl_t *annotation_impl = NULL;
- axis2_hash_t *super = NULL;
-
- super = AXIS2_XML_SCHEMA_ANNOTATION_SUPER_OBJS(annotation, env);
- annotation_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
- "AXIS2_XML_SCHEMA_ANNOTATION", AXIS2_HASH_KEY_STRING));
+ axis2_hash_t *ht_super = NULL;
- return annotation_impl->items;
+ ht_super = AXIS2_XML_SCHEMA_ANNOTATION_SUPER_OBJS(annotation, env);
+ if(NULL != ht_super)
+ {
+ annotation_impl = (axis2_xml_schema_annotation_impl_t*)
+ axis2_hash_get(ht_super , "AXIS2_XML_SCHEMA_ANNOTATION",
+ AXIS2_HASH_KEY_STRING);
+ return annotation_impl->items;
+ }
+ */
+ return AXIS2_INTF_TO_IMPL(annotation)->items;
}
+axis2_hash_t *AXIS2_CALL
+axis2_xml_schema_annotation_super_objs(
+ void *annotation,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_annotation_impl_t *annotation_impl = NULL;
+ annotation_impl = AXIS2_INTF_TO_IMPL(annotation);
+ return annotation_impl->ht_super;
+}
+
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_annotation_type(
+ void *annotation,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_annotation_impl_t *annotation_impl = NULL;
+ annotation_impl = AXIS2_INTF_TO_IMPL(annotation);
+ return annotation_impl->obj_type;
+}
Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_any.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_any.c?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_any.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_any.c Mon May 15 02:31:10 2006
@@ -27,8 +27,11 @@
{
axis2_xml_schema_any_t any;
axis2_xml_schema_particle_t *particle;
+
axis2_xml_schema_types_t obj_type;
- axis2_hash_t *super;
+
+ axis2_hash_t *ht_super;
+
axis2_hash_t *methods;
axis2_xml_schema_content_processing_t *process_content;
@@ -74,11 +77,11 @@
axis2_env_t **env);
axis2_status_t AXIS2_CALL
-axis2_xml_schema_any_set_process_content(void *any,
- axis2_env_t **env,
- axis2_xml_schema_content_processing_t *
- process_content);
-
+axis2_xml_schema_any_set_process_content(
+ void *any,
+ axis2_env_t **env,
+ axis2_xml_schema_content_processing_t *process_content);
+
/************************ end function prototypes ******************************/
AXIS2_DECLARE(axis2_xml_schema_any_t *)
@@ -86,6 +89,7 @@
{
axis2_xml_schema_any_impl_t *any_impl = NULL;
axis2_status_t status = AXIS2_FAILURE;
+ axis2_xml_schema_annotated_t *annotated = NULL;
any_impl = AXIS2_MALLOC((*env)->allocator,
sizeof(axis2_xml_schema_any_impl_t));
@@ -98,9 +102,10 @@
any_impl->any.ops = NULL;
any_impl->ns = NULL;
any_impl->obj_type = AXIS2_XML_SCHEMA_ANY;
- any_impl->super = NULL;
+ any_impl->ht_super = NULL;
any_impl->particle = NULL;
any_impl->process_content = NULL;
+
any_impl->any.ops = AXIS2_MALLOC((*env)->allocator,
sizeof(axis2_xml_schema_any_ops_t));
@@ -111,13 +116,16 @@
AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
+
any_impl->process_content = axis2_xml_schema_content_processing_create(env,
"None");
+
if(!any_impl->process_content)
{
axis2_xml_schema_any_free(&(any_impl->any), env);
return NULL;
}
+
any_impl->any.ops->free =
axis2_xml_schema_any_free;
any_impl->any.ops->super_objs =
@@ -142,9 +150,9 @@
return NULL;
}
axis2_hash_set(any_impl->methods, "free", AXIS2_HASH_KEY_STRING,
- axis2_xml_schema_any_super_objs);
- axis2_hash_set(any_impl->methods, "super_objs", AXIS2_HASH_KEY_STRING,
axis2_xml_schema_any_free);
+ axis2_hash_set(any_impl->methods, "super_objs", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_any_super_objs);
axis2_hash_set(any_impl->methods, "type", AXIS2_HASH_KEY_STRING,
axis2_xml_schema_any_type);
axis2_hash_set(any_impl->methods, "get_namespace", AXIS2_HASH_KEY_STRING,
@@ -163,16 +171,26 @@
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- any_impl->super = axis2_hash_make(env);
- if(!any_impl->super)
+ any_impl->ht_super = axis2_hash_make(env);
+ if(!any_impl->ht_super)
{
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- axis2_hash_set(any_impl->super, "AXIS_XML_SCHEMA_ANY", AXIS2_HASH_KEY_STRING,
+ axis2_hash_set(any_impl->ht_super, "AXIS_XML_SCHEMA_ANY", AXIS2_HASH_KEY_STRING,
&(any_impl->any));
- axis2_hash_set(any_impl->super, "AXIS_XML_SCHEMA_PARTICLE", AXIS2_HASH_KEY_STRING,
+ axis2_hash_set(any_impl->ht_super, "AXIS_XML_SCHEMA_PARTICLE", AXIS2_HASH_KEY_STRING,
any_impl->particle);
+
+ annotated = AXIS2_XML_SCHEMA_PARTICLE_GET_BASE_IMPL(any_impl->particle, env);
+ if(NULL != annotated)
+ {
+ axis2_hash_set(any_impl->ht_super, "AXIS_XML_SCHEMA_ANNOTATED", AXIS2_HASH_KEY_STRING,
+ annotated);
+
+ axis2_hash_set(any_impl->ht_super, "AXIS_XML_SCHEMA_OBJ", AXIS2_HASH_KEY_STRING,
+ AXIS2_XML_SCHEMA_ANNOTATED_GET_BASE_IMPL(annotated, env));
+ }
status = axis2_xml_schema_particle_resolve_methods(
&(any_impl->any.base), env, any_impl->particle,
@@ -201,10 +219,10 @@
any_impl->process_content = NULL;
}
- if(NULL != any_impl->super)
+ if(NULL != any_impl->ht_super)
{
- axis2_hash_free(any_impl->super, env);
- any_impl->super = NULL;
+ axis2_hash_free(any_impl->ht_super, env);
+ any_impl->ht_super = NULL;
}
if(NULL != any_impl->methods)
@@ -240,7 +258,6 @@
axis2_env_t **env)
{
axis2_xml_schema_any_impl_t *any_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
any_impl = AXIS2_INTF_TO_IMPL(any);
return any_impl->obj_type;
@@ -252,10 +269,9 @@
axis2_env_t **env)
{
axis2_xml_schema_any_impl_t *any_impl = NULL;
-
AXIS2_ENV_CHECK(env, NULL);
any_impl = AXIS2_INTF_TO_IMPL(any);
- return any_impl->super;
+ return any_impl->ht_super;
}
axis2_xml_schema_particle_t *AXIS2_CALL
@@ -263,7 +279,6 @@
axis2_env_t **env)
{
axis2_xml_schema_any_impl_t *any_impl = NULL;
-
AXIS2_ENV_CHECK(env, NULL);
any_impl = AXIS2_INTF_TO_IMPL(any);
return any_impl->particle;
@@ -276,49 +291,57 @@
axis2_xml_schema_any_t *any_impl,
axis2_hash_t *methods)
{
- axis2_xml_schema_any_impl_t *any_impl_l = NULL;
+ axis2_xml_schema_any_impl_t *sch_any_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, any_impl, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
- any_impl_l = (axis2_xml_schema_any_impl_t *) any_impl;
+ sch_any_impl = (axis2_xml_schema_any_impl_t *) any_impl;
any->ops = AXIS2_MALLOC((*env)->allocator,
sizeof(axis2_xml_schema_any_ops_t));
+ if(!any->ops)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
any->ops->free = axis2_hash_get(methods, "free",
AXIS2_HASH_KEY_STRING);
+
any->ops->super_objs = axis2_hash_get(methods, "super_objs",
AXIS2_HASH_KEY_STRING);
+
any->ops->type = axis2_hash_get(methods, "type",
AXIS2_HASH_KEY_STRING);
+
any->ops->get_namespace = axis2_hash_get(methods,
"get_namespace", AXIS2_HASH_KEY_STRING);
if(!any->ops->get_namespace)
any->ops->get_namespace =
- any_impl_l->any.ops->get_namespace;
+ sch_any_impl->any.ops->get_namespace;
any->ops->set_namespace = axis2_hash_get(methods,
"set_namespace", AXIS2_HASH_KEY_STRING);
if(!any->ops->set_namespace)
any->ops->set_namespace =
- any_impl_l->any.ops->set_namespace;
+ sch_any_impl->any.ops->set_namespace;
any->ops->get_process_content = axis2_hash_get(methods,
"get_process_content", AXIS2_HASH_KEY_STRING);
if(!any->ops->get_process_content)
any->ops->get_process_content =
- any_impl_l->any.ops->get_process_content;
+ sch_any_impl->any.ops->get_process_content;
any->ops->set_process_content = axis2_hash_get(methods,
"set_process_content", AXIS2_HASH_KEY_STRING);
if(!any->ops->set_process_content)
any->ops->set_process_content =
- any_impl_l->any.ops->set_process_content;
+ sch_any_impl->any.ops->set_process_content;
return axis2_xml_schema_particle_resolve_methods(&(any->base),
- env, any_impl_l->particle, methods);
+ env, sch_any_impl->particle, methods);
}
axis2_char_t *AXIS2_CALL
@@ -326,12 +349,16 @@
axis2_env_t **env)
{
axis2_xml_schema_any_impl_t *any_impl = NULL;
- axis2_hash_t *super = NULL;
+ axis2_hash_t *ht_super = NULL;
- super = AXIS2_XML_SCHEMA_ANY_SUPER_OBJS(any, env);
- any_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
+ ht_super = AXIS2_XML_SCHEMA_ANY_SUPER_OBJS(any, env);
+ if(NULL != ht_super)
+ {
+ any_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
"AXIS2_XML_SCHEMA_ANY", AXIS2_HASH_KEY_STRING));
-
+ if(!any_impl)
+ return NULL;
+ }
return any_impl->ns;
}
@@ -341,14 +368,18 @@
axis2_char_t *namespc)
{
axis2_xml_schema_any_impl_t *any_impl = NULL;
- axis2_hash_t *super = NULL;
+ axis2_hash_t *ht_super = NULL;
+ AXIS2_PARAM_CHECK((*env)->error, namespc, AXIS2_FAILURE);
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- super = AXIS2_XML_SCHEMA_ANY_SUPER_OBJS(any, env);
- any_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
+ ht_super = AXIS2_XML_SCHEMA_ANY_SUPER_OBJS(any, env);
+ if(NULL != ht_super)
+ {
+ any_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
"AXIS2_XML_SCHEMA_ANY", AXIS2_HASH_KEY_STRING));
-
- if(!any_impl->ns)
+ if(!any_impl)
+ return AXIS2_FAILURE;
+ }
+ if(NULL != any_impl->ns)
{
AXIS2_FREE((*env)->allocator, any_impl->ns);
any_impl->ns = NULL;
@@ -362,11 +393,16 @@
axis2_env_t **env)
{
axis2_xml_schema_any_impl_t *any_impl = NULL;
- axis2_hash_t *super = NULL;
- super = AXIS2_XML_SCHEMA_ANY_SUPER_OBJS(any, env);
- any_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
+ axis2_hash_t *ht_super = NULL;
+
+ ht_super = AXIS2_XML_SCHEMA_ANY_SUPER_OBJS(any, env);
+ if(NULL != ht_super)
+ {
+ any_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
"AXIS2_XML_SCHEMA_ANY", AXIS2_HASH_KEY_STRING));
-
+ if(!any_impl)
+ return NULL;
+ }
return any_impl->process_content;
}
@@ -377,14 +413,21 @@
process_content)
{
axis2_xml_schema_any_impl_t *any_impl = NULL;
- axis2_hash_t *super = NULL;
+ axis2_hash_t *ht_super = NULL;
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- super = AXIS2_XML_SCHEMA_ANY_SUPER_OBJS(any, env);
- any_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super,
+ AXIS2_PARAM_CHECK((*env)->error, process_content, AXIS2_FAILURE);
+
+ ht_super = AXIS2_XML_SCHEMA_ANY_SUPER_OBJS(any, env);
+
+ if(NULL != ht_super)
+ {
+ any_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super,
"AXIS2_XML_SCHEMA_ANY", AXIS2_HASH_KEY_STRING));
+ if(!any_impl)
+ return AXIS2_FAILURE;
+ }
- if(!any_impl->process_content)
+ if(NULL != any_impl->process_content)
{
AXIS2_XML_SCHEMA_CONTENT_PROCESSING_FREE(any_impl->process_content, env);
any_impl->process_content = NULL;
Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_any_attribute.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_any_attribute.c?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_any_attribute.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_any_attribute.c Mon May 15 02:31:10 2006
@@ -35,10 +35,15 @@
/**
* Namespaces containing the elements that can be used.
*/
+ axis2_xml_schema_types_t obj_type;
+
+ axis2_hash_t* ht_super;
+
axis2_char_t *ns;
};
-#define AXIS2_INTF_TO_IMPL(any_attr) ((axis2_xml_schema_any_attribute_impl_t *) any_attr)
+#define AXIS2_INTF_TO_IMPL(any_attr) \
+ ((axis2_xml_schema_any_attribute_impl_t *) any_attr)
/******************* function prototypes **********************************/
axis2_status_t AXIS2_CALL
@@ -49,6 +54,14 @@
axis2_xml_schema_any_attribute_get_base_impl(void *any_attr,
axis2_env_t **env);
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_any_attribute_type(void *any_attr,
+ axis2_env_t **env);
+
+axis2_hash_t* AXIS2_CALL
+axis2_xml_schema_any_attribute_super_objs(void *any_attr,
+ axis2_env_t **env);
+
axis2_char_t *AXIS2_CALL
axis2_xml_schema_any_attribute_get_namespace(void *any_attr,
axis2_env_t **env);
@@ -88,6 +101,8 @@
any_attr_impl->annotated = NULL;
any_attr_impl->process_content = NULL;
any_attr_impl->methods = NULL;
+ any_attr_impl->ht_super = NULL;
+ any_attr_impl->obj_type = AXIS2_XML_SCHEMA_ANY_ATTRIBUTE;
any_attr_impl->any_attr.ops = AXIS2_MALLOC((*env)->allocator,
sizeof(axis2_xml_schema_any_attribute_ops_t));
@@ -107,14 +122,25 @@
}
any_attr_impl->any_attr.ops->free =
axis2_xml_schema_any_attribute_free;
+
+ any_attr_impl->any_attr.ops->type =
+ axis2_xml_schema_any_attribute_type;
+
+ any_attr_impl->any_attr.ops->super_objs =
+ axis2_xml_schema_any_attribute_super_objs;
+
any_attr_impl->any_attr.ops->get_base_impl =
axis2_xml_schema_any_attribute_get_base_impl;
+
any_attr_impl->any_attr.ops->get_namespace =
axis2_xml_schema_any_attribute_get_namespace;
+
any_attr_impl->any_attr.ops->set_namespace =
axis2_xml_schema_any_attribute_set_namespace;
+
any_attr_impl->any_attr.ops->get_process_content =
axis2_xml_schema_any_attribute_get_process_content;
+
any_attr_impl->any_attr.ops->set_process_content =
axis2_xml_schema_any_attribute_set_process_content;
@@ -126,6 +152,10 @@
}
axis2_hash_set(any_attr_impl->methods, "free", AXIS2_HASH_KEY_STRING,
axis2_xml_schema_any_attribute_free);
+ axis2_hash_set(any_attr_impl->methods, "type", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_any_attribute_type);
+ axis2_hash_set(any_attr_impl->methods, "super_objs", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_any_attribute_super_objs);
axis2_hash_set(any_attr_impl->methods, "get_namespace", AXIS2_HASH_KEY_STRING,
axis2_xml_schema_any_attribute_get_namespace);
axis2_hash_set(any_attr_impl->methods, "set_namespace", AXIS2_HASH_KEY_STRING,
@@ -142,6 +172,24 @@
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
+
+ any_attr_impl->ht_super = axis2_hash_make(env);
+ if(!any_attr_impl->methods)
+ {
+ axis2_xml_schema_any_attribute_free(&(any_attr_impl->any_attr), env);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(any_attr_impl->ht_super, "AXIS2_XML_SCHEMA_ANY_ATTRIBUTE",
+ AXIS2_HASH_KEY_STRING, &(any_attr_impl->any_attr));
+
+ axis2_hash_set(any_attr_impl->ht_super, "AXIS2_XML_SCHEMA_ANNOTATED",
+ AXIS2_HASH_KEY_STRING, any_attr_impl->annotated);
+
+ axis2_hash_set(any_attr_impl->ht_super, "AXIS2_XML_SCHEMA_OBJ",
+ AXIS2_HASH_KEY_STRING,
+ AXIS2_XML_SCHEMA_ANNOTATED_GET_BASE_IMPL(any_attr_impl->annotated, env));
+
status = axis2_xml_schema_annotated_resolve_methods(
&(any_attr_impl->any_attr.base), env, any_attr_impl->annotated,
any_attr_impl->methods);
@@ -162,7 +210,11 @@
AXIS2_FREE((*env)->allocator, any_attr_impl->ns);
any_attr_impl->ns = NULL;
}
-
+ if(NULL != any_attr_impl->ht_super)
+ {
+ axis2_hash_free(any_attr_impl->ht_super, env);
+ any_attr_impl->ht_super = NULL;
+ }
if(NULL != any_attr_impl->process_content)
{
AXIS2_XML_SCHEMA_CONTENT_PROCESSING_FREE(any_attr_impl->process_content, env);
@@ -208,6 +260,7 @@
return any_attr_impl->annotated;
}
+/*
AXIS2_DECLARE(axis2_status_t)
axis2_xml_schema_any_attribute_resolve_methods(
axis2_xml_schema_any_attribute_t *any_attr,
@@ -248,7 +301,7 @@
return axis2_xml_schema_annotated_resolve_methods(&(any_attr->base),
env, any_impl_l->annotated, methods);
}
-
+*/
axis2_char_t *AXIS2_CALL
axis2_xml_schema_any_attribute_get_namespace(void *any_attr,
axis2_env_t **env)
@@ -302,3 +355,17 @@
return AXIS2_SUCCESS;
}
+
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_any_attribute_type(void *any_attr,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(any_attr)->obj_type;
+}
+
+axis2_hash_t* AXIS2_CALL
+axis2_xml_schema_any_attribute_super_objs(void *any_attr,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(any_attr)->ht_super;
+}
\ No newline at end of file
Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_app_info.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_app_info.c?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_app_info.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_app_info.c Mon May 15 02:31:10 2006
@@ -15,8 +15,10 @@
*/
#include <xml_schema/axis2_xml_schema_app_info.h>
+#include <xml_schema/axis2_xml_schema_use.h>
-typedef struct axis2_xml_schema_app_info_impl axis2_xml_schema_app_info_impl_t;
+typedef struct axis2_xml_schema_app_info_impl
+ axis2_xml_schema_app_info_impl_t;
/**
* @brief Other Extension Struct Impl
@@ -27,12 +29,13 @@
axis2_xml_schema_app_info_t app_info;
axis2_xml_schema_obj_t *schema_obj;
+
axis2_xml_schema_types_t obj_type;
- axis2_hash_t *super;
+
+ axis2_hash_t *ht_super;
+
axis2_hash_t *methods;
- /**
- * Provides the source of the application information.
- */
+
axis2_char_t *source;
void *markup; /* TODO Replace (void *) with node list */
@@ -94,11 +97,12 @@
AXIS2_ERROR_SET((*env)->error , AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
+
app_info_impl->schema_obj = NULL;
app_info_impl->app_info.base.ops = NULL;
app_info_impl->app_info.ops = NULL;
app_info_impl->obj_type = AXIS2_XML_SCHEMA_APP_INFO;
- app_info_impl->super = NULL;
+ app_info_impl->ht_super = NULL;
app_info_impl->methods = NULL;
app_info_impl->source = NULL;
app_info_impl->markup = NULL;
@@ -114,18 +118,25 @@
}
app_info_impl->app_info.ops->free =
axis2_xml_schema_app_info_free;
+
app_info_impl->app_info.ops->super_objs =
axis2_xml_schema_app_info_super_objs;
+
app_info_impl->app_info.ops->type =
axis2_xml_schema_app_info_type;
+
app_info_impl->app_info.ops->get_base_impl =
axis2_xml_schema_app_info_get_base_impl;
+
app_info_impl->app_info.ops->get_source =
axis2_xml_schema_app_info_get_source;
+
app_info_impl->app_info.ops->set_source =
axis2_xml_schema_app_info_set_source;
+
app_info_impl->app_info.ops->get_markup =
axis2_xml_schema_app_info_get_markup;
+
app_info_impl->app_info.ops->set_markup =
axis2_xml_schema_app_info_set_markup;
@@ -138,16 +149,22 @@
}
axis2_hash_set(app_info_impl->methods, "free",
AXIS2_HASH_KEY_STRING, axis2_xml_schema_app_info_free);
+
axis2_hash_set(app_info_impl->methods, "super_objs",
AXIS2_HASH_KEY_STRING, axis2_xml_schema_app_info_super_objs);
+
axis2_hash_set(app_info_impl->methods, "type",
AXIS2_HASH_KEY_STRING, axis2_xml_schema_app_info_type);
+
axis2_hash_set(app_info_impl->methods, "get_source",
AXIS2_HASH_KEY_STRING, axis2_xml_schema_app_info_get_source);
+
axis2_hash_set(app_info_impl->methods, "set_source",
AXIS2_HASH_KEY_STRING, axis2_xml_schema_app_info_set_source);
+
axis2_hash_set(app_info_impl->methods, "get_markup",
AXIS2_HASH_KEY_STRING, axis2_xml_schema_app_info_get_markup);
+
axis2_hash_set(app_info_impl->methods, "set_markup",
AXIS2_HASH_KEY_STRING, axis2_xml_schema_app_info_set_markup);
@@ -158,20 +175,21 @@
return NULL;
}
- app_info_impl->super = axis2_hash_make(env);
- if(!app_info_impl->super)
+ app_info_impl->ht_super = axis2_hash_make(env);
+
+ if(!app_info_impl->ht_super)
{
axis2_xml_schema_app_info_free(&(app_info_impl->app_info), env);
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- axis2_hash_set(app_info_impl->super, "AXIS2_XML_SCHEMA_APP_INFO",
+ axis2_hash_set(app_info_impl->ht_super, "AXIS2_XML_SCHEMA_APP_INFO",
AXIS2_HASH_KEY_STRING, &(app_info_impl->app_info));
- axis2_hash_set(app_info_impl->super, "AXIS2_XML_SCHEMA_OBJ",
+
+ axis2_hash_set(app_info_impl->ht_super, "AXIS2_XML_SCHEMA_OBJ",
AXIS2_HASH_KEY_STRING, app_info_impl->schema_obj);
- status =
- axis2_xml_schema_obj_resolve_methods(&(app_info_impl->app_info.base),
+ status = axis2_xml_schema_obj_resolve_methods(&(app_info_impl->app_info.base),
env, app_info_impl->schema_obj, app_info_impl->methods);
return &(app_info_impl->app_info);
}
@@ -193,10 +211,10 @@
/* TODO Free markup */
- if(NULL != app_info_impl->super)
+ if(NULL != app_info_impl->ht_super)
{
- axis2_hash_free(app_info_impl->super, env);
- app_info_impl->super = NULL;
+ axis2_hash_free(app_info_impl->ht_super, env);
+ app_info_impl->ht_super = NULL;
}
if(NULL != app_info_impl->methods)
@@ -234,12 +252,7 @@
void *app_info,
axis2_env_t **env)
{
- axis2_xml_schema_app_info_impl_t *app_info_impl = NULL;
-
- AXIS2_ENV_CHECK(env, NULL);
- app_info_impl = AXIS2_INTF_TO_IMPL(app_info);
-
- return app_info_impl->super;
+ return AXIS2_INTF_TO_IMPL(app_info)->ht_super;
}
axis2_xml_schema_types_t AXIS2_CALL
@@ -247,12 +260,7 @@
void *app_info,
axis2_env_t **env)
{
- axis2_xml_schema_app_info_impl_t *app_info_impl = NULL;
-
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- app_info_impl = AXIS2_INTF_TO_IMPL(app_info);
-
- return app_info_impl->obj_type;
+ return AXIS2_INTF_TO_IMPL(app_info)->obj_type;
}
axis2_xml_schema_obj_t *AXIS2_CALL
@@ -260,86 +268,27 @@
void *app_info,
axis2_env_t **env)
{
- axis2_xml_schema_app_info_impl_t *app_info_impl = NULL;
-
- AXIS2_ENV_CHECK(env, NULL);
- app_info_impl = AXIS2_INTF_TO_IMPL(app_info);
-
- return app_info_impl->schema_obj;
-}
-
-AXIS2_DECLARE(axis2_status_t)
-axis2_xml_schema_app_info_resolve_methods(
- axis2_xml_schema_app_info_t *app_info,
- axis2_env_t **env,
- axis2_xml_schema_app_info_t *app_info_impl,
- axis2_hash_t *methods)
-{
- axis2_xml_schema_app_info_impl_t *app_info_impl_l = NULL;
-
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, app_info_impl, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
-
- app_info_impl_l = (axis2_xml_schema_app_info_impl_t *) app_info_impl;
-
- app_info->ops = AXIS2_MALLOC((*env)->allocator,
- sizeof(axis2_xml_schema_app_info_ops_t));
-
- if(!app_info_impl)
- {
- AXIS2_ERROR_SET((*env)->error , AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return AXIS2_FAILURE;
- }
- app_info->ops->free = axis2_hash_get(methods, "free",
- AXIS2_HASH_KEY_STRING);
- app_info->ops->super_objs = axis2_hash_get(methods, "super_objs",
- AXIS2_HASH_KEY_STRING);
- app_info->ops->type = axis2_hash_get(methods, "type",
- AXIS2_HASH_KEY_STRING);
-
- app_info->ops->get_source = axis2_hash_get(methods,
- "get_source", AXIS2_HASH_KEY_STRING);
-
- if(!app_info->ops->get_source)
- app_info->ops->get_source =
- app_info_impl_l->app_info.ops->get_source;
-
- app_info->ops->set_source = axis2_hash_get(methods,
- "set_source", AXIS2_HASH_KEY_STRING);
- if(!app_info->ops->set_source)
- app_info->ops->set_source =
- app_info_impl_l->app_info.ops->set_source;
-
- app_info->ops->get_markup = axis2_hash_get(methods,
- "get_markup", AXIS2_HASH_KEY_STRING);
- if(!app_info->ops->get_markup)
- app_info->ops->get_markup =
- app_info_impl_l->app_info.ops->get_markup;
-
- app_info->ops->set_markup = axis2_hash_get(methods,
- "set_markup", AXIS2_HASH_KEY_STRING);
- if(!app_info->ops->set_markup)
- app_info->ops->set_markup =
- app_info_impl_l->app_info.ops->set_markup;
-
- return axis2_xml_schema_obj_resolve_methods(&(app_info->base),
- env, app_info_impl_l->schema_obj, methods);
+ return AXIS2_INTF_TO_IMPL(app_info)->schema_obj;
}
axis2_char_t *AXIS2_CALL
axis2_xml_schema_app_info_get_source(void *app_info,
axis2_env_t **env)
{
+
axis2_xml_schema_app_info_impl_t *app_info_impl = NULL;
- axis2_hash_t *super = NULL;
-
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_USE_SUPER_OBJS(app_info, env);
- app_info_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super, "AXIS2_XML_SCHEMA_USE",
+ ht_super = AXIS2_XML_SCHEMA_USE_SUPER_OBJS(app_info, env);
+ if(NULL != ht_super)
+ {
+ app_info_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, "AXIS2_XML_SCHEMA_APP_INFO",
AXIS2_HASH_KEY_STRING));
+ if(NULL != app_info_impl)
+ return app_info_impl->source;
+ }
- return app_info_impl->source;
+ return NULL;
}
axis2_status_t AXIS2_CALL
@@ -348,20 +297,25 @@
axis2_char_t *source)
{
axis2_xml_schema_app_info_impl_t *app_info_impl = NULL;
- axis2_hash_t *super = NULL;
-
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, source, AXIS2_FAILURE);
- super = AXIS2_XML_SCHEMA_USE_SUPER_OBJS(app_info, env);
- app_info_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super, "AXIS2_XML_SCHEMA_USE",
- AXIS2_HASH_KEY_STRING));
+ ht_super = AXIS2_XML_SCHEMA_USE_SUPER_OBJS(app_info, env);
+ if(NULL != ht_super)
+ {
+ app_info_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, "AXIS2_XML_SCHEMA_APP_INFO",
+ AXIS2_HASH_KEY_STRING));
+ if(NULL != app_info_impl)
+ return AXIS2_FAILURE;
+ }
if(NULL != app_info_impl->source)
{
AXIS2_FREE((*env)->allocator, app_info_impl->source);
app_info_impl->source = NULL;
}
+
app_info_impl->source = AXIS2_STRDUP(source, env);
if(!app_info_impl->source)
{
@@ -377,13 +331,16 @@
axis2_env_t **env)
{
axis2_xml_schema_app_info_impl_t *app_info_impl = NULL;
- axis2_hash_t *super = NULL;
-
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, NULL);
- super = AXIS2_XML_SCHEMA_USE_SUPER_OBJS(app_info, env);
- app_info_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super, "AXIS2_XML_SCHEMA_USE",
+ ht_super = AXIS2_XML_SCHEMA_USE_SUPER_OBJS(app_info, env);
+ if(NULL != ht_super)
+ {
+ app_info_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, "AXIS2_XML_SCHEMA_APP_INFO",
AXIS2_HASH_KEY_STRING));
-
+ if(NULL != app_info_impl)
+ return NULL;
+ }
return app_info_impl->markup;
}
@@ -394,15 +351,17 @@
void *markup)
{
axis2_xml_schema_app_info_impl_t *app_info_impl = NULL;
- axis2_hash_t *super = NULL;
-
+ axis2_hash_t *ht_super = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, markup, AXIS2_FAILURE);
- super = AXIS2_XML_SCHEMA_USE_SUPER_OBJS(app_info, env);
- app_info_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super, "AXIS2_XML_SCHEMA_USE",
+ ht_super = AXIS2_XML_SCHEMA_USE_SUPER_OBJS(app_info, env);
+ if(NULL != ht_super)
+ {
+ app_info_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, "AXIS2_XML_SCHEMA_APP_INFO",
AXIS2_HASH_KEY_STRING));
-
-
+ if(NULL != app_info_impl)
+ return AXIS2_FAILURE;
+ }
app_info_impl->markup = markup;
return AXIS2_SUCCESS;
}