axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r399982 [2/2] - in /webservices/axis2/trunk/c: include/xml_schema/ modules/xml/xml_schema/
Date Fri, 05 May 2006 06:12:39 GMT
Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_content.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_content.c?rev=399982&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_content.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_content.c Thu May 
4 23:12:38 2006
@@ -0,0 +1,295 @@
+/*
+ * 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_simple_content.h>
+
+typedef struct axis2_xml_schema_simple_content_impl 
+                    axis2_xml_schema_simple_content_impl_t;
+
+/** 
+ * @brief Other Extension Struct Impl
+ *	Axis2 Other Extension  
+ */ 
+struct axis2_xml_schema_simple_content_impl
+{
+    axis2_xml_schema_simple_content_t sim_content;
+    
+    axis2_xml_schema_annotated_t *annotated;
+    
+    axis2_hash_t *methods;
+    
+    void *content;
+    
+    int content_type;
+};
+
+#define AXIS2_INTF_TO_IMPL(sim_content) \
+        ((axis2_xml_schema_simple_content_impl_t *) sim_content)
+
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_simple_content_free(void *sim_content,
+                        axis2_env_t **env);
+
+axis2_xml_schema_annotated_t *AXIS2_CALL
+axis2_xml_schema_simple_content_get_base_impl(void *sim_content,
+                                        axis2_env_t **env);
+
+void* AXIS2_CALL
+axis2_xml_schema_simple_content_get_content(void *sim_content,
+                                            axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_content_set_content(void *sim_content,
+                                            axis2_env_t **env,
+                                            void* content,
+                                            int content_type);
+
+int AXIS2_CALL
+axis2_xml_schema_simple_content_get_content_type(void *sim_content,
+                                                 axis2_env_t **env);
+
+axis2_char_t* AXIS2_CALL
+axis2_xml_schema_simple_content_to_string(void *sim_content,
+                                          axis2_env_t **env,
+                                          axis2_char_t *prefix, 
+                                          int tab);
+                                          
+
+AXIS2_DECLARE(axis2_xml_schema_simple_content_t *)
+axis2_xml_schema_simple_content_create(axis2_env_t **env)
+{
+    axis2_xml_schema_simple_content_impl_t *group_impl = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+
+    group_impl = (axis2_xml_schema_simple_content_impl_t*)AXIS2_MALLOC((*env)->allocator,

+        sizeof(axis2_xml_schema_simple_content_impl_t));
+    if(!group_impl)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    
+    group_impl->annotated = NULL;
+    group_impl->methods = NULL;
+    group_impl->content = NULL;
+    group_impl->content_type = -1;
+    group_impl->sim_content.base.ops = NULL;
+    group_impl->sim_content.ops = NULL;
+    
+    group_impl->sim_content.ops = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_simple_content_ops_t));
+    if(!group_impl->sim_content.ops)
+    {
+        axis2_xml_schema_simple_content_free(&(group_impl->sim_content), env);
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+
+
+    group_impl->sim_content.ops->free = 
+            axis2_xml_schema_simple_content_free;
+    group_impl->sim_content.ops->get_base_impl = 
+            axis2_xml_schema_simple_content_get_base_impl;
+    group_impl->sim_content.ops->get_content_type = 
+            axis2_xml_schema_simple_content_get_content_type;
+    group_impl->sim_content.ops->set_content = 
+            axis2_xml_schema_simple_content_set_content;
+    group_impl->sim_content.ops->get_content = 
+            axis2_xml_schema_simple_content_get_content;
+    group_impl->sim_content.ops->to_string = 
+            axis2_xml_schema_simple_content_to_string;
+   
+    group_impl->methods = axis2_hash_make(env);
+   
+    if(!group_impl->methods)
+    {
+        axis2_xml_schema_simple_content_free(&(group_impl->sim_content), env);
+        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_simple_content_free);
+    axis2_hash_set(group_impl->methods, "get_content", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_content_get_content);
+    axis2_hash_set(group_impl->methods, "set_content", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_content_set_content);
+    axis2_hash_set(group_impl->methods, "get_content_type", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_content_get_content_type);
+    axis2_hash_set(group_impl->methods, "to_string", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_content_to_string);
+    
+    group_impl->annotated = axis2_xml_schema_annotated_create(env);
+    if(!group_impl->annotated)
+    {
+        axis2_xml_schema_simple_content_free(&(group_impl->sim_content), env);
+        return NULL;
+    }
+    status = axis2_xml_schema_annotated_resolve_methods(
+            &(group_impl->sim_content.base), env, group_impl->annotated, 
+            group_impl->methods);
+    
+    return &(group_impl->sim_content);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_content_free(void *sim_content,
+                                    axis2_env_t **env)
+{
+    axis2_xml_schema_simple_content_impl_t *group_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    group_impl = AXIS2_INTF_TO_IMPL(sim_content);
+
+    if(NULL != group_impl->content)
+    {
+        /** TODO */
+    }
+
+    if(NULL != group_impl->methods)
+    {
+        axis2_hash_free(group_impl->methods, env);
+        group_impl->methods = NULL;
+    }
+    if(NULL != group_impl->annotated)
+    {
+        AXIS2_XML_SCHEMA_ANNOTATED_FREE(group_impl->annotated, env);
+        group_impl->annotated = NULL;
+    }
+    if(NULL != group_impl->sim_content.base.ops)
+    {
+        AXIS2_FREE((*env)->allocator, group_impl->sim_content.base.ops);
+        group_impl->sim_content.base.ops = NULL;  
+    }
+    if(NULL != group_impl->sim_content.ops)
+    {
+        AXIS2_FREE((*env)->allocator, group_impl->sim_content.ops);
+        group_impl->sim_content.ops = NULL;
+    }
+ 
+    AXIS2_FREE((*env)->allocator, group_impl);
+    group_impl = NULL;
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_annotated_t *AXIS2_CALL
+axis2_xml_schema_simple_content_get_base_impl(void *sim_content,
+                                axis2_env_t **env)
+{
+    axis2_xml_schema_simple_content_impl_t *group_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    group_impl = AXIS2_INTF_TO_IMPL(sim_content);
+    return group_impl->annotated;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_simple_content_resolve_methods(
+                                axis2_xml_schema_simple_content_t *sim_content,
+                                axis2_env_t **env,
+                                axis2_xml_schema_simple_content_t *group_impl,
+                                axis2_hash_t *methods)
+{
+    axis2_xml_schema_simple_content_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);
+    AXIS2_PARAM_CHECK((*env)->error, sim_content, AXIS2_FAILURE);
+    
+    group_impl_l = (axis2_xml_schema_simple_content_impl_t *) group_impl;
+    
+    sim_content->ops = AXIS2_MALLOC((*env)->allocator, 
+            sizeof(axis2_xml_schema_simple_content_ops_t));
+    if(!sim_content->ops)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    sim_content->ops->free = axis2_hash_get(methods, "free", 
+            AXIS2_HASH_KEY_STRING);
+    sim_content->ops->get_base_impl = 
+            group_impl_l->sim_content.ops->get_base_impl;
+    sim_content->ops->get_content_type = 
+            group_impl_l->sim_content.ops->get_content_type;
+    sim_content->ops->get_content = 
+            group_impl_l->sim_content.ops->get_content;
+    sim_content->ops->set_content = 
+            group_impl_l->sim_content.ops->set_content;
+    sim_content->ops->to_string = 
+            group_impl_l->sim_content.ops->to_string;
+    
+    return axis2_xml_schema_annotated_resolve_methods(&(sim_content->base), 
+            env, group_impl_l->annotated, methods);
+}
+
+void* AXIS2_CALL
+axis2_xml_schema_simple_content_get_content(void *sim_content,
+                                axis2_env_t **env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(sim_content)->content;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_content_set_content(void *sim_content,
+                                axis2_env_t **env,
+                                void *content,
+                                int content_type)
+{
+    axis2_xml_schema_simple_content_impl_t *group_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, content, AXIS2_FAILURE);
+    
+    group_impl = AXIS2_INTF_TO_IMPL(sim_content);
+
+    if(NULL != group_impl->content)
+    {
+        /** TODO */
+        
+    }
+    group_impl->content = content;
+    group_impl->content_type = content_type;
+    
+    return AXIS2_SUCCESS;
+}
+
+int AXIS2_CALL
+axis2_xml_schema_simple_content_get_content_type(void *sim_content,
+                                        axis2_env_t **env)
+{
+    AXIS2_ENV_CHECK(env, -1);
+    return AXIS2_INTF_TO_IMPL(sim_content)->content_type;
+}
+
+axis2_char_t* AXIS2_CALL
+axis2_xml_schema_simple_content_to_string(void *sim_content,
+                                          axis2_env_t **env,
+                                          axis2_char_t *prefix, 
+                                          int tab)
+{
+    axis2_xml_schema_simple_content_impl_t *group_impl = NULL;
+    axis2_char_t *xml = NULL;
+    AXIS2_ENV_CHECK(env, NULL);
+
+    group_impl = AXIS2_INTF_TO_IMPL(sim_content);
+    if(NULL != prefix && AXIS2_STRCMP(prefix, "") != 0 && strchr(prefix,
':') == NULL)
+    {
+        xml = AXIS2_STRACAT(prefix, ":", env);
+    }
+    return xml;
+}
+

Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_content_extension.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_content_extension.c?rev=399982&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_content_extension.c
(added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_content_extension.c
Thu May  4 23:12:38 2006
@@ -0,0 +1,304 @@
+/*
+ * 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_complex_content_extension.h>
+
+typedef struct axis2_xml_schema_complex_content_extension_impl 
+                    axis2_xml_schema_complex_content_extension_impl_t;
+
+/** 
+ * @brief Other Extension Struct Impl
+ *	Axis2 Other Extension  
+ */ 
+struct axis2_xml_schema_complex_content_extension_impl
+{
+    axis2_xml_schema_complex_content_extension_t cmp_content_ext;
+    
+    axis2_xml_schema_annotated_t *annotated;
+    
+    axis2_hash_t *methods;
+    
+    axis2_xml_schema_obj_collection_t *attributes;
+    
+    axis2_xml_schema_any_attribute_t *any_attribute;
+    
+    axis2_qname_t *base_type_name;
+    
+    int type;
+};
+
+#define AXIS2_INTF_TO_IMPL(cmp_content_ext) \
+        ((axis2_xml_schema_complex_content_extension_impl_t *) cmp_content_ext)
+
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_complex_content_extension_free(void *cmp_content_ext,
+                        axis2_env_t **env);
+
+axis2_xml_schema_annotated_t *AXIS2_CALL
+axis2_xml_schema_complex_content_extension_get_base_impl(void *cmp_content_ext,
+                                        axis2_env_t **env);
+
+axis2_xml_schema_any_attribute_t* AXIS2_CALL
+axis2_xml_schema_complex_content_extension_get_any_attribute(
+                                            void *cmp_content_ext,
+                                            axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_content_extension_set_any_attribute(void *cmp_content_ext,
+                                            axis2_env_t **env,
+                                            axis2_xml_schema_any_attribute_t *any_attr);
+
+axis2_xml_schema_obj_collection_t* AXIS2_CALL
+axis2_xml_schema_complex_content_extension_get_attributes(void *cmp_content_ext,
+                                                         axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_content_extension_set_base_type_name(
+                                          void *cmp_content_ext,
+                                          axis2_env_t **env,
+                                          axis2_qname_t *base_type_name);
+                                          
+axis2_qname_t* AXIS2_CALL
+axis2_xml_schema_complex_content_extension_get_base_type_name(
+                                          void *cmp_content_ext,
+                                          axis2_env_t **env);
+                                          
+int AXIS2_CALL 
+axis2_xml_schema_complex_content_extension_get_type(
+                                        void *cmp_content_ext,
+                                        axis2_env_t **env);                             
            
+                                          
+/*************************** end function protos **********************************/    
                                     
+AXIS2_DECLARE(axis2_xml_schema_complex_content_extension_t *)
+axis2_xml_schema_complex_content_extension_create(axis2_env_t **env)
+{
+    axis2_xml_schema_complex_content_extension_impl_t *cmp_content_ext_impl = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+
+    cmp_content_ext_impl = (axis2_xml_schema_complex_content_extension_impl_t*)
+        AXIS2_MALLOC((*env)->allocator, sizeof(axis2_xml_schema_complex_content_extension_impl_t));
+        
+    if(!cmp_content_ext_impl)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    
+    cmp_content_ext_impl->annotated = NULL;
+    cmp_content_ext_impl->methods = NULL;
+    cmp_content_ext_impl->cmp_content_ext.base.ops = NULL;
+    cmp_content_ext_impl->cmp_content_ext.ops = NULL;
+    cmp_content_ext_impl->attributes = NULL;
+    cmp_content_ext_impl->base_type_name = NULL;
+    cmp_content_ext_impl->any_attribute = NULL;
+    
+    cmp_content_ext_impl->cmp_content_ext.ops = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_complex_content_extension_ops_t));
+    if(!cmp_content_ext_impl->cmp_content_ext.ops)
+    {
+        axis2_xml_schema_complex_content_extension_free(
+            &(cmp_content_ext_impl->cmp_content_ext), env);
+        AXIS2_ERROR_SET((*env)->error, 
+            AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+
+
+    cmp_content_ext_impl->cmp_content_ext.ops->free = 
+            axis2_xml_schema_complex_content_extension_free;
+    cmp_content_ext_impl->cmp_content_ext.ops->get_base_impl = 
+            axis2_xml_schema_complex_content_extension_get_base_impl;
+    cmp_content_ext_impl->cmp_content_ext.ops->get_any_attribute = 
+            axis2_xml_schema_complex_content_extension_get_any_attribute;
+    cmp_content_ext_impl->cmp_content_ext.ops->set_any_attribute = 
+            axis2_xml_schema_complex_content_extension_set_any_attribute;
+    cmp_content_ext_impl->cmp_content_ext.ops->get_attributes = 
+            axis2_xml_schema_complex_content_extension_get_attributes;
+    cmp_content_ext_impl->cmp_content_ext.ops->get_base_type_name = 
+            axis2_xml_schema_complex_content_extension_get_base_type_name;
+    cmp_content_ext_impl->cmp_content_ext.ops->set_base_type_name =
+            axis2_xml_schema_complex_content_extension_set_base_type_name; 
+
+    cmp_content_ext_impl->methods = axis2_hash_make(env);
+   
+    if(!cmp_content_ext_impl->methods)
+    {
+        axis2_xml_schema_complex_content_extension_free(
+            &(cmp_content_ext_impl->cmp_content_ext), env);
+        AXIS2_ERROR_SET((*env)->error, 
+            AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    axis2_hash_set(cmp_content_ext_impl->methods, "free", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_complex_content_extension_free);
+    axis2_hash_set(cmp_content_ext_impl->methods, "get_any_attribute", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_complex_content_extension_get_any_attribute);
+    axis2_hash_set(cmp_content_ext_impl->methods, "set_any_attribute", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_complex_content_extension_set_any_attribute);
+    axis2_hash_set(cmp_content_ext_impl->methods, "get_attributes", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_complex_content_extension_get_attributes);
+    axis2_hash_set(cmp_content_ext_impl->methods, "get_base_type_name", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_complex_content_extension_get_base_type_name);
+    axis2_hash_set(cmp_content_ext_impl->methods, "set_base_type_name",
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_complex_content_extension_set_base_type_name);
+    cmp_content_ext_impl->annotated = axis2_xml_schema_annotated_create(env);
+    if(!cmp_content_ext_impl->annotated)
+    {
+        axis2_xml_schema_complex_content_extension_free(
+                &(cmp_content_ext_impl->cmp_content_ext), env);
+        return NULL;
+    }
+    cmp_content_ext_impl->attributes = axis2_xml_schema_obj_collection_create(env);
+    if(!cmp_content_ext_impl->attributes)
+    {
+        axis2_xml_schema_complex_content_extension_free(&(cmp_content_ext_impl->cmp_content_ext),
env);
+        return NULL;
+    }
+    status = axis2_xml_schema_annotated_resolve_methods(
+            &(cmp_content_ext_impl->cmp_content_ext.base), env, cmp_content_ext_impl->annotated,

+            cmp_content_ext_impl->methods);
+    
+    return &(cmp_content_ext_impl->cmp_content_ext);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_content_extension_free(void *cmp_content_ext_ext,
+                                    axis2_env_t **env)
+{
+    axis2_xml_schema_complex_content_extension_impl_t *content_ext_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    content_ext_impl = AXIS2_INTF_TO_IMPL(cmp_content_ext_ext);
+    if(NULL != content_ext_impl->any_attribute)
+    {
+        AXIS2_XML_SCHEMA_ANY_ATTRIBUTE_FREE(content_ext_impl->any_attribute, env);
+        content_ext_impl->any_attribute = NULL;
+    }
+    if(NULL != content_ext_impl->attributes)
+    {
+        /** TODO free attributes */
+    }    
+    if(NULL != content_ext_impl->base_type_name)
+    {
+        AXIS2_QNAME_FREE(content_ext_impl->base_type_name, env);
+        content_ext_impl->base_type_name = NULL;
+    }    
+    if(NULL != content_ext_impl->methods)
+    {
+        axis2_hash_free(content_ext_impl->methods, env);
+        content_ext_impl->methods = NULL;
+    }
+    if(NULL != content_ext_impl->annotated)
+    {
+        AXIS2_XML_SCHEMA_ANNOTATED_FREE(content_ext_impl->annotated, env);
+        content_ext_impl->annotated = NULL;
+    }
+    if(NULL != content_ext_impl->cmp_content_ext.base.ops)
+    {
+        AXIS2_FREE((*env)->allocator, content_ext_impl->cmp_content_ext.base.ops);
+        content_ext_impl->cmp_content_ext.base.ops = NULL;  
+    }
+    if(NULL != content_ext_impl->cmp_content_ext.ops)
+    {
+        AXIS2_FREE((*env)->allocator, content_ext_impl->cmp_content_ext.ops);
+        content_ext_impl->cmp_content_ext.ops = NULL;
+    }
+ 
+    AXIS2_FREE((*env)->allocator, content_ext_impl);
+    content_ext_impl = NULL;
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_annotated_t *AXIS2_CALL
+axis2_xml_schema_complex_content_extension_get_base_impl(void *cmp_content_ext,
+                                axis2_env_t **env)
+{
+    axis2_xml_schema_complex_content_extension_impl_t *content_ext_impl = NULL;
+    AXIS2_ENV_CHECK(env, NULL);
+    content_ext_impl = AXIS2_INTF_TO_IMPL(cmp_content_ext);
+    return content_ext_impl->annotated;
+}
+
+
+
+axis2_xml_schema_any_attribute_t* AXIS2_CALL
+axis2_xml_schema_complex_content_extension_get_any_attribute(void *cmp_content_ext,
+                                                            axis2_env_t **env)
+{
+    axis2_xml_schema_complex_content_extension_impl_t *cnt_ext_impl = NULL;
+    AXIS2_ENV_CHECK(env, NULL);
+    cnt_ext_impl = AXIS2_INTF_TO_IMPL(cmp_content_ext);
+    return cnt_ext_impl->any_attribute;    
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_content_extension_set_any_attribute(void *cmp_content_ext,
+                                axis2_env_t **env,
+                                axis2_xml_schema_any_attribute_t *any_attr)
+{
+    axis2_xml_schema_complex_content_extension_impl_t *content_ext_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, any_attr, AXIS2_FAILURE);
+    if(NULL != content_ext_impl->any_attribute)
+    {
+        AXIS2_XML_SCHEMA_ANY_ATTRIBUTE_FREE(content_ext_impl->any_attribute, env);
+        content_ext_impl->any_attribute = NULL;
+    }
+        content_ext_impl->any_attribute = any_attr;
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_obj_collection_t* AXIS2_CALL
+axis2_xml_schema_complex_content_extension_get_attributes(void *cmp_content,
+                                                        axis2_env_t **env)
+{
+    axis2_xml_schema_complex_content_extension_impl_t *cnt_ext_impl = NULL;
+    AXIS2_ENV_CHECK(env, NULL);
+    cnt_ext_impl = AXIS2_INTF_TO_IMPL(cmp_content);
+    return cnt_ext_impl->attributes;
+}
+
+axis2_qname_t* AXIS2_CALL
+axis2_xml_schema_complex_content_extension_get_base_type_name(
+                                          void *cmp_content,
+                                          axis2_env_t **env)
+{
+    axis2_xml_schema_complex_content_extension_impl_t *content_ext_impl = NULL;
+    AXIS2_ENV_CHECK(env, NULL);
+    content_ext_impl = AXIS2_INTF_TO_IMPL(cmp_content);
+    return content_ext_impl->base_type_name;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_content_extension_set_base_type_name(
+                                          void *cmp_content,
+                                          axis2_env_t **env,
+                                          axis2_qname_t *base_type_name)
+{
+    axis2_xml_schema_complex_content_extension_impl_t *content_ext_impl = NULL;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    content_ext_impl = AXIS2_INTF_TO_IMPL(cmp_content);
+    if(NULL != content_ext_impl->base_type_name)
+    {
+        AXIS2_QNAME_FREE(content_ext_impl->base_type_name, env);
+        content_ext_impl->base_type_name = NULL;
+    }
+    content_ext_impl->base_type_name = base_type_name;
+    return AXIS2_SUCCESS;
+}
+
+                                       
\ No newline at end of file

Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_content_restriction.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_content_restriction.c?rev=399982&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_content_restriction.c
(added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_content_restriction.c
Thu May  4 23:12:38 2006
@@ -0,0 +1,373 @@
+/*
+ * 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_complex_content_restriction.h>
+
+typedef struct axis2_xml_schema_complex_content_restriction_impl 
+                    axis2_xml_schema_complex_content_restriction_impl_t;
+
+/** 
+ * @brief Other Extension Struct Impl
+ *	Axis2 Other Extension  
+ */ 
+struct axis2_xml_schema_complex_content_restriction_impl
+{
+    axis2_xml_schema_complex_content_restriction_t sim_content_res;
+    
+    axis2_xml_schema_annotated_t *annotated;
+    
+    axis2_hash_t *methods;
+    
+    axis2_xml_schema_obj_collection_t *attributes;
+    
+    axis2_xml_schema_obj_collection_t *facets;
+    
+    axis2_xml_schema_any_attribute_t *any_attribute;
+    
+    axis2_qname_t *base_type_name;
+    
+    axis2_xml_schema_simple_type_t *base_type;
+};
+
+#define AXIS2_INTF_TO_IMPL(sim_content_res) \
+        ((axis2_xml_schema_complex_content_restriction_impl_t *) sim_content_res)
+
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_complex_content_restriction_free(void *sim_content_res,
+                        axis2_env_t **env);
+
+axis2_xml_schema_annotated_t *AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_get_base_impl(void *sim_content_res,
+                                        axis2_env_t **env);
+
+axis2_xml_schema_any_attribute_t* AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_get_any_attribute(
+                                            void *sim_content_res,
+                                            axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_set_any_attribute(void *sim_content_res,
+                                            axis2_env_t **env,
+                                            axis2_xml_schema_any_attribute_t *any_attr);
+
+axis2_xml_schema_obj_collection_t* AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_get_attributes(void *sim_content_res,
+                                                         axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_set_base_type_name(
+                                          void *sim_content_res,
+                                          axis2_env_t **env,
+                                          axis2_qname_t *base_type_name);
+                                          
+axis2_qname_t* AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_get_base_type_name(
+                                          void *sim_content_res,
+                                          axis2_env_t **env);
+                                          
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_complex_content_restriction_set_base_type(void *sim_content_res,
+                                              axis2_env_t **env,
+                                              axis2_xml_schema_simple_type_t *base_type);
+                                              
+axis2_xml_schema_simple_type_t* AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_get_base_type(void *sim_content_res,
+                                              axis2_env_t **env);
+                                                 
+axis2_xml_schema_obj_collection_t* AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_get_facets(void *sim_content_res,
+                                                       axis2_env_t **env);              
                           
+                                          
+                                          
+/*****************************************************************************/         
                                
+AXIS2_DECLARE(axis2_xml_schema_complex_content_restriction_t *)
+axis2_xml_schema_complex_content_restriction_create(axis2_env_t **env)
+{
+    axis2_xml_schema_complex_content_restriction_impl_t *sim_content_res_impl = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+
+    sim_content_res_impl = (axis2_xml_schema_complex_content_restriction_impl_t*)
+        AXIS2_MALLOC((*env)->allocator, sizeof(axis2_xml_schema_complex_content_restriction_impl_t));
+        
+    if(!sim_content_res_impl)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    
+    sim_content_res_impl->annotated = NULL;
+    sim_content_res_impl->methods = NULL;
+    sim_content_res_impl->sim_content_res.base.ops = NULL;
+    sim_content_res_impl->sim_content_res.ops = NULL;
+    sim_content_res_impl->attributes = NULL;
+    sim_content_res_impl->base_type_name = NULL;
+    sim_content_res_impl->any_attribute = NULL;
+    sim_content_res_impl->facets = NULL;
+    sim_content_res_impl->base_type = NULL;
+    
+    sim_content_res_impl->sim_content_res.ops = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_complex_content_restriction_ops_t));
+    if(!sim_content_res_impl->sim_content_res.ops)
+    {
+        axis2_xml_schema_complex_content_restriction_free(
+            &(sim_content_res_impl->sim_content_res), env);
+        AXIS2_ERROR_SET((*env)->error, 
+            AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+
+
+    sim_content_res_impl->sim_content_res.ops->free = 
+            axis2_xml_schema_complex_content_restriction_free;
+            
+    sim_content_res_impl->sim_content_res.ops->get_base_impl = 
+            axis2_xml_schema_complex_content_restriction_get_base_impl;
+            
+    sim_content_res_impl->sim_content_res.ops->get_any_attribute = 
+            axis2_xml_schema_complex_content_restriction_get_any_attribute;
+            
+    sim_content_res_impl->sim_content_res.ops->set_any_attribute = 
+            axis2_xml_schema_complex_content_restriction_set_any_attribute;
+            
+    sim_content_res_impl->sim_content_res.ops->get_attributes = 
+            axis2_xml_schema_complex_content_restriction_get_attributes;
+            
+    sim_content_res_impl->sim_content_res.ops->get_base_type_name = 
+            axis2_xml_schema_complex_content_restriction_get_base_type_name;
+            
+    sim_content_res_impl->sim_content_res.ops->set_base_type_name =
+            axis2_xml_schema_complex_content_restriction_set_base_type_name;  
+            
+    sim_content_res_impl->sim_content_res.ops->set_base_type = 
+            axis2_xml_schema_complex_content_restriction_set_base_type;
+            
+    sim_content_res_impl->sim_content_res.ops->get_base_type =
+            axis2_xml_schema_complex_content_restriction_get_base_type;  
+            
+    sim_content_res_impl->sim_content_res.ops->get_facets =
+            axis2_xml_schema_complex_content_restriction_get_facets;                    
 
+                          
+   
+    sim_content_res_impl->methods = axis2_hash_make(env);
+   
+    if(!sim_content_res_impl->methods)
+    {
+        axis2_xml_schema_complex_content_restriction_free(
+            &(sim_content_res_impl->sim_content_res), env);
+        AXIS2_ERROR_SET((*env)->error, 
+            AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    axis2_hash_set(sim_content_res_impl->methods, "free", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_complex_content_restriction_free);
+    axis2_hash_set(sim_content_res_impl->methods, "get_any_attribute", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_complex_content_restriction_get_any_attribute);
+    axis2_hash_set(sim_content_res_impl->methods, "set_any_attribute", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_complex_content_restriction_set_any_attribute);
+    axis2_hash_set(sim_content_res_impl->methods, "get_attributes", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_complex_content_restriction_get_attributes);
+    axis2_hash_set(sim_content_res_impl->methods, "get_base_type_name", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_complex_content_restriction_get_base_type_name);
+    axis2_hash_set(sim_content_res_impl->methods, "set_base_type_name",
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_complex_content_restriction_set_base_type_name);
+    
+    sim_content_res_impl->annotated = axis2_xml_schema_annotated_create(env);
+    if(!sim_content_res_impl->annotated)
+    {
+        axis2_xml_schema_complex_content_restriction_free(
+                &(sim_content_res_impl->sim_content_res), env);
+        return NULL;
+    }
+    sim_content_res_impl->attributes = axis2_xml_schema_obj_collection_create(env);
+    sim_content_res_impl->facets = axis2_xml_schema_obj_collection_create(env);
+    if(!sim_content_res_impl->attributes || !sim_content_res_impl->facets)
+    {
+        axis2_xml_schema_complex_content_restriction_free(
+            &(sim_content_res_impl->sim_content_res), env);
+        return NULL;            
+    }
+    
+    status = axis2_xml_schema_annotated_resolve_methods(
+            &(sim_content_res_impl->sim_content_res.base), env, sim_content_res_impl->annotated,

+            sim_content_res_impl->methods);
+    
+    return &(sim_content_res_impl->sim_content_res);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_free(void *sim_content_res,
+                                    axis2_env_t **env)
+{
+    axis2_xml_schema_complex_content_restriction_impl_t *content_res_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    content_res_impl = AXIS2_INTF_TO_IMPL(sim_content_res);
+    if(NULL != content_res_impl->any_attribute)
+    {
+        AXIS2_XML_SCHEMA_ANY_ATTRIBUTE_FREE(content_res_impl->any_attribute, env);
+        content_res_impl->any_attribute = NULL;
+    }
+    if(NULL != content_res_impl->attributes)
+    {
+        /** TODO free attributes */
+    } 
+    if(NULL != content_res_impl->facets)
+    {
+        /** TODO free facets */
+    }
+    if(NULL != content_res_impl->base_type_name)
+    {
+        AXIS2_QNAME_FREE(content_res_impl->base_type_name, env);
+        content_res_impl->base_type_name = NULL;
+    }    
+    if(NULL != content_res_impl->methods)
+    {
+        axis2_hash_free(content_res_impl->methods, env);
+        content_res_impl->methods = NULL;
+    }
+    if(NULL != content_res_impl->annotated)
+    {
+        AXIS2_XML_SCHEMA_ANNOTATED_FREE(content_res_impl->annotated, env);
+        content_res_impl->annotated = NULL;
+    }
+    if(NULL != content_res_impl->sim_content_res.base.ops)
+    {
+        AXIS2_FREE((*env)->allocator, content_res_impl->sim_content_res.base.ops);
+        content_res_impl->sim_content_res.base.ops = NULL;  
+    }
+    if(NULL != content_res_impl->sim_content_res.ops)
+    {
+        AXIS2_FREE((*env)->allocator, content_res_impl->sim_content_res.ops);
+        content_res_impl->sim_content_res.ops = NULL;
+    }
+ 
+    AXIS2_FREE((*env)->allocator, content_res_impl);
+    content_res_impl = NULL;
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_annotated_t *AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_get_base_impl(void *sim_content_res,
+                                axis2_env_t **env)
+{
+    axis2_xml_schema_complex_content_restriction_impl_t *content_res_impl = NULL;
+    AXIS2_ENV_CHECK(env, NULL);
+    content_res_impl = AXIS2_INTF_TO_IMPL(sim_content_res);
+    return content_res_impl->annotated;
+}
+
+
+
+axis2_xml_schema_any_attribute_t* AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_get_any_attribute(void *sim_content_res,
+                                                            axis2_env_t **env)
+{
+    axis2_xml_schema_complex_content_restriction_impl_t *cnt_res_impl = NULL;
+    AXIS2_ENV_CHECK(env, NULL);
+    cnt_res_impl = AXIS2_INTF_TO_IMPL(sim_content_res);
+    return cnt_res_impl->any_attribute;    
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_set_any_attribute(void *sim_content_res,
+                                axis2_env_t **env,
+                                axis2_xml_schema_any_attribute_t *any_attr)
+{
+    axis2_xml_schema_complex_content_restriction_impl_t *content_res_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, any_attr, AXIS2_FAILURE);
+    if(NULL != content_res_impl->any_attribute)
+    {
+        AXIS2_XML_SCHEMA_ANY_ATTRIBUTE_FREE(content_res_impl->any_attribute, env);
+        content_res_impl->any_attribute = NULL;
+    }
+        content_res_impl->any_attribute = any_attr;
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_obj_collection_t* AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_get_attributes(void *sim_content,
+                                                        axis2_env_t **env)
+{
+    axis2_xml_schema_complex_content_restriction_impl_t *cnt_res_impl = NULL;
+    AXIS2_ENV_CHECK(env, NULL);
+    cnt_res_impl = AXIS2_INTF_TO_IMPL(sim_content);
+    return cnt_res_impl->attributes;
+}
+
+axis2_qname_t* AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_get_base_type_name(
+                                          void *sim_content,
+                                          axis2_env_t **env)
+{
+    axis2_xml_schema_complex_content_restriction_impl_t *content_res_impl = NULL;
+    AXIS2_ENV_CHECK(env, NULL);
+    content_res_impl = AXIS2_INTF_TO_IMPL(sim_content);
+    return content_res_impl->base_type_name;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_set_base_type_name(
+                                          void *sim_content,
+                                          axis2_env_t **env,
+                                          axis2_qname_t *base_type_name)
+{
+    axis2_xml_schema_complex_content_restriction_impl_t *content_res_impl = NULL;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    content_res_impl = AXIS2_INTF_TO_IMPL(sim_content);
+    if(NULL != content_res_impl->base_type_name)
+    {
+        AXIS2_QNAME_FREE(content_res_impl->base_type_name, env);
+        content_res_impl->base_type_name = NULL;
+    }
+    content_res_impl->base_type_name = base_type_name;
+    return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_complex_content_restriction_set_base_type(void *sim_content_res,
+                                              axis2_env_t **env,
+                                              axis2_xml_schema_simple_type_t *base_type)
+{
+    axis2_xml_schema_complex_content_restriction_impl_t *sim_cnt_res_impl = NULL;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, base_type, AXIS2_FAILURE);
+    sim_cnt_res_impl = AXIS2_INTF_TO_IMPL(sim_content_res);
+    if(NULL != sim_cnt_res_impl->base_type)
+    {
+        AXIS2_XML_SCHEMA_SIMPLE_TYPE_FREE(sim_cnt_res_impl->base_type, env);
+        sim_cnt_res_impl->base_type = NULL;
+    }
+    sim_cnt_res_impl->base_type = base_type;
+    return AXIS2_SUCCESS;
+}                                              
+                                              
+                                              
+axis2_xml_schema_simple_type_t* AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_get_base_type(void *sim_content_res,
+                                              axis2_env_t **env)
+{
+    return AXIS2_INTF_TO_IMPL(sim_content_res)->base_type;
+}                                              
+
+                                                 
+axis2_xml_schema_obj_collection_t* AXIS2_CALL
+axis2_xml_schema_complex_content_restriction_get_facets(void *sim_content_res,
+                                                       axis2_env_t **env)
+{
+    return AXIS2_INTF_TO_IMPL(sim_content_res)->facets;
+}                                                       
\ No newline at end of file



Mime
View raw message