axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r404937 - in /webservices/axis2/trunk/c: include/xml_schema/axis2_xml_severity_type.h modules/xml/xml_schema/xml_schema_simple_content_extension.c modules/xml/xml_schema/xml_severity_type.c
Date Mon, 08 May 2006 06:04:39 GMT
Author: nandika
Date: Sun May  7 23:04:38 2006
New Revision: 404937

URL: http://svn.apache.org/viewcvs?rev=404937&view=rev
Log:
severity type added 

Added:
    webservices/axis2/trunk/c/include/xml_schema/axis2_xml_severity_type.h
    webservices/axis2/trunk/c/modules/xml/xml_schema/xml_severity_type.c
Modified:
    webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_content_extension.c

Added: webservices/axis2/trunk/c/include/xml_schema/axis2_xml_severity_type.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/xml_schema/axis2_xml_severity_type.h?rev=404937&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/xml_schema/axis2_xml_severity_type.h (added)
+++ webservices/axis2/trunk/c/include/xml_schema/axis2_xml_severity_type.h Sun May  7 23:04:38
2006
@@ -0,0 +1,99 @@
+/*
+ * 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_SEREVITY_TYPE_H
+#define AXIS2_XML_SEREVITY_TYPE_H
+
+/**
+ * @file axis2_xml_severity_type.h
+ * @brief Axis2 Xml Schema Form Interface
+ *          Indicates if attributes or elements need to be qualified or left 
+ *          unqualified.
+ *
+ */
+
+#include <axis2_xml_schema_enum.h>
+
+/** @defgroup axis2_xml_severity_type Xml Schema Form
+  * @ingroup axis2_xml_schema
+  * @{
+  */
+
+typedef struct axis2_xml_severity_type axis2_xml_severity_type_t;
+typedef struct axis2_xml_severity_type_ops axis2_xml_severity_type_ops_t;
+
+#define AXIS2_XML_ERROR "error"
+#define AXIS2_XML_WARNING "warning"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+struct axis2_xml_severity_type_ops
+{
+	/** 
+     * Deallocate memory
+     * @return status code
+     */
+    axis2_status_t (AXIS2_CALL *
+    free) (void *sevetiry,
+            axis2_env_t **env);
+
+    axis2_xml_schema_enum_t *(AXIS2_CALL *
+    get_base_impl) (void *severity,
+                    axis2_env_t **env);
+    
+    axis2_array_list_t *(AXIS2_CALL *
+    get_values)(void *severity,
+                axis2_env_t **env);
+    
+};
+
+struct axis2_xml_severity_type
+{
+    axis2_xml_schema_enum_t base;
+    axis2_xml_severity_type_ops_t *ops;
+};
+
+AXIS2_DECLARE(axis2_xml_severity_type_t *)
+axis2_xml_severity_type_create(axis2_env_t **env,
+                                    axis2_char_t* value);
+
+/**
+ * This method is internal to Axis2 C. It is called from Child Constructor
+ */
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_severity_type_resolve_methods(
+                                axis2_xml_severity_type_t *severity,
+                                axis2_env_t **env,
+                                axis2_xml_severity_type_t *severity_impl,
+                                axis2_hash_t *methods);
+
+#define AXIS2_XML_SEREVITY_TYPE_FREE(severity, env) \
+		(((axis2_xml_severity_type_t *) severity)->ops->free(severity, env))
+
+#define AXIS2_XML_SEREVITY_TYPE_GET_BASE_IMPL(severity, env) \
+		(((axis2_xml_severity_type_t *) severity)->ops->get_base_impl(severity, env))
+
+#define AXIS2_XML_SEREVITY_TYPE_GET_VALUES(severity, env) \
+		(((axis2_xml_severity_type_t *) severity)->ops->values(severity, env))
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+#endif /* AXIS2_XML_SEREVITY_TYPE_H */

