axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r394660 [5/6] - in /webservices/axis2/trunk/c/modules/xml/xml_schema: ./ constants/ utils/
Date Mon, 17 Apr 2006 12:15:52 GMT
Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_facet.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_facet.c?rev=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_facet.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_facet.c Mon Apr 17 05:15:47 2006
@@ -0,0 +1,256 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <axis2_xml_schema_facet.h>
+
+typedef struct axis2_xml_schema_facet_impl axis2_xml_schema_facet_impl_t;
+
+/** 
+ * @brief Other Extension Struct Impl
+ *	Axis2 Other Extension  
+ */ 
+struct axis2_xml_schema_facet_impl
+{
+    axis2_xml_schema_facet_t facet;
+    axis2_xml_schema_annotated_t *annotated;
+    axis2_hash_t *methods;
+    axis2_bool_t fixed;
+    void *value;
+};
+
+#define INTF_TO_IMPL(facet) ((axis2_xml_schema_facet_impl_t *) facet)
+
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_facet_free(void *facet,
+                        axis2_env_t **env);
+
+axis2_xml_schema_annotated_t *AXIS2_CALL
+axis2_xml_schema_facet_get_base_impl(void *facet,
+                                        axis2_env_t **env);
+
+axis2_bool_t AXIS2_CALL
+axis2_xml_schema_facet_is_fixed(void *facet,
+                                axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_facet_set_fixed(void *facet,
+                                 axis2_env_t **env,
+                                 axis2_bool_t fixed);
+
+void *AXIS2_CALL
+axis2_xml_schema_facet_get_value(void *facet,
+                                 axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_facet_set_value(void *facet,
+                                 axis2_env_t **env,
+                                 void *value);
+
+axis2_xml_schema_facet_t *AXIS2_CALL
+axis2_xml_schema_facet_construct (axis2_xml_schema_facet_t *facet,
+                                    axis2_env_t **env,
+                                    axis2_om_element_t *element,
+                                    axis2_om_node_t **node);
+
+AXIS2_DECLARE(axis2_xml_schema_facet_t *)
+axis2_xml_schema_facet_create(axis2_env_t **env,
+                                void *value,
+                                axis2_bool_t fixed)
+{
+    axis2_xml_schema_facet_impl_t *facet_impl = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+
+    facet_impl = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_facet_impl_t));
+
+    facet_impl->annotated = NULL;
+    facet_impl->methods = NULL;
+    facet_impl->fixed = fixed;
+    facet_impl->value = value;
+    facet_impl->facet.ops = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_facet_ops_t));
+
+    facet_impl->facet.ops->free = axis2_xml_schema_facet_free;
+    facet_impl->facet.ops->get_base_impl = 
+            axis2_xml_schema_facet_get_base_impl;
+    facet_impl->facet.ops->is_fixed = 
+            axis2_xml_schema_facet_is_fixed;
+    facet_impl->facet.ops->set_fixed = 
+            axis2_xml_schema_facet_set_fixed;
+    facet_impl->facet.ops->get_value = 
+            axis2_xml_schema_facet_get_value;
+    facet_impl->facet.ops->set_value = 
+            axis2_xml_schema_facet_set_value;
+    facet_impl->facet.ops->construct = 
+            axis2_xml_schema_facet_construct;
+   
+    facet_impl->methods = axis2_hash_make(env);
+    if(!facet_impl->methods)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    axis2_hash_set(facet_impl->methods, "free", AXIS2_HASH_KEY_STRING, 
+            axis2_xml_schema_facet_free);
+    axis2_hash_set(facet_impl->methods, "is_fixed", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_facet_is_fixed);
+    axis2_hash_set(facet_impl->methods, "set_fixed", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_facet_set_fixed);
+    axis2_hash_set(facet_impl->methods, "get_value", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_facet_get_value);
+    axis2_hash_set(facet_impl->methods, "set_value", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_facet_set_value);
+    axis2_hash_set(facet_impl->methods, "construct", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_facet_construct);
+    
+    facet_impl->annotated = axis2_xml_schema_annotated_create(env);
+    status = axis2_xml_schema_annotated_resolve_methods(
+            &(facet_impl->facet.base), env, facet_impl->annotated, 
+            facet_impl->methods);
+    
+    return &(facet_impl->facet);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_facet_free(void *facet,
+                                    axis2_env_t **env)
+{
+    axis2_xml_schema_facet_impl_t *facet_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    facet_impl = INTF_TO_IMPL(facet);
+
+    if(facet_impl->methods)
+    {
+        axis2_hash_free(facet_impl->methods, env);
+        facet_impl->methods = NULL;
+    }
+
+    if(facet_impl->annotated)
+    {
+        AXIS2_XML_SCHEMA_OBJ_FREE(facet_impl->annotated, env);
+        facet_impl->annotated = NULL;
+    }
+    
+    if((&(facet_impl->facet))->ops)
+    {
+        AXIS2_FREE((*env)->allocator, (&(facet_impl->facet))->ops);
+        (&(facet_impl->facet))->ops = NULL;
+    }
+
+    if(facet_impl)
+    {
+        AXIS2_FREE((*env)->allocator, facet_impl);
+        facet_impl = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_annotated_t *AXIS2_CALL
+axis2_xml_schema_facet_get_base_impl(void *facet,
+                                axis2_env_t **env)
+{
+    axis2_xml_schema_facet_impl_t *facet_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    facet_impl = INTF_TO_IMPL(facet);
+
+    return facet_impl->annotated;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_facet_resolve_methods(
+                                axis2_xml_schema_facet_t *facet,
+                                axis2_env_t **env,
+                                axis2_xml_schema_facet_t *facet_impl,
+                                axis2_hash_t *methods)
+{
+    axis2_xml_schema_facet_impl_t *facet_impl_l = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, facet_impl, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+    
+    facet_impl_l = (axis2_xml_schema_facet_impl_t *) facet_impl;
+    
+    facet->ops = AXIS2_MALLOC((*env)->allocator, 
+            sizeof(axis2_xml_schema_facet_ops_t));
+    facet->ops->free = axis2_hash_get(methods, "free", 
+            AXIS2_HASH_KEY_STRING);
+    facet->ops->get_base_impl = 
+            facet_impl_l->facet.ops->get_base_impl;
+    facet->ops->is_fixed = 
+            facet_impl_l->facet.ops->is_fixed;
+    facet->ops->set_fixed = 
+            facet_impl_l->facet.ops->set_fixed;
+    facet->ops->get_value = 
+            facet_impl_l->facet.ops->get_value;
+    facet->ops->set_value = 
+            facet_impl_l->facet.ops->set_value;
+    facet->ops->construct = 
+            facet_impl_l->facet.ops->construct;
+    
+    return axis2_xml_schema_annotated_resolve_methods(&(facet->base), 
+            env, facet_impl_l->annotated, methods);
+}
+
+axis2_bool_t AXIS2_CALL
+axis2_xml_schema_facet_is_fixed(void *facet,
+                                            axis2_env_t **env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    return INTF_TO_IMPL(facet)->fixed;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_facet_set_fixed(void *facet,
+                                  axis2_env_t **env,
+                                  axis2_bool_t fixed)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    INTF_TO_IMPL(facet)->fixed = fixed;
+    return AXIS2_SUCCESS;
+}
+
+void *AXIS2_CALL
+axis2_xml_schema_facet_get_value(void *facet,
+                                 axis2_env_t **env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    return INTF_TO_IMPL(facet)->value;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_facet_set_value(void *facet,
+                                 axis2_env_t **env,
+                                 void *value)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    /* TODO if value already exist free it */
+    INTF_TO_IMPL(facet)->value = value;
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_facet_t *AXIS2_CALL
+axis2_xml_schema_facet_construct (axis2_xml_schema_facet_t *facet,
+                                    axis2_env_t **env,
+                                    axis2_om_element_t *element,
+                                    axis2_om_node_t **node)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    /* TODO write logic */
+    return NULL;
+}

Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_form.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_form.c?rev=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_form.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_form.c Mon Apr 17 05:15:47 2006
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <axis2_xml_schema_form.h>
+
+typedef struct axis2_xml_schema_form_impl axis2_xml_schema_form_impl_t;
+
+/** 
+ * @brief Other Extension Struct Impl
+ *	Axis2 Other Extension  
+ */ 
+struct axis2_xml_schema_form_impl
+{
+    axis2_xml_schema_form_t form;
+    axis2_xml_schema_enum_t *schema_enum;
+    axis2_hash_t *methods;
+    axis2_array_list_t *members;
+};
+
+#define INTF_TO_IMPL(form) ((axis2_xml_schema_form_impl_t *) form)
+
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_form_free(void *form,
+                        axis2_env_t **env);
+
+axis2_xml_schema_enum_t *AXIS2_CALL
+axis2_xml_schema_form_get_base_impl(void *form,
+                                axis2_env_t **env);
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_form_resolve_methods(
+                                axis2_xml_schema_form_t *form,
+                                axis2_env_t **env,
+                                axis2_xml_schema_form_t *form_impl,
+                                axis2_hash_t *methods);
+
+axis2_array_list_t *
+axis2_xml_schema_form_get_values(void *form,
+                        axis2_env_t **env);
+
+
+AXIS2_DECLARE(axis2_xml_schema_form_t *)
+axis2_xml_schema_form_create(axis2_env_t **env,
+                            axis2_char_t *value)
+{
+    axis2_xml_schema_form_impl_t *form_impl = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+    
+    form_impl = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_form_impl_t));
+
+    form_impl->schema_enum = NULL;
+    form_impl->methods = NULL;
+    form_impl->members = NULL;
+    form_impl->form.ops = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_form_ops_t));
+
+    form_impl->form.ops->free = axis2_xml_schema_form_free;
+    form_impl->form.ops->get_base_impl = axis2_xml_schema_form_get_base_impl;
+    form_impl->form.ops->get_values = 
+            axis2_xml_schema_form_get_values;
+   
+    if(!form_impl->members)
+    {
+        form_impl->members = axis2_array_list_create(env, 0);
+        if(!form_impl->members)
+            return NULL;
+        AXIS2_ARRAY_LIST_ADD(form_impl->members, env, AXIS2_XML_SCHEMA_NONE);
+        AXIS2_ARRAY_LIST_ADD(form_impl->members, env, AXIS2_XML_SCHEMA_QUALIFIED);
+        AXIS2_ARRAY_LIST_ADD(form_impl->members, env, AXIS2_XML_SCHEMA_UNQUALIFIED);
+    }
+    form_impl->methods = axis2_hash_make(env);
+    if(!form_impl->methods)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    axis2_hash_set(form_impl->methods, "free", AXIS2_HASH_KEY_STRING, 
+            axis2_xml_schema_form_free);
+    axis2_hash_set(form_impl->methods, "get_values", AXIS2_HASH_KEY_STRING, 
+            axis2_xml_schema_form_get_values);
+
+    form_impl->schema_enum = axis2_xml_schema_enum_create(env, value);
+    status = axis2_xml_schema_enum_resolve_methods(
+            &(form_impl->form.base), env, form_impl->schema_enum, 
+            form_impl->methods); 
+
+    return &(form_impl->form);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_form_free(void *form,
+                                    axis2_env_t **env)
+{
+    axis2_xml_schema_form_impl_t *form_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    form_impl = INTF_TO_IMPL(form);
+
+    if(form_impl->members)
+    {
+        AXIS2_ARRAY_LIST_FREE(form_impl->members, env);
+        form_impl->members = NULL;
+    }
+    
+    if(form_impl->schema_enum)
+    {
+        AXIS2_XML_SCHEMA_ENUM_FREE(form_impl->schema_enum, env);
+        form_impl->schema_enum = NULL;
+    }
+    
+    if((&(form_impl->form))->ops)
+    {
+        AXIS2_FREE((*env)->allocator, (&(form_impl->form))->ops);
+        (&(form_impl->form))->ops = NULL;
+    }
+
+    if(form_impl)
+    {
+        AXIS2_FREE((*env)->allocator, form_impl);
+        form_impl = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_enum_t *AXIS2_CALL
+axis2_xml_schema_form_get_base_impl(void *form,
+                                axis2_env_t **env)
+{
+    axis2_xml_schema_form_impl_t *form_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    form_impl = INTF_TO_IMPL(form);
+
+    return form_impl->schema_enum;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_form_resolve_methods(
+                                axis2_xml_schema_form_t *form,
+                                axis2_env_t **env,
+                                axis2_xml_schema_form_t *form_impl,
+                                axis2_hash_t *methods)
+{
+    axis2_xml_schema_form_impl_t *form_impl_l = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, form_impl, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+    
+    form_impl_l = (axis2_xml_schema_form_impl_t *) form_impl;
+    
+    form->ops = AXIS2_MALLOC((*env)->allocator, 
+            sizeof(axis2_xml_schema_form_ops_t));
+    form->ops->free = axis2_hash_get(methods, "free", 
+            AXIS2_HASH_KEY_STRING);
+    form->ops->get_base_impl = 
+            form_impl_l->form.ops->get_base_impl;
+    form->ops->get_values = 
+            form_impl_l->form.ops->get_values;
+    
+    return axis2_xml_schema_enum_resolve_methods(&(form->base), 
+            env, form_impl_l->schema_enum, methods);
+}
+
+axis2_array_list_t *AXIS2_CALL
+axis2_xml_schema_form_get_values(void *form,
+                                        axis2_env_t **env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return INTF_TO_IMPL(form)->members;
+}
+

Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_group.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_group.c?rev=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_group.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_group.c Mon Apr 17 05:15:47 2006
@@ -0,0 +1,262 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <axis2_xml_schema_group.h>
+#include <axis2_xml_schema_group_base.h>
+
+typedef struct axis2_xml_schema_group_impl axis2_xml_schema_group_impl_t;
+
+/** 
+ * @brief Other Extension Struct Impl
+ *	Axis2 Other Extension  
+ */ 
+struct axis2_xml_schema_group_impl
+{
+    axis2_xml_schema_group_t group;
+    axis2_xml_schema_annotated_t *annotated;
+    axis2_hash_t *methods;
+    axis2_char_t *name;
+    axis2_xml_schema_group_base_t *particle;
+};
+
+#define INTF_TO_IMPL(group) ((axis2_xml_schema_group_impl_t *) group)
+
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_group_free(void *group,
+                        axis2_env_t **env);
+
+axis2_xml_schema_annotated_t *AXIS2_CALL
+axis2_xml_schema_group_get_base_impl(void *group,
+                                        axis2_env_t **env);
+
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_group_get_name(void *group,
+                                axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_group_set_name(void *group,
+                                axis2_env_t **env,
+                                axis2_char_t *name);
+
+axis2_xml_schema_group_base_t *AXIS2_CALL
+axis2_xml_schema_group_get_particle(void *group,
+                                        axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_group_set_particle(void *group,
+                                    axis2_env_t **env,
+                                    axis2_xml_schema_group_base_t *particle);
+
+AXIS2_DECLARE(axis2_xml_schema_group_t *)
+axis2_xml_schema_group_create(axis2_env_t **env)
+{
+    axis2_xml_schema_group_impl_t *group_impl = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+
+    group_impl = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_group_impl_t));
+
+    group_impl->annotated = NULL;
+    group_impl->methods = NULL;
+    group_impl->name = NULL;
+    group_impl->particle = NULL;
+    group_impl->group.ops = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_group_ops_t));
+
+    group_impl->group.ops->free = axis2_xml_schema_group_free;
+    group_impl->group.ops->get_base_impl = 
+            axis2_xml_schema_group_get_base_impl;
+    group_impl->group.ops->get_name = 
+            axis2_xml_schema_group_get_name;
+    group_impl->group.ops->set_name = 
+            axis2_xml_schema_group_set_name;
+    group_impl->group.ops->get_particle = 
+            axis2_xml_schema_group_get_particle;
+    group_impl->group.ops->set_particle = 
+            axis2_xml_schema_group_set_particle;
+   
+    group_impl->methods = axis2_hash_make(env);
+    if(!group_impl->methods)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    axis2_hash_set(group_impl->methods, "free", AXIS2_HASH_KEY_STRING, 
+            axis2_xml_schema_group_free);
+    axis2_hash_set(group_impl->methods, "get_name", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_group_get_name);
+    axis2_hash_set(group_impl->methods, "set_name", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_group_set_name);
+    axis2_hash_set(group_impl->methods, "get_particle", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_group_get_particle);
+    axis2_hash_set(group_impl->methods, "set_particle", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_group_set_particle);
+    
+    group_impl->annotated = axis2_xml_schema_annotated_create(env);
+    status = axis2_xml_schema_annotated_resolve_methods(
+            &(group_impl->group.base), env, group_impl->annotated, 
+            group_impl->methods);
+    
+    return &(group_impl->group);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_group_free(void *group,
+                                    axis2_env_t **env)
+{
+    axis2_xml_schema_group_impl_t *group_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    group_impl = INTF_TO_IMPL(group);
+
+    if(group_impl->name)
+    {
+        AXIS2_FREE((*env)->allocator, group_impl->name);
+        group_impl->name = NULL;
+    }
+
+    if(group_impl->particle)
+    {
+        AXIS2_XML_SCHEMA_PARTICLE_FREE(group_impl->particle, env);
+        group_impl->particle = NULL;
+    }
+    
+    if(group_impl->methods)
+    {
+        axis2_hash_free(group_impl->methods, env);
+        group_impl->methods = NULL;
+    }
+
+    if(group_impl->annotated)
+    {
+        AXIS2_XML_SCHEMA_ANNOTATED_FREE(group_impl->annotated, env);
+        group_impl->annotated = NULL;
+    }
+    
+    if((&(group_impl->group))->ops)
+    {
+        AXIS2_FREE((*env)->allocator, (&(group_impl->group))->ops);
+        (&(group_impl->group))->ops = NULL;
+    }
+
+    if(group_impl)
+    {
+        AXIS2_FREE((*env)->allocator, group_impl);
+        group_impl = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_annotated_t *AXIS2_CALL
+axis2_xml_schema_group_get_base_impl(void *group,
+                                axis2_env_t **env)
+{
+    axis2_xml_schema_group_impl_t *group_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    group_impl = INTF_TO_IMPL(group);
+
+    return group_impl->annotated;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_group_resolve_methods(
+                                axis2_xml_schema_group_t *group,
+                                axis2_env_t **env,
+                                axis2_xml_schema_group_t *group_impl,
+                                axis2_hash_t *methods)
+{
+    axis2_xml_schema_group_impl_t *group_impl_l = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, group_impl, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+    
+    group_impl_l = (axis2_xml_schema_group_impl_t *) group_impl;
+    
+    group->ops = AXIS2_MALLOC((*env)->allocator, 
+            sizeof(axis2_xml_schema_group_ops_t));
+    group->ops->free = axis2_hash_get(methods, "free", 
+            AXIS2_HASH_KEY_STRING);
+    group->ops->get_base_impl = 
+            group_impl_l->group.ops->get_base_impl;
+    group->ops->get_name = 
+            group_impl_l->group.ops->get_name;
+    group->ops->set_name = 
+            group_impl_l->group.ops->set_name;
+    group->ops->get_particle = 
+            group_impl_l->group.ops->get_particle;
+    group->ops->set_particle = 
+            group_impl_l->group.ops->set_particle;
+    
+    return axis2_xml_schema_annotated_resolve_methods(&(group->base), 
+            env, group_impl_l->annotated, methods);
+}
+
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_group_get_name(void *group,
+                                axis2_env_t **env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    return INTF_TO_IMPL(group)->name;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_group_set_name(void *group,
+                                axis2_env_t **env,
+                                axis2_char_t *name)
+{
+    axis2_xml_schema_group_impl_t *group_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    group_impl = INTF_TO_IMPL(group);
+
+    if(group_impl->name)
+    {
+        AXIS2_FREE((*env)->allocator, group_impl->name);
+        group_impl->name = NULL;
+    }
+    group_impl->name = AXIS2_STRDUP(name, env);
+    if(!group_impl->name)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_group_base_t *AXIS2_CALL
+axis2_xml_schema_group_get_particle(void *group,
+                                        axis2_env_t **env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    return INTF_TO_IMPL(group)->particle;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_group_set_particle(void *group,
+                                    axis2_env_t **env,
+                                    axis2_xml_schema_group_base_t *particle)
+{
+    axis2_xml_schema_group_impl_t *group_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    group_impl = INTF_TO_IMPL(group);
+    
+    group_impl->particle = particle;
+    return AXIS2_SUCCESS;
+}
+

Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_group_base.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_group_base.c?rev=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_group_base.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_group_base.c Mon Apr 17 05:15:47 2006
@@ -0,0 +1,174 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <axis2_xml_schema_group_base.h>
+
+typedef struct axis2_xml_schema_group_base_impl axis2_xml_schema_group_base_impl_t;
+
+/** 
+ * @brief Other Extension Struct Impl
+ *	Axis2 Other Extension  
+ */ 
+struct axis2_xml_schema_group_base_impl
+{
+    axis2_xml_schema_group_base_t group_base;
+    axis2_xml_schema_particle_t *particle;
+    axis2_hash_t *methods;
+    axis2_xml_schema_obj_collection_t *items;
+};
+
+#define INTF_TO_IMPL(group_base) ((axis2_xml_schema_group_base_impl_t *) group_base)
+
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_group_base_free(void *group_base,
+                        axis2_env_t **env);
+
+axis2_xml_schema_particle_t *AXIS2_CALL
+axis2_xml_schema_group_base_get_base_impl(void *group_base,
+                                    axis2_env_t **env);
+
+
+axis2_xml_schema_obj_collection_t *AXIS2_CALL
+axis2_xml_schema_group_base_get_items(void *group_base,
+                                        axis2_env_t **env);
+
+ 
+AXIS2_DECLARE(axis2_xml_schema_group_base_t *)
+axis2_xml_schema_group_base_create(axis2_env_t **env)
+{
+    axis2_xml_schema_group_base_impl_t *group_base_impl = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+    
+    group_base_impl = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_group_base_impl_t));
+
+    group_base_impl->particle = NULL;
+    group_base_impl->methods = NULL;
+    group_base_impl->items = NULL;
+    group_base_impl->group_base.ops = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_group_base_ops_t));
+
+    group_base_impl->group_base.ops->free = axis2_xml_schema_group_base_free;
+    group_base_impl->group_base.ops->get_base_impl = axis2_xml_schema_group_base_get_base_impl;
+    group_base_impl->group_base.ops->get_items = axis2_xml_schema_group_base_get_items;
+   
+    group_base_impl->methods = axis2_hash_make(env);
+    if(!group_base_impl->methods)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    axis2_hash_set(group_base_impl->methods, "free", AXIS2_HASH_KEY_STRING, 
+            axis2_xml_schema_group_base_free);
+    axis2_hash_set(group_base_impl->methods, "get_items", AXIS2_HASH_KEY_STRING, 
+            axis2_xml_schema_group_base_get_items);
+    
+    group_base_impl->particle = axis2_xml_schema_particle_create(env);
+    status = axis2_xml_schema_particle_resolve_methods(
+            &(group_base_impl->group_base.base), env, group_base_impl->particle, 
+            group_base_impl->methods); 
+    return &(group_base_impl->group_base);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_group_base_free(void *group_base,
+                            axis2_env_t **env)
+{
+    axis2_xml_schema_group_base_impl_t *group_base_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    group_base_impl = INTF_TO_IMPL(group_base);
+
+    if(group_base_impl->items)
+    {
+        AXIS2_XML_SCHEMA_OBJ_COLLECTION_FREE(group_base_impl->items, env);
+        group_base_impl->items = NULL;
+    }
+ 
+    if(group_base_impl->methods)
+    {
+        axis2_hash_free(group_base_impl->methods, env);
+        group_base_impl->methods = NULL;
+    }
+   
+    if(group_base_impl->particle)
+    {
+        AXIS2_XML_SCHEMA_OBJ_FREE(group_base_impl->particle, env);
+        group_base_impl->particle = NULL;
+    }
+    
+    if((&(group_base_impl->group_base))->ops)
+    {
+        AXIS2_FREE((*env)->allocator, (&(group_base_impl->group_base))->ops);
+        (&(group_base_impl->group_base))->ops = NULL;
+    }
+
+    if(group_base_impl)
+    {
+        AXIS2_FREE((*env)->allocator, group_base_impl);
+        group_base_impl = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_particle_t *AXIS2_CALL
+axis2_xml_schema_group_base_get_base_impl(void *group_base,
+                                axis2_env_t **env)
+{
+    axis2_xml_schema_group_base_impl_t *group_base_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    group_base_impl = INTF_TO_IMPL(group_base);
+
+    return group_base_impl->particle;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_group_base_resolve_methods(
+                                axis2_xml_schema_group_base_t *group_base,
+                                axis2_env_t **env,
+                                axis2_xml_schema_group_base_t *group_base_impl,
+                                axis2_hash_t *methods)
+{
+    axis2_xml_schema_group_base_impl_t *group_base_impl_l = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, group_base_impl, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+    
+    group_base_impl_l = (axis2_xml_schema_group_base_impl_t *) group_base_impl;
+    
+    group_base->ops = AXIS2_MALLOC((*env)->allocator, 
+            sizeof(axis2_xml_schema_group_base_ops_t));
+    group_base->ops->free = axis2_hash_get(methods, "free", 
+            AXIS2_HASH_KEY_STRING);
+    group_base->ops->get_base_impl = 
+            group_base_impl_l->group_base.ops->get_base_impl;
+    group_base->ops->get_items = axis2_hash_get(methods, "get_items", 
+            AXIS2_HASH_KEY_STRING);
+    
+    return axis2_xml_schema_particle_resolve_methods(&(group_base->base), 
+            env, group_base_impl_l->particle, methods);
+}
+
+axis2_xml_schema_obj_collection_t *AXIS2_CALL
+axis2_xml_schema_group_base_get_items(void *group_base,
+                                        axis2_env_t **env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return INTF_TO_IMPL(group_base)->items;
+}
+

Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_group_ref.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_group_ref.c?rev=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_group_ref.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_group_ref.c Mon Apr 17 05:15:47 2006
@@ -0,0 +1,242 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <axis2_xml_schema_group_ref.h>
+#include <axis2_xml_schema_group_base.h>
+
+typedef struct axis2_xml_schema_group_ref_impl axis2_xml_schema_group_ref_impl_t;
+
+/** 
+ * @brief Other Extension Struct Impl
+ *	Axis2 Other Extension  
+ */ 
+struct axis2_xml_schema_group_ref_impl
+{
+    axis2_xml_schema_group_ref_t group_ref;
+    axis2_xml_schema_particle_t *base;
+    axis2_hash_t *methods;
+    axis2_qname_t *ref_qname;
+    axis2_xml_schema_group_base_t *particle;
+};
+
+#define INTF_TO_IMPL(group_ref) ((axis2_xml_schema_group_ref_impl_t *) group_ref)
+
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_group_ref_free(void *group_ref,
+                        axis2_env_t **env);
+
+axis2_xml_schema_particle_t *AXIS2_CALL
+axis2_xml_schema_group_ref_get_base_impl(void *group_ref,
+                                        axis2_env_t **env);
+
+axis2_qname_t *AXIS2_CALL
+axis2_xml_schema_group_ref_get_ref_qname(void *group_ref,
+                                axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_group_ref_set_ref_qname(void *group_ref,
+                                axis2_env_t **env,
+                                axis2_qname_t *ref_qname);
+
+axis2_xml_schema_group_base_t *AXIS2_CALL
+axis2_xml_schema_group_ref_get_particle(void *group_ref,
+                                        axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_group_ref_set_particle(void *group_ref,
+                                    axis2_env_t **env,
+                                    axis2_xml_schema_group_base_t *particle);
+
+AXIS2_DECLARE(axis2_xml_schema_group_ref_t *)
+axis2_xml_schema_group_ref_create(axis2_env_t **env)
+{
+    axis2_xml_schema_group_ref_impl_t *group_ref_impl = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+
+    group_ref_impl = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_group_ref_impl_t));
+
+    group_ref_impl->base = NULL;
+    group_ref_impl->methods = NULL;
+    group_ref_impl->ref_qname = NULL;
+    group_ref_impl->particle = NULL;
+    group_ref_impl->group_ref.ops = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_group_ref_ops_t));
+
+    group_ref_impl->group_ref.ops->free = axis2_xml_schema_group_ref_free;
+    group_ref_impl->group_ref.ops->get_base_impl = 
+            axis2_xml_schema_group_ref_get_base_impl;
+    group_ref_impl->group_ref.ops->get_ref_qname = 
+            axis2_xml_schema_group_ref_get_ref_qname;
+    group_ref_impl->group_ref.ops->set_ref_qname = 
+            axis2_xml_schema_group_ref_set_ref_qname;
+    group_ref_impl->group_ref.ops->get_particle = 
+            axis2_xml_schema_group_ref_get_particle;
+   
+    group_ref_impl->methods = axis2_hash_make(env);
+    if(!group_ref_impl->methods)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    axis2_hash_set(group_ref_impl->methods, "free", AXIS2_HASH_KEY_STRING, 
+            axis2_xml_schema_group_ref_free);
+    axis2_hash_set(group_ref_impl->methods, "get_ref_qname", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_group_ref_get_ref_qname);
+    axis2_hash_set(group_ref_impl->methods, "set_ref_qname", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_group_ref_get_ref_qname);
+    axis2_hash_set(group_ref_impl->methods, "set_particle", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_group_ref_get_particle);
+    
+    group_ref_impl->base = axis2_xml_schema_particle_create(env);
+    status = axis2_xml_schema_particle_resolve_methods(
+            &(group_ref_impl->group_ref.base), env, group_ref_impl->base, 
+            group_ref_impl->methods);
+    
+    return &(group_ref_impl->group_ref);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_group_ref_free(void *group_ref,
+                                    axis2_env_t **env)
+{
+    axis2_xml_schema_group_ref_impl_t *group_ref_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    group_ref_impl = INTF_TO_IMPL(group_ref);
+
+    if(group_ref_impl->ref_qname)
+    {
+        AXIS2_FREE((*env)->allocator, group_ref_impl->ref_qname);
+        group_ref_impl->ref_qname = NULL;
+    }
+
+    if(group_ref_impl->particle)
+    {
+        AXIS2_XML_SCHEMA_GROUP_BASE_FREE(group_ref_impl->particle, env);
+        group_ref_impl->particle = NULL;
+    }
+    
+    if(group_ref_impl->methods)
+    {
+        axis2_hash_free(group_ref_impl->methods, env);
+        group_ref_impl->methods = NULL;
+    }
+
+    if(group_ref_impl->base)
+    {
+        AXIS2_XML_SCHEMA_PARTICLE_FREE(group_ref_impl->base, env);
+        group_ref_impl->base = NULL;
+    }
+    
+    if((&(group_ref_impl->group_ref))->ops)
+    {
+        AXIS2_FREE((*env)->allocator, (&(group_ref_impl->group_ref))->ops);
+        (&(group_ref_impl->group_ref))->ops = NULL;
+    }
+
+    if(group_ref_impl)
+    {
+        AXIS2_FREE((*env)->allocator, group_ref_impl);
+        group_ref_impl = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_particle_t *AXIS2_CALL
+axis2_xml_schema_group_ref_get_base_impl(void *group_ref,
+                                axis2_env_t **env)
+{
+    axis2_xml_schema_group_ref_impl_t *group_ref_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    group_ref_impl = INTF_TO_IMPL(group_ref);
+
+    return group_ref_impl->base;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_group_ref_resolve_methods(
+                                axis2_xml_schema_group_ref_t *group_ref,
+                                axis2_env_t **env,
+                                axis2_xml_schema_group_ref_t *group_ref_impl,
+                                axis2_hash_t *methods)
+{
+    axis2_xml_schema_group_ref_impl_t *group_ref_impl_l = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, group_ref_impl, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+    
+    group_ref_impl_l = (axis2_xml_schema_group_ref_impl_t *) group_ref_impl;
+    
+    group_ref->ops = AXIS2_MALLOC((*env)->allocator, 
+            sizeof(axis2_xml_schema_group_ref_ops_t));
+    group_ref->ops->free = axis2_hash_get(methods, "free", 
+            AXIS2_HASH_KEY_STRING);
+    group_ref->ops->get_base_impl = 
+            group_ref_impl_l->group_ref.ops->get_base_impl;
+    group_ref->ops->get_ref_qname = 
+            group_ref_impl_l->group_ref.ops->get_ref_qname;
+    group_ref->ops->set_ref_qname = 
+            group_ref_impl_l->group_ref.ops->set_ref_qname;
+    group_ref->ops->get_particle = 
+            group_ref_impl_l->group_ref.ops->get_particle;
+    
+    return axis2_xml_schema_particle_resolve_methods(&(group_ref->base), 
+            env, group_ref_impl_l->base, methods);
+}
+
+axis2_qname_t *AXIS2_CALL
+axis2_xml_schema_group_ref_get_ref_qname(void *group_ref,
+                                axis2_env_t **env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    return INTF_TO_IMPL(group_ref)->ref_qname;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_group_ref_set_ref_qname(void *group_ref,
+                                axis2_env_t **env,
+                                axis2_qname_t *ref_qname)
+{
+    axis2_xml_schema_group_ref_impl_t *group_ref_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    group_ref_impl = INTF_TO_IMPL(group_ref);
+
+    if(group_ref_impl->ref_qname)
+    {
+        AXIS2_QNAME_FREE(group_ref_impl->ref_qname, env);
+        group_ref_impl->ref_qname = NULL;
+    }
+    group_ref_impl->ref_qname = AXIS2_QNAME_CLONE(ref_qname, env);
+    if(!group_ref_impl->ref_qname)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_group_base_t *AXIS2_CALL
+axis2_xml_schema_group_ref_get_particle(void *group_ref,
+                                        axis2_env_t **env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    return INTF_TO_IMPL(group_ref)->particle;
+}
+

Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_identity_constraint.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_identity_constraint.c?rev=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_identity_constraint.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_identity_constraint.c Mon Apr 17 05:15:47 2006
@@ -0,0 +1,284 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <axis2_xml_schema_identity_constraint.h>
+#include <axis2_xml_schema_obj_collection.h>
+#include <axis2_xml_schema_xpath.h>
+
+typedef struct axis2_xml_schema_identity_constraint_impl axis2_xml_schema_identity_constraint_impl_t;
+
+/** 
+ * @brief Other Extension Struct Impl
+ *	Axis2 Other Extension  
+ */ 
+struct axis2_xml_schema_identity_constraint_impl
+{
+    axis2_xml_schema_identity_constraint_t identity_constraint;
+    axis2_xml_schema_annotated_t *annotated;
+    axis2_hash_t *methods;
+    axis2_xml_schema_obj_collection_t *fields;
+    axis2_char_t *name;
+    axis2_xml_schema_xpath_t *selector;
+};
+
+#define INTF_TO_IMPL(identity_constraint) ((axis2_xml_schema_identity_constraint_impl_t *) identity_constraint)
+
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_identity_constraint_free(void *identity_constraint,
+                        axis2_env_t **env);
+
+axis2_xml_schema_annotated_t *AXIS2_CALL
+axis2_xml_schema_identity_constraint_get_base_impl(void *identity_constraint,
+                                        axis2_env_t **env);
+
+axis2_xml_schema_obj_collection_t *AXIS2_CALL
+axis2_xml_schema_identity_constraint_get_fields(void *identity_constraint,
+                                axis2_env_t **env);
+
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_identity_constraint_get_name(void *identity_constraint,
+                                axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_identity_constraint_set_name(void *identity_constraint,
+                                axis2_env_t **env,
+                                axis2_char_t *name);
+
+axis2_xml_schema_xpath_t *AXIS2_CALL
+axis2_xml_schema_identity_constraint_get_selector(void *identity_constraint,
+                                        axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_identity_constraint_set_selector(void *identity_constraint,
+                                    axis2_env_t **env,
+                                    axis2_xml_schema_xpath_t *selector);
+
+AXIS2_DECLARE(axis2_xml_schema_identity_constraint_t *)
+axis2_xml_schema_identity_constraint_create(axis2_env_t **env)
+{
+    axis2_xml_schema_identity_constraint_impl_t *identity_constraint_impl = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+
+    identity_constraint_impl = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_identity_constraint_impl_t));
+
+    identity_constraint_impl->annotated = NULL;
+    identity_constraint_impl->methods = NULL;
+    identity_constraint_impl->fields = NULL;
+    identity_constraint_impl->name = NULL;
+    identity_constraint_impl->selector = NULL;
+    identity_constraint_impl->identity_constraint.ops = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_identity_constraint_ops_t));
+
+    identity_constraint_impl->identity_constraint.ops->free = 
+            axis2_xml_schema_identity_constraint_free;
+    identity_constraint_impl->identity_constraint.ops->get_base_impl = 
+            axis2_xml_schema_identity_constraint_get_base_impl;
+    identity_constraint_impl->identity_constraint.ops->get_fields = 
+            axis2_xml_schema_identity_constraint_get_fields;
+    identity_constraint_impl->identity_constraint.ops->get_name = 
+            axis2_xml_schema_identity_constraint_get_name;
+    identity_constraint_impl->identity_constraint.ops->set_name = 
+            axis2_xml_schema_identity_constraint_set_name;
+    identity_constraint_impl->identity_constraint.ops->get_selector = 
+            axis2_xml_schema_identity_constraint_get_selector;
+    identity_constraint_impl->identity_constraint.ops->set_selector = 
+            axis2_xml_schema_identity_constraint_set_selector;
+   
+    identity_constraint_impl->methods = axis2_hash_make(env);
+    if(!identity_constraint_impl->methods)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    axis2_hash_set(identity_constraint_impl->methods, "free", AXIS2_HASH_KEY_STRING, 
+            axis2_xml_schema_identity_constraint_free);
+    axis2_hash_set(identity_constraint_impl->methods, "get_fields", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_identity_constraint_get_fields);
+    axis2_hash_set(identity_constraint_impl->methods, "get_name", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_identity_constraint_get_name);
+    axis2_hash_set(identity_constraint_impl->methods, "set_name", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_identity_constraint_set_name);
+    axis2_hash_set(identity_constraint_impl->methods, "get_selector", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_identity_constraint_get_selector);
+    axis2_hash_set(identity_constraint_impl->methods, "set_selector", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_identity_constraint_set_selector);
+    
+    identity_constraint_impl->annotated = axis2_xml_schema_annotated_create(env);
+    status = axis2_xml_schema_annotated_resolve_methods(
+            &(identity_constraint_impl->identity_constraint.base), env, identity_constraint_impl->annotated, 
+            identity_constraint_impl->methods);
+    
+    return &(identity_constraint_impl->identity_constraint);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_identity_constraint_free(void *identity_constraint,
+                                    axis2_env_t **env)
+{
+    axis2_xml_schema_identity_constraint_impl_t *identity_constraint_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    identity_constraint_impl = INTF_TO_IMPL(identity_constraint);
+
+    if(identity_constraint_impl->name)
+    {
+        AXIS2_FREE((*env)->allocator, identity_constraint_impl->name);
+        identity_constraint_impl->name = NULL;
+    }
+
+    if(identity_constraint_impl->selector)
+    {
+        AXIS2_XML_SCHEMA_XPATH_FREE(identity_constraint_impl->selector, env);
+        identity_constraint_impl->selector = NULL;
+    }
+    
+    if(identity_constraint_impl->methods)
+    {
+        axis2_hash_free(identity_constraint_impl->methods, env);
+        identity_constraint_impl->methods = NULL;
+    }
+
+    if(identity_constraint_impl->annotated)
+    {
+        AXIS2_XML_SCHEMA_ANNOTATED_FREE(identity_constraint_impl->annotated, env);
+        identity_constraint_impl->annotated = NULL;
+    }
+    
+    if((&(identity_constraint_impl->identity_constraint))->ops)
+    {
+        AXIS2_FREE((*env)->allocator, (&(identity_constraint_impl->identity_constraint))->ops);
+        (&(identity_constraint_impl->identity_constraint))->ops = NULL;
+    }
+
+    if(identity_constraint_impl)
+    {
+        AXIS2_FREE((*env)->allocator, identity_constraint_impl);
+        identity_constraint_impl = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_annotated_t *AXIS2_CALL
+axis2_xml_schema_identity_constraint_get_base_impl(void *identity_constraint,
+                                axis2_env_t **env)
+{
+    axis2_xml_schema_identity_constraint_impl_t *identity_constraint_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    identity_constraint_impl = INTF_TO_IMPL(identity_constraint);
+
+    return identity_constraint_impl->annotated;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_identity_constraint_resolve_methods(
+                axis2_xml_schema_identity_constraint_t *identity_constraint,
+                axis2_env_t **env,
+                axis2_xml_schema_identity_constraint_t *identity_constraint_impl,
+                axis2_hash_t *methods)
+{
+    axis2_xml_schema_identity_constraint_impl_t *identity_constraint_impl_l = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, identity_constraint_impl, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+    
+    identity_constraint_impl_l = (axis2_xml_schema_identity_constraint_impl_t *) identity_constraint_impl;
+    
+    identity_constraint->ops = AXIS2_MALLOC((*env)->allocator, 
+            sizeof(axis2_xml_schema_identity_constraint_ops_t));
+    identity_constraint->ops->free = axis2_hash_get(methods, "free", 
+            AXIS2_HASH_KEY_STRING);
+    identity_constraint->ops->get_base_impl = 
+            identity_constraint_impl_l->identity_constraint.ops->get_base_impl;
+    identity_constraint->ops->get_fields = 
+            identity_constraint_impl_l->identity_constraint.ops->get_fields;
+    identity_constraint->ops->get_name = 
+            identity_constraint_impl_l->identity_constraint.ops->get_name;
+    identity_constraint->ops->set_name = 
+            identity_constraint_impl_l->identity_constraint.ops->set_name;
+    identity_constraint->ops->get_selector = 
+            identity_constraint_impl_l->identity_constraint.ops->get_selector;
+    identity_constraint->ops->set_selector = 
+            identity_constraint_impl_l->identity_constraint.ops->set_selector;
+    
+    return axis2_xml_schema_annotated_resolve_methods(&(identity_constraint->base), 
+            env, identity_constraint_impl_l->annotated, methods);
+}
+
+axis2_xml_schema_obj_collection_t *AXIS2_CALL
+axis2_xml_schema_identity_constraint_get_fields(void *identity_constraint,
+                                                axis2_env_t **env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    return INTF_TO_IMPL(identity_constraint)->fields;
+}
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_identity_constraint_get_name(void *identity_constraint,
+                                axis2_env_t **env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    return INTF_TO_IMPL(identity_constraint)->name;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_identity_constraint_set_name(void *identity_constraint,
+                                axis2_env_t **env,
+                                axis2_char_t *name)
+{
+    axis2_xml_schema_identity_constraint_impl_t *identity_constraint_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    identity_constraint_impl = INTF_TO_IMPL(identity_constraint);
+
+    if(identity_constraint_impl->name)
+    {
+        AXIS2_FREE((*env)->allocator, identity_constraint_impl->name);
+        identity_constraint_impl->name = NULL;
+    }
+    identity_constraint_impl->name = AXIS2_STRDUP(name, env);
+    if(!identity_constraint_impl->name)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_xpath_t *AXIS2_CALL
+axis2_xml_schema_identity_constraint_get_selector(void *identity_constraint,
+                                                    axis2_env_t **env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    return INTF_TO_IMPL(identity_constraint)->selector;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_identity_constraint_set_selector(void *identity_constraint,
+                                    axis2_env_t **env,
+                                    axis2_xml_schema_xpath_t *selector)
+{
+    axis2_xml_schema_identity_constraint_impl_t *identity_constraint_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, selector, AXIS2_FAILURE);
+    identity_constraint_impl = INTF_TO_IMPL(identity_constraint);
+    
+    identity_constraint_impl->selector = selector;
+    return AXIS2_SUCCESS;
+}
+

Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_obj.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_obj.c?rev=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_obj.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_obj.c Mon Apr 17 05:15:47 2006
@@ -0,0 +1,252 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+#include <axis2_xml_schema_obj.h>
+#include <axis2_hash.h>
+
+typedef struct axis2_xml_schema_obj_impl axis2_xml_schema_obj_impl_t;
+
+/** 
+ * @brief Xml Schema Obj Struct Impl
+ *	Axis2 Xml Schema Obj  
+ */ 
+struct axis2_xml_schema_obj_impl
+{
+    axis2_xml_schema_obj_t obj;
+    int line_num;
+    int line_pos;
+    axis2_char_t *source_uri;
+};
+
+#define INTF_TO_IMPL(obj) ((axis2_xml_schema_obj_impl_t *) obj)
+
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_obj_free(void *obj,
+                axis2_env_t **env);
+
+axis2_char_t * AXIS2_CALL
+axis2_xml_schema_obj_get_source_uri(void *obj,
+                        axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_set_source_uri(void *obj,
+                        axis2_env_t **env,
+                        axis2_char_t *source_uri);
+
+axis2_bool_t AXIS2_CALL
+axis2_xml_schema_obj_equals(void *obj,
+                                axis2_env_t **env,
+                                void *obj_comp);
+
+int AXIS2_CALL
+axis2_xml_schema_obj_get_line_num(void *obj,
+                                    axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_set_line_num(void *obj,
+                        axis2_env_t **env,
+                        int line_num);
+
+int AXIS2_CALL
+axis2_xml_schema_obj_get_line_pos(void *obj,
+                                    axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_set_line_pos(void *obj,
+                        axis2_env_t **env,
+                        int line_pos);
+
+AXIS2_DECLARE(axis2_xml_schema_obj_t *)
+axis2_xml_schema_obj_create(axis2_env_t **env)
+{
+    axis2_xml_schema_obj_impl_t *obj_impl = NULL;
+    
+    obj_impl = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_obj_impl_t));
+
+    obj_impl->line_num = -1;
+    obj_impl->line_pos = -1;
+    obj_impl->source_uri = NULL;
+
+    obj_impl->obj.ops = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_obj_ops_t)); 
+
+
+    obj_impl->obj.ops->free = axis2_xml_schema_obj_free;
+    obj_impl->obj.ops->get_line_num = axis2_xml_schema_obj_get_line_num;
+    obj_impl->obj.ops->set_line_num = axis2_xml_schema_obj_set_line_num;
+    obj_impl->obj.ops->get_line_pos = axis2_xml_schema_obj_get_line_pos;
+    obj_impl->obj.ops->set_line_pos = axis2_xml_schema_obj_set_line_pos;
+    obj_impl->obj.ops->get_source_uri = axis2_xml_schema_obj_get_source_uri;
+    obj_impl->obj.ops->set_source_uri = axis2_xml_schema_obj_set_source_uri;
+    obj_impl->obj.ops->equals = axis2_xml_schema_obj_equals;
+
+    return &(obj_impl->obj);
+}
+
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_free(void *obj,
+                axis2_env_t **env)
+{
+    axis2_xml_schema_obj_impl_t *obj_impl = NULL;
+
+    obj_impl = INTF_TO_IMPL(obj);
+
+    if(obj_impl->source_uri)
+    {
+        AXIS2_FREE((*env)->allocator, obj_impl->source_uri);
+        obj_impl->source_uri = NULL;
+    }
+
+    if((&(obj_impl->obj))->ops)
+    {
+        free((&(obj_impl->obj))->ops);
+        (&(obj_impl->obj))->ops = NULL;
+    }
+
+    if(obj_impl)
+    {
+        free(obj_impl);
+        obj_impl = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_obj_resolve_methods(axis2_xml_schema_obj_t *obj,
+                                        axis2_env_t **env,
+                                        axis2_xml_schema_obj_t *obj_impl,
+                                        axis2_hash_t *methods)
+{    
+    axis2_xml_schema_obj_impl_t *obj_impl_l = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, obj_impl, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+    
+    obj_impl_l = (axis2_xml_schema_obj_impl_t *) obj_impl;
+    
+    obj->ops = AXIS2_MALLOC((*env)->allocator, 
+            sizeof(axis2_xml_schema_obj_ops_t));
+    obj->ops->free = axis2_hash_get(methods, "free", 
+            AXIS2_HASH_KEY_STRING);
+    obj->ops->get_line_num = 
+            obj_impl_l->obj.ops->get_line_num;
+    obj->ops->set_line_num = 
+            obj_impl_l->obj.ops->set_line_num; 
+    obj->ops->get_line_pos = 
+            obj_impl_l->obj.ops->get_line_pos;
+    obj->ops->set_line_pos = 
+            obj_impl_l->obj.ops->set_line_pos; 
+    obj->ops->get_source_uri = 
+            obj_impl_l->obj.ops->get_source_uri;
+    obj->ops->set_source_uri = 
+            obj_impl_l->obj.ops->set_source_uri; 
+    obj->ops->equals = 
+            obj_impl_l->obj.ops->equals;
+    return AXIS2_SUCCESS;    
+
+}
+int AXIS2_CALL
+axis2_xml_schema_obj_get_line_num(void *obj,
+                                    axis2_env_t **env)
+{
+    axis2_xml_schema_obj_impl_t *obj_impl = NULL;
+    
+    obj_impl = INTF_TO_IMPL(obj);
+    return obj_impl->line_num;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_set_line_num(void *obj,
+                        axis2_env_t **env,
+                        int line_num)
+{
+    axis2_xml_schema_obj_impl_t *obj_impl = NULL;
+
+    obj_impl = INTF_TO_IMPL(obj);
+
+    obj_impl->line_num = line_num;
+
+    return AXIS2_SUCCESS;
+}
+
+int AXIS2_CALL
+axis2_xml_schema_obj_get_line_pos(void *obj,
+                                    axis2_env_t **env)
+{
+    axis2_xml_schema_obj_impl_t *obj_impl = NULL;
+    
+    obj_impl = INTF_TO_IMPL(obj);
+    return obj_impl->line_pos;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_set_line_pos(void *obj,
+                        axis2_env_t **env,
+                        int line_pos)
+{
+    axis2_xml_schema_obj_impl_t *obj_impl = NULL;
+
+    obj_impl = INTF_TO_IMPL(obj);
+
+    obj_impl->line_pos = line_pos;
+
+    return AXIS2_SUCCESS;
+}
+
+axis2_char_t * AXIS2_CALL
+axis2_xml_schema_obj_get_source_uri(void *obj,
+                                    axis2_env_t **env)
+{
+    axis2_xml_schema_obj_impl_t *obj_impl = NULL;
+    
+    obj_impl = INTF_TO_IMPL(obj);
+    return obj_impl->source_uri;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_set_source_uri(void *obj,
+                        axis2_env_t **env,
+                        axis2_char_t *source_uri)
+{
+    axis2_xml_schema_obj_impl_t *obj_impl = NULL;
+
+    obj_impl = INTF_TO_IMPL(obj);
+
+    if(obj_impl->source_uri)
+    {
+        free(obj_impl->source_uri);
+        obj_impl->source_uri = NULL;
+    }
+    obj_impl->source_uri = AXIS2_STRDUP(source_uri, env);
+
+    return AXIS2_SUCCESS;
+}
+
+axis2_bool_t AXIS2_CALL
+axis2_xml_schema_obj_equals(void *obj,
+                                axis2_env_t **env,
+                                void *obj_comp)
+{
+    axis2_xml_schema_obj_impl_t *obj_impl = NULL;
+
+    obj_impl = INTF_TO_IMPL(obj);
+
+    return AXIS2_TRUE;
+}
+

Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_obj_collection.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_obj_collection.c?rev=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_obj_collection.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_obj_collection.c Mon Apr 17 05:15:47 2006
@@ -0,0 +1,274 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+#include <axis2_xml_schema_obj_collection.h>
+#include <axis2_hash.h>
+
+typedef struct axis2_xml_schema_obj_collection_impl axis2_xml_schema_obj_collection_impl_t;
+
+/** 
+ * @brief Xml Schema Obj Struct Impl
+ *	Axis2 Xml Schema Obj  
+ */ 
+struct axis2_xml_schema_obj_collection_impl
+{
+    axis2_xml_schema_obj_collection_t obj_collection;
+    axis2_array_list_t *objs;
+};
+
+#define INTF_TO_IMPL(obj_collection) ((axis2_xml_schema_obj_collection_impl_t *) obj_collection)
+
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_obj_collection_free(void *obj_collection,
+                axis2_env_t **env);
+
+int AXIS2_CALL
+axis2_xml_schema_obj_collection_get_count(void *obj_collection,
+                                            axis2_env_t **env);
+
+axis2_xml_schema_obj_t *AXIS2_CALL
+axis2_xml_schema_obj_collection_get_item(void *obj_collection,
+                                            axis2_env_t **env,
+                                            int i);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_collection_set_item(void *obj_collection,
+                                            axis2_env_t **env,
+                                            int i,
+                                            axis2_xml_schema_obj_t *item);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_collection_add(void *obj_collection,
+                                    axis2_env_t **env,
+                                    axis2_xml_schema_obj_t *item);
+
+axis2_bool_t AXIS2_CALL
+axis2_xml_schema_obj_collection_contains(void *obj_collection,
+                                            axis2_env_t **env,
+                                            axis2_xml_schema_obj_t *item);
+
+int AXIS2_CALL
+axis2_xml_schema_obj_collection_index_of(void *obj_collection,
+                                            axis2_env_t **env,
+                                            axis2_xml_schema_obj_t *item);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_collection_remove_at(void *obj_collection,
+                                        axis2_env_t **env,
+                                        int index);
+
+AXIS2_DECLARE(axis2_xml_schema_obj_collection_t *)
+axis2_xml_schema_obj_collection_create(axis2_env_t **env)
+{
+    axis2_xml_schema_obj_collection_impl_t *obj_collection_impl = NULL;
+    
+    obj_collection_impl = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_obj_collection_impl_t));
+
+    obj_collection_impl->objs = NULL;
+
+    obj_collection_impl->obj_collection.ops = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_obj_collection_ops_t)); 
+
+    obj_collection_impl->objs = axis2_array_list_create(env, 0);
+    if(!obj_collection_impl->objs)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    obj_collection_impl->obj_collection.ops->free = 
+            axis2_xml_schema_obj_collection_free;
+    obj_collection_impl->obj_collection.ops->get_count = 
+            axis2_xml_schema_obj_collection_get_count;
+    obj_collection_impl->obj_collection.ops->get_item = 
+            axis2_xml_schema_obj_collection_get_item;
+    obj_collection_impl->obj_collection.ops->set_item = 
+            axis2_xml_schema_obj_collection_set_item;
+    obj_collection_impl->obj_collection.ops->add = 
+            axis2_xml_schema_obj_collection_add;
+    obj_collection_impl->obj_collection.ops->contains = 
+            axis2_xml_schema_obj_collection_contains;
+    obj_collection_impl->obj_collection.ops->index_of = 
+            axis2_xml_schema_obj_collection_index_of;
+    obj_collection_impl->obj_collection.ops->remove_at = 
+            axis2_xml_schema_obj_collection_remove_at;
+
+    return &(obj_collection_impl->obj_collection);
+}
+
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_collection_free(void *obj_collection,
+                                        axis2_env_t **env)
+{
+    axis2_xml_schema_obj_collection_impl_t *obj_collection_impl = NULL;
+
+    obj_collection_impl = INTF_TO_IMPL(obj_collection);
+
+    if(obj_collection_impl->objs)
+    {
+        AXIS2_ARRAY_LIST_FREE(obj_collection_impl->objs, env);
+        obj_collection_impl->objs = NULL;
+    }
+
+    if((&(obj_collection_impl->obj_collection))->ops)
+    {
+        free((&(obj_collection_impl->obj_collection))->ops);
+        (&(obj_collection_impl->obj_collection))->ops = NULL;
+    }
+
+    if(obj_collection_impl)
+    {
+        free(obj_collection_impl);
+        obj_collection_impl = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_obj_collection_resolve_methods(
+                        axis2_xml_schema_obj_collection_t *obj_collection,
+                        axis2_env_t **env,
+                        axis2_xml_schema_obj_collection_t *obj_collection_impl,
+                        axis2_hash_t *methods)
+{    
+    axis2_xml_schema_obj_collection_impl_t *obj_collection_impl_l = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, obj_collection_impl, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+    
+    obj_collection_impl_l = (axis2_xml_schema_obj_collection_impl_t *) obj_collection_impl;
+    
+    obj_collection->ops = AXIS2_MALLOC((*env)->allocator, 
+            sizeof(axis2_xml_schema_obj_collection_ops_t));
+    obj_collection->ops->free = axis2_hash_get(methods, "free", 
+            AXIS2_HASH_KEY_STRING);
+    obj_collection->ops->get_count = 
+            obj_collection_impl_l->obj_collection.ops->get_count;
+    obj_collection->ops->get_item = 
+            obj_collection_impl_l->obj_collection.ops->get_item; 
+    obj_collection->ops->set_item = 
+            obj_collection_impl_l->obj_collection.ops->set_item;
+    obj_collection->ops->add = 
+            obj_collection_impl_l->obj_collection.ops->add; 
+    obj_collection->ops->contains = 
+            obj_collection_impl_l->obj_collection.ops->contains;
+    obj_collection->ops->index_of = 
+            obj_collection_impl_l->obj_collection.ops->index_of; 
+    obj_collection->ops->remove_at = 
+            obj_collection_impl_l->obj_collection.ops->remove_at;
+    return AXIS2_SUCCESS;    
+
+}
+
+int AXIS2_CALL
+axis2_xml_schema_obj_collection_get_count(void *obj_collection,
+                                            axis2_env_t **env)
+{
+    axis2_xml_schema_obj_collection_impl_t *obj_collection_impl = NULL;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    obj_collection_impl = INTF_TO_IMPL(obj_collection);
+    return AXIS2_ARRAY_LIST_SIZE(obj_collection_impl->objs, env);
+}
+
+axis2_xml_schema_obj_t *AXIS2_CALL
+axis2_xml_schema_obj_collection_get_item(void *obj_collection,
+                                            axis2_env_t **env,
+                                            int i)
+{
+    axis2_xml_schema_obj_collection_impl_t *obj_collection_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    obj_collection_impl = INTF_TO_IMPL(obj_collection);
+    return AXIS2_ARRAY_LIST_GET(obj_collection_impl->objs, env, i);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_collection_set_item(void *obj_collection,
+                                            axis2_env_t **env,
+                                            int i,
+                                            axis2_xml_schema_obj_t *item)
+{
+    axis2_xml_schema_obj_collection_impl_t *obj_collection_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, item, AXIS2_FAILURE);
+    obj_collection_impl = INTF_TO_IMPL(obj_collection);
+
+    AXIS2_ARRAY_LIST_SET(obj_collection_impl->objs, env, i, item);
+    return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_collection_add(void *obj_collection,
+                                    axis2_env_t **env,
+                                    axis2_xml_schema_obj_t *item)
+{
+    axis2_xml_schema_obj_collection_impl_t *obj_collection_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, item, AXIS2_FAILURE);
+    obj_collection_impl = INTF_TO_IMPL(obj_collection);
+    return AXIS2_ARRAY_LIST_ADD(obj_collection_impl->objs, env, item);
+}
+
+axis2_bool_t AXIS2_CALL
+axis2_xml_schema_obj_collection_contains(void *obj_collection,
+                                            axis2_env_t **env,
+                                            axis2_xml_schema_obj_t *item)
+{
+    axis2_xml_schema_obj_collection_impl_t *obj_collection_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, item, AXIS2_FAILURE);
+    obj_collection_impl = INTF_TO_IMPL(obj_collection);
+    
+    return AXIS2_ARRAY_LIST_CONTAINS(obj_collection_impl->objs, env, item);
+}
+
+int AXIS2_CALL
+axis2_xml_schema_obj_collection_index_of(void *obj_collection,
+                                            axis2_env_t **env,
+                                            axis2_xml_schema_obj_t *item)
+{
+    axis2_xml_schema_obj_collection_impl_t *obj_collection_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, item, AXIS2_FAILURE);
+    obj_collection_impl = INTF_TO_IMPL(obj_collection);
+
+    return AXIS2_ARRAY_LIST_INDEX_OF(obj_collection_impl->objs, env, item);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_collection_remove_at(void *obj_collection,
+                                        axis2_env_t **env,
+                                        int index)
+{
+    axis2_xml_schema_obj_collection_impl_t *obj_collection_impl = NULL;
+    void *item = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    obj_collection_impl = INTF_TO_IMPL(obj_collection);
+    
+    item = AXIS2_ARRAY_LIST_REMOVE(obj_collection_impl->objs, env, index);
+    if(!item)
+        return AXIS2_FAILURE;
+    return AXIS2_SUCCESS;
+}
+
+

Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_obj_table.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_obj_table.c?rev=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_obj_table.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_obj_table.c Mon Apr 17 05:15:47 2006
@@ -0,0 +1,322 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+#include <axis2_xml_schema_obj_table.h>
+#include <axis2_hash.h>
+
+typedef struct axis2_xml_schema_obj_table_impl axis2_xml_schema_obj_table_impl_t;
+
+/** 
+ * @brief Xml Schema Obj Struct Impl
+ *	Axis2 Xml Schema Obj  
+ */ 
+struct axis2_xml_schema_obj_table_impl
+{
+    axis2_xml_schema_obj_table_t obj_table;
+    axis2_hash_t *collection;
+    axis2_array_list_t *names;
+    axis2_array_list_t *values;
+};
+
+#define INTF_TO_IMPL(obj_table) ((axis2_xml_schema_obj_table_impl_t *) obj_table)
+
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_obj_table_free(void *obj_table,
+                axis2_env_t **env);
+
+int AXIS2_CALL
+axis2_xml_schema_obj_table_get_count(void *obj_table,
+                                            axis2_env_t **env);
+
+axis2_xml_schema_obj_t *AXIS2_CALL
+axis2_xml_schema_obj_table_get_item(void *obj_table,
+                                            axis2_env_t **env,
+                                            axis2_qname_t *qname);
+
+axis2_array_list_t *AXIS2_CALL
+axis2_xml_schema_obj_table_get_names(void *obj_table,
+                            axis2_env_t **env);
+
+axis2_array_list_t *AXIS2_CALL
+axis2_xml_schema_obj_table_get_values(void *obj_table,
+                            axis2_env_t **env);
+
+axis2_bool_t AXIS2_CALL
+axis2_xml_schema_obj_table_contains(void *obj_table,
+                                            axis2_env_t **env,
+                                            axis2_qname_t *qname);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_table_add(void *obj_table,
+                                    axis2_env_t **env,
+                                    axis2_qname_t *qname,
+                                    axis2_xml_schema_obj_t *value);
+
+AXIS2_DECLARE(axis2_xml_schema_obj_table_t *)
+axis2_xml_schema_obj_table_create(axis2_env_t **env)
+{
+    axis2_xml_schema_obj_table_impl_t *obj_table_impl = NULL;
+    
+    obj_table_impl = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_obj_table_impl_t));
+
+    obj_table_impl->collection = NULL;
+    obj_table_impl->names = NULL;
+    obj_table_impl->values = NULL;
+
+    obj_table_impl->obj_table.ops = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_obj_table_ops_t)); 
+
+    obj_table_impl->collection = axis2_hash_make(env);
+    if(!obj_table_impl->collection)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    obj_table_impl->obj_table.ops->free = 
+            axis2_xml_schema_obj_table_free;
+    obj_table_impl->obj_table.ops->get_count = 
+            axis2_xml_schema_obj_table_get_count;
+    obj_table_impl->obj_table.ops->get_item = 
+            axis2_xml_schema_obj_table_get_item;
+    obj_table_impl->obj_table.ops->get_names = 
+            axis2_xml_schema_obj_table_get_names;
+    obj_table_impl->obj_table.ops->get_values = 
+            axis2_xml_schema_obj_table_get_values;
+    obj_table_impl->obj_table.ops->contains = 
+            axis2_xml_schema_obj_table_contains;
+    obj_table_impl->obj_table.ops->add = 
+            axis2_xml_schema_obj_table_add;
+
+    return &(obj_table_impl->obj_table);
+}
+
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_table_free(void *obj_table,
+                                        axis2_env_t **env)
+{
+    axis2_xml_schema_obj_table_impl_t *obj_table_impl = NULL;
+
+    obj_table_impl = INTF_TO_IMPL(obj_table);
+
+    if(obj_table_impl->names)
+    {
+        AXIS2_ARRAY_LIST_FREE(obj_table_impl->names, env);
+        obj_table_impl->names = NULL;
+    }
+
+    if(obj_table_impl->values)
+    {
+        AXIS2_ARRAY_LIST_FREE(obj_table_impl->values, env);
+        obj_table_impl->values = NULL;
+    }
+
+    if(obj_table_impl->collection)
+    {
+        axis2_hash_free(obj_table_impl->collection, env);
+        obj_table_impl->collection = NULL;
+    }
+
+    if((&(obj_table_impl->obj_table))->ops)
+    {
+        free((&(obj_table_impl->obj_table))->ops);
+        (&(obj_table_impl->obj_table))->ops = NULL;
+    }
+
+    if(obj_table_impl)
+    {
+        free(obj_table_impl);
+        obj_table_impl = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_obj_table_resolve_methods(
+                        axis2_xml_schema_obj_table_t *obj_table,
+                        axis2_env_t **env,
+                        axis2_xml_schema_obj_table_t *obj_table_impl,
+                        axis2_hash_t *methods)
+{    
+    axis2_xml_schema_obj_table_impl_t *obj_table_impl_l = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, obj_table_impl, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+    
+    obj_table_impl_l = (axis2_xml_schema_obj_table_impl_t *) obj_table_impl;
+    
+    obj_table->ops = AXIS2_MALLOC((*env)->allocator, 
+            sizeof(axis2_xml_schema_obj_table_ops_t));
+    obj_table->ops->free = axis2_hash_get(methods, "free", 
+            AXIS2_HASH_KEY_STRING);
+    obj_table->ops->get_count = 
+            obj_table_impl_l->obj_table.ops->get_count;
+    obj_table->ops->get_item = 
+            obj_table_impl_l->obj_table.ops->get_item; 
+    obj_table->ops->get_names = 
+            obj_table_impl_l->obj_table.ops->get_names; 
+    obj_table->ops->get_values = 
+            obj_table_impl_l->obj_table.ops->get_values;
+    obj_table->ops->contains = 
+            obj_table_impl_l->obj_table.ops->contains;
+    obj_table->ops->add = 
+            obj_table_impl_l->obj_table.ops->add; 
+    return AXIS2_SUCCESS;    
+
+}
+
+int AXIS2_CALL
+axis2_xml_schema_obj_table_get_count(void *obj_table,
+                                            axis2_env_t **env)
+{
+    axis2_xml_schema_obj_table_impl_t *obj_table_impl = NULL;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    obj_table_impl = INTF_TO_IMPL(obj_table);
+    return axis2_hash_count(obj_table_impl->collection);
+}
+
+axis2_xml_schema_obj_t *AXIS2_CALL
+axis2_xml_schema_obj_table_get_item(void *obj_table,
+                                            axis2_env_t **env,
+                                            axis2_qname_t *qname)
+{
+    axis2_xml_schema_obj_table_impl_t *obj_table_impl = NULL;
+    axis2_char_t *name = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    obj_table_impl = INTF_TO_IMPL(obj_table);
+
+    name = AXIS2_QNAME_TO_STRING(qname, env);
+    return axis2_hash_get(obj_table_impl->collection, name, 
+            AXIS2_HASH_KEY_STRING);
+}
+
+axis2_array_list_t *AXIS2_CALL
+axis2_xml_schema_obj_table_get_names(void *obj_table,
+                            axis2_env_t **env)
+{
+    axis2_xml_schema_obj_table_impl_t *obj_table_impl = NULL;
+    axis2_hash_index_t *hi = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    
+    if(obj_table_impl->names)
+    {
+       int i = 0;
+       int size = 0;
+
+       size = AXIS2_ARRAY_LIST_SIZE(obj_table_impl->names, env);
+       for (i = 0; i < size; i++)
+       {
+            AXIS2_FREE((*env)->allocator, AXIS2_ARRAY_LIST_GET(obj_table_impl->
+                        names, env, i));
+       }
+    }
+    else
+    {
+        obj_table_impl->names = axis2_array_list_create(env, 0);
+        if(!obj_table_impl->names)
+        {
+            AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+            return NULL;
+        }
+    }
+    for (hi = axis2_hash_first (obj_table_impl->collection, env); hi;
+             hi = axis2_hash_next ( env, hi))
+    {
+        void *val = NULL;
+
+        axis2_hash_this (hi, &val, NULL, NULL);
+        AXIS2_ARRAY_LIST_ADD(obj_table_impl->names, env, val);
+        val = NULL;
+           
+    }
+    return obj_table_impl->names;
+}
+
+axis2_array_list_t *AXIS2_CALL
+axis2_xml_schema_obj_table_get_values(void *obj_table,
+                            axis2_env_t **env)
+{
+    axis2_xml_schema_obj_table_impl_t *obj_table_impl = NULL;
+    axis2_hash_index_t *hi = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    
+    if(!obj_table_impl->values)
+    {
+        obj_table_impl->values = axis2_array_list_create(env, 0);
+        if(!obj_table_impl->values)
+        {
+            AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+            return NULL;
+        }
+    }
+    for (hi = axis2_hash_first (obj_table_impl->collection, env); hi;
+             hi = axis2_hash_next ( env, hi))
+    {
+        void *val = NULL;
+
+        axis2_hash_this (hi, NULL, NULL, &val);
+        AXIS2_ARRAY_LIST_ADD(obj_table_impl->values, env, val);
+        val = NULL;
+           
+    }
+    return obj_table_impl->values;
+}
+
+axis2_bool_t AXIS2_CALL
+axis2_xml_schema_obj_table_contains(void *obj_table,
+                                            axis2_env_t **env,
+                                            axis2_qname_t *qname)
+{
+    axis2_xml_schema_obj_table_impl_t *obj_table_impl = NULL;
+    void *value = NULL;
+    axis2_char_t *name = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, qname, AXIS2_FAILURE);
+    obj_table_impl = INTF_TO_IMPL(obj_table);
+    
+    name = AXIS2_QNAME_TO_STRING(qname, env);
+    value = axis2_hash_get(obj_table_impl->collection, name, 
+            AXIS2_HASH_KEY_STRING);
+    if(value) return AXIS2_TRUE;
+    else return AXIS2_FALSE;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_obj_table_add(void *obj_table,
+                                    axis2_env_t **env,
+                                    axis2_qname_t *qname,
+                                    axis2_xml_schema_obj_t *value)
+{
+    axis2_xml_schema_obj_table_impl_t *obj_table_impl = NULL;
+    axis2_char_t *name = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, qname, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, value, AXIS2_FAILURE);
+    obj_table_impl = INTF_TO_IMPL(obj_table);
+
+    name = AXIS2_QNAME_TO_STRING(qname, env);
+    axis2_hash_set(obj_table_impl->collection, name, AXIS2_HASH_KEY_STRING, value);
+    return AXIS2_SUCCESS;
+}
+
+



Mime
View raw message