axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r404969 - in /webservices/axis2/trunk/c: include/xml_schema/axis2_xml_schema_redefine.h modules/xml/xml_schema/xml_schema_redefine.c
Date Mon, 08 May 2006 08:47:39 GMT
Author: nandika
Date: Mon May  8 01:47:36 2006
New Revision: 404969

URL: http://svn.apache.org/viewcvs?rev=404969&view=rev
Log:
xml xchema redefine added 

Added:
    webservices/axis2/trunk/c/include/xml_schema/axis2_xml_schema_redefine.h
    webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_redefine.c

Added: webservices/axis2/trunk/c/include/xml_schema/axis2_xml_schema_redefine.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/xml_schema/axis2_xml_schema_redefine.h?rev=404969&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/xml_schema/axis2_xml_schema_redefine.h (added)
+++ webservices/axis2/trunk/c/include/xml_schema/axis2_xml_schema_redefine.h Mon May  8 01:47:36
2006
@@ -0,0 +1,143 @@
+/*
+ * 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.
+ */
+
+#ifndef AXIS2_XML_SCHEMA_REDEFINE_H
+#define AXIS2_XML_SCHEMA_REDEFINE_H
+
+/**
+ * @file axis2_xml_schema_redefine.h
+ * @brief Axis2 Xml Schema Particle Interface
+ *          Base class for all redefine types.
+ */
+
+#include <axis2_xml_schema_external.h>
+#include <axis2_hash.h>
+#include <axis2_xml_schema_obj_table.h>
+#include <axis2_xml_schema_obj_collection.h>
+
+/** @defgroup axis2_xml_schema_include Xml Schema Particle
+  * @ingroup axis2_xml_schema
+  * @{
+  */
+
+typedef struct axis2_xml_schema_redefine 
+                    axis2_xml_schema_redefine_t;
+typedef struct axis2_xml_schema_redefine_ops 
+                    axis2_xml_schema_redefine_ops_t;
+                    
+struct axis2_xml_schema;                    
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+struct axis2_xml_schema_redefine_ops
+{
+	/** 
+     * Deallocate memory
+     * @return status code
+     */
+    axis2_status_t (AXIS2_CALL *
+    free) (void *redefine,
+            axis2_env_t **env);
+            
+            
+    axis2_xml_schema_external_t* (AXIS2_CALL *
+    get_base_impl)(void *redefine,
+                   axis2_env_t **env);            
+
+    axis2_xml_schema_obj_table_t* (AXIS2_CALL *
+    get_attribute_group)(void *redefine,
+                axis2_env_t **env);
+                
+    axis2_status_t (AXIS2_CALL *
+    set_attribute_group)(void *redefine,
+                axis2_env_t **env,
+                axis2_xml_schema_obj_table_t *group);
+
+   
+                   
+    axis2_xml_schema_obj_collection_t* (AXIS2_CALL *
+    get_items)(void *redefine,
+               axis2_env_t **env);
+               
+    axis2_xml_schema_obj_table_t* (AXIS2_CALL *
+    get_schema_types)(void *redefine,
+                      axis2_env_t **env);
+                      
+    axis2_xml_schema_obj_table_t* (AXIS2_CALL *
+    get_group)(void *redefine, 
+               axis2_env_t **env);                      
+                      
+                                       
+                       
+};
+
+struct axis2_xml_schema_redefine
+{
+    axis2_xml_schema_external_t base;
+    axis2_xml_schema_redefine_ops_t *ops;
+};
+
+/**
+ * Creates new Xml Schema redefine
+ */
+AXIS2_DECLARE(axis2_xml_schema_redefine_t *)
+axis2_xml_schema_redefine_create(axis2_env_t **env);
+
+/**
+ * This method is internal to Axis2 C. It is called from Child Constructor
+ */
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_redefine_resolve_methods(
+                                axis2_xml_schema_redefine_t *redefine,
+                                axis2_env_t **env,
+                                axis2_xml_schema_redefine_t *redefine_impl,
+                                axis2_hash_t *methods);
+
+#define AXIS2_XML_SCHEMA_REDEFINE_FREE(redefine, env) \
+		(((axis2_xml_schema_redefine_t *) redefine)->ops->\
+            free(redefine, env))
+
+#define AXIS2_XML_SCHEMA_REDEFINE_GET_BASE_IMPL(redefine, env) \
+		(((axis2_xml_schema_redefine_t *) redefine)->ops->\
+            get_base_impl(redefine, env))
+
+#define AXIS2_XML_SCHEMA_REDEFINE_GET_ATTRIBUTE_GROUP(redefine, env) \
+		(((axis2_xml_schema_redefine_t *) redefine)->ops->\
+            get_attribute_group(redefine, env))
+
+#define AXIS2_XML_SCHEMA_REDEFINE_SET_ATTRIBUTE_GROUP(redefine, env, group) \
+		(((axis2_xml_schema_redefine_t *) redefine)->ops->\
+            set_attribute_group(redefine, env, group))
+            
+#define AXIS2_XML_SCHEMA_REDEFINE_GET_ITEMS(redefine, env) \
+        (((axis2_xml_schema_redefine_t *) redefine)->ops->\
+            get_items(redefine, env))
+            
+#define AXIS2_XML_SCHEMA_REDEFINE_GET_GROUP(redefine, env) \
+        (((axis2_xml_schema_redefine_t *) redefine)->ops->\
+            get_group(redefine, env))                       
+
+#define AXIS2_XML_SCHEMA_REDEFINE_GET_SCHEMA_TYPES(redefine, env) \
+        (((axis2_xml_schema_redefine_t *) redefine)->ops->\
+            get_schema_types(redefine, env))
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+#endif /* AXIS2_XML_SCHEMA_REDEFINE_H */

Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_redefine.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_redefine.c?rev=404969&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_redefine.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_redefine.c Mon May  8 01:47:36
2006
@@ -0,0 +1,254 @@
+/*
+ * 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_redefine.h>
+#include  <axis2_xml_schema.h>
+
+/** 
+ * @brief Other Extension Struct Impl
+ *	Axis2 Other Extension  
+ */ 
+typedef struct axis2_xml_schema_redefine_impl
+{
+    axis2_xml_schema_redefine_t redefine;
+    
+    axis2_xml_schema_external_t *external;
+        
+    axis2_xml_schema_obj_collection_t *items;
+    
+    axis2_xml_schema_obj_table_t *attr_groups;
+    
+    axis2_xml_schema_obj_table_t *groups;
+    
+    axis2_xml_schema_obj_table_t *schema_types;
+        
+    axis2_hash_t *methods;
+
+}axis2_xml_schema_redefine_impl_t;
+
+#define AXIS2_INTF_TO_IMPL(redefine) \
+        ((axis2_xml_schema_redefine_impl_t *) redefine)
+
+/********************* function prototypes ***********************************/
+
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_redefine_free(void *redefine,
+                        axis2_env_t **env);
+
+axis2_xml_schema_external_t *AXIS2_CALL
+axis2_xml_schema_redefine_get_base_impl(void *redefine,
+                                        axis2_env_t **env);
+
+axis2_xml_schema_obj_table_t* AXIS2_CALL
+axis2_xml_schema_redefine_get_attribute_group(void *redefine,
+                                              axis2_env_t **env);
+                
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_redefine_set_attribute_group(void *redefine,
+                axis2_env_t **env,
+                axis2_xml_schema_obj_table_t *group);
+
+   
+                   
+axis2_xml_schema_obj_collection_t* AXIS2_CALL
+axis2_xml_schema_redefine_get_items(void *redefine,
+               axis2_env_t **env);
+               
+axis2_xml_schema_obj_table_t* AXIS2_CALL
+axis2_xml_schema_redefine_get_schema_types(void *redefine,
+                      axis2_env_t **env);
+                      
+axis2_xml_schema_obj_table_t* AXIS2_CALL
+axis2_xml_schema_redefine_get_group(void *redefine, 
+               axis2_env_t **env);                      
+                      
+    
+/********************* end function prototypes ********************************/
+
+AXIS2_DECLARE(axis2_xml_schema_redefine_t *)
+axis2_xml_schema_redefine_create(axis2_env_t **env)
+{
+    axis2_xml_schema_redefine_impl_t *redefine_impl = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+
+    redefine_impl = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_redefine_impl_t));
+    if(!redefine_impl)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    redefine_impl->external = NULL;
+    redefine_impl->methods = NULL;
+    redefine_impl->redefine.ops = NULL;
+    redefine_impl->redefine.base.ops = NULL;
+    redefine_impl->attr_groups = NULL;
+    redefine_impl->groups = NULL;
+    redefine_impl->schema_types = NULL;
+    redefine_impl->items = NULL;
+    
+    redefine_impl->redefine.ops = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_schema_redefine_ops_t));
+
+    if(!redefine_impl->redefine.ops)
+    {
+        axis2_xml_schema_redefine_free(&(redefine_impl->redefine), env);
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    
+    redefine_impl->redefine.ops->free = 
+        axis2_xml_schema_redefine_free;
+    redefine_impl->redefine.ops->get_base_impl = 
+        axis2_xml_schema_redefine_get_base_impl;
+        
+    redefine_impl->redefine.ops->get_items = 
+            axis2_xml_schema_redefine_get_items;
+            
+    redefine_impl->redefine.ops->get_group = 
+            axis2_xml_schema_redefine_get_group;
+
+    redefine_impl->methods = axis2_hash_make(env);
+    if(!redefine_impl->methods)
+    {
+        axis2_xml_schema_redefine_free(&(redefine_impl->redefine), env);
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+
+    axis2_hash_set(redefine_impl->methods, "free", AXIS2_HASH_KEY_STRING, 
+            axis2_xml_schema_redefine_free);
+
+    axis2_hash_set(redefine_impl->methods, "get_items", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_redefine_get_items);
+    axis2_hash_set(redefine_impl->methods, "get_group", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_redefine_get_group);
+
+    redefine_impl->external = axis2_xml_schema_external_create(env);
+     if(!redefine_impl->external)
+    {
+        axis2_xml_schema_redefine_free(&(redefine_impl->redefine), env);
+        return NULL;
+    }
+    status = axis2_xml_schema_external_resolve_methods(
+            &(redefine_impl->redefine.base), env, redefine_impl->external, 
+            redefine_impl->methods);
+
+    return &(redefine_impl->redefine);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_redefine_free(void *redefine,
+                                    axis2_env_t **env)
+{
+    axis2_xml_schema_redefine_impl_t *redefine_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    redefine_impl = AXIS2_INTF_TO_IMPL(redefine);
+
+    if(NULL != redefine_impl->methods)
+    {
+        axis2_hash_free(redefine_impl->methods, env);
+        redefine_impl->methods = NULL;
+    }
+
+    if(NULL != redefine_impl->external)
+    {
+        AXIS2_XML_SCHEMA_EXTERNAL_FREE(redefine_impl->external, env);
+        redefine_impl->external = NULL;
+    }
+    
+    if(NULL != redefine_impl->redefine.ops)
+    {
+        AXIS2_FREE((*env)->allocator, redefine_impl->redefine.ops);
+        redefine_impl->redefine.ops = NULL;
+    }
+    if(NULL != redefine_impl->redefine.base.ops)
+    {
+        AXIS2_FREE((*env)->allocator, redefine_impl->redefine.base.ops);
+        redefine_impl->redefine.base.ops = NULL;        
+    }
+    AXIS2_FREE((*env)->allocator, redefine_impl);
+    redefine_impl = NULL;
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_external_t *AXIS2_CALL
+axis2_xml_schema_redefine_get_base_impl(void *redefine,
+                                axis2_env_t **env)
+{
+    axis2_xml_schema_redefine_impl_t *redefine_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    redefine_impl = AXIS2_INTF_TO_IMPL(redefine);
+
+    return redefine_impl->external;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_redefine_resolve_methods(
+                                axis2_xml_schema_redefine_t *redefine,
+                                axis2_env_t **env,
+                                axis2_xml_schema_redefine_t *redefine_impl,
+                                axis2_hash_t *methods)
+{
+    axis2_xml_schema_redefine_impl_t *redefine_impl_l = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, redefine_impl, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+    
+    redefine_impl_l = (axis2_xml_schema_redefine_impl_t *) redefine_impl;
+    
+    redefine->ops = AXIS2_MALLOC((*env)->allocator, 
+            sizeof(axis2_xml_schema_redefine_ops_t));
+            
+    redefine->ops->free = axis2_hash_get(methods, "free", 
+            AXIS2_HASH_KEY_STRING);
+            
+    redefine->ops->get_base_impl = 
+        redefine_impl_l->redefine.ops->get_base_impl;
+    redefine->ops->get_group = 
+        redefine_impl_l->redefine.ops->get_group;
+    redefine->ops->get_items = 
+        redefine_impl_l->redefine.ops->get_items;
+        
+    return axis2_xml_schema_external_resolve_methods(&(redefine->base), 
+            env, redefine_impl_l->external, methods);
+}
+
+axis2_xml_schema_obj_table_t* AXIS2_CALL
+axis2_xml_schema_redefine_get_attribute_group(void *redefine,
+                                              axis2_env_t **env){}
+                
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_redefine_set_attribute_group(void *redefine,
+                axis2_env_t **env,
+                axis2_xml_schema_obj_table_t *group){}
+
+   
+                   
+axis2_xml_schema_obj_collection_t* AXIS2_CALL
+axis2_xml_schema_redefine_get_items(void *redefine,
+               axis2_env_t **env){}
+               
+axis2_xml_schema_obj_table_t* AXIS2_CALL
+axis2_xml_schema_redefine_get_schema_types(void *redefine,
+                      axis2_env_t **env){}
+                      
+axis2_xml_schema_obj_table_t* AXIS2_CALL
+axis2_xml_schema_redefine_get_group(void *redefine, 
+               axis2_env_t **env){}
\ No newline at end of file



Mime
View raw message