Modified: 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=404937&r1=404936&r2=404937&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_content_extension.c
(original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_content_extension.c
Sun May  7 23:04:38 2006
@@ -132,7 +132,8 @@
             axis2_xml_schema_simple_content_extension_get_base_type_name;
     sim_content_ext_impl->sim_content_ext.ops->set_base_type_name =
             axis2_xml_schema_simple_content_extension_set_base_type_name; 
-
+    
+    sim_content_ext_impl->annotated = axis2_xml_schema_annotated_create(env);
     if(!sim_content_ext_impl->annotated)
     {
         axis2_xml_schema_simple_content_extension_free(

Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_severity_type.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_severity_type.c?rev=404937&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_severity_type.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_severity_type.c Sun May  7 23:04:38
2006
@@ -0,0 +1,223 @@
+/*
+ * 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_severity_type.h>
+
+typedef struct axis2_xml_severity_type_impl 
+                axis2_xml_severity_type_impl_t;
+
+/** 
+ * @brief Other Extension Struct Impl
+ *	Axis2 Other Extension  
+ */ 
+struct axis2_xml_severity_type_impl
+{
+    axis2_xml_severity_type_t severity_type;
+    axis2_xml_schema_enum_t *schema_enum;
+    axis2_hash_t *methods;
+    axis2_array_list_t *members;
+};
+
+#define AXIS2_INTF_TO_IMPL(severity_type) \
+        ((axis2_xml_severity_type_impl_t *) severity_type)
+
+axis2_status_t AXIS2_CALL 
+axis2_xml_severity_type_free(void *severity_type,
+                        axis2_env_t **env);
+
+axis2_xml_schema_enum_t *AXIS2_CALL
+axis2_xml_severity_type_get_base_impl(void *severity_type,
+                                axis2_env_t **env);
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_severity_type_resolve_methods(
+                                axis2_xml_severity_type_t *severity_type,
+                                axis2_env_t **env,
+                                axis2_xml_severity_type_t *severity_type_impl,
+                                axis2_hash_t *methods);
+
+axis2_array_list_t *AXIS2_CALL
+axis2_xml_severity_type_get_values(void *severity_type,
+                        axis2_env_t **env);
+
+
+AXIS2_DECLARE(axis2_xml_severity_type_t *)
+axis2_xml_severity_type_create(axis2_env_t **env,
+                            axis2_char_t *value)
+{
+    axis2_xml_severity_type_impl_t *severity_type_impl = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+    
+    severity_type_impl = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_severity_type_impl_t));
+    if(!severity_type_impl)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }                    
+
+    severity_type_impl->schema_enum = NULL;
+    severity_type_impl->methods = NULL;
+    severity_type_impl->members = NULL;
+    severity_type_impl->severity_type.ops = AXIS2_MALLOC((*env)->allocator, 
+                    sizeof(axis2_xml_severity_type_ops_t));
+    if(!severity_type_impl->severity_type.ops)
+    {
+        axis2_xml_severity_type_free(&(severity_type_impl->severity_type), env);
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    
+                        
+    severity_type_impl->severity_type.ops->free = 
+            axis2_xml_severity_type_free;
+    severity_type_impl->severity_type.ops->get_base_impl = 
+            axis2_xml_severity_type_get_base_impl;
+    severity_type_impl->severity_type.ops->get_values = 
+            axis2_xml_severity_type_get_values;
+
+    severity_type_impl->members = axis2_array_list_create(env, 0);
+    if(!severity_type_impl->members)
+    {    
+        axis2_xml_severity_type_free(&(severity_type_impl->severity_type), env);
+        return NULL;
+    }       
+    AXIS2_ARRAY_LIST_ADD(severity_type_impl->members, env, "qualified");
+    AXIS2_ARRAY_LIST_ADD(severity_type_impl->members, env, "unqualified");
+    AXIS2_ARRAY_LIST_ADD(severity_type_impl->members, env, "none");
+
+    severity_type_impl->methods = axis2_hash_make(env);
+    if(!severity_type_impl->methods)
+    {
+        axis2_xml_severity_type_free(&(severity_type_impl->severity_type), env);
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+
+    axis2_hash_set(severity_type_impl->methods, "free", AXIS2_HASH_KEY_STRING, 
+            axis2_xml_severity_type_free);
+    axis2_hash_set(severity_type_impl->methods, "get_values", AXIS2_HASH_KEY_STRING, 
+            axis2_xml_severity_type_get_values);
+
+    severity_type_impl->schema_enum = axis2_xml_schema_enum_create(env, value);
+    if(!severity_type_impl->schema_enum)
+    {
+        axis2_xml_severity_type_free(&(severity_type_impl->severity_type), env);
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    
+    status = axis2_xml_schema_enum_resolve_methods(
+            &(severity_type_impl->severity_type.base), env, severity_type_impl->schema_enum,

+            severity_type_impl->methods); 
+
+    return &(severity_type_impl->severity_type);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_severity_type_free(void *severity_type,
+                                    axis2_env_t **env)
+{
+    axis2_xml_severity_type_impl_t *severity_type_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    severity_type_impl = AXIS2_INTF_TO_IMPL(severity_type);
+
+    if(severity_type_impl->members)
+    {
+        int size = 0;
+        int i    = 0;
+        size = AXIS2_ARRAY_LIST_SIZE(severity_type_impl->members, env);
+        for(i = 0; i < size ; i++)
+        {
+            axis2_char_t *value = NULL;
+            value =(axis2_char_t* ) AXIS2_ARRAY_LIST_GET(severity_type_impl->members,
env, i);
+            if(NULL != value)
+            {
+                AXIS2_FREE((*env)->allocator, value);
+                value = NULL;
+            }
+        }
+        AXIS2_ARRAY_LIST_FREE(severity_type_impl->members, env);
+        severity_type_impl->members = NULL;
+    }
+    
+    if(severity_type_impl->schema_enum)
+    {
+        AXIS2_XML_SCHEMA_ENUM_FREE(severity_type_impl->schema_enum, env);
+        severity_type_impl->schema_enum = NULL;
+    }
+    
+    if((&(severity_type_impl->severity_type))->ops)
+    {
+        AXIS2_FREE((*env)->allocator, (&(severity_type_impl->severity_type))->ops);
+        (&(severity_type_impl->severity_type))->ops = NULL;
+    }
+
+    if(severity_type_impl)
+    {
+        AXIS2_FREE((*env)->allocator, severity_type_impl);
+        severity_type_impl = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_enum_t *AXIS2_CALL
+axis2_xml_severity_type_get_base_impl(void *severity_type,
+                                axis2_env_t **env)
+{
+    axis2_xml_severity_type_impl_t *severity_type_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+    severity_type_impl = AXIS2_INTF_TO_IMPL(severity_type);
+    return severity_type_impl->schema_enum;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_severity_type_resolve_methods(
+                                axis2_xml_severity_type_t *severity_type,
+                                axis2_env_t **env,
+                                axis2_xml_severity_type_t *severity_type_impl,
+                                axis2_hash_t *methods)
+{
+    axis2_xml_severity_type_impl_t *severity_type_impl_l = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, severity_type_impl, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+    
+    severity_type_impl_l = (axis2_xml_severity_type_impl_t *) severity_type_impl;
+    
+    severity_type->ops = AXIS2_MALLOC((*env)->allocator, 
+            sizeof(axis2_xml_severity_type_ops_t));
+    severity_type->ops->free = axis2_hash_get(methods, "free", 
+            AXIS2_HASH_KEY_STRING);
+    severity_type->ops->get_base_impl = 
+            severity_type_impl_l->severity_type.ops->get_base_impl;
+    severity_type->ops->get_values = 
+            severity_type_impl_l->severity_type.ops->get_values;
+    
+    return axis2_xml_schema_enum_resolve_methods(&(severity_type->base), 
+            env, severity_type_impl_l->schema_enum, methods);
+}
+
+axis2_array_list_t* AXIS2_CALL
+axis2_xml_severity_type_get_values(void *severity_type,
+                                axis2_env_t **env)
+{
+    return AXIS2_INTF_TO_IMPL(severity_type)->members;
+}
+



Mime
View raw message