You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by da...@apache.org on 2006/07/06 08:02:31 UTC
svn commit: r419452 [15/46] - in /webservices/axis2/trunk/c/woden: ./
include/ samples/ samples/wsdl10/ src/ src/builder/ src/builder/wsdl10/
src/schema/ src/types/ src/util/ src/wsdl/ src/wsdl/enumeration/
src/wsdl10/ src/wsdl10/enumeration/ src/wsdl1...
Added: webservices/axis2/trunk/c/woden/src/schema/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/schema/Makefile.am?rev=419452&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/schema/Makefile.am (added)
+++ webservices/axis2/trunk/c/woden/src/schema/Makefile.am Wed Jul 5 23:02:19 2006
@@ -0,0 +1,12 @@
+noinst_LTLIBRARIES = libwoden_schema.la
+
+libwoden_schema_la_SOURCES = \
+ schema.c \
+ imported_schema.c \
+ inlined_schema.c \
+ schema_constants.c
+
+INCLUDES = -I$(top_builddir)/include \
+ @AXIOMINC@ \
+ @UTILINC@ \
+ @XMLSCHEMAINC@
Added: webservices/axis2/trunk/c/woden/src/schema/imported_schema.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/schema/imported_schema.c?rev=419452&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/schema/imported_schema.c (added)
+++ webservices/axis2/trunk/c/woden/src/schema/imported_schema.c Wed Jul 5 23:02:19 2006
@@ -0,0 +1,356 @@
+/*
+ * 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 <woden_imported_schema.h>
+#include <xml_schema.h>
+#include <axis2_uri.h>
+
+typedef struct woden_imported_schema_impl woden_imported_schema_impl_t;
+
+/**
+ * @brief Imported Schema Struct Impl
+ * Axis2 Imported Schema
+ */
+struct woden_imported_schema_impl
+{
+ woden_imported_schema_t imported_schema;
+ woden_schema_t *schema;
+ woden_obj_types_t obj_type;
+ axis2_hash_t *methods;
+ axis2_hash_t *super;
+ axis2_uri_t *f_schema_location;
+};
+
+#define INTF_TO_IMPL(schema) \
+ ((woden_imported_schema_impl_t *) schema)
+
+axis2_status_t AXIS2_CALL
+woden_imported_schema_free(
+ void *schema,
+ const axis2_env_t *env);
+
+axis2_hash_t *AXIS2_CALL
+woden_imported_schema_super_objs(
+ void *schema,
+ const axis2_env_t *env);
+
+woden_obj_types_t AXIS2_CALL
+woden_imported_schema_type(
+ void *schema,
+ const axis2_env_t *env);
+
+woden_schema_t *AXIS2_CALL
+woden_imported_schema_get_base_impl(
+ void *schema,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+woden_imported_schema_set_location(
+ void *schema,
+ const axis2_env_t *env,
+ axis2_uri_t *location);
+
+axis2_uri_t *AXIS2_CALL
+woden_imported_schema_get_location(
+ void *schema,
+ const axis2_env_t *env);
+
+static woden_imported_schema_t *
+create(const axis2_env_t *env);
+
+static axis2_status_t
+woden_imported_schema_free_ops(
+ void *schema,
+ const axis2_env_t *env);
+
+/************************Woden C Internal Methods******************************/
+AXIS2_EXTERN woden_imported_schema_t * AXIS2_CALL
+woden_imported_schema_to_schema(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ if(!schema)
+ {
+ schema_impl = (woden_imported_schema_impl_t *) create(env);
+ }
+ else
+ schema_impl = (woden_imported_schema_impl_t *) schema;
+
+ woden_imported_schema_free_ops(schema, env);
+
+ schema_impl->imported_schema.schema.ops =
+ AXIS2_MALLOC(env->allocator, sizeof(woden_schema_ops_t));
+ woden_schema_resolve_methods(&(schema_impl->imported_schema.schema),
+ env, schema_impl->schema, schema_impl->methods);
+
+ return schema;
+}
+
+/************************End of Woden C Internal Methods***********************/
+
+static woden_imported_schema_t *
+create(
+ const axis2_env_t *env)
+{
+ woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ schema_impl = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_imported_schema_impl_t));
+
+ schema_impl->schema = NULL;
+ schema_impl->obj_type = WODEN_IMPORTED_SCHEMA;
+ schema_impl->methods = NULL;
+ schema_impl->super = NULL;
+ schema_impl->f_schema_location = NULL;
+
+ schema_impl->imported_schema.schema.ops = NULL;
+
+ schema_impl->imported_schema.ops =
+ AXIS2_MALLOC(env->allocator,
+ sizeof(woden_imported_schema_ops_t));
+
+ schema_impl->imported_schema.ops->free =
+ woden_imported_schema_free;
+ schema_impl->imported_schema.ops->super_objs =
+ woden_imported_schema_super_objs;
+ schema_impl->imported_schema.ops->type =
+ woden_imported_schema_type;
+ schema_impl->imported_schema.ops->get_base_impl =
+ woden_imported_schema_get_base_impl;
+
+ schema_impl->imported_schema.ops->set_location =
+ woden_imported_schema_set_location;
+ schema_impl->imported_schema.ops->get_location =
+ woden_imported_schema_get_location;
+
+
+ schema_impl->super = axis2_hash_make(env);
+ if(!schema_impl->super)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ schema_impl->methods = axis2_hash_make(env);
+ if(!schema_impl->methods)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(schema_impl->methods, "free",
+ AXIS2_HASH_KEY_STRING, woden_imported_schema_free);
+ axis2_hash_set(schema_impl->methods, "super_objs",
+ AXIS2_HASH_KEY_STRING, woden_imported_schema_super_objs);
+ axis2_hash_set(schema_impl->methods, "type",
+ AXIS2_HASH_KEY_STRING, woden_imported_schema_type);
+
+ axis2_hash_set(schema_impl->methods, "set_location",
+ AXIS2_HASH_KEY_STRING, woden_imported_schema_set_location);
+ axis2_hash_set(schema_impl->methods, "get_location",
+ AXIS2_HASH_KEY_STRING, woden_imported_schema_get_location);
+
+ return &(schema_impl->imported_schema);
+}
+AXIS2_EXTERN woden_imported_schema_t * AXIS2_CALL
+woden_imported_schema_create(
+ const axis2_env_t *env)
+{
+ woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ schema_impl = (woden_imported_schema_impl_t *) create(env);
+
+ schema_impl->schema = woden_schema_create(env);
+ axis2_hash_set(schema_impl->super, "WODEN_IMPORTED_SCHEMA", AXIS2_HASH_KEY_STRING,
+ &(schema_impl->schema));
+ axis2_hash_set(schema_impl->super, "WODEN_SCHEMA", AXIS2_HASH_KEY_STRING,
+ schema_impl->schema);
+ return &(schema_impl->imported_schema);
+}
+
+woden_obj_types_t AXIS2_CALL
+woden_imported_schema_type(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return schema_impl->obj_type;
+}
+
+static axis2_status_t
+woden_imported_schema_free_ops(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ if(schema_impl->imported_schema.schema.ops)
+ {
+ AXIS2_FREE(env->allocator, schema_impl->imported_schema.schema.ops);
+ schema_impl->imported_schema.schema.ops = NULL;
+ }
+
+ return AXIS2_SUCCESS;
+}
+
+
+axis2_status_t AXIS2_CALL
+woden_imported_schema_free(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ if(schema_impl->f_schema_location)
+ {
+ AXIS2_URI_FREE(schema_impl->f_schema_location, env);
+ schema_impl->f_schema_location = NULL;
+ }
+
+ if(schema_impl->methods)
+ {
+ axis2_hash_free(schema_impl->methods, env);
+ schema_impl->methods = NULL;
+ }
+
+ if(schema_impl->schema)
+ {
+ WODEN_SCHEMA_FREE(schema_impl->schema, env);
+ schema_impl->schema = NULL;
+ }
+
+ woden_imported_schema_free_ops(schema, env);
+
+ if((&(schema_impl->imported_schema))->ops)
+ {
+ AXIS2_FREE(env->allocator, (&(schema_impl->imported_schema))->ops);
+ (&(schema_impl->imported_schema))->ops = NULL;
+ }
+
+ if(schema_impl)
+ {
+ AXIS2_FREE(env->allocator, schema_impl);
+ schema_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_hash_t *AXIS2_CALL
+woden_imported_schema_super_objs(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return schema_impl->super;
+}
+
+woden_schema_t *AXIS2_CALL
+woden_imported_schema_get_base_impl(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return schema_impl->schema;
+}
+
+axis2_status_t AXIS2_CALL
+woden_imported_schema_resolve_methods(
+ woden_imported_schema_t *schema,
+ const axis2_env_t *env,
+ woden_imported_schema_t *schema_impl,
+ axis2_hash_t *methods)
+{
+ woden_imported_schema_impl_t *schema_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, methods, AXIS2_FAILURE);
+ schema_impl_l = INTF_TO_IMPL(schema_impl);
+
+ schema->ops->free =
+ axis2_hash_get(methods, "free", AXIS2_HASH_KEY_STRING);
+ schema->ops->type =
+ axis2_hash_get(methods, "type", AXIS2_HASH_KEY_STRING);
+
+ schema->ops->set_location = axis2_hash_get(methods,
+ "set_location", AXIS2_HASH_KEY_STRING);
+ if(!schema->ops->set_location && schema_impl_l)
+ schema->ops->set_location =
+ schema_impl_l->imported_schema.ops->set_location;
+
+ schema->ops->get_location = axis2_hash_get(methods,
+ "get_location", AXIS2_HASH_KEY_STRING);
+ if(!schema->ops->get_location && schema_impl_l)
+ schema->ops->get_location =
+ schema_impl_l->imported_schema.ops->get_location;
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+woden_imported_schema_set_location(
+ void *schema,
+ const axis2_env_t *env,
+ axis2_uri_t *location)
+{
+ woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ if(schema_impl->f_schema_location)
+ {
+ AXIS2_URI_FREE(schema_impl->f_schema_location, env);
+ schema_impl->f_schema_location = NULL;
+ }
+ schema_impl->f_schema_location = AXIS2_URI_CLONE(location, env);
+ return AXIS2_SUCCESS;
+}
+
+axis2_uri_t *AXIS2_CALL
+woden_imported_schema_get_location(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_imported_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return schema_impl->f_schema_location;
+}
+
Added: webservices/axis2/trunk/c/woden/src/schema/inlined_schema.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/schema/inlined_schema.c?rev=419452&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/schema/inlined_schema.c (added)
+++ webservices/axis2/trunk/c/woden/src/schema/inlined_schema.c Wed Jul 5 23:02:19 2006
@@ -0,0 +1,361 @@
+/*
+ * 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 <woden_inlined_schema.h>
+#include <xml_schema.h>
+#include <axis2_uri.h>
+
+typedef struct woden_inlined_schema_impl woden_inlined_schema_impl_t;
+
+/**
+ * @brief Inlined Schema Struct Impl
+ * Axis2 Inlined Schema
+ */
+struct woden_inlined_schema_impl
+{
+ woden_inlined_schema_t inlined_schema;
+ woden_schema_t *schema;
+ woden_obj_types_t obj_type;
+ axis2_hash_t *methods;
+ axis2_hash_t *super;
+ axis2_char_t *f_schema_id;
+};
+
+#define INTF_TO_IMPL(schema) \
+ ((woden_inlined_schema_impl_t *) schema)
+
+axis2_status_t AXIS2_CALL
+woden_inlined_schema_free(
+ void *schema,
+ const axis2_env_t *env);
+
+axis2_hash_t *AXIS2_CALL
+woden_inlined_schema_super_objs(
+ void *schema,
+ const axis2_env_t *env);
+
+woden_obj_types_t AXIS2_CALL
+woden_inlined_schema_type(
+ void *schema,
+ const axis2_env_t *env);
+
+woden_schema_t *AXIS2_CALL
+woden_inlined_schema_get_base_impl(
+ void *schema,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+woden_inlined_schema_set_id(
+ void *schema,
+ const axis2_env_t *env,
+ axis2_char_t *id);
+
+axis2_char_t *AXIS2_CALL
+woden_inlined_schema_get_id(
+ void *schema,
+ const axis2_env_t *env);
+
+static woden_inlined_schema_t *
+create(const axis2_env_t *env);
+
+static axis2_status_t
+woden_inlined_schema_free_ops(
+ void *schema,
+ const axis2_env_t *env);
+
+/************************Woden C Internal Methods******************************/
+AXIS2_EXTERN woden_inlined_schema_t * AXIS2_CALL
+woden_inlined_schema_to_schema(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_inlined_schema_impl_t *schema_impl = NULL;
+ void *base_schema = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+
+ if(!schema)
+ {
+ schema_impl = (woden_inlined_schema_impl_t *) create(env);
+ }
+ else
+ schema_impl = (woden_inlined_schema_impl_t *) schema;
+
+ woden_inlined_schema_free_ops(schema, env);
+
+ schema_impl->inlined_schema.schema.ops =
+ AXIS2_MALLOC(env->allocator,
+ sizeof(woden_schema_ops_t));
+ base_schema = WODEN_INLINED_SCHEMA_GET_BASE_IMPL(schema, env);
+ woden_schema_resolve_methods(&(schema_impl->inlined_schema.schema),
+ env, base_schema, schema_impl->methods);
+
+ return schema;
+}
+
+/************************End of Woden C Internal Methods***********************/
+
+static woden_inlined_schema_t *
+create(
+ const axis2_env_t *env)
+{
+ woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ schema_impl = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_inlined_schema_impl_t));
+
+ schema_impl->schema = NULL;
+ schema_impl->obj_type = WODEN_INLINED_SCHEMA;
+ schema_impl->methods = NULL;
+ schema_impl->super = NULL;
+ schema_impl->f_schema_id = NULL;
+
+ schema_impl->inlined_schema.schema.ops = NULL;
+
+ schema_impl->inlined_schema.ops =
+ AXIS2_MALLOC(env->allocator,
+ sizeof(woden_inlined_schema_ops_t));
+
+ schema_impl->inlined_schema.ops->free =
+ woden_inlined_schema_free;
+ schema_impl->inlined_schema.ops->super_objs =
+ woden_inlined_schema_super_objs;
+ schema_impl->inlined_schema.ops->type =
+ woden_inlined_schema_type;
+ schema_impl->inlined_schema.ops->get_base_impl =
+ woden_inlined_schema_get_base_impl;
+
+ schema_impl->inlined_schema.ops->set_id =
+ woden_inlined_schema_set_id;
+ schema_impl->inlined_schema.ops->get_id =
+ woden_inlined_schema_get_id;
+
+ schema_impl->methods = axis2_hash_make(env);
+ if(!schema_impl->methods)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(schema_impl->methods, "free",
+ AXIS2_HASH_KEY_STRING, woden_inlined_schema_free);
+ axis2_hash_set(schema_impl->methods, "super_objs",
+ AXIS2_HASH_KEY_STRING, woden_inlined_schema_super_objs);
+ axis2_hash_set(schema_impl->methods, "type",
+ AXIS2_HASH_KEY_STRING, woden_inlined_schema_type);
+
+ axis2_hash_set(schema_impl->methods, "set_id",
+ AXIS2_HASH_KEY_STRING, woden_inlined_schema_set_id);
+ axis2_hash_set(schema_impl->methods, "get_id",
+ AXIS2_HASH_KEY_STRING, woden_inlined_schema_get_id);
+
+ return &(schema_impl->inlined_schema);
+}
+AXIS2_EXTERN woden_inlined_schema_t * AXIS2_CALL
+woden_inlined_schema_create(
+ const axis2_env_t *env)
+{
+ woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ schema_impl = (woden_inlined_schema_impl_t *) create(env);
+
+ schema_impl->schema = woden_schema_create(env);
+ schema_impl->super = axis2_hash_make(env);
+ if(!schema_impl->super)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(schema_impl->super, "WODEN_INLINED_SCHEMA", AXIS2_HASH_KEY_STRING,
+ &(schema_impl->schema));
+ axis2_hash_set(schema_impl->super, "WODEN_SCHEMA", AXIS2_HASH_KEY_STRING,
+ schema_impl->schema);
+
+ return &(schema_impl->inlined_schema);
+}
+
+woden_obj_types_t AXIS2_CALL
+woden_inlined_schema_type(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return schema_impl->obj_type;
+}
+
+static axis2_status_t
+woden_inlined_schema_free_ops(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ if(schema_impl->inlined_schema.schema.ops)
+ {
+ AXIS2_FREE(env->allocator, schema_impl->inlined_schema.schema.ops);
+ schema_impl->inlined_schema.schema.ops = NULL;
+ }
+
+ return AXIS2_SUCCESS;
+}
+
+
+axis2_status_t AXIS2_CALL
+woden_inlined_schema_free(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ if(schema_impl->f_schema_id)
+ {
+ AXIS2_FREE(env->allocator, schema_impl->f_schema_id);
+ schema_impl->f_schema_id = NULL;
+ }
+
+ if(schema_impl->methods)
+ {
+ axis2_hash_free(schema_impl->methods, env);
+ schema_impl->methods = NULL;
+ }
+
+ if(schema_impl->schema)
+ {
+ WODEN_SCHEMA_FREE(schema_impl->schema, env);
+ schema_impl->schema = NULL;
+ }
+
+ woden_inlined_schema_free_ops(schema, env);
+
+ if((&(schema_impl->inlined_schema))->ops)
+ {
+ AXIS2_FREE(env->allocator, (&(schema_impl->inlined_schema))->ops);
+ (&(schema_impl->inlined_schema))->ops = NULL;
+ }
+
+ if(schema_impl)
+ {
+ AXIS2_FREE(env->allocator, schema_impl);
+ schema_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+woden_schema_t *AXIS2_CALL
+woden_inlined_schema_get_base_impl(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return schema_impl->schema;
+}
+
+axis2_hash_t *AXIS2_CALL
+woden_inlined_schema_super_objs(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return schema_impl->super;
+}
+
+axis2_status_t AXIS2_CALL
+woden_inlined_schema_resolve_methods(
+ woden_inlined_schema_t *schema,
+ const axis2_env_t *env,
+ woden_inlined_schema_t *schema_impl,
+ axis2_hash_t *methods)
+{
+ woden_inlined_schema_impl_t *schema_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, methods, AXIS2_FAILURE);
+ schema_impl_l = INTF_TO_IMPL(schema_impl);
+
+ schema->ops->free =
+ axis2_hash_get(methods, "free", AXIS2_HASH_KEY_STRING);
+ schema->ops->super_objs = axis2_hash_get(methods, "super_objs",
+ AXIS2_HASH_KEY_STRING);
+ schema->ops->type =
+ axis2_hash_get(methods, "type", AXIS2_HASH_KEY_STRING);
+
+ schema->ops->set_id = axis2_hash_get(methods,
+ "set_id", AXIS2_HASH_KEY_STRING);
+ if(!schema->ops->set_id && schema_impl_l)
+ schema->ops->set_id =
+ schema_impl_l->inlined_schema.ops->set_id;
+
+ schema->ops->get_id = axis2_hash_get(methods,
+ "get_id", AXIS2_HASH_KEY_STRING);
+ if(!schema->ops->get_id && schema_impl_l)
+ schema->ops->get_id =
+ schema_impl_l->inlined_schema.ops->get_id;
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+woden_inlined_schema_set_id(
+ void *schema,
+ const axis2_env_t *env,
+ axis2_char_t *id)
+{
+ woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ if(schema_impl->f_schema_id)
+ {
+ AXIS2_FREE(env->allocator, schema_impl->f_schema_id);
+ schema_impl->f_schema_id = NULL;
+ }
+ schema_impl->f_schema_id = AXIS2_STRDUP(id, env);
+ return AXIS2_SUCCESS;
+}
+
+axis2_char_t *AXIS2_CALL
+woden_inlined_schema_get_id(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_inlined_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return schema_impl->f_schema_id;
+}
+
+
Added: webservices/axis2/trunk/c/woden/src/schema/schema.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/schema/schema.c?rev=419452&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/schema/schema.c (added)
+++ webservices/axis2/trunk/c/woden/src/schema/schema.c Wed Jul 5 23:02:19 2006
@@ -0,0 +1,396 @@
+/*
+ * 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 <woden_schema.h>
+#include <xml_schema.h>
+
+typedef struct woden_schema_impl woden_schema_impl_t;
+
+/**
+ * @brief Schema Struct Impl
+ * Axis2 Schema
+ */
+struct woden_schema_impl
+{
+ woden_schema_t schema;
+ axis2_hash_t *super;
+ woden_obj_types_t obj_type;
+
+ axis2_uri_t *f_namespc;
+ xml_schema_t *f_schema_def;
+ axis2_bool_t f_is_referenceable;
+};
+
+#define INTF_TO_IMPL(schema) ((woden_schema_impl_t *) schema)
+
+axis2_status_t AXIS2_CALL
+woden_schema_free(
+ void *schema,
+ const axis2_env_t *envv);
+
+axis2_hash_t *AXIS2_CALL
+woden_schema_super_objs(
+ void *schema,
+ const axis2_env_t *env);
+
+woden_obj_types_t AXIS2_CALL
+woden_schema_type(
+ void *schema,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+woden_schema_set_namespace(
+ void *schema,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc);
+
+axis2_uri_t *AXIS2_CALL
+woden_schema_get_namespace(
+ void *schema,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+woden_schema_set_schema_def(
+ void *schema,
+ const axis2_env_t *env,
+ xml_schema_t *schema_def);
+
+xml_schema_t *AXIS2_CALL
+woden_schema_get_schema_def(
+ void *schema,
+ const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+woden_schema_set_referenceable(
+ void *schema,
+ const axis2_env_t *env,
+ axis2_bool_t referenceable);
+
+axis2_bool_t AXIS2_CALL
+woden_schema_is_referenceable(
+ void *schema,
+ const axis2_env_t *env);
+
+axis2_char_t *AXIS2_CALL
+woden_schema_get_namespace_as_string(
+ void *schema,
+ const axis2_env_t *env);
+
+AXIS2_EXTERN woden_schema_t * AXIS2_CALL
+woden_schema_create(
+ const axis2_env_t *env)
+{
+ woden_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ schema_impl = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_schema_impl_t));
+
+ schema_impl->super = NULL;
+ schema_impl->obj_type = WODEN_SCHEMA;
+ schema_impl->f_namespc = NULL;
+ schema_impl->f_schema_def = NULL;
+ schema_impl->f_is_referenceable = AXIS2_TRUE;
+
+ schema_impl->schema.ops = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_schema_ops_t));
+
+ schema_impl->super = axis2_hash_make(env);
+ if(!schema_impl->super)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ schema_impl->schema.ops->free = woden_schema_free;
+ schema_impl->schema.ops->type = woden_schema_type;
+ schema_impl->schema.ops->super_objs = woden_schema_super_objs;
+ schema_impl->schema.ops->set_namespace = woden_schema_set_namespace;
+ schema_impl->schema.ops->get_namespace = woden_schema_get_namespace;
+ schema_impl->schema.ops->set_schema_def = woden_schema_set_schema_def;
+ schema_impl->schema.ops->get_schema_def = woden_schema_get_schema_def;
+ schema_impl->schema.ops->set_referenceable =
+ woden_schema_set_referenceable;
+ schema_impl->schema.ops->is_referenceable =
+ woden_schema_is_referenceable;
+ schema_impl->schema.ops->get_namespace_as_string =
+ woden_schema_get_namespace_as_string;
+
+ axis2_hash_set(schema_impl->super, "WODEN_SCHEMA", AXIS2_HASH_KEY_STRING,
+ &(schema_impl->schema));
+
+ return &(schema_impl->schema);
+}
+
+axis2_status_t AXIS2_CALL
+woden_schema_free(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ if(schema_impl->f_namespc)
+ {
+ AXIS2_URI_FREE(schema_impl->f_namespc, env);
+ schema_impl->f_namespc = NULL;
+ }
+
+ if(schema_impl->f_schema_def)
+ {
+ XML_SCHEMA_FREE(schema_impl->f_schema_def, env);
+ schema_impl->f_schema_def = NULL;
+ }
+
+ if((&(schema_impl->schema))->ops)
+ {
+ AXIS2_FREE(env->allocator, (&(schema_impl->schema))->ops);
+ (&(schema_impl->schema))->ops = NULL;
+ }
+
+ if(schema_impl)
+ {
+ AXIS2_FREE(env->allocator, schema_impl);
+ schema_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_hash_t *AXIS2_CALL
+woden_schema_super_objs(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return schema_impl->super;
+}
+
+woden_obj_types_t AXIS2_CALL
+woden_schema_type(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_schema_impl_t *schema_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ schema_impl = INTF_TO_IMPL(schema);
+
+ return schema_impl->obj_type;
+}
+
+
+axis2_status_t AXIS2_CALL
+woden_schema_resolve_methods(
+ woden_schema_t *schema,
+ const axis2_env_t *env,
+ woden_schema_t *schema_impl,
+ axis2_hash_t *methods)
+{
+ woden_schema_impl_t *schema_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, methods, AXIS2_FAILURE);
+ schema_impl_l = INTF_TO_IMPL(schema_impl);
+
+ schema->ops->free = axis2_hash_get(methods, "free", AXIS2_HASH_KEY_STRING);
+ schema->ops->super_objs = axis2_hash_get(methods, "super_objs",
+ AXIS2_HASH_KEY_STRING);
+ schema->ops->type = axis2_hash_get(methods, "type", AXIS2_HASH_KEY_STRING);
+
+ schema->ops->set_namespace = axis2_hash_get(methods,
+ "set_namespace", AXIS2_HASH_KEY_STRING);
+ if(!schema->ops->set_namespace && schema_impl_l)
+ schema->ops->set_namespace =
+ schema_impl_l->schema.ops->set_namespace;
+
+ schema->ops->get_namespace = axis2_hash_get(methods,
+ "get_namespace", AXIS2_HASH_KEY_STRING);
+ if(!schema->ops->get_namespace && schema_impl_l)
+ schema->ops->get_namespace =
+ schema_impl_l->schema.ops->get_namespace;
+
+ schema->ops->set_schema_def = axis2_hash_get(methods,
+ "set_schema_def", AXIS2_HASH_KEY_STRING);
+ if(!schema->ops->set_schema_def && schema_impl_l)
+ schema->ops->set_schema_def =
+ schema_impl_l->schema.ops->set_schema_def;
+
+ schema->ops->get_schema_def = axis2_hash_get(methods,
+ "get_schema_def", AXIS2_HASH_KEY_STRING);
+ if(!schema->ops->get_schema_def && schema_impl_l)
+ schema->ops->get_schema_def =
+ schema_impl_l->schema.ops->get_schema_def;
+
+ schema->ops->set_referenceable = axis2_hash_get(methods,
+ "set_referenceable", AXIS2_HASH_KEY_STRING);
+ if(!schema->ops->set_referenceable && schema_impl_l)
+ schema->ops->set_referenceable =
+ schema_impl_l->schema.ops->set_referenceable;
+
+ schema->ops->is_referenceable = axis2_hash_get(methods,
+ "is_referenceable", AXIS2_HASH_KEY_STRING);
+ if(!schema->ops->is_referenceable && schema_impl_l)
+ schema->ops->is_referenceable =
+ schema_impl_l->schema.ops->is_referenceable;
+
+ schema->ops->get_namespace_as_string = axis2_hash_get(methods,
+ "get_namespace_as_string", AXIS2_HASH_KEY_STRING);
+ if(!schema->ops->get_namespace_as_string && schema_impl_l)
+ schema->ops->get_namespace_as_string =
+ schema_impl_l->schema.ops->get_namespace_as_string;
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+woden_schema_set_namespace(
+ void *schema,
+ const axis2_env_t *env,
+ axis2_uri_t *namespc)
+{
+ woden_schema_impl_t *schema_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, namespc, AXIS2_FAILURE);
+ super = WODEN_SCHEMA_SUPER_OBJS(schema, env);
+ schema_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_SCHEMA", AXIS2_HASH_KEY_STRING));
+
+ if(schema_impl->f_namespc)
+ {
+ AXIS2_URI_FREE(schema_impl->f_namespc, env);
+ schema_impl->f_namespc = NULL;
+ }
+ schema_impl->f_namespc = AXIS2_URI_CLONE(namespc, env);
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_uri_t *AXIS2_CALL
+woden_schema_get_namespace(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_schema_impl_t *schema_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_SCHEMA_SUPER_OBJS(schema, env);
+ schema_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_SCHEMA", AXIS2_HASH_KEY_STRING));
+
+ return schema_impl->f_namespc;
+}
+
+axis2_status_t AXIS2_CALL
+woden_schema_set_schema_def(
+ void *schema,
+ const axis2_env_t *env,
+ xml_schema_t *schema_def)
+{
+ woden_schema_impl_t *schema_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, schema_def, AXIS2_FAILURE);
+ super = WODEN_SCHEMA_SUPER_OBJS(schema, env);
+ schema_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_SCHEMA", AXIS2_HASH_KEY_STRING));
+
+ if(schema_impl->f_schema_def)
+ {
+ XML_SCHEMA_FREE(schema_impl->f_schema_def, env);
+ schema_impl->f_schema_def = NULL;
+ }
+ schema_impl->f_schema_def = schema_def;
+
+ return AXIS2_SUCCESS;
+}
+
+xml_schema_t *AXIS2_CALL
+woden_schema_get_schema_def(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_schema_impl_t *schema_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_SCHEMA_SUPER_OBJS(schema, env);
+ schema_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_SCHEMA", AXIS2_HASH_KEY_STRING));
+
+ return schema_impl->f_schema_def;
+}
+
+axis2_status_t AXIS2_CALL
+woden_schema_set_referenceable(
+ void *schema,
+ const axis2_env_t *env,
+ axis2_bool_t referenceable)
+{
+ woden_schema_impl_t *schema_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ super = WODEN_SCHEMA_SUPER_OBJS(schema, env);
+ schema_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_SCHEMA", AXIS2_HASH_KEY_STRING));
+
+ schema_impl->f_is_referenceable = referenceable;
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_bool_t AXIS2_CALL
+woden_schema_is_referenceable(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_schema_impl_t *schema_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ super = WODEN_SCHEMA_SUPER_OBJS(schema, env);
+ schema_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_SCHEMA", AXIS2_HASH_KEY_STRING));
+
+ return schema_impl->f_is_referenceable;
+}
+
+axis2_char_t *AXIS2_CALL
+woden_schema_get_namespace_as_string(
+ void *schema,
+ const axis2_env_t *env)
+{
+ woden_schema_impl_t *schema_impl = NULL;
+ axis2_hash_t *super = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ super = WODEN_SCHEMA_SUPER_OBJS(schema, env);
+ schema_impl = INTF_TO_IMPL(axis2_hash_get(super,
+ "WODEN_SCHEMA", AXIS2_HASH_KEY_STRING));
+
+ return schema_impl->f_namespc != NULL ?
+ AXIS2_URI_TO_STRING(schema_impl->f_namespc, env, AXIS2_URI_UNP_OMITUSERINFO) : NULL;
+}
+
Added: webservices/axis2/trunk/c/woden/src/schema/schema_constants.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/schema/schema_constants.c?rev=419452&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/schema/schema_constants.c (added)
+++ webservices/axis2/trunk/c/woden/src/schema/schema_constants.c Wed Jul 5 23:02:19 2006
@@ -0,0 +1,147 @@
+/*
+ * 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_allocator.h>
+#include <axis2_env.h>
+#include <axis2_error.h>
+#include <axis2_string.h>
+#include <axis2_utils.h>
+#include <axis2_hash.h>
+#include <axis2_uri.h>
+#include <axis2_qname.h>
+#include <woden.h>
+#include <woden_schema_constants.h>
+
+axis2_bool_t AXIS2_CALL
+woden_schema_constants_compare_schema(
+ axis2_qname_t *schema,
+ const axis2_env_t *env)
+{
+ axis2_qname_t *q1999 = NULL;
+ axis2_qname_t *q2000 = NULL;
+ axis2_qname_t *q2001 = NULL;
+ axis2_bool_t ret = AXIS2_FALSE;
+
+ q1999 = axis2_qname_create_from_string(env, WODEN_Q_ELEM_XSD_1999);
+ q2000 = axis2_qname_create_from_string(env, WODEN_Q_ELEM_XSD_2000);
+ q2001 = axis2_qname_create_from_string(env, WODEN_Q_ELEM_XSD_2001);
+
+ if(AXIS2_TRUE == AXIS2_QNAME_EQUALS(schema, env, q1999) ||
+ AXIS2_TRUE == AXIS2_QNAME_EQUALS(schema, env, q2000) ||
+ AXIS2_TRUE == AXIS2_QNAME_EQUALS(schema, env, q2001))
+ {
+ ret = AXIS2_TRUE;
+ }
+ if(q1999)
+ AXIS2_QNAME_FREE(q1999, env);
+ if(q2000)
+ AXIS2_QNAME_FREE(q2000, env);
+ if(q2001)
+ AXIS2_QNAME_FREE(q2001, env);
+
+ return ret;
+}
+
+axis2_bool_t AXIS2_CALL
+woden_schema_constants_compare_include(
+ axis2_qname_t *include,
+ const axis2_env_t *env)
+{
+ axis2_qname_t *q1999 = NULL;
+ axis2_qname_t *q2000 = NULL;
+ axis2_qname_t *q2001 = NULL;
+ axis2_bool_t ret = AXIS2_FALSE;
+
+ q1999 = axis2_qname_create_from_string(env, WODEN_Q_ELEM_INCLUDE_XSD_1999);
+ q2000 = axis2_qname_create_from_string(env, WODEN_Q_ELEM_INCLUDE_XSD_2000);
+ q2001 = axis2_qname_create_from_string(env, WODEN_Q_ELEM_INCLUDE_XSD_2001);
+
+ if(AXIS2_TRUE == AXIS2_QNAME_EQUALS(include, env, q1999) ||
+ AXIS2_TRUE == AXIS2_QNAME_EQUALS(include, env, q2000) ||
+ AXIS2_TRUE == AXIS2_QNAME_EQUALS(include, env, q2001))
+ {
+ ret = AXIS2_TRUE;
+ }
+ if(q1999)
+ AXIS2_QNAME_FREE(q1999, env);
+ if(q2000)
+ AXIS2_QNAME_FREE(q2000, env);
+ if(q2001)
+ AXIS2_QNAME_FREE(q2001, env);
+
+ return ret;
+}
+
+axis2_bool_t AXIS2_CALL
+woden_schema_constants_compare_import(
+ axis2_qname_t *import,
+ const axis2_env_t *env)
+{
+ axis2_qname_t *q1999 = NULL;
+ axis2_qname_t *q2000 = NULL;
+ axis2_qname_t *q2001 = NULL;
+ axis2_bool_t ret = AXIS2_FALSE;
+
+ q1999 = axis2_qname_create_from_string(env, WODEN_Q_ELEM_IMPORT_XSD_1999);
+ q2000 = axis2_qname_create_from_string(env, WODEN_Q_ELEM_IMPORT_XSD_2000);
+ q2001 = axis2_qname_create_from_string(env, WODEN_Q_ELEM_IMPORT_XSD_2001);
+
+ if(AXIS2_TRUE == AXIS2_QNAME_EQUALS(import, env, q1999) ||
+ AXIS2_TRUE == AXIS2_QNAME_EQUALS(import, env, q2000) ||
+ AXIS2_TRUE == AXIS2_QNAME_EQUALS(import, env, q2001))
+ {
+ ret = AXIS2_TRUE;
+ }
+ if(q1999)
+ AXIS2_QNAME_FREE(q1999, env);
+ if(q2000)
+ AXIS2_QNAME_FREE(q2000, env);
+ if(q2001)
+ AXIS2_QNAME_FREE(q2001, env);
+
+ return ret;
+}
+
+axis2_bool_t AXIS2_CALL
+woden_schema_constants_compare_redefine(
+ axis2_qname_t *redefine,
+ const axis2_env_t *env)
+{
+ axis2_qname_t *q1999 = NULL;
+ axis2_qname_t *q2000 = NULL;
+ axis2_qname_t *q2001 = NULL;
+ axis2_bool_t ret = AXIS2_FALSE;
+
+ q1999 = axis2_qname_create_from_string(env, WODEN_Q_ELEM_REDEFINE_XSD_1999);
+ q2000 = axis2_qname_create_from_string(env, WODEN_Q_ELEM_REDEFINE_XSD_2000);
+ q2001 = axis2_qname_create_from_string(env, WODEN_Q_ELEM_REDEFINE_XSD_2001);
+
+ if(AXIS2_TRUE == AXIS2_QNAME_EQUALS(redefine, env, q1999) ||
+ AXIS2_TRUE == AXIS2_QNAME_EQUALS(redefine, env, q2000) ||
+ AXIS2_TRUE == AXIS2_QNAME_EQUALS(redefine, env, q2001))
+ {
+ ret = AXIS2_TRUE;
+ }
+ if(q1999)
+ AXIS2_QNAME_FREE(q1999, env);
+ if(q2000)
+ AXIS2_QNAME_FREE(q2000, env);
+ if(q2001)
+ AXIS2_QNAME_FREE(q2001, env);
+
+ return ret;
+}
+
Added: webservices/axis2/trunk/c/woden/src/types/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/types/Makefile.am?rev=419452&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/types/Makefile.am (added)
+++ webservices/axis2/trunk/c/woden/src/types/Makefile.am Wed Jul 5 23:02:19 2006
@@ -0,0 +1,10 @@
+noinst_LTLIBRARIES = libwoden_types.la
+
+libwoden_types_la_SOURCES = \
+ xml_char.c \
+ nc_name.c
+
+INCLUDES = -I$(top_builddir)/include \
+ @AXIOMINC@ \
+ @UTILINC@ \
+ @XMLSCHEMAINC@
Added: webservices/axis2/trunk/c/woden/src/types/nc_name.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/types/nc_name.c?rev=419452&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/types/nc_name.c (added)
+++ webservices/axis2/trunk/c/woden/src/types/nc_name.c Wed Jul 5 23:02:19 2006
@@ -0,0 +1,175 @@
+/*
+ * 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 <woden_nc_name.h>
+#include <woden_xml_char.h>
+
+typedef struct woden_nc_name_impl woden_nc_name_impl_t;
+
+/**
+ * @brief NC Name Struct Impl
+ * Axis2 NC Name
+ */
+struct woden_nc_name_impl
+{
+ woden_nc_name_t nc_name;
+ axis2_char_t *f_value;
+};
+
+#define INTF_TO_IMPL(nc_name) ((woden_nc_name_impl_t *) nc_name)
+
+axis2_status_t AXIS2_CALL
+woden_nc_name_free(
+ void *nc_name,
+ const axis2_env_t *envv);
+
+axis2_bool_t AXIS2_CALL
+woden_nc_name_is_valid(
+ void *nc_name,
+ const axis2_env_t *env,
+ axis2_char_t *st_value);
+
+axis2_status_t AXIS2_CALL
+woden_nc_name_set_value(
+ void *nc_name,
+ const axis2_env_t *env,
+ axis2_char_t *value);
+
+axis2_char_t *AXIS2_CALL
+woden_nc_name_to_string(
+ void *nc_name,
+ const axis2_env_t *env);
+
+AXIS2_EXTERN woden_nc_name_t * AXIS2_CALL
+woden_nc_name_create(
+ const axis2_env_t *env,
+ axis2_char_t *value)
+{
+ woden_nc_name_impl_t *nc_name_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ nc_name_impl = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_nc_name_impl_t));
+
+ nc_name_impl->f_value = NULL;
+
+ nc_name_impl->nc_name.ops = AXIS2_MALLOC(env->allocator,
+ sizeof(woden_nc_name_ops_t));
+
+ nc_name_impl->nc_name.ops->free = woden_nc_name_free;
+ nc_name_impl->nc_name.ops->is_valid = woden_nc_name_is_valid;
+ nc_name_impl->nc_name.ops->set_value = woden_nc_name_set_value;
+ nc_name_impl->nc_name.ops->to_string = woden_nc_name_to_string;
+
+ woden_nc_name_set_value(&(nc_name_impl->nc_name), env, value);
+
+ return &(nc_name_impl->nc_name);
+}
+
+axis2_status_t AXIS2_CALL
+woden_nc_name_free(
+ void *nc_name,
+ const axis2_env_t *env)
+{
+ woden_nc_name_impl_t *nc_name_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ nc_name_impl = INTF_TO_IMPL(nc_name);
+
+ if(nc_name_impl->f_value)
+ {
+ AXIS2_FREE(env->allocator, nc_name_impl->f_value);
+ nc_name_impl->f_value = NULL;
+ }
+
+ if((&(nc_name_impl->nc_name))->ops)
+ {
+ AXIS2_FREE(env->allocator, (&(nc_name_impl->nc_name))->ops);
+ (&(nc_name_impl->nc_name))->ops = NULL;
+ }
+
+ if(nc_name_impl)
+ {
+ AXIS2_FREE(env->allocator, nc_name_impl);
+ nc_name_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_bool_t AXIS2_CALL
+woden_nc_name_is_valid(
+ void *nc_name,
+ const axis2_env_t *env,
+ axis2_char_t *st_value)
+{
+ woden_nc_name_impl_t *nc_name_impl = NULL;
+ int scan = 0;
+ axis2_bool_t b_valid = AXIS2_TRUE;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ nc_name_impl = INTF_TO_IMPL(nc_name);
+
+ for (scan=0; scan < AXIS2_STRLEN(st_value); scan++)
+ {
+ if (scan == 0)
+ b_valid = woden_xml_char_is_nc_name_start (st_value[scan]);
+ else
+ b_valid = woden_xml_char_is_nc_name(st_value[scan]);
+ if (b_valid == AXIS2_FALSE)
+ break;
+ }
+ return b_valid;
+}
+
+axis2_status_t AXIS2_CALL
+woden_nc_name_set_value(
+ void *nc_name,
+ const axis2_env_t *env,
+ axis2_char_t *value)
+{
+ woden_nc_name_impl_t *nc_name_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ nc_name_impl = INTF_TO_IMPL(nc_name);
+
+ if(AXIS2_TRUE != woden_nc_name_is_valid(nc_name, env, value))
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_STRING_DOES_NOT_REPRESENT_A_VALID_NC_NAME,
+ AXIS2_FAILURE);
+ }
+ if(nc_name_impl->f_value)
+ {
+ AXIS2_FREE(env->allocator, nc_name_impl->f_value);
+ nc_name_impl->f_value = NULL;
+ }
+ nc_name_impl->f_value = AXIS2_STRDUP(value, env);
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_char_t *AXIS2_CALL
+woden_nc_name_to_string(
+ void *nc_name,
+ const axis2_env_t *env)
+{
+ woden_nc_name_impl_t *nc_name_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ nc_name_impl = INTF_TO_IMPL(nc_name);
+
+ return nc_name_impl->f_value;
+}
+
Added: webservices/axis2/trunk/c/woden/src/types/xml_char.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/types/xml_char.c?rev=419452&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/types/xml_char.c (added)
+++ webservices/axis2/trunk/c/woden/src/types/xml_char.c Wed Jul 5 23:02:19 2006
@@ -0,0 +1,524 @@
+/*
+ * 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 <woden_xml_char.h>
+
+/** Character flags. */
+static axis2_char_t CHARS[1 << 16];
+
+/** Valid character mask. */
+static int MASK_VALID = 0x01;
+
+/** Space character mask. */
+static int MASK_SPACE = 0x02;
+
+/** Name start character mask. */
+static int MASK_NAME_START = 0x04;
+
+/** Name character mask. */
+static int MASK_NAME = 0x08;
+
+/** Pubid character mask. */
+static int MASK_PUBID = 0x10;
+
+/**
+ * Content character mask. Special characters are those that can
+ * be considered the start of markup, such as '<' and '&'.
+ * The various newline characters are considered special as well.
+ * All other valid XML characters can be considered content.
+ * <p>
+ * This is an optimization for the inner loop of character scanning.
+ */
+static int MASK_CONTENT = 0x20;
+
+/** NCName start character mask. */
+static int MASK_NCNAME_START = 0x40;
+
+/** NCName character mask. */
+static int MASK_NCNAME = 0x80;
+
+/*
+ *
+ * [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] |
+ * [#xE000-#xFFFD] | [#x10000-#x10FFFF]
+ *
+ */
+static int char_range_len = 8;
+static int char_range[] = {
+ 0x0009, 0x000A, 0x000D, 0x000D, 0x0020, 0xD7FF, 0xE000, 0xFFFD,
+};
+
+/*
+ *
+ * [3] S ::= (#x20 | #x9 | #xD | #xA)+
+ *
+ */
+static int space_char_len = 4;
+static int space_char[] = {
+ 0x0020, 0x0009, 0x000D, 0x000A,
+};
+
+/*
+ * [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
+ * CombiningChar | Extender
+ */
+static int name_char_len = 2;
+static int name_char[] = {
+ 0x002D, 0x002E, /* '-' and '.' */
+};
+
+/*
+ * [5] Name ::= (Letter | '_' | ':') (NameChar)*
+ */
+static int name_start_char_len = 2;
+static int name_start_char[] = {
+ 0x003A, 0x005F, /* ':' and '_' */
+};
+
+/*
+ * [13] PubidChar ::= #x20 | 0xD | 0xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
+ */
+static int pubid_char_len = 9;
+static int pubid_char[] = {
+ 0x000A, 0x000D, 0x0020, 0x0021, 0x0023, 0x0024, 0x0025, 0x003D,
+ 0x005F
+};
+
+static int pubid_range_len = 6;
+static int pubid_range[] = {
+ 0x0027, 0x003B, 0x003F, 0x005A, 0x0061, 0x007A
+};
+
+/*
+ * [84] Letter ::= BaseChar | Ideographic
+ */
+static int letter_range_len = 298;
+static int letter_range[] = {
+ /* BaseChar */
+ 0x0041, 0x005A, 0x0061, 0x007A, 0x00C0, 0x00D6, 0x00D8, 0x00F6,
+ 0x00F8, 0x0131, 0x0134, 0x013E, 0x0141, 0x0148, 0x014A, 0x017E,
+ 0x0180, 0x01C3, 0x01CD, 0x01F0, 0x01F4, 0x01F5, 0x01FA, 0x0217,
+ 0x0250, 0x02A8, 0x02BB, 0x02C1, 0x0388, 0x038A, 0x038E, 0x03A1,
+ 0x03A3, 0x03CE, 0x03D0, 0x03D6, 0x03E2, 0x03F3, 0x0401, 0x040C,
+ 0x040E, 0x044F, 0x0451, 0x045C, 0x045E, 0x0481, 0x0490, 0x04C4,
+ 0x04C7, 0x04C8, 0x04CB, 0x04CC, 0x04D0, 0x04EB, 0x04EE, 0x04F5,
+ 0x04F8, 0x04F9, 0x0531, 0x0556, 0x0561, 0x0586, 0x05D0, 0x05EA,
+ 0x05F0, 0x05F2, 0x0621, 0x063A, 0x0641, 0x064A, 0x0671, 0x06B7,
+ 0x06BA, 0x06BE, 0x06C0, 0x06CE, 0x06D0, 0x06D3, 0x06E5, 0x06E6,
+ 0x0905, 0x0939, 0x0958, 0x0961, 0x0985, 0x098C, 0x098F, 0x0990,
+ 0x0993, 0x09A8, 0x09AA, 0x09B0, 0x09B6, 0x09B9, 0x09DC, 0x09DD,
+ 0x09DF, 0x09E1, 0x09F0, 0x09F1, 0x0A05, 0x0A0A, 0x0A0F, 0x0A10,
+ 0x0A13, 0x0A28, 0x0A2A, 0x0A30, 0x0A32, 0x0A33, 0x0A35, 0x0A36,
+ 0x0A38, 0x0A39, 0x0A59, 0x0A5C, 0x0A72, 0x0A74, 0x0A85, 0x0A8B,
+ 0x0A8F, 0x0A91, 0x0A93, 0x0AA8, 0x0AAA, 0x0AB0, 0x0AB2, 0x0AB3,
+ 0x0AB5, 0x0AB9, 0x0B05, 0x0B0C, 0x0B0F, 0x0B10, 0x0B13, 0x0B28,
+ 0x0B2A, 0x0B30, 0x0B32, 0x0B33, 0x0B36, 0x0B39, 0x0B5C, 0x0B5D,
+ 0x0B5F, 0x0B61, 0x0B85, 0x0B8A, 0x0B8E, 0x0B90, 0x0B92, 0x0B95,
+ 0x0B99, 0x0B9A, 0x0B9E, 0x0B9F, 0x0BA3, 0x0BA4, 0x0BA8, 0x0BAA,
+ 0x0BAE, 0x0BB5, 0x0BB7, 0x0BB9, 0x0C05, 0x0C0C, 0x0C0E, 0x0C10,
+ 0x0C12, 0x0C28, 0x0C2A, 0x0C33, 0x0C35, 0x0C39, 0x0C60, 0x0C61,
+ 0x0C85, 0x0C8C, 0x0C8E, 0x0C90, 0x0C92, 0x0CA8, 0x0CAA, 0x0CB3,
+ 0x0CB5, 0x0CB9, 0x0CE0, 0x0CE1, 0x0D05, 0x0D0C, 0x0D0E, 0x0D10,
+ 0x0D12, 0x0D28, 0x0D2A, 0x0D39, 0x0D60, 0x0D61, 0x0E01, 0x0E2E,
+ 0x0E32, 0x0E33, 0x0E40, 0x0E45, 0x0E81, 0x0E82, 0x0E87, 0x0E88,
+ 0x0E94, 0x0E97, 0x0E99, 0x0E9F, 0x0EA1, 0x0EA3, 0x0EAA, 0x0EAB,
+ 0x0EAD, 0x0EAE, 0x0EB2, 0x0EB3, 0x0EC0, 0x0EC4, 0x0F40, 0x0F47,
+ 0x0F49, 0x0F69, 0x10A0, 0x10C5, 0x10D0, 0x10F6, 0x1102, 0x1103,
+ 0x1105, 0x1107, 0x110B, 0x110C, 0x110E, 0x1112, 0x1154, 0x1155,
+ 0x115F, 0x1161, 0x116D, 0x116E, 0x1172, 0x1173, 0x11AE, 0x11AF,
+ 0x11B7, 0x11B8, 0x11BC, 0x11C2, 0x1E00, 0x1E9B, 0x1EA0, 0x1EF9,
+ 0x1F00, 0x1F15, 0x1F18, 0x1F1D, 0x1F20, 0x1F45, 0x1F48, 0x1F4D,
+ 0x1F50, 0x1F57, 0x1F5F, 0x1F7D, 0x1F80, 0x1FB4, 0x1FB6, 0x1FBC,
+ 0x1FC2, 0x1FC4, 0x1FC6, 0x1FCC, 0x1FD0, 0x1FD3, 0x1FD6, 0x1FDB,
+ 0x1FE0, 0x1FEC, 0x1FF2, 0x1FF4, 0x1FF6, 0x1FFC, 0x212A, 0x212B,
+ 0x2180, 0x2182, 0x3041, 0x3094, 0x30A1, 0x30FA, 0x3105, 0x312C,
+ 0xAC00, 0xD7A3,
+ /* Ideographic */
+ 0x3021, 0x3029, 0x4E00, 0x9FA5,
+};
+
+static int letter_char_len = 52;
+static int letter_char[] = {
+ /* BaseChar */
+ 0x0386, 0x038C, 0x03DA, 0x03DC, 0x03DE, 0x03E0, 0x0559, 0x06D5,
+ 0x093D, 0x09B2, 0x0A5E, 0x0A8D, 0x0ABD, 0x0AE0, 0x0B3D, 0x0B9C,
+ 0x0CDE, 0x0E30, 0x0E84, 0x0E8A, 0x0E8D, 0x0EA5, 0x0EA7, 0x0EB0,
+ 0x0EBD, 0x1100, 0x1109, 0x113C, 0x113E, 0x1140, 0x114C, 0x114E,
+ 0x1150, 0x1159, 0x1163, 0x1165, 0x1167, 0x1169, 0x1175, 0x119E,
+ 0x11A8, 0x11AB, 0x11BA, 0x11EB, 0x11F0, 0x11F9, 0x1F59, 0x1F5B,
+ 0x1F5D, 0x1FBE, 0x2126, 0x212E,
+ /* Ideographic */
+ 0x3007,
+};
+
+/*
+ * [87] CombiningChar ::= ...
+ */
+static int combining_char_range_len = 130;
+static int combining_char_range[] = {
+ 0x0300, 0x0345, 0x0360, 0x0361, 0x0483, 0x0486, 0x0591, 0x05A1,
+ 0x05A3, 0x05B9, 0x05BB, 0x05BD, 0x05C1, 0x05C2, 0x064B, 0x0652,
+ 0x06D6, 0x06DC, 0x06DD, 0x06DF, 0x06E0, 0x06E4, 0x06E7, 0x06E8,
+ 0x06EA, 0x06ED, 0x0901, 0x0903, 0x093E, 0x094C, 0x0951, 0x0954,
+ 0x0962, 0x0963, 0x0981, 0x0983, 0x09C0, 0x09C4, 0x09C7, 0x09C8,
+ 0x09CB, 0x09CD, 0x09E2, 0x09E3, 0x0A40, 0x0A42, 0x0A47, 0x0A48,
+ 0x0A4B, 0x0A4D, 0x0A70, 0x0A71, 0x0A81, 0x0A83, 0x0ABE, 0x0AC5,
+ 0x0AC7, 0x0AC9, 0x0ACB, 0x0ACD, 0x0B01, 0x0B03, 0x0B3E, 0x0B43,
+ 0x0B47, 0x0B48, 0x0B4B, 0x0B4D, 0x0B56, 0x0B57, 0x0B82, 0x0B83,
+ 0x0BBE, 0x0BC2, 0x0BC6, 0x0BC8, 0x0BCA, 0x0BCD, 0x0C01, 0x0C03,
+ 0x0C3E, 0x0C44, 0x0C46, 0x0C48, 0x0C4A, 0x0C4D, 0x0C55, 0x0C56,
+ 0x0C82, 0x0C83, 0x0CBE, 0x0CC4, 0x0CC6, 0x0CC8, 0x0CCA, 0x0CCD,
+ 0x0CD5, 0x0CD6, 0x0D02, 0x0D03, 0x0D3E, 0x0D43, 0x0D46, 0x0D48,
+ 0x0D4A, 0x0D4D, 0x0E34, 0x0E3A, 0x0E47, 0x0E4E, 0x0EB4, 0x0EB9,
+ 0x0EBB, 0x0EBC, 0x0EC8, 0x0ECD, 0x0F18, 0x0F19, 0x0F71, 0x0F84,
+ 0x0F86, 0x0F8B, 0x0F90, 0x0F95, 0x0F99, 0x0FAD, 0x0FB1, 0x0FB7,
+ 0x20D0, 0x20DC, 0x302A, 0x302F,
+};
+
+static int combining_char_char_len = 29;
+static int combining_char_char[] = {
+ 0x05BF, 0x05C4, 0x0670, 0x093C, 0x094D, 0x09BC, 0x09BE, 0x09BF,
+ 0x09D7, 0x0A02, 0x0A3C, 0x0A3E, 0x0A3F, 0x0ABC, 0x0B3C, 0x0BD7,
+ 0x0D57, 0x0E31, 0x0EB1, 0x0F35, 0x0F37, 0x0F39, 0x0F3E, 0x0F3F,
+ 0x0F97, 0x0FB9, 0x20E1, 0x3099, 0x309A,
+};
+
+/*
+ * [88] Digit ::= ...
+ */
+static int digit_range_len = 30;
+static int digit_range[] = {
+ 0x0030, 0x0039, 0x0660, 0x0669, 0x06F0, 0x06F9, 0x0966, 0x096F,
+ 0x09E6, 0x09EF, 0x0A66, 0x0A6F, 0x0AE6, 0x0AEF, 0x0B66, 0x0B6F,
+ 0x0BE7, 0x0BEF, 0x0C66, 0x0C6F, 0x0CE6, 0x0CEF, 0x0D66, 0x0D6F,
+ 0x0E50, 0x0E59, 0x0ED0, 0x0ED9, 0x0F20, 0x0F29,
+};
+
+/*
+ * [89] Extender ::= ...
+ */
+static int extender_range_len = 6;
+static int extender_range[] = {
+ 0x3031, 0x3035, 0x309D, 0x309E, 0x30FC, 0x30FE,
+};
+
+static int extender_char_len = 8;
+static int extender_char[] = {
+ 0x00B7, 0x02D0, 0x02D1, 0x0387, 0x0640, 0x0E46, 0x0EC6, 0x3005,
+};
+
+/*
+ * SpecialChar ::= '<', '&', '\n', '\r', ']'
+ */
+static int special_char_len = 5;
+static int special_char[] = {
+ '<', '&', '\n', '\r', ']',
+};
+
+/*
+ * Initialize
+ */
+axis2_status_t AXIS2_CALL
+woden_xml_char_init()
+{
+ int i = 0;
+ int j = 0;
+
+ /* set valid characters */
+ for (i = 0; i < char_range_len; i += 2)
+ {
+ for (j = char_range[i]; j <= char_range[i + 1]; j++)
+ {
+ CHARS[j] |= MASK_VALID | MASK_CONTENT;
+ }
+ }
+
+ /* remove special characters */
+ for (i = 0; i < special_char_len; i++)
+ {
+ CHARS[special_char[i]] = (char)(CHARS[special_char[i]] & ~MASK_CONTENT);
+ }
+
+ /* set space characters */
+ for (i = 0; i < space_char_len; i++)
+ {
+ CHARS[space_char[i]] |= MASK_SPACE;
+ }
+
+ /* set name start characters */
+ for (i = 0; i < name_start_char_len; i++)
+ {
+ CHARS[name_start_char[i]] |= MASK_NAME_START | MASK_NAME |
+ MASK_NCNAME_START | MASK_NCNAME;
+ }
+ for (i = 0; i < letter_range_len; i += 2)
+ {
+ for (j = letter_range[i]; j <= letter_range[i + 1]; j++)
+ {
+ CHARS[j] |= MASK_NAME_START | MASK_NAME |
+ MASK_NCNAME_START | MASK_NCNAME;
+ }
+ }
+ for (i = 0; i < letter_char_len; i++)
+ {
+ CHARS[letter_char[i]] |= MASK_NAME_START | MASK_NAME |
+ MASK_NCNAME_START | MASK_NCNAME;
+ }
+
+ /* set name characters */
+ for (i = 0; i < name_char_len; i++)
+ {
+ CHARS[name_char[i]] |= MASK_NAME | MASK_NCNAME;
+ }
+ for (i = 0; i < digit_range_len; i += 2)
+ {
+ for (j = digit_range[i]; j <= digit_range[i + 1]; j++)
+ {
+ CHARS[j] |= MASK_NAME | MASK_NCNAME;
+ }
+ }
+ for (i = 0; i < combining_char_range_len; i += 2)
+ {
+ for (j = combining_char_range[i]; j <= combining_char_range[i + 1]; j++)
+ {
+ CHARS[j] |= MASK_NAME | MASK_NCNAME;
+ }
+ }
+ for (i = 0; i < combining_char_char_len; i++)
+ {
+ CHARS[combining_char_char[i]] |= MASK_NAME | MASK_NCNAME;
+ }
+ for (i = 0; i < extender_range_len; i += 2)
+ {
+ for (j = extender_range[i]; j <= extender_range[i + 1]; j++)
+ {
+ CHARS[j] |= MASK_NAME | MASK_NCNAME;
+ }
+ }
+ for (i = 0; i < extender_char_len; i++)
+ {
+ CHARS[extender_char[i]] |= MASK_NAME | MASK_NCNAME;
+ }
+
+ /* remove ':' from allowable MASK_NCNAME_START and MASK_NCNAME chars */
+ CHARS[':'] &= ~(MASK_NCNAME_START | MASK_NCNAME);
+
+ /* set Pubid characters */
+ for (i = 0; i < pubid_char_len; i++)
+ {
+ CHARS[pubid_char[i]] |= MASK_PUBID;
+ }
+ for (i = 0; i < pubid_range_len; i += 2)
+ {
+ for (j = pubid_range[i]; j <= pubid_range[i + 1]; j++)
+ {
+ CHARS[j] |= MASK_PUBID;
+ }
+ }
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_supplemental(
+ int c)
+{
+ return (c >= 0x10000 && c <= 0x10FFFF);
+}
+
+int AXIS2_CALL
+woden_xml_char_supplemental(
+ char h,
+ char l)
+{
+ return (h - 0xD800) * 0x400 + (l - 0xDC00) + 0x10000;
+}
+
+axis2_char_t AXIS2_CALL
+woden_xml_char_high_surrogate(
+ int c)
+{
+ return (char) (((c - 0x00010000) >> 10) + 0xD800);
+}
+
+axis2_char_t AXIS2_CALL
+woden_xml_char_low_surrogate(
+ int c)
+{
+ return (char) (((c - 0x00010000) & 0x3FF) + 0xDC00);
+}
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_high_surrogate(
+ int c)
+{
+ return (0xD800 <= c && c <= 0xDBFF);
+}
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_low_surrogate(
+ int c)
+{
+ return (0xDC00 <= c && c <= 0xDFFF);
+}
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_valid(
+ int c)
+{
+ return (c < 0x10000 && (CHARS[c] & MASK_VALID) != 0) ||
+ (0x10000 <= c && c <= 0x10FFFF);
+}
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_invalid(
+ int c)
+{
+ return !woden_xml_char_is_valid(c);
+}
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_content(
+ int c)
+{
+ return (c < 0x10000 && (CHARS[c] & MASK_CONTENT) != 0) ||
+ (0x10000 <= c && c <= 0x10FFFF);
+}
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_markup(
+ int c)
+{
+ return c == '<' || c == '&' || c == '%';
+}
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_space(
+ int c)
+{
+ return c < 0x10000 && (CHARS[c] & MASK_SPACE) != 0;
+}
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_xml11_space(
+ int c)
+{
+ return (c < 0x10000 && (CHARS[c] & MASK_SPACE) != 0) ||
+ c == 0x85 || c == 0x2028;
+}
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_name_start(
+ int c)
+{
+ return c < 0x10000 && (CHARS[c] & MASK_NAME_START) != 0;
+}
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_name(
+ int c)
+{
+ return c < 0x10000 && (CHARS[c] & MASK_NAME) != 0;
+}
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_nc_name_start(
+ int c)
+{
+ return c < 0x10000 && (CHARS[c] & MASK_NCNAME_START) != 0;
+}
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_nc_name(
+ int c)
+{
+ return c < 0x10000 && (CHARS[c] & MASK_NCNAME) != 0;
+}
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_pubid(
+ int c)
+{
+ return c < 0x10000 && (CHARS[c] & MASK_PUBID) != 0;
+}
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_valid_name(
+ axis2_char_t *name)
+{
+ axis2_char_t ch = 0;
+ int i = 0;
+
+ if (AXIS2_STRLEN(name) == 0)
+ return AXIS2_FALSE;
+ ch = name[0];
+ if( woden_xml_char_is_name_start(ch) == AXIS2_FALSE)
+ return AXIS2_FALSE;
+ for (i = 1; i < AXIS2_STRLEN(name); i++ )
+ {
+ ch = name[i];
+ if( woden_xml_char_is_name( ch ) == AXIS2_FALSE )
+ {
+ return AXIS2_FALSE;
+ }
+ }
+ return AXIS2_TRUE;
+}
+
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_valid_nc_name(
+ axis2_char_t * nc_name)
+{
+ axis2_char_t ch = 0;
+ int i = 0;
+
+ if (AXIS2_STRLEN(nc_name) == 0)
+ return AXIS2_FALSE;
+ ch = nc_name[0];
+ if( woden_xml_char_is_nc_name_start(ch) == AXIS2_FALSE)
+ return AXIS2_FALSE;
+ for (i = 1; i < AXIS2_STRLEN(nc_name); i++ )
+ {
+ ch = nc_name[i];
+ if( woden_xml_char_is_nc_name( ch ) == AXIS2_FALSE )
+ {
+ return AXIS2_FALSE;
+ }
+ }
+ return AXIS2_TRUE;
+}
+
+axis2_bool_t AXIS2_CALL
+woden_xml_char_is_valid_nmtoken(
+ axis2_char_t * nmtoken)
+{
+ axis2_char_t ch = 0;
+ int i = 0;
+
+ if (AXIS2_STRLEN(nmtoken) == 0)
+ return AXIS2_FALSE;
+ for (i = 0; i < AXIS2_STRLEN(nmtoken); i++ )
+ {
+ ch = nmtoken[i];
+ if( ! woden_xml_char_is_name( ch ) )
+ {
+ return AXIS2_FALSE;
+ }
+ }
+ return AXIS2_TRUE;
+}
+
Added: webservices/axis2/trunk/c/woden/src/util/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/util/Makefile.am?rev=419452&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/util/Makefile.am (added)
+++ webservices/axis2/trunk/c/woden/src/util/Makefile.am Wed Jul 5 23:02:19 2006
@@ -0,0 +1,14 @@
+TESTS =
+noinst_LTLIBRARIES = libwoden_util.la
+
+libwoden_util_la_SOURCES = \
+ qname_util.c \
+ woden_om_util.c
+
+INCLUDES = -I$(top_builddir)/include \
+ @AXIOMINC@ \
+ @UTILINC@ \
+ @XMLSCHEMAINC@
+
+EXTRA_DIST = woden_component_model_builder.h woden_om_util.h
+
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org