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 na...@apache.org on 2006/09/27 14:39:32 UTC
svn commit: r450420 [1/2] -
/webservices/axis2/trunk/c/tools/codegen/src/util/
Author: nandika
Date: Wed Sep 27 05:39:31 2006
New Revision: 450420
URL: http://svn.apache.org/viewvc?view=rev&rev=450420
Log:
changes to commit schema generator by dimuthu
Modified:
webservices/axis2/trunk/c/tools/codegen/src/util/class_loader.c
webservices/axis2/trunk/c/tools/codegen/src/util/cmdline_option.c
webservices/axis2/trunk/c/tools/codegen/src/util/cmdline_option_parser.c
webservices/axis2/trunk/c/tools/codegen/src/util/cmdline_option_validator.c
webservices/axis2/trunk/c/tools/codegen/src/util/codegen-config.properties
webservices/axis2/trunk/c/tools/codegen/src/util/config_property_loader.c
webservices/axis2/trunk/c/tools/codegen/src/util/cqname2name_maker.c
webservices/axis2/trunk/c/tools/codegen/src/util/file_writer.c
webservices/axis2/trunk/c/tools/codegen/src/util/messages.c
webservices/axis2/trunk/c/tools/codegen/src/util/properties.c
webservices/axis2/trunk/c/tools/codegen/src/util/resource.properties
webservices/axis2/trunk/c/tools/codegen/src/util/string.c
webservices/axis2/trunk/c/tools/codegen/src/util/typemapper.c
webservices/axis2/trunk/c/tools/codegen/src/util/url_processor.c
webservices/axis2/trunk/c/tools/codegen/src/util/xslt_template_processor.c
webservices/axis2/trunk/c/tools/codegen/src/util/xslt_utils.c
Modified: webservices/axis2/trunk/c/tools/codegen/src/util/class_loader.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/tools/codegen/src/util/class_loader.c?view=diff&rev=450420&r1=450419&r2=450420
==============================================================================
--- webservices/axis2/trunk/c/tools/codegen/src/util/class_loader.c (original)
+++ webservices/axis2/trunk/c/tools/codegen/src/util/class_loader.c Wed Sep 27 05:39:31 2006
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
#include <axis2_class_loader.h>
#include <w2c_class_loader.h>
#include <w2c_string.h>
@@ -21,10 +21,10 @@
AXIS2_EXTERN void* AXIS2_CALL
w2c_class_loader_get_object_from_class_name
-(const axis2_env_t *env,
- char *class_name,
- axis2_char_t *inter_path,
- axis2_dll_desc_t **pdll_desc)
+ (const axis2_env_t *env,
+ char *class_name,
+ axis2_char_t *inter_path,
+ axis2_dll_desc_t **pdll_desc)
{
axis2_char_t *dll_name = NULL;
axis2_dll_desc_t *dll_desc = NULL;
@@ -36,20 +36,20 @@
AXIS2_PARAM_CHECK(env->error, class_name, AXIS2_FAILURE);
file_path = getenv("AXIS2C_HOME");
- file_path = AXIS2_STRDUP(file_path, env);
+ file_path = AXIS2_STRDUP( file_path, env);
dll_desc = axis2_dll_desc_create(env);
*pdll_desc = dll_desc;
- dll_name =
- AXIS2_DLL_DESC_CREATE_PLATFORM_SPECIFIC_DLL_NAME(
- dll_desc, env, class_name);
- if (NULL == dll_name)
+ dll_name=
+ AXIS2_DLL_DESC_CREATE_PLATFORM_SPECIFIC_DLL_NAME(
+ dll_desc, env, class_name );
+ if ( NULL == dll_name )
{
- w2c_messages_print_n_log_error(env, "utils.classloadFailed");
+ w2c_messages_print_n_log_error ( env, "utils.classloadFailed");
return NULL;
}
- file_path = w2c_string_add_string(file_path, inter_path, env);
- file_path = w2c_string_add_string(file_path, dll_name, env);
+ file_path = w2c_string_add_string(file_path, inter_path, env );
+ file_path = w2c_string_add_string(file_path, dll_name, env );
AXIS2_DLL_DESC_SET_NAME(dll_desc, env, file_path);
AXIS2_DLL_DESC_SET_TYPE(dll_desc, env, -1); /* not a standard type */
@@ -60,14 +60,14 @@
axis2_class_loader_init(env);
obj = axis2_class_loader_create_dll(env, impl_info_param);
- AXIS2_FREE(env->allocator, file_path);
+ AXIS2_FREE ( env->allocator, file_path);
return obj;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
w2c_class_loader_free_loaded_class(
- const axis2_env_t *env,
- axis2_dll_desc_t *dll_desc)
+ const axis2_env_t *env,
+ axis2_dll_desc_t *dll_desc )
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, dll_desc, AXIS2_FAILURE);
Modified: webservices/axis2/trunk/c/tools/codegen/src/util/cmdline_option.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/tools/codegen/src/util/cmdline_option.c?view=diff&rev=450420&r1=450419&r2=450420
==============================================================================
--- webservices/axis2/trunk/c/tools/codegen/src/util/cmdline_option.c (original)
+++ webservices/axis2/trunk/c/tools/codegen/src/util/cmdline_option.c Wed Sep 27 05:39:31 2006
@@ -13,112 +13,111 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
#include <w2c_cmdline_option.h>
#include <w2c_cmdline_option_consts.h>
#include <axis2_array_list.h>
#include <axis2_string.h>
#include <w2c_string.h>
-/**
+/**
* @brief
*/
typedef struct w2c_cmdline_option_impl
{
w2c_cmdline_option_t cmdline_option;
-
+
axis2_char_t *type;
axis2_array_list_t *values_arr;
-
-}
-w2c_cmdline_option_impl_t;
+
+} w2c_cmdline_option_impl_t;
#define W2C_INTF_TO_IMPL(cmdline_option) \
((w2c_cmdline_option_impl_t *) cmdline_option)
/************************* Function prototypes ********************************/
-axis2_status_t AXIS2_CALL
-w2c_cmdline_option_free(w2c_cmdline_option_t *cmdline_option,
- const axis2_env_t *env);
+axis2_status_t AXIS2_CALL
+w2c_cmdline_option_free (w2c_cmdline_option_t *cmdline_option,
+ const axis2_env_t *env);
-axis2_char_t*
+axis2_char_t*
w2c_cmdline_option_get_type(w2c_cmdline_option_t *cmdline_option,
- const axis2_env_t *env);
+ const axis2_env_t *env);
axis2_char_t* AXIS2_CALL
w2c_cmdline_option_get_value(w2c_cmdline_option_t *cmdline_option,
- const axis2_env_t *env);
+ const axis2_env_t *env);
axis2_array_list_t* AXIS2_CALL
w2c_cmdline_option_get_values(w2c_cmdline_option_t *cmdline_option,
- const axis2_env_t *env);
+ const axis2_env_t *env);
/* internal functions */
axis2_char_t*
w2c_cmdline_option_set_type(
- w2c_cmdline_option_impl_t *cmdline_option_impl,
- const axis2_env_t *env,
- axis2_char_t *type);
+ w2c_cmdline_option_impl_t *cmdline_option_impl,
+ const axis2_env_t *env,
+ axis2_char_t *type );
/************************** End of function prototypes ************************/
-AXIS2_EXTERN w2c_cmdline_option_t * AXIS2_CALL
-w2c_cmdline_option_create(const axis2_env_t *env)
+AXIS2_EXTERN w2c_cmdline_option_t * AXIS2_CALL
+w2c_cmdline_option_create (const axis2_env_t *env)
{
w2c_cmdline_option_impl_t *cmdline_option_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
cmdline_option_impl = (w2c_cmdline_option_impl_t *) AXIS2_MALLOC(env->
- allocator, sizeof(w2c_cmdline_option_impl_t));
+ allocator, sizeof(w2c_cmdline_option_impl_t));
- if (NULL == cmdline_option_impl)
+ if(NULL == cmdline_option_impl)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
cmdline_option_impl->type = NULL;
cmdline_option_impl->values_arr = NULL;
-
- cmdline_option_impl->cmdline_option.ops =
- AXIS2_MALLOC(env->allocator, sizeof(w2c_cmdline_option_ops_t));
- if (NULL == cmdline_option_impl->cmdline_option.ops)
+
+ cmdline_option_impl->cmdline_option.ops =
+ AXIS2_MALLOC (env->allocator, sizeof(w2c_cmdline_option_ops_t));
+ if(NULL == cmdline_option_impl->cmdline_option.ops)
{
w2c_cmdline_option_free(&(cmdline_option_impl->cmdline_option), env);
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
-
+
cmdline_option_impl->cmdline_option.ops->free = w2c_cmdline_option_free;
cmdline_option_impl->cmdline_option.ops->get_type =
- w2c_cmdline_option_get_type;
+ w2c_cmdline_option_get_type;
cmdline_option_impl->cmdline_option.ops->get_value =
- w2c_cmdline_option_get_value;
- cmdline_option_impl->cmdline_option.ops->get_values =
- w2c_cmdline_option_get_values;
+ w2c_cmdline_option_get_value;
+ cmdline_option_impl->cmdline_option.ops->get_values =
+ w2c_cmdline_option_get_values;
return &(cmdline_option_impl->cmdline_option);
}
-AXIS2_EXTERN w2c_cmdline_option_t * AXIS2_CALL
-w2c_cmdline_option_create_with_values(const axis2_env_t *env,
- axis2_char_t *type,
- axis2_array_list_t *values_arr)
+AXIS2_EXTERN w2c_cmdline_option_t * AXIS2_CALL
+w2c_cmdline_option_create_with_values (const axis2_env_t *env,
+ axis2_char_t *type,
+ axis2_array_list_t *values_arr)
{
w2c_cmdline_option_impl_t *cmdline_option_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, type, NULL);
-
+
cmdline_option_impl = (w2c_cmdline_option_impl_t *) w2c_cmdline_option_create(env);
- if (!cmdline_option_impl)
+ if(!cmdline_option_impl)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
+ return NULL;
}
/* populate data */
- w2c_cmdline_option_set_type(cmdline_option_impl ,
- env, (axis2_char_t*)AXIS2_STRDUP(type, env));
+ w2c_cmdline_option_set_type( cmdline_option_impl ,
+ env, (axis2_char_t*)AXIS2_STRDUP(type, env));
cmdline_option_impl-> values_arr = values_arr;
return &(cmdline_option_impl->cmdline_option);
@@ -126,122 +125,122 @@
/***************************Function implementation****************************/
-axis2_status_t AXIS2_CALL
-w2c_cmdline_option_free(w2c_cmdline_option_t *cmdline_option,
- const axis2_env_t *env)
+axis2_status_t AXIS2_CALL
+w2c_cmdline_option_free (w2c_cmdline_option_t *cmdline_option,
+ const axis2_env_t *env)
{
w2c_cmdline_option_impl_t *cmdline_option_impl = NULL;
int i = 0;
- int size = 0;
+ int size= 0;
axis2_char_t *value = NULL;
-
+
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
+
cmdline_option_impl = W2C_INTF_TO_IMPL(cmdline_option);
-
+
if (cmdline_option_impl-> type)
{
- AXIS2_FREE(env-> allocator, cmdline_option_impl-> type);
+ AXIS2_FREE (env-> allocator, cmdline_option_impl-> type);
}
- if (cmdline_option_impl-> values_arr)
+ if( cmdline_option_impl-> values_arr )
{
- size = AXIS2_ARRAY_LIST_SIZE(cmdline_option_impl-> values_arr, env);
- for (i = 0; i < size; i++)
+ size = AXIS2_ARRAY_LIST_SIZE ( cmdline_option_impl-> values_arr, env );
+ for (i =0; i < size; i++ )
{
- value = AXIS2_ARRAY_LIST_GET(cmdline_option_impl-> values_arr, env, i);
- AXIS2_FREE(env-> allocator, value);
+ value = AXIS2_ARRAY_LIST_GET ( cmdline_option_impl-> values_arr, env, i );
+ AXIS2_FREE ( env-> allocator, value );
}
- AXIS2_ARRAY_LIST_FREE(cmdline_option_impl-> values_arr, env);
+ AXIS2_ARRAY_LIST_FREE ( cmdline_option_impl-> values_arr, env );
}
- if (cmdline_option->ops)
+ if(cmdline_option->ops)
{
AXIS2_FREE(env->allocator, cmdline_option->ops);
cmdline_option->ops = NULL;
}
- if (cmdline_option_impl)
+ if(cmdline_option_impl)
{
AXIS2_FREE(env->allocator, cmdline_option_impl);
cmdline_option_impl = NULL;
}
-
+
return AXIS2_SUCCESS;
}
-axis2_char_t*
+axis2_char_t*
w2c_cmdline_option_get_type(w2c_cmdline_option_t *cmdline_option,
- const axis2_env_t *env)
+ const axis2_env_t *env)
{
w2c_cmdline_option_impl_t *cmdline_option_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
cmdline_option_impl = W2C_INTF_TO_IMPL(cmdline_option);
-
+
return cmdline_option_impl-> type;
-
+
}
axis2_char_t* AXIS2_CALL
w2c_cmdline_option_get_value(w2c_cmdline_option_t *cmdline_option,
- const axis2_env_t *env)
+ const axis2_env_t *env)
{
w2c_cmdline_option_impl_t *cmdline_option_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
cmdline_option_impl = W2C_INTF_TO_IMPL(cmdline_option);
-
- if (cmdline_option_impl-> values_arr &&
- AXIS2_ARRAY_LIST_SIZE(cmdline_option_impl-> values_arr, env) > 0)
- {
- return AXIS2_ARRAY_LIST_GET(cmdline_option_impl-> values_arr, env, 0);
- }
- return NULL;
+
+ if ( cmdline_option_impl-> values_arr &&
+ AXIS2_ARRAY_LIST_SIZE ( cmdline_option_impl-> values_arr, env) > 0)
+ {
+ return AXIS2_ARRAY_LIST_GET (cmdline_option_impl-> values_arr, env, 0);
+ }
+ return NULL;
}
axis2_array_list_t* AXIS2_CALL
w2c_cmdline_option_get_values(w2c_cmdline_option_t *cmdline_option,
- const axis2_env_t *env)
+ const axis2_env_t *env)
{
w2c_cmdline_option_impl_t *cmdline_option_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
cmdline_option_impl = W2C_INTF_TO_IMPL(cmdline_option);
-
+
return cmdline_option_impl-> values_arr;
-
+
}
/* internal functions */
axis2_char_t*
w2c_cmdline_option_set_type(
- w2c_cmdline_option_impl_t *cmdline_option_impl,
- const axis2_env_t *env,
- axis2_char_t *type)
+ w2c_cmdline_option_impl_t *cmdline_option_impl,
+ const axis2_env_t *env,
+ axis2_char_t *type )
{
int index = 0;
-
- index = w2c_string_indexof_cs(type, "--");
- if (index > -1)
+
+ index = w2c_string_indexof_cs ( type, "--" );
+ if ( index > -1 )
{
/* skip -- */
type = (axis2_char_t*)
- axis2_string_substring_starting_at(type, index + 2);
- }
- index = w2c_string_indexof_cs(type, "-");
- if (index > -1)
+ axis2_string_substring_starting_at ( type, index +2 );
+ }
+ index = w2c_string_indexof_cs ( type, "-" );
+ if ( index > -1 )
{
/* skip - */
type = (axis2_char_t*)
- axis2_string_substring_starting_at(type, index + 1);
+ axis2_string_substring_starting_at ( type, index +1 );
}
- index = w2c_string_indexof_cs(type,
- W2C_CMDLINE_OPTION_CONSTS_EXTRA_OPTIONTYPE_PREFIX);
-
- if (index < 0)
+ index = w2c_string_indexof_cs ( type,
+ W2C_CMDLINE_OPTION_CONSTS_EXTRA_OPTIONTYPE_PREFIX );
+
+ if (index < 0 )
{
- type = (axis2_char_t*)axis2_string_tolower(type);
+ type = (axis2_char_t*)axis2_string_tolower( type );
}
cmdline_option_impl-> type = type;
return type;
Modified: webservices/axis2/trunk/c/tools/codegen/src/util/cmdline_option_parser.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/tools/codegen/src/util/cmdline_option_parser.c?view=diff&rev=450420&r1=450419&r2=450420
==============================================================================
--- webservices/axis2/trunk/c/tools/codegen/src/util/cmdline_option_parser.c (original)
+++ webservices/axis2/trunk/c/tools/codegen/src/util/cmdline_option_parser.c Wed Sep 27 05:39:31 2006
@@ -13,211 +13,210 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
#include <w2c_cmdline_option_parser.h>
#include <w2c_cmdline_option_consts.h>
#include <w2c_cmdline_option.h>
#include <w2c_cmdline_option_validator.h>
#include <axis2_string.h>
-/**
+/**
* @brief
*/
typedef struct w2c_cmdline_option_parser_impl
{
w2c_cmdline_option_parser_t cmdline_option_parser;
-
+
axis2_hash_t *hash;
-
-}
-w2c_cmdline_option_parser_impl_t;
+
+} w2c_cmdline_option_parser_impl_t;
#define W2C_INTF_TO_IMPL(cmdline_option_parser) \
((w2c_cmdline_option_parser_impl_t *) cmdline_option_parser)
/************************* Function prototypes ********************************/
-axis2_status_t AXIS2_CALL
-w2c_cmdline_option_parser_free(
- w2c_cmdline_option_parser_t *cmdline_option_parser,
- const axis2_env_t *env);
+axis2_status_t AXIS2_CALL
+w2c_cmdline_option_parser_free (
+ w2c_cmdline_option_parser_t *cmdline_option_parser,
+ const axis2_env_t *env);
axis2_hash_t* AXIS2_CALL
-w2c_cmdline_option_parser_get_options(
- w2c_cmdline_option_parser_t *cmdline_option_parser,
- const axis2_env_t *env);
-
-axis2_array_list_t* AXIS2_CALL
-w2c_cmdline_option_parser_get_invalid_options(
- w2c_cmdline_option_parser_t *cmdline_option_parser,
- const axis2_env_t *env);
+w2c_cmdline_option_parser_get_options (
+ w2c_cmdline_option_parser_t *cmdline_option_parser,
+ const axis2_env_t *env);
+
+axis2_array_list_t* AXIS2_CALL
+w2c_cmdline_option_parser_get_invalid_options (
+ w2c_cmdline_option_parser_t *cmdline_option_parser,
+ const axis2_env_t *env);
/** private method */
void
-w2c_cmdline_option_parser_parse(w2c_cmdline_option_parser_impl_t *parser,
- const axis2_env_t *env,
- int argv, axis2_char_t **argc);
-
+w2c_cmdline_option_parser_parse( w2c_cmdline_option_parser_impl_t *parser,
+ const axis2_env_t *env,
+ int argv, axis2_char_t **argc);
+
/************************** End of function prototypes ************************/
-AXIS2_EXTERN w2c_cmdline_option_parser_t* AXIS2_CALL
-w2c_cmdline_option_parser_create(const axis2_env_t *env,
- int argc,
- axis2_char_t **argv)
+AXIS2_EXTERN w2c_cmdline_option_parser_t* AXIS2_CALL
+w2c_cmdline_option_parser_create (const axis2_env_t *env,
+ int argc,
+ axis2_char_t **argv)
{
w2c_cmdline_option_parser_impl_t *cmdline_option_parser_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
cmdline_option_parser_impl = (w2c_cmdline_option_parser_impl_t *) AXIS2_MALLOC(env->
- allocator, sizeof(w2c_cmdline_option_parser_impl_t));
+ allocator, sizeof(w2c_cmdline_option_parser_impl_t));
- if (NULL == cmdline_option_parser_impl)
+ if(NULL == cmdline_option_parser_impl)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
cmdline_option_parser_impl->hash = NULL;
-
- cmdline_option_parser_impl->cmdline_option_parser.ops =
- AXIS2_MALLOC(env->allocator, sizeof(w2c_cmdline_option_parser_ops_t));
- if (NULL == cmdline_option_parser_impl->cmdline_option_parser.ops)
+
+ cmdline_option_parser_impl->cmdline_option_parser.ops =
+ AXIS2_MALLOC (env->allocator, sizeof(w2c_cmdline_option_parser_ops_t));
+ if(NULL == cmdline_option_parser_impl->cmdline_option_parser.ops)
{
w2c_cmdline_option_parser_free(
- &(cmdline_option_parser_impl->cmdline_option_parser), env);
+ &(cmdline_option_parser_impl->cmdline_option_parser), env);
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
w2c_cmdline_option_parser_parse
- (cmdline_option_parser_impl, env, argc, argv);
+ ( cmdline_option_parser_impl, env, argc, argv );
- cmdline_option_parser_impl->cmdline_option_parser.ops->free =
- w2c_cmdline_option_parser_free;
+ cmdline_option_parser_impl->cmdline_option_parser.ops->free =
+ w2c_cmdline_option_parser_free;
cmdline_option_parser_impl->cmdline_option_parser.ops->get_options =
- w2c_cmdline_option_parser_get_options;
+ w2c_cmdline_option_parser_get_options;
cmdline_option_parser_impl->cmdline_option_parser.ops->get_invalid_options =
- w2c_cmdline_option_parser_get_invalid_options;
+ w2c_cmdline_option_parser_get_invalid_options;
return &(cmdline_option_parser_impl->cmdline_option_parser);
}
/***************************Function implementation****************************/
-axis2_status_t AXIS2_CALL
-w2c_cmdline_option_parser_free(w2c_cmdline_option_parser_t *cmdline_option_parser,
- const axis2_env_t *env)
+axis2_status_t AXIS2_CALL
+w2c_cmdline_option_parser_free (w2c_cmdline_option_parser_t *cmdline_option_parser,
+ const axis2_env_t *env)
{
w2c_cmdline_option_parser_impl_t *cmdline_option_parser_impl = NULL;
axis2_hash_index_t *hi;
w2c_cmdline_option_t *option = NULL;
-
+
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
+
cmdline_option_parser_impl = W2C_INTF_TO_IMPL(cmdline_option_parser);
-
- if (cmdline_option_parser->ops)
+
+ if(cmdline_option_parser->ops)
{
AXIS2_FREE(env->allocator, cmdline_option_parser->ops);
cmdline_option_parser->ops = NULL;
}
-
+
if (cmdline_option_parser_impl-> hash)
{
for (hi = axis2_hash_first(cmdline_option_parser_impl->hash, env); hi;
- hi = axis2_hash_next(env, hi))
+ hi = axis2_hash_next(env, hi))
{
axis2_hash_this(hi, NULL, NULL, (void*)&option);
- W2C_CMDLINE_OPTION_FREE(option, env);
+ W2C_CMDLINE_OPTION_FREE ( option, env );
}
- axis2_hash_free(cmdline_option_parser_impl-> hash, env);
+ axis2_hash_free ( cmdline_option_parser_impl-> hash, env );
}
- if (cmdline_option_parser_impl)
+ if(cmdline_option_parser_impl)
{
AXIS2_FREE(env->allocator, cmdline_option_parser_impl);
cmdline_option_parser_impl = NULL;
}
-
+
return AXIS2_SUCCESS;
}
axis2_hash_t* AXIS2_CALL
-w2c_cmdline_option_parser_get_options(
- w2c_cmdline_option_parser_t *cmdline_option_parser,
- const axis2_env_t *env)
+w2c_cmdline_option_parser_get_options (
+ w2c_cmdline_option_parser_t *cmdline_option_parser,
+ const axis2_env_t *env)
{
w2c_cmdline_option_parser_impl_t *cmdline_option_parser_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
cmdline_option_parser_impl = W2C_INTF_TO_IMPL(cmdline_option_parser);
- return cmdline_option_parser_impl -> hash;
+ return cmdline_option_parser_impl -> hash;
}
axis2_array_list_t* AXIS2_CALL
-w2c_cmdline_option_parser_get_invalid_options(
- w2c_cmdline_option_parser_t *cmdline_option_parser,
- const axis2_env_t *env)
+w2c_cmdline_option_parser_get_invalid_options (
+ w2c_cmdline_option_parser_t *cmdline_option_parser,
+ const axis2_env_t *env)
{
w2c_cmdline_option_parser_impl_t *cmdline_option_parser_impl = NULL;
axis2_array_list_t *invalid_arr = NULL;
axis2_hash_index_t *hi = NULL;
w2c_cmdline_option_t *option = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
cmdline_option_parser_impl = W2C_INTF_TO_IMPL(cmdline_option_parser);
-
- invalid_arr = axis2_array_list_create(env, 1);
-
+
+ invalid_arr = axis2_array_list_create ( env, 1 );
+
for (hi = axis2_hash_first(cmdline_option_parser_impl->hash, env); hi;
- hi = axis2_hash_next(env, hi))
+ hi = axis2_hash_next( env, hi))
{
- axis2_hash_this(hi, NULL, NULL, (void*)&option);
- if (w2c_cmdline_option_validator_isinvalid(env, option))
- {
- AXIS2_ARRAY_LIST_ADD(invalid_arr, env, option);
- }
- }
- return invalid_arr;
+ axis2_hash_this(hi, NULL, NULL, (void*)&option);
+ if (w2c_cmdline_option_validator_isinvalid ( env,option ) )
+ {
+ AXIS2_ARRAY_LIST_ADD ( invalid_arr, env, option );
+ }
+ }
+ return invalid_arr;
}
/** private method */
void
-w2c_cmdline_option_parser_parse(w2c_cmdline_option_parser_impl_t *parser,
- const axis2_env_t *env,
- int argc, axis2_char_t **argv)
+w2c_cmdline_option_parser_parse( w2c_cmdline_option_parser_impl_t *parser,
+ const axis2_env_t *env,
+ int argc, axis2_char_t **argv)
{
int i = 0;
w2c_cmdline_option_t *option = NULL;
axis2_hash_t *hash;
axis2_char_t *key = NULL;
axis2_char_t *value = NULL;
- axis2_array_list_t *values_arr = NULL;
-
- hash = axis2_hash_make(env);
+ axis2_array_list_t *values_arr= NULL;
+
+ hash = axis2_hash_make ( env );
parser->hash = hash;
- while (i < argc)
+ while ( i < argc )
{
key = argv[i];
values_arr = (axis2_array_list_t*)
- axis2_array_list_create(env, 1);
+ axis2_array_list_create(env, 1 );
i ++;
- while (i < argc && !(w2c_string_indexof_cs(argv[i], "-") == 0)
- && !(w2c_string_indexof_cs(argv[i], "--") == 0))
+ while ( i < argc && !(w2c_string_indexof_cs ( argv[i], "-" ) == 0)
+ && !(w2c_string_indexof_cs ( argv[i], "--" ) == 0) )
{
value = (axis2_char_t*)AXIS2_STRDUP(argv[i], env);
- AXIS2_ARRAY_LIST_ADD(values_arr, env, value);
+ AXIS2_ARRAY_LIST_ADD ( values_arr, env, value );
i ++;
}
option = (w2c_cmdline_option_t*)
- w2c_cmdline_option_create_with_values(env, key, values_arr);
- key = W2C_CMDLINE_OPTION_GET_TYPE(option, env);
- axis2_hash_set(hash, key, AXIS2_HASH_KEY_STRING, option);
- }
+ w2c_cmdline_option_create_with_values( env, key, values_arr );
+ key = W2C_CMDLINE_OPTION_GET_TYPE ( option, env );
+ axis2_hash_set ( hash, key, AXIS2_HASH_KEY_STRING, option );
+ }
return;
}
Modified: webservices/axis2/trunk/c/tools/codegen/src/util/cmdline_option_validator.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/tools/codegen/src/util/cmdline_option_validator.c?view=diff&rev=450420&r1=450419&r2=450420
==============================================================================
--- webservices/axis2/trunk/c/tools/codegen/src/util/cmdline_option_validator.c (original)
+++ webservices/axis2/trunk/c/tools/codegen/src/util/cmdline_option_validator.c Wed Sep 27 05:39:31 2006
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
#include <w2c_cmdline_option_validator.h>
#include <w2c_cmdline_option_consts.h>
#include <w2c_cmdline_option.h>
@@ -27,57 +27,57 @@
axis2_bool_t isinvalid = AXIS2_FALSE;
axis2_char_t *type = NULL;
int index = -1;
-
- type = W2C_CMDLINE_OPTION_GET_TYPE(option, env);
+
+ type = W2C_CMDLINE_OPTION_GET_TYPE( option, env );
index = w2c_string_indexof_cs(type,
W2C_CMDLINE_OPTION_CONSTS_EXTRA_OPTIONTYPE_PREFIX);
- if (index != 0)
+ if (index != 0 )
{
- isinvalid =
- strcmp(W2C_CMDLINE_OPTION_CONSTS_WSDL_LOCATION_URI, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_OUTPUT_LOCATION, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_SERVER_SIDE_CODE, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_SERVICE_DESCRIPTION, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_ASYNC_ONLY, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_SYNC_ONLY, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_PACKAGE, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_STUB_LANGUAGE, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_GENERATE_TEST_CASE, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_DATA_BINDING_TYPE, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_UNPACK_CLASSES, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_GENERATE_ALL, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_PORT_NAME, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_SERVICE_NAME, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_REPOSITORY_PATH, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_NAME_SPACE_TO_PACKAGE, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_SERVER_SIDE_INTERFACE, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_EXTERNAL_MAPPING, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_WSDL_VERSION, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_FLATTEN_FILES, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_CONVERT_NAMES, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_INDENT_CODE , type) &&
+ isinvalid =
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_WSDL_LOCATION_URI, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_OUTPUT_LOCATION, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_SERVER_SIDE_CODE, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_SERVICE_DESCRIPTION, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_ASYNC_ONLY, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_SYNC_ONLY, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_PACKAGE, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_STUB_LANGUAGE, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_GENERATE_TEST_CASE, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_DATA_BINDING_TYPE, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_PACK_CLASSES, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_GENERATE_ALL, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_PORT_NAME, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_SERVICE_NAME, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_REPOSITORY_PATH, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_NAME_SPACE_TO_PACKAGE, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_SERVER_SIDE_INTERFACE, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_EXTERNAL_MAPPING, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_WSDL_VERSION, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_FLATTEN_FILES, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_CONVERT_NAMES, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_INDENT_CODE , type ) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_OUTPUT_LOCATION, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_SERVER_SIDE_CODE, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_SERVICE_DESCRIPTION, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_ASYNC_ONLY, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_SYNC_ONLY, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_PACKAGE, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_STUB_LANGUAGE, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_GENERATE_TEST_CASE, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_DATA_BINDING_TYPE, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_UNPACK_CLASSES, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_GENERATE_ALL, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_PORT_NAME, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_SERVICE_NAME, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_REPOSITORY_PATH, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_NAME_SPACE_TO_PACKAGE, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_SERVER_SIDE_INTERFACE, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_EXTERNAL_MAPPING, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_WSDL_VERSION, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_FLATTEN_FILES, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_CONVERT_NAMES, type) &&
- strcmp(W2C_CMDLINE_OPTION_CONSTS_LONG_INDENT_CODE, type);
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_OUTPUT_LOCATION, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_SERVER_SIDE_CODE, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_SERVICE_DESCRIPTION, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_ASYNC_ONLY, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_SYNC_ONLY, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_PACKAGE, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_STUB_LANGUAGE, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_GENERATE_TEST_CASE, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_DATA_BINDING_TYPE, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_PACK_CLASSES, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_GENERATE_ALL, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_PORT_NAME, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_SERVICE_NAME, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_REPOSITORY_PATH, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_NAME_SPACE_TO_PACKAGE, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_SERVER_SIDE_INTERFACE, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_EXTERNAL_MAPPING, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_WSDL_VERSION, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_FLATTEN_FILES, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_CONVERT_NAMES, type ) &&
+ strcmp( W2C_CMDLINE_OPTION_CONSTS_LONG_INDENT_CODE, type );
}
return isinvalid;
}
Modified: webservices/axis2/trunk/c/tools/codegen/src/util/codegen-config.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/tools/codegen/src/util/codegen-config.properties?view=diff&rev=450420&r1=450419&r2=450420
==============================================================================
--- webservices/axis2/trunk/c/tools/codegen/src/util/codegen-config.properties (original)
+++ webservices/axis2/trunk/c/tools/codegen/src/util/codegen-config.properties Wed Sep 27 05:39:31 2006
@@ -7,7 +7,8 @@
codegen.extension=w2c_databinding_default_ext, \
w2c_default_qname2name_ext, \
w2c_c_namemaker_ext, \
- w2c_c_qname2name_ext
+ w2c_c_qname2name_ext, \
+ w2c_databinding_adb_ext
post.codegen.extension=w2c_c_code_indenter_ext
# Language types - these are the language types that the code generator understands. Again this is the name of the
# language that should be passed from the tool as well
Modified: webservices/axis2/trunk/c/tools/codegen/src/util/config_property_loader.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/tools/codegen/src/util/config_property_loader.c?view=diff&rev=450420&r1=450419&r2=450420
==============================================================================
--- webservices/axis2/trunk/c/tools/codegen/src/util/config_property_loader.c (original)
+++ webservices/axis2/trunk/c/tools/codegen/src/util/config_property_loader.c Wed Sep 27 05:39:31 2006
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
#include <w2c_config_property_loader.h>
#include <w2c_properties.h>
#include <axis2_array_list.h>
@@ -44,7 +44,7 @@
"codegen.databinding.testobject.template"
/* the above define should be replace to follwing pre and suf fix defines */
#define W2C_CONFIG_PROPERTY_LOADER_DATA_BINDING_TEMPLATE_NAME_KEY_PREFIX \
- "codegen.databinding."
+ "codegen.databinding."
#define W2C_CONFIG_PROPERTY_LOADER_DATA_BINDING_TEMPLATE_NAME_KEY_SUFFIX \
"template"
#define W2C_CONFIG_PROPERTY_LOADER_DEFAULT_CODEGEN_CONFIG_PROPERTIES \
@@ -55,13 +55,13 @@
#define W2C_CONFIG_PROPERTY_LOADER_SEPARATOR_CHAR ','
-/**
+/**
* @brief
*/
typedef struct w2c_config_property_loader_impl
{
w2c_config_property_loader_t config_property_loader;
-
+
axis2_char_t *test_object_template_name;
axis2_char_t *db_supporter_template_name;
axis2_array_list_t *extension_class_names;
@@ -77,9 +77,8 @@
w2c_properties_t *prop_set;
axis2_char_t *prop_filename;
-
-}
-w2c_config_property_loader_impl_t;
+
+} w2c_config_property_loader_impl_t;
#define W2C_INTF_TO_IMPL(config_property_loader) \
((w2c_config_property_loader_impl_t *) config_property_loader)
@@ -87,78 +86,78 @@
/************************* Function prototypes ********************************/
axis2_status_t AXIS2_CALL
-w2c_config_property_loader_free(
- w2c_config_property_loader_t *config_property_loader,
+w2c_config_property_loader_free (
+ w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env);
axis2_status_t AXIS2_CALL
-w2c_config_property_loader_set_filename(
- w2c_config_property_loader_t *config_property_loader,
- const axis2_env_t *env,
- axis2_char_t *filename);
+w2c_config_property_loader_set_filename (
+ w2c_config_property_loader_t *config_property_loader,
+ const axis2_env_t *env,
+ axis2_char_t *filename);
axis2_status_t AXIS2_CALL
-w2c_config_property_loader_reload(
- w2c_config_property_loader_t *config_property_loader,
+w2c_config_property_loader_reload (
+ w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env);
axis2_char_t* AXIS2_CALL
-w2c_config_property_loader_get_test_object_template_name(
+w2c_config_property_loader_get_test_object_template_name (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env);
axis2_char_t* AXIS2_CALL
-w2c_config_property_loader_get_db_supporter_template_name(
+w2c_config_property_loader_get_db_supporter_template_name (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env);
-axis2_array_list_t* AXIS2_CALL
-w2c_config_property_loader_get_extension_class_names(
+axis2_array_list_t* AXIS2_CALL
+w2c_config_property_loader_get_extension_class_names (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env);
-axis2_array_list_t* AXIS2_CALL
-w2c_config_property_loader_get_post_extension_class_names(
+axis2_array_list_t* AXIS2_CALL
+w2c_config_property_loader_get_post_extension_class_names (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env);
-axis2_array_list_t* AXIS2_CALL
-w2c_config_property_loader_get_third_party_schema_names(
+axis2_array_list_t* AXIS2_CALL
+w2c_config_property_loader_get_third_party_schema_names (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env);
-axis2_array_list_t* AXIS2_CALL
-w2c_config_property_loader_get_language_types(
+axis2_array_list_t* AXIS2_CALL
+w2c_config_property_loader_get_language_types (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env);
-axis2_hash_t* AXIS2_CALL
-w2c_config_property_loader_get_language_emitter_map(
+axis2_hash_t* AXIS2_CALL
+w2c_config_property_loader_get_language_emitter_map (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env);
-axis2_char_t* AXIS2_CALL
-w2c_config_property_loader_get_default_language(
+axis2_char_t* AXIS2_CALL
+w2c_config_property_loader_get_default_language (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env);
-axis2_hash_t* AXIS2_CALL
-w2c_config_property_loader_get_language_specific_properties_map(
+axis2_hash_t* AXIS2_CALL
+w2c_config_property_loader_get_language_specific_properties_map (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env);
-axis2_array_list_t* AXIS2_CALL
-w2c_config_property_loader_get_databinding_framework_names(
+axis2_array_list_t* AXIS2_CALL
+w2c_config_property_loader_get_databinding_framework_names (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env);
-axis2_hash_t* AXIS2_CALL
-w2c_config_property_loader_get_databinding_framework_name_to_extension_map(
+axis2_hash_t* AXIS2_CALL
+w2c_config_property_loader_get_databinding_framework_name_to_extension_map (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env);
-axis2_char_t* AXIS2_CALL
-w2c_config_property_loader_get_default_db_framework_name(
+axis2_char_t* AXIS2_CALL
+w2c_config_property_loader_get_default_db_framework_name (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env);
@@ -166,54 +165,54 @@
static void
w2c_config_property_loader_load_values(
- w2c_config_property_loader_impl_t *obj_impl,
- const axis2_env_t *env);
+ w2c_config_property_loader_impl_t *obj_impl,
+ const axis2_env_t *env);
static axis2_array_list_t*
w2c_config_property_loader_dup_array(
- axis2_array_list_t *arr,
- const axis2_env_t *env);
+ axis2_array_list_t *arr,
+ const axis2_env_t *env);
static axis2_status_t
w2c_config_property_loader_free_array(
- axis2_array_list_t *original,
- const axis2_env_t *env);
+ axis2_array_list_t *original,
+ const axis2_env_t *env);
static axis2_status_t
w2c_config_property_loader_free_hash(
- axis2_hash_t *original,
- const axis2_env_t *env);
+ axis2_hash_t *original,
+ const axis2_env_t *env);
/************************** End of function prototypes ************************/
-AXIS2_EXTERN w2c_config_property_loader_t * AXIS2_CALL
-w2c_config_property_loader_create(const axis2_env_t *env)
+AXIS2_EXTERN w2c_config_property_loader_t * AXIS2_CALL
+w2c_config_property_loader_create (const axis2_env_t *env)
{
w2c_config_property_loader_impl_t *config_property_loader_impl = NULL;
axis2_char_t* axis2c_home;
int path_len;
-
+
AXIS2_ENV_CHECK(env, NULL);
config_property_loader_impl = (w2c_config_property_loader_impl_t *) AXIS2_MALLOC(env->
- allocator, sizeof(w2c_config_property_loader_impl_t));
+ allocator, sizeof(w2c_config_property_loader_impl_t));
- if (NULL == config_property_loader_impl)
+ if(NULL == config_property_loader_impl)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
-
- config_property_loader_impl->config_property_loader.ops =
- AXIS2_MALLOC(env->allocator, sizeof(w2c_config_property_loader_ops_t));
- if (NULL == config_property_loader_impl->config_property_loader.ops)
+
+ config_property_loader_impl->config_property_loader.ops =
+ AXIS2_MALLOC (env->allocator, sizeof(w2c_config_property_loader_ops_t));
+ if(NULL == config_property_loader_impl->config_property_loader.ops)
{
w2c_config_property_loader_free(&(config_property_loader_impl->config_property_loader), env);
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
-
+
config_property_loader_impl->test_object_template_name = NULL;
config_property_loader_impl->db_supporter_template_name = NULL;
config_property_loader_impl->extension_class_names = NULL;
@@ -228,53 +227,53 @@
config_property_loader_impl->default_db_framework_name = NULL;
config_property_loader_impl->prop_set = NULL;
config_property_loader_impl->prop_filename = NULL;
-
- axis2c_home = getenv("AXIS2C_HOME");
- path_len = AXIS2_STRLEN(axis2c_home) +
- AXIS2_STRLEN(W2C_CONFIG_PROPERTY_LOADER_DEFAULT_CODEGEN_CONFIG_PROPERTIES) +
- 2;
- config_property_loader_impl-> prop_filename = AXIS2_MALLOC(env->allocator,
- sizeof(axis2_char_t) * path_len);
+
+ axis2c_home = getenv ( "AXIS2C_HOME" );
+ path_len = AXIS2_STRLEN (axis2c_home ) +
+ AXIS2_STRLEN (W2C_CONFIG_PROPERTY_LOADER_DEFAULT_CODEGEN_CONFIG_PROPERTIES) +
+ 2;
+ config_property_loader_impl-> prop_filename = AXIS2_MALLOC ( env->allocator,
+ sizeof(axis2_char_t)*path_len );
sprintf(config_property_loader_impl-> prop_filename, "%s%s", axis2c_home,
- W2C_CONFIG_PROPERTY_LOADER_DEFAULT_CODEGEN_CONFIG_PROPERTIES);
-
- config_property_loader_impl-> prop_set = w2c_properties_create(env,
- config_property_loader_impl-> prop_filename ,
- W2C_CONFIG_PROPERTY_LOADER_SEPARATOR_CHAR);
- if (config_property_loader_impl-> prop_set)
- {
- w2c_config_property_loader_load_values(config_property_loader_impl, env);
- }
- config_property_loader_impl->config_property_loader.ops->free =
- w2c_config_property_loader_free;
- config_property_loader_impl->config_property_loader.ops->set_filename =
- w2c_config_property_loader_set_filename;
- config_property_loader_impl->config_property_loader.ops->reload =
- w2c_config_property_loader_reload;
+ W2C_CONFIG_PROPERTY_LOADER_DEFAULT_CODEGEN_CONFIG_PROPERTIES);
+
+ config_property_loader_impl-> prop_set = w2c_properties_create( env,
+ config_property_loader_impl-> prop_filename ,
+ W2C_CONFIG_PROPERTY_LOADER_SEPARATOR_CHAR );
+ if ( config_property_loader_impl-> prop_set != NULL )
+ {
+ w2c_config_property_loader_load_values( config_property_loader_impl, env );
+ }
+ config_property_loader_impl->config_property_loader.ops->free =
+ w2c_config_property_loader_free;
+ config_property_loader_impl->config_property_loader.ops->set_filename=
+ w2c_config_property_loader_set_filename;
+ config_property_loader_impl->config_property_loader.ops->reload =
+ w2c_config_property_loader_reload;
config_property_loader_impl->config_property_loader.ops->get_test_object_template_name =
- w2c_config_property_loader_get_test_object_template_name ;
+ w2c_config_property_loader_get_test_object_template_name ;
config_property_loader_impl->config_property_loader.ops->get_db_supporter_template_name =
- w2c_config_property_loader_get_db_supporter_template_name ;
- config_property_loader_impl->config_property_loader.ops->get_extension_class_names =
- w2c_config_property_loader_get_extension_class_names;
- config_property_loader_impl->config_property_loader.ops->get_post_extension_class_names =
- w2c_config_property_loader_get_post_extension_class_names;
- config_property_loader_impl->config_property_loader.ops->get_third_party_schema_names =
- w2c_config_property_loader_get_third_party_schema_names;
- config_property_loader_impl->config_property_loader.ops->get_language_types =
- w2c_config_property_loader_get_language_types ;
- config_property_loader_impl->config_property_loader.ops->get_language_emitter_map =
- w2c_config_property_loader_get_language_emitter_map;
- config_property_loader_impl->config_property_loader.ops->get_default_language =
- w2c_config_property_loader_get_default_language;
- config_property_loader_impl->config_property_loader.ops->get_language_specific_properties_map =
- w2c_config_property_loader_get_language_specific_properties_map;
- config_property_loader_impl->config_property_loader.ops->get_databinding_framework_names =
- w2c_config_property_loader_get_databinding_framework_names;
- config_property_loader_impl->config_property_loader.ops->get_databinding_framework_name_to_extension_map =
- w2c_config_property_loader_get_databinding_framework_name_to_extension_map;
+ w2c_config_property_loader_get_db_supporter_template_name ;
+ config_property_loader_impl->config_property_loader.ops->get_extension_class_names =
+ w2c_config_property_loader_get_extension_class_names;
+ config_property_loader_impl->config_property_loader.ops->get_post_extension_class_names =
+ w2c_config_property_loader_get_post_extension_class_names;
+ config_property_loader_impl->config_property_loader.ops->get_third_party_schema_names =
+ w2c_config_property_loader_get_third_party_schema_names;
+ config_property_loader_impl->config_property_loader.ops->get_language_types =
+ w2c_config_property_loader_get_language_types ;
+ config_property_loader_impl->config_property_loader.ops->get_language_emitter_map =
+ w2c_config_property_loader_get_language_emitter_map;
+ config_property_loader_impl->config_property_loader.ops->get_default_language =
+ w2c_config_property_loader_get_default_language;
+ config_property_loader_impl->config_property_loader.ops->get_language_specific_properties_map =
+ w2c_config_property_loader_get_language_specific_properties_map;
+ config_property_loader_impl->config_property_loader.ops->get_databinding_framework_names =
+ w2c_config_property_loader_get_databinding_framework_names;
+ config_property_loader_impl->config_property_loader.ops->get_databinding_framework_name_to_extension_map =
+ w2c_config_property_loader_get_databinding_framework_name_to_extension_map;
config_property_loader_impl->config_property_loader.ops->get_default_db_framework_name =
- w2c_config_property_loader_get_default_db_framework_name;
+ w2c_config_property_loader_get_default_db_framework_name;
return &(config_property_loader_impl->config_property_loader);
}
@@ -282,150 +281,150 @@
/***************************Function implementation****************************/
-axis2_status_t AXIS2_CALL
-w2c_config_property_loader_free(w2c_config_property_loader_t *config_property_loader,
- const axis2_env_t *env)
+axis2_status_t AXIS2_CALL
+w2c_config_property_loader_free (w2c_config_property_loader_t *config_property_loader,
+ const axis2_env_t *env)
{
w2c_config_property_loader_impl_t *config_property_loader_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
+
config_property_loader_impl = W2C_INTF_TO_IMPL(config_property_loader);
-
+
if (config_property_loader_impl-> test_object_template_name)
{
- AXIS2_FREE(env-> allocator,
- config_property_loader_impl-> test_object_template_name);
+ AXIS2_FREE (env-> allocator,
+ config_property_loader_impl-> test_object_template_name);
}
-
+
if (config_property_loader_impl-> db_supporter_template_name)
{
- AXIS2_FREE(env-> allocator,
- config_property_loader_impl-> db_supporter_template_name);
+ AXIS2_FREE (env-> allocator,
+ config_property_loader_impl-> db_supporter_template_name);
}
if (config_property_loader_impl-> extension_class_names)
{
w2c_config_property_loader_free_array(
- config_property_loader_impl-> extension_class_names, env);
+ config_property_loader_impl-> extension_class_names, env);
}
if (config_property_loader_impl-> post_extension_class_names)
{
w2c_config_property_loader_free_array(
- config_property_loader_impl-> post_extension_class_names, env);
+ config_property_loader_impl-> post_extension_class_names, env);
}
if (config_property_loader_impl-> third_party_schema_names)
{
w2c_config_property_loader_free_array(
- config_property_loader_impl-> third_party_schema_names, env);
+ config_property_loader_impl-> third_party_schema_names, env);
}
if (config_property_loader_impl-> language_types)
{
w2c_config_property_loader_free_array(
- config_property_loader_impl-> language_types, env);
+ config_property_loader_impl-> language_types, env);
}
if (config_property_loader_impl-> language_emitter_map)
{
w2c_config_property_loader_free_hash(
- config_property_loader_impl-> language_emitter_map, env);
+ config_property_loader_impl-> language_emitter_map, env);
}
if (config_property_loader_impl-> default_language)
{
- AXIS2_FREE(env-> allocator, config_property_loader_impl-> default_language);
+ AXIS2_FREE (env-> allocator, config_property_loader_impl-> default_language);
}
if (config_property_loader_impl-> language_specific_properties_map)
{
/* all the elemenets here will be freed by some other */
- axis2_hash_free(
- config_property_loader_impl-> language_specific_properties_map, env);
+ axis2_hash_free (
+ config_property_loader_impl-> language_specific_properties_map, env);
}
if (config_property_loader_impl-> databinding_framework_names)
{
w2c_config_property_loader_free_array(
- config_property_loader_impl-> databinding_framework_names, env);
+ config_property_loader_impl-> databinding_framework_names, env);
}
if (config_property_loader_impl-> databinding_framework_name_to_extension_map)
{
w2c_config_property_loader_free_hash(
- config_property_loader_impl-> databinding_framework_name_to_extension_map, env);
+ config_property_loader_impl-> databinding_framework_name_to_extension_map, env);
}
if (config_property_loader_impl-> default_db_framework_name)
{
- AXIS2_FREE(env-> allocator, config_property_loader_impl-> default_db_framework_name);
+ AXIS2_FREE (env-> allocator, config_property_loader_impl-> default_db_framework_name);
}
if (config_property_loader_impl-> prop_set)
{
- W2C_PROPERTIES_FREE(config_property_loader_impl-> prop_set, env);
+ W2C_PROPERTIES_FREE( config_property_loader_impl-> prop_set, env);
}
if (config_property_loader_impl-> prop_filename)
{
- AXIS2_FREE(env-> allocator, config_property_loader_impl-> prop_filename);
+ AXIS2_FREE (env-> allocator, config_property_loader_impl-> prop_filename);
}
- if (config_property_loader->ops)
+ if(config_property_loader->ops)
{
AXIS2_FREE(env->allocator, config_property_loader->ops);
config_property_loader->ops = NULL;
}
- if (config_property_loader_impl)
+ if(config_property_loader_impl)
{
AXIS2_FREE(env->allocator, config_property_loader_impl);
config_property_loader_impl = NULL;
}
-
+
return AXIS2_SUCCESS;
}
axis2_status_t AXIS2_CALL
-w2c_config_property_loader_set_filename(
- w2c_config_property_loader_t *config_property_loader,
- const axis2_env_t *env,
- axis2_char_t *filename)
+w2c_config_property_loader_set_filename (
+ w2c_config_property_loader_t *config_property_loader,
+ const axis2_env_t *env,
+ axis2_char_t *filename)
{
w2c_config_property_loader_impl_t *config_property_loader_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
+
config_property_loader_impl = W2C_INTF_TO_IMPL(config_property_loader);
- config_property_loader_impl -> prop_filename = filename;
- w2c_config_property_loader_reload(config_property_loader, env);
+ config_property_loader_impl -> prop_filename = filename;
+ w2c_config_property_loader_reload ( config_property_loader, env );
return AXIS2_SUCCESS;
}
axis2_status_t AXIS2_CALL
-w2c_config_property_loader_reload(
- w2c_config_property_loader_t *config_property_loader,
+w2c_config_property_loader_reload (
+ w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env)
{
w2c_config_property_loader_impl_t *config_property_loader_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
+
config_property_loader_impl = W2C_INTF_TO_IMPL(config_property_loader);
-
+
if (config_property_loader_impl-> prop_set)
{
- W2C_PROPERTIES_FREE(config_property_loader_impl->prop_set, env);
+ W2C_PROPERTIES_FREE ( config_property_loader_impl->prop_set, env );
}
- config_property_loader_impl-> prop_set = w2c_properties_create(env,
- config_property_loader_impl-> prop_filename ,
- W2C_CONFIG_PROPERTY_LOADER_SEPARATOR_CHAR);
- if (config_property_loader_impl-> prop_set)
+ config_property_loader_impl-> prop_set= w2c_properties_create( env,
+ config_property_loader_impl-> prop_filename ,
+ W2C_CONFIG_PROPERTY_LOADER_SEPARATOR_CHAR );
+ if ( config_property_loader_impl-> prop_set != NULL )
{
- w2c_config_property_loader_load_values(config_property_loader_impl, env);
+ w2c_config_property_loader_load_values( config_property_loader_impl, env );
}
else
{
@@ -437,410 +436,410 @@
axis2_char_t* AXIS2_CALL
-w2c_config_property_loader_get_test_object_template_name(
+w2c_config_property_loader_get_test_object_template_name (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env)
{
w2c_config_property_loader_impl_t *config_property_loader_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
config_property_loader_impl = W2C_INTF_TO_IMPL(config_property_loader);
-
+
return config_property_loader_impl-> test_object_template_name;
}
axis2_char_t* AXIS2_CALL
-w2c_config_property_loader_get_db_supporter_template_name(
+w2c_config_property_loader_get_db_supporter_template_name (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env)
{
w2c_config_property_loader_impl_t *config_property_loader_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
config_property_loader_impl = W2C_INTF_TO_IMPL(config_property_loader);
-
+
return config_property_loader_impl-> db_supporter_template_name;
}
-axis2_array_list_t* AXIS2_CALL
-w2c_config_property_loader_get_extension_class_names(
+axis2_array_list_t* AXIS2_CALL
+w2c_config_property_loader_get_extension_class_names (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env)
{
w2c_config_property_loader_impl_t *config_property_loader_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
config_property_loader_impl = W2C_INTF_TO_IMPL(config_property_loader);
-
+
return config_property_loader_impl-> extension_class_names;
}
-axis2_array_list_t* AXIS2_CALL
-w2c_config_property_loader_get_post_extension_class_names(
+axis2_array_list_t* AXIS2_CALL
+w2c_config_property_loader_get_post_extension_class_names (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env)
{
w2c_config_property_loader_impl_t *config_property_loader_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
config_property_loader_impl = W2C_INTF_TO_IMPL(config_property_loader);
-
+
return config_property_loader_impl-> post_extension_class_names;
}
-axis2_array_list_t* AXIS2_CALL
-w2c_config_property_loader_get_third_party_schema_names(
+axis2_array_list_t* AXIS2_CALL
+w2c_config_property_loader_get_third_party_schema_names (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env)
{
w2c_config_property_loader_impl_t *config_property_loader_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
config_property_loader_impl = W2C_INTF_TO_IMPL(config_property_loader);
-
+
return config_property_loader_impl-> third_party_schema_names;
}
-axis2_array_list_t* AXIS2_CALL
-w2c_config_property_loader_get_language_types(
+axis2_array_list_t* AXIS2_CALL
+w2c_config_property_loader_get_language_types (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env)
{
w2c_config_property_loader_impl_t *config_property_loader_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
config_property_loader_impl = W2C_INTF_TO_IMPL(config_property_loader);
-
+
return config_property_loader_impl->language_types;
}
-axis2_hash_t* AXIS2_CALL
-w2c_config_property_loader_get_language_emitter_map(
+axis2_hash_t* AXIS2_CALL
+w2c_config_property_loader_get_language_emitter_map (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env)
{
w2c_config_property_loader_impl_t *config_property_loader_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
config_property_loader_impl = W2C_INTF_TO_IMPL(config_property_loader);
-
+
return config_property_loader_impl-> language_emitter_map;
}
-axis2_char_t* AXIS2_CALL
-w2c_config_property_loader_get_default_language(
+axis2_char_t* AXIS2_CALL
+w2c_config_property_loader_get_default_language (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env)
{
w2c_config_property_loader_impl_t *config_property_loader_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
config_property_loader_impl = W2C_INTF_TO_IMPL(config_property_loader);
-
+
return config_property_loader_impl-> default_language;
}
-axis2_hash_t* AXIS2_CALL
-w2c_config_property_loader_get_language_specific_properties_map(
+axis2_hash_t* AXIS2_CALL
+w2c_config_property_loader_get_language_specific_properties_map (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env)
{
w2c_config_property_loader_impl_t *config_property_loader_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
config_property_loader_impl = W2C_INTF_TO_IMPL(config_property_loader);
-
+
return config_property_loader_impl-> language_specific_properties_map;
}
-axis2_array_list_t* AXIS2_CALL
-w2c_config_property_loader_get_databinding_framework_names(
+axis2_array_list_t* AXIS2_CALL
+w2c_config_property_loader_get_databinding_framework_names (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env)
{
w2c_config_property_loader_impl_t *config_property_loader_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
config_property_loader_impl = W2C_INTF_TO_IMPL(config_property_loader);
-
+
return config_property_loader_impl-> databinding_framework_names;
}
-axis2_hash_t* AXIS2_CALL
-w2c_config_property_loader_get_databinding_framework_name_to_extension_map(
+axis2_hash_t* AXIS2_CALL
+w2c_config_property_loader_get_databinding_framework_name_to_extension_map (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env)
{
w2c_config_property_loader_impl_t *config_property_loader_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
config_property_loader_impl = W2C_INTF_TO_IMPL(config_property_loader);
-
+
return config_property_loader_impl-> databinding_framework_name_to_extension_map;
}
-axis2_char_t* AXIS2_CALL
-w2c_config_property_loader_get_default_db_framework_name(
+axis2_char_t* AXIS2_CALL
+w2c_config_property_loader_get_default_db_framework_name (
w2c_config_property_loader_t *config_property_loader,
const axis2_env_t *env)
{
w2c_config_property_loader_impl_t *config_property_loader_impl = NULL;
-
+
AXIS2_ENV_CHECK(env, NULL);
-
+
config_property_loader_impl = W2C_INTF_TO_IMPL(config_property_loader);
-
+
return config_property_loader_impl-> default_db_framework_name;
}
static void
w2c_config_property_loader_load_values(
- w2c_config_property_loader_impl_t *obj_impl,
- const axis2_env_t *env)
+ w2c_config_property_loader_impl_t *obj_impl,
+ const axis2_env_t *env)
{
- axis2_hash_t* prop_hash = NULL;
- axis2_hash_t* temp_hash = NULL;
- axis2_hash_t* lang_spec_hash = NULL;
- axis2_hash_index_t* hi = NULL;
- axis2_array_list_t* prop = NULL;
- axis2_array_list_t* temp_array = NULL;
- axis2_char_t* temp_buff = NULL;
- axis2_char_t* key = NULL;
- axis2_char_t* val = NULL;
- int i;
- int size;
-
- prop_hash = W2C_PROPERTIES_GET_HASH(obj_impl-> prop_set, env);
-
- /*TODO: this should be configured to choose the prophash from
- * a command line option -codegen.config="file"
- */
-
- /*load the extension class names*/
- prop = (axis2_array_list_t*)axis2_hash_get(prop_hash,
- W2C_CONFIG_PROPERTY_LOADER_CODE_GEN_KEY_PREFIX,
- AXIS2_HASH_KEY_STRING);
- if (prop)
- {
- obj_impl ->extension_class_names =
- w2c_config_property_loader_dup_array(prop, env);
- }
-
- /*load the post extension class names*/
- prop = (axis2_array_list_t*)axis2_hash_get(prop_hash,
- W2C_CONFIG_PROPERTY_LOADER_POST_CODE_GEN_KEY_PREFIX,
- AXIS2_HASH_KEY_STRING);
- if (prop)
- {
- obj_impl ->post_extension_class_names =
- w2c_config_property_loader_dup_array(prop, env);
- }
-
- /* load the data binding framework names */
- prop = (axis2_array_list_t*)axis2_hash_get(prop_hash,
- W2C_CONFIG_PROPERTY_LOADER_DATA_BINDING_FRAMEWORK_NAME_KEY,
- AXIS2_HASH_KEY_STRING);
- if (prop)
- {
- obj_impl ->databinding_framework_names =
- w2c_config_property_loader_dup_array(prop, env);
- }
-
- /* populate the data binding framework name to extension name map */
- temp_array = NULL;
- prop = (axis2_array_list_t*)axis2_hash_get(prop_hash,
- W2C_CONFIG_PROPERTY_LOADER_DATA_BINDING_FRAMEWORK_EXTENSION_NAME_KEY,
- AXIS2_HASH_KEY_STRING);
- if (prop)
- {
- temp_array =
- w2c_config_property_loader_dup_array(prop, env);
-
- size = AXIS2_ARRAY_LIST_SIZE(obj_impl ->databinding_framework_names, env);
- if (size != AXIS2_ARRAY_LIST_SIZE(temp_array, env))
- {
- fprintf(stderr, "data_binding_framework name to extension diff in size");
- w2c_config_property_loader_free(
- &(obj_impl->config_property_loader), env);
- return;
- }
-
- temp_hash = axis2_hash_make(env);
- obj_impl ->databinding_framework_name_to_extension_map = temp_hash;
- for (i = 0 ; i < size ;i++)
- {
- axis2_hash_set(temp_hash,
- AXIS2_STRDUP(AXIS2_ARRAY_LIST_GET(obj_impl ->databinding_framework_names, env, i), env),
- AXIS2_HASH_KEY_STRING,
- AXIS2_STRDUP(AXIS2_ARRAY_LIST_GET(temp_array, env, i), env));
- }
- }
-
- /*load the default framework name */
- prop = (axis2_array_list_t*)axis2_hash_get(prop_hash,
- W2C_CONFIG_PROPERTY_LOADER_DATA_BINDING_FRAMEWORK_DEFAULT_NAME_KEY,
- AXIS2_HASH_KEY_STRING);
- if (prop)
- {
- obj_impl ->default_db_framework_name =
- AXIS2_STRDUP(AXIS2_ARRAY_LIST_GET(prop, env, 0), env);
- }
-
- /* load the third party schema names */
- prop = (axis2_array_list_t*)axis2_hash_get(prop_hash,
- W2C_CONFIG_PROPERTY_LOADER_THIRD_PARTY_SCHEMA_KEY_PREFIX,
- AXIS2_HASH_KEY_STRING);
- if (prop)
- {
- obj_impl ->third_party_schema_names =
- AXIS2_STRDUP(AXIS2_ARRAY_LIST_GET(prop, env, 0), env);
- }
-
- /* the db supporter template name */
- prop = (axis2_array_list_t*)axis2_hash_get(prop_hash,
- W2C_CONFIG_PROPERTY_LOADER_DATA_BINDING_TEMPLATE_NAME_KEY,
- AXIS2_HASH_KEY_STRING);
- if (prop)
- {
- obj_impl ->db_supporter_template_name =
- AXIS2_STRDUP(AXIS2_ARRAY_LIST_GET(prop, env, 0), env);
- }
-
- /* test object template name */
- /* TODO: this should be replce to check for all properties
- * starts with W2C_CONFIG_PROPERTY_LOADER_DATA_BINDING_TEMPLATE_NAME_KEY_PREFIX
- * ends with W2C_CONFIG_PROPERTY_LOADER_DATA_BINDING_TEMPLATE_NAME_KEY_SUFFIX
- */
- prop = (axis2_array_list_t*)axis2_hash_get(prop_hash,
- W2C_CONFIG_PROPERTY_LOADER_DATA_BINDING_TEST_OBJECT_TEMPLATE_NAME_KEY,
- AXIS2_HASH_KEY_STRING);
- if (prop)
- {
- obj_impl ->test_object_template_name =
- AXIS2_STRDUP(AXIS2_ARRAY_LIST_GET(prop, env, 0), env);
- }
-
-
- /* load the language types */
- prop = (axis2_array_list_t*)axis2_hash_get(prop_hash,
- W2C_CONFIG_PROPERTY_LOADER_LANGUAGE_TYPE_KEY_PREFIX,
- AXIS2_HASH_KEY_STRING);
- if (prop)
- {
- obj_impl ->language_types =
- w2c_config_property_loader_dup_array(prop, env);
- }
-
- /* load the language emitter map */
- prop = (axis2_array_list_t*)axis2_hash_get(prop_hash,
- W2C_CONFIG_PROPERTY_LOADER_EMITTER_CLASS_KEY,
- AXIS2_HASH_KEY_STRING);
- if (prop)
- {
- temp_array = w2c_config_property_loader_dup_array(prop, env);
-
- size = AXIS2_ARRAY_LIST_SIZE(obj_impl->language_types , env);
- if (size != AXIS2_ARRAY_LIST_SIZE(temp_array, env))
- {
- fprintf(stderr, "data_binding_framework name to extension diff in size");
- w2c_config_property_loader_free(
- &(obj_impl->config_property_loader), env);
- return;
- }
-
- temp_hash = axis2_hash_make(env);
- obj_impl ->language_emitter_map = temp_hash;
- for (i = 0 ; i < size ; i++)
- {
- key = AXIS2_ARRAY_LIST_GET(obj_impl ->language_types, env, i);
- val = AXIS2_ARRAY_LIST_GET(temp_array, env, i);
- axis2_hash_set(temp_hash,
- AXIS2_STRDUP(key, env),
- AXIS2_HASH_KEY_STRING,
- AXIS2_STRDUP(val, env));
- }
- }
-
- /* load the default language */
- prop = (axis2_array_list_t*)axis2_hash_get(prop_hash,
- W2C_CONFIG_PROPERTY_LOADER_DEFAULT_LANGUAGE_TYPE_KEY,
- AXIS2_HASH_KEY_STRING);
- if (prop)
- {
- obj_impl ->default_language =
- AXIS2_STRDUP(AXIS2_ARRAY_LIST_GET(prop, env, 0), env);
- }
-
- /**
- * run through the language specific properties and populate the
- * language specific property map
- */
- if (obj_impl->language_types)
- {
- temp_hash = axis2_hash_make(env);
- obj_impl->language_specific_properties_map = temp_hash;
- size = AXIS2_ARRAY_LIST_SIZE(obj_impl->language_types , env);
- for (i = 0 ; i < size ; i++)
- {
- temp_buff = AXIS2_ARRAY_LIST_GET(obj_impl ->language_types, env, i);
- lang_spec_hash = axis2_hash_make(env);
- for (hi = axis2_hash_first(prop_hash, env); hi;
- hi = axis2_hash_next(env, hi))
- {
+ axis2_hash_t* prop_hash = NULL;
+ axis2_hash_t* temp_hash = NULL;
+ axis2_hash_t* lang_spec_hash = NULL;
+ axis2_hash_index_t* hi = NULL;
+ axis2_array_list_t* prop = NULL;
+ axis2_array_list_t* temp_array = NULL;
+ axis2_char_t* temp_buff = NULL;
+ axis2_char_t* key= NULL;
+ axis2_char_t* val= NULL;
+ int i;
+ int size;
+
+ prop_hash = W2C_PROPERTIES_GET_HASH( obj_impl-> prop_set, env);
+
+ /*TODO: this should be configured to choose the prophash from
+ * a command line option -codegen.config="file"
+ */
+
+ /*load the extension class names*/
+ prop = (axis2_array_list_t*)axis2_hash_get ( prop_hash,
+ W2C_CONFIG_PROPERTY_LOADER_CODE_GEN_KEY_PREFIX,
+ AXIS2_HASH_KEY_STRING );
+ if ( prop != NULL)
+ {
+ obj_impl ->extension_class_names =
+ w2c_config_property_loader_dup_array(prop, env );
+ }
+
+ /*load the post extension class names*/
+ prop = (axis2_array_list_t*)axis2_hash_get ( prop_hash,
+ W2C_CONFIG_PROPERTY_LOADER_POST_CODE_GEN_KEY_PREFIX,
+ AXIS2_HASH_KEY_STRING );
+ if ( prop != NULL)
+ {
+ obj_impl ->post_extension_class_names =
+ w2c_config_property_loader_dup_array(prop, env );
+ }
+
+ /* load the data binding framework names */
+ prop = (axis2_array_list_t*)axis2_hash_get ( prop_hash,
+ W2C_CONFIG_PROPERTY_LOADER_DATA_BINDING_FRAMEWORK_NAME_KEY,
+ AXIS2_HASH_KEY_STRING );
+ if ( prop != NULL)
+ {
+ obj_impl ->databinding_framework_names =
+ w2c_config_property_loader_dup_array(prop, env );
+ }
+
+ /* populate the data binding framework name to extension name map */
+ temp_array = NULL;
+ prop = (axis2_array_list_t*)axis2_hash_get ( prop_hash,
+ W2C_CONFIG_PROPERTY_LOADER_DATA_BINDING_FRAMEWORK_EXTENSION_NAME_KEY,
+ AXIS2_HASH_KEY_STRING );
+ if ( prop != NULL)
+ {
+ temp_array =
+ w2c_config_property_loader_dup_array(prop, env );
+
+ size= AXIS2_ARRAY_LIST_SIZE (obj_impl ->databinding_framework_names, env);
+ if (size != AXIS2_ARRAY_LIST_SIZE (temp_array, env) )
+ {
+ fprintf ( stderr, "data_binding_framework name to extension diff in size" );
+ w2c_config_property_loader_free(
+ &(obj_impl->config_property_loader), env);
+ return;
+ }
+
+ temp_hash = axis2_hash_make ( env );
+ obj_impl ->databinding_framework_name_to_extension_map = temp_hash;
+ for (i = 0 ; i < size ;i++ )
+ {
+ axis2_hash_set ( temp_hash,
+ AXIS2_STRDUP( AXIS2_ARRAY_LIST_GET(obj_impl ->databinding_framework_names, env, i ), env),
+ AXIS2_HASH_KEY_STRING,
+ AXIS2_STRDUP( AXIS2_ARRAY_LIST_GET(temp_array, env, i ), env));
+ }
+ }
+
+ /*load the default framework name */
+ prop = (axis2_array_list_t*)axis2_hash_get ( prop_hash,
+ W2C_CONFIG_PROPERTY_LOADER_DATA_BINDING_FRAMEWORK_DEFAULT_NAME_KEY,
+ AXIS2_HASH_KEY_STRING );
+ if ( prop != NULL)
+ {
+ obj_impl ->default_db_framework_name =
+ AXIS2_STRDUP( AXIS2_ARRAY_LIST_GET(prop, env, 0 ), env);
+ }
+
+ /* load the third party schema names */
+ prop = (axis2_array_list_t*)axis2_hash_get ( prop_hash,
+ W2C_CONFIG_PROPERTY_LOADER_THIRD_PARTY_SCHEMA_KEY_PREFIX,
+ AXIS2_HASH_KEY_STRING );
+ if ( prop != NULL)
+ {
+ obj_impl ->third_party_schema_names=
+ AXIS2_STRDUP( AXIS2_ARRAY_LIST_GET(prop, env, 0 ), env);
+ }
+
+ /* the db supporter template name */
+ prop = (axis2_array_list_t*)axis2_hash_get ( prop_hash,
+ W2C_CONFIG_PROPERTY_LOADER_DATA_BINDING_TEMPLATE_NAME_KEY,
+ AXIS2_HASH_KEY_STRING );
+ if ( prop != NULL)
+ {
+ obj_impl ->db_supporter_template_name=
+ AXIS2_STRDUP( AXIS2_ARRAY_LIST_GET(prop, env, 0 ), env);
+ }
+
+ /* test object template name */
+ /* TODO: this should be replce to check for all properties
+ * starts with W2C_CONFIG_PROPERTY_LOADER_DATA_BINDING_TEMPLATE_NAME_KEY_PREFIX
+ * ends with W2C_CONFIG_PROPERTY_LOADER_DATA_BINDING_TEMPLATE_NAME_KEY_SUFFIX
+ */
+ prop = (axis2_array_list_t*)axis2_hash_get ( prop_hash,
+ W2C_CONFIG_PROPERTY_LOADER_DATA_BINDING_TEST_OBJECT_TEMPLATE_NAME_KEY,
+ AXIS2_HASH_KEY_STRING );
+ if ( prop != NULL)
+ {
+ obj_impl ->test_object_template_name=
+ AXIS2_STRDUP( AXIS2_ARRAY_LIST_GET(prop, env, 0), env);
+ }
+
+
+ /* load the language types */
+ prop = (axis2_array_list_t*)axis2_hash_get ( prop_hash,
+ W2C_CONFIG_PROPERTY_LOADER_LANGUAGE_TYPE_KEY_PREFIX,
+ AXIS2_HASH_KEY_STRING );
+ if ( prop != NULL)
+ {
+ obj_impl ->language_types =
+ w2c_config_property_loader_dup_array(prop, env );
+ }
+
+ /* load the language emitter map */
+ prop = (axis2_array_list_t*)axis2_hash_get ( prop_hash,
+ W2C_CONFIG_PROPERTY_LOADER_EMITTER_CLASS_KEY,
+ AXIS2_HASH_KEY_STRING );
+ if ( prop != NULL)
+ {
+ temp_array = w2c_config_property_loader_dup_array(prop, env );
+
+ size= AXIS2_ARRAY_LIST_SIZE (obj_impl->language_types , env);
+ if (size != AXIS2_ARRAY_LIST_SIZE (temp_array, env) )
+ {
+ fprintf ( stderr, "data_binding_framework name to extension diff in size" );
+ w2c_config_property_loader_free(
+ &(obj_impl->config_property_loader), env);
+ return;
+ }
+
+ temp_hash = axis2_hash_make ( env );
+ obj_impl ->language_emitter_map = temp_hash;
+ for (i = 0 ; i< size ; i++ )
+ {
+ key = AXIS2_ARRAY_LIST_GET(obj_impl ->language_types, env, i);
+ val = AXIS2_ARRAY_LIST_GET(temp_array, env, i );
+ axis2_hash_set ( temp_hash,
+ AXIS2_STRDUP( key, env),
+ AXIS2_HASH_KEY_STRING,
+ AXIS2_STRDUP( val, env));
+ }
+ }
+
+ /* load the default language */
+ prop = (axis2_array_list_t*)axis2_hash_get ( prop_hash,
+ W2C_CONFIG_PROPERTY_LOADER_DEFAULT_LANGUAGE_TYPE_KEY,
+ AXIS2_HASH_KEY_STRING );
+ if ( prop != NULL)
+ {
+ obj_impl ->default_language =
+ AXIS2_STRDUP( AXIS2_ARRAY_LIST_GET(prop, env, 0 ), env);
+ }
+
+ /**
+ * run through the language specific properties and populate the
+ * language specific property map
+ */
+ if ( obj_impl->language_types)
+ {
+ temp_hash = axis2_hash_make ( env );
+ obj_impl->language_specific_properties_map = temp_hash;
+ size= AXIS2_ARRAY_LIST_SIZE (obj_impl->language_types , env);
+ for (i = 0 ; i< size ; i++ )
+ {
+ temp_buff = AXIS2_ARRAY_LIST_GET(obj_impl ->language_types, env, i );
+ lang_spec_hash = axis2_hash_make ( env );
+ for (hi = axis2_hash_first(prop_hash, env); hi;
+ hi = axis2_hash_next(env, hi))
+ {
axis2_hash_this(hi, (void*)&key, NULL, (void*)&prop);
- if (w2c_string_indexof_cs(key, temp_buff) == 0 &&
- w2c_string_indexof(key, '.') == strlen(temp_buff))
+ if ( w2c_string_indexof_cs ( key, temp_buff ) == 0 &&
+ w2c_string_indexof ( key, '.') == strlen (temp_buff ))
{
- prop = w2c_config_property_loader_dup_array(prop, env);
- axis2_hash_set(lang_spec_hash, key, AXIS2_HASH_KEY_STRING, prop);
+ prop = w2c_config_property_loader_dup_array( prop, env );
+ axis2_hash_set ( lang_spec_hash, key, AXIS2_HASH_KEY_STRING, prop );
}
- }
- axis2_hash_set(temp_hash, temp_buff, AXIS2_HASH_KEY_STRING, lang_spec_hash);
- }
- }
+ }
+ axis2_hash_set (temp_hash, temp_buff, AXIS2_HASH_KEY_STRING, lang_spec_hash );
+ }
+ }
}
static axis2_array_list_t*
w2c_config_property_loader_dup_array(
- axis2_array_list_t *original,
- const axis2_env_t *env)
+ axis2_array_list_t *original,
+ const axis2_env_t *env)
{
int i = 0;
int size = 0;
axis2_array_list_t* new_array = NULL;
axis2_char_t *tmp = NULL;
-
- size = AXIS2_ARRAY_LIST_SIZE(original, env);
- if (0 == size)
- return axis2_array_list_create(env, 1);
-
- new_array = axis2_array_list_create(env, size);
- for (i = 0; i < size; i ++)
- {
- tmp = (axis2_char_t*)AXIS2_ARRAY_LIST_GET(original, env, i);
- tmp = AXIS2_STRDUP(tmp, env);
- AXIS2_ARRAY_LIST_ADD_AT(new_array, env, i, tmp);
+
+ size = AXIS2_ARRAY_LIST_SIZE( original, env);
+ if ( 0 == size )
+ return axis2_array_list_create( env, 1);
+
+ new_array = axis2_array_list_create( env, size);
+ for( i = 0; i < size; i ++ )
+ {
+ tmp = (axis2_char_t*)AXIS2_ARRAY_LIST_GET( original, env, i);
+ tmp = AXIS2_STRDUP( tmp, env);
+ AXIS2_ARRAY_LIST_ADD_AT( new_array, env, i, tmp);
}
return new_array;
}
@@ -848,47 +847,47 @@
/** this frees axis2_char_t[] */
static axis2_status_t
w2c_config_property_loader_free_array(
- axis2_array_list_t *arr,
- const axis2_env_t *env)
+ axis2_array_list_t *arr,
+ const axis2_env_t *env)
{
int i = 0;
int size = 0;
axis2_char_t *tmp = NULL;
-
- size = AXIS2_ARRAY_LIST_SIZE(arr, env);
- for (i = 0; i < size; i ++)
+
+ size = AXIS2_ARRAY_LIST_SIZE( arr, env);
+ for( i = 0; i < size; i ++ )
{
- tmp = (axis2_char_t*)AXIS2_ARRAY_LIST_GET(arr, env, i);
- AXIS2_FREE(env-> allocator, tmp);
+ tmp = (axis2_char_t*)AXIS2_ARRAY_LIST_GET( arr, env, i);
+ AXIS2_FREE( env-> allocator, tmp);
}
- AXIS2_ARRAY_LIST_FREE(arr, env);
+ AXIS2_ARRAY_LIST_FREE( arr, env);
return AXIS2_SUCCESS;
}
/** this frees (axis2_char_t, axis2_char_t) */
static axis2_status_t
w2c_config_property_loader_free_hash(
- axis2_hash_t *h,
- const axis2_env_t *env)
+ axis2_hash_t *h,
+ const axis2_env_t *env)
{
axis2_char_t *key = NULL;
axis2_char_t *value = NULL;
axis2_hash_index_t *hi = NULL;
- for (hi = axis2_hash_first(h, env);
- hi; hi = axis2_hash_next(env, hi))
+ for (hi = axis2_hash_first( h, env);
+ hi; hi = axis2_hash_next(env, hi))
{
axis2_hash_this(hi, (void*)&key, NULL, (void*)&value);
- if (key)
+ if (key )
{
- AXIS2_FREE(env-> allocator, key);
+ AXIS2_FREE( env-> allocator, key);
}
if (value)
{
AXIS2_FREE(env-> allocator, value);
}
}
- axis2_hash_free(h, env);
+ axis2_hash_free( h, env);
return AXIS2_SUCCESS;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org