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 sa...@apache.org on 2007/09/28 05:13:00 UTC
svn commit: r580200 [1/4] - /webservices/axis2/trunk/c/util/src/
Author: samisa
Date: Thu Sep 27 20:12:58 2007
New Revision: 580200
URL: http://svn.apache.org/viewvc?rev=580200&view=rev
Log:
Fixed indentation
Modified:
webservices/axis2/trunk/c/util/src/allocator.c
webservices/axis2/trunk/c/util/src/array_list.c
webservices/axis2/trunk/c/util/src/base64.c
webservices/axis2/trunk/c/util/src/base64_binary.c
webservices/axis2/trunk/c/util/src/class_loader.c
webservices/axis2/trunk/c/util/src/date_time.c
webservices/axis2/trunk/c/util/src/date_time_util.c
webservices/axis2/trunk/c/util/src/dir_handler.c
webservices/axis2/trunk/c/util/src/dll_desc.c
webservices/axis2/trunk/c/util/src/duration.c
webservices/axis2/trunk/c/util/src/env.c
webservices/axis2/trunk/c/util/src/error.c
webservices/axis2/trunk/c/util/src/file.c
webservices/axis2/trunk/c/util/src/file_handler.c
webservices/axis2/trunk/c/util/src/generic_obj.c
webservices/axis2/trunk/c/util/src/hash.c
webservices/axis2/trunk/c/util/src/linked_list.c
webservices/axis2/trunk/c/util/src/log.c
webservices/axis2/trunk/c/util/src/network_handler.c
webservices/axis2/trunk/c/util/src/param.c
webservices/axis2/trunk/c/util/src/param_container.c
webservices/axis2/trunk/c/util/src/properties.c
webservices/axis2/trunk/c/util/src/property.c
webservices/axis2/trunk/c/util/src/qname.c
webservices/axis2/trunk/c/util/src/rand.c
webservices/axis2/trunk/c/util/src/stack.c
webservices/axis2/trunk/c/util/src/stream.c
webservices/axis2/trunk/c/util/src/string.c
webservices/axis2/trunk/c/util/src/string_util.c
webservices/axis2/trunk/c/util/src/thread_pool.c
webservices/axis2/trunk/c/util/src/types.c
webservices/axis2/trunk/c/util/src/uri.c
webservices/axis2/trunk/c/util/src/url.c
webservices/axis2/trunk/c/util/src/utils.c
webservices/axis2/trunk/c/util/src/uuid_gen.c
webservices/axis2/trunk/c/util/src/version.c
Modified: webservices/axis2/trunk/c/util/src/allocator.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/allocator.c?rev=580200&r1=580199&r2=580200&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/allocator.c (original)
+++ webservices/axis2/trunk/c/util/src/allocator.c Thu Sep 27 20:12:58 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -19,18 +20,22 @@
#include <axutil_utils.h>
#include <stdlib.h>
-void *AXIS2_CALL
-axutil_allocator_malloc_impl(axutil_allocator_t *allocator, size_t size);
-
-void *AXIS2_CALL
-axutil_allocator_realloc_impl(axutil_allocator_t *allocator, void *ptr, size_t size);
-
-void AXIS2_CALL
-axutil_allocator_free_impl(axutil_allocator_t *allocator, void *ptr);
-
-
-AXIS2_EXTERN axutil_allocator_t * AXIS2_CALL
-axutil_allocator_init(axutil_allocator_t *allocator)
+void *AXIS2_CALL axutil_allocator_malloc_impl(
+ axutil_allocator_t * allocator,
+ size_t size);
+
+void *AXIS2_CALL axutil_allocator_realloc_impl(
+ axutil_allocator_t * allocator,
+ void *ptr,
+ size_t size);
+
+void AXIS2_CALL axutil_allocator_free_impl(
+ axutil_allocator_t * allocator,
+ void *ptr);
+
+AXIS2_EXTERN axutil_allocator_t *AXIS2_CALL
+axutil_allocator_init(
+ axutil_allocator_t * allocator)
{
if (allocator)
return allocator;
@@ -50,7 +55,8 @@
}
AXIS2_EXTERN void AXIS2_CALL
-axutil_allocator_free(axutil_allocator_t *allocator)
+axutil_allocator_free(
+ axutil_allocator_t * allocator)
{
if (allocator)
{
@@ -60,39 +66,46 @@
}
void *AXIS2_CALL
-axutil_allocator_malloc_impl(axutil_allocator_t *allocator, size_t size)
+axutil_allocator_malloc_impl(
+ axutil_allocator_t * allocator,
+ size_t size)
{
return malloc(size);
}
void *AXIS2_CALL
-axutil_allocator_realloc_impl(axutil_allocator_t *allocator, void *ptr, size_t size)
+axutil_allocator_realloc_impl(
+ axutil_allocator_t * allocator,
+ void *ptr,
+ size_t size)
{
return realloc(ptr, size);
}
void AXIS2_CALL
-axutil_allocator_free_impl(axutil_allocator_t *allocator, void *ptr)
+axutil_allocator_free_impl(
+ axutil_allocator_t * allocator,
+ void *ptr)
{
free(ptr);
}
-
-AXIS2_EXTERN void AXIS2_CALL
-axutil_allocator_switch_to_global_pool(axutil_allocator_t *allocator)
-{
+AXIS2_EXTERN void AXIS2_CALL
+axutil_allocator_switch_to_global_pool(
+ axutil_allocator_t * allocator)
+{
if (!allocator)
return;
allocator->current_pool = allocator->global_pool;
return;
}
-AXIS2_EXTERN void AXIS2_CALL
-axutil_allocator_switch_to_local_pool(axutil_allocator_t *allocator)
+AXIS2_EXTERN void AXIS2_CALL
+axutil_allocator_switch_to_local_pool(
+ axutil_allocator_t * allocator)
{
if (!allocator)
return;
allocator->current_pool = allocator->local_pool;
return;
}
-
Modified: webservices/axis2/trunk/c/util/src/array_list.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/array_list.c?rev=580200&r1=580199&r2=580200&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/array_list.c (original)
+++ webservices/axis2/trunk/c/util/src/array_list.c Thu Sep 27 20:12:58 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -21,16 +22,20 @@
struct axutil_array_list
{
+
/**The number of elements in this list. */
int size;
+
/**Current capacity of this list. */
int capacity;
+
/** Where the data is stored. */
- void** data;
+ void **data;
};
-AXIS2_EXTERN struct axutil_array_list* AXIS2_CALL
-axutil_array_list_create(const axutil_env_t *env,
+AXIS2_EXTERN struct axutil_array_list *AXIS2_CALL
+axutil_array_list_create(
+ const axutil_env_t * env,
int capacity)
{
axutil_array_list_t *array_list = NULL;
@@ -51,7 +56,7 @@
/* Check capacity, and set the default if error */
if (capacity <= 0)
capacity = AXIS2_ARRAY_LIST_DEFAULT_CAPACITY;
- array_list->data = AXIS2_MALLOC(env->allocator, sizeof(void*) * capacity);
+ array_list->data = AXIS2_MALLOC(env->allocator, sizeof(void *) * capacity);
if (!array_list->data)
{
axutil_array_list_free(array_list, env);
@@ -63,28 +68,27 @@
return array_list;
}
-
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_array_list_ensure_capacity(struct axutil_array_list *array_list,
- const axutil_env_t *env,
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axutil_array_list_ensure_capacity(
+ struct axutil_array_list * array_list,
+ const axutil_env_t * env,
int min_capacity)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
if (min_capacity > array_list->capacity)
{
- int new_capacity = (array_list->capacity * 2 > min_capacity) ?
- (array_list->capacity * 2) : min_capacity;
- void **data = (void**) AXIS2_MALLOC(env->allocator,
- sizeof(void*) * new_capacity);
+ int new_capacity =
+ (array_list->capacity * 2 > min_capacity) ? (array_list->capacity * 2) : min_capacity;
+ void **data = (void **) AXIS2_MALLOC(env->allocator,
+ sizeof(void *) * new_capacity);
if (!data)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return AXIS2_FAILURE;
}
- memcpy(data, array_list->data,
- sizeof(void*) * array_list->capacity);
-
+ memcpy(data, array_list->data, sizeof(void *) * array_list->capacity);
+
AXIS2_FREE(env->allocator, array_list->data);
array_list->data = data;
@@ -93,34 +97,38 @@
return AXIS2_SUCCESS;
}
-AXIS2_EXTERN int AXIS2_CALL
-axutil_array_list_size(struct axutil_array_list *array_list,
- const axutil_env_t *env)
+AXIS2_EXTERN int AXIS2_CALL
+axutil_array_list_size(
+ struct axutil_array_list *array_list,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
return array_list->size;
}
-AXIS2_EXTERN axis2_bool_t AXIS2_CALL
-axutil_array_list_is_empty(struct axutil_array_list *array_list,
- const axutil_env_t *env)
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+axutil_array_list_is_empty(
+ struct axutil_array_list * array_list,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
return array_list->size == 0;
}
-AXIS2_EXTERN axis2_bool_t AXIS2_CALL
-axutil_array_list_contains(struct axutil_array_list *array_list,
- const axutil_env_t *env,
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+axutil_array_list_contains(
+ struct axutil_array_list * array_list,
+ const axutil_env_t * env,
void *e)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
return axutil_array_list_index_of(array_list, env, e) != -1;
}
-AXIS2_EXTERN int AXIS2_CALL
-axutil_array_list_index_of(struct axutil_array_list *array_list,
- const axutil_env_t *env,
+AXIS2_EXTERN int AXIS2_CALL
+axutil_array_list_index_of(
+ struct axutil_array_list *array_list,
+ const axutil_env_t * env,
void *e)
{
int i = 0;
@@ -133,9 +141,10 @@
return -1;
}
-AXIS2_EXTERN void* AXIS2_CALL
-axutil_array_list_get(struct axutil_array_list *array_list,
- const axutil_env_t *env,
+AXIS2_EXTERN void *AXIS2_CALL
+axutil_array_list_get(
+ struct axutil_array_list *array_list,
+ const axutil_env_t * env,
int index)
{
if (axutil_array_list_check_bound_exclusive(array_list, env, index))
@@ -144,13 +153,14 @@
return NULL;
}
-AXIS2_EXTERN void* AXIS2_CALL
-axutil_array_list_set(struct axutil_array_list *array_list,
- const axutil_env_t *env,
- int index,
- void* e)
+AXIS2_EXTERN void *AXIS2_CALL
+axutil_array_list_set(
+ struct axutil_array_list *array_list,
+ const axutil_env_t * env,
+ int index,
+ void *e)
{
- void* result = NULL;
+ void *result = NULL;
AXIS2_ENV_CHECK(env, NULL);
@@ -162,24 +172,27 @@
return result;
}
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_array_list_add(struct axutil_array_list *array_list,
- const axutil_env_t *env,
- const void* e)
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axutil_array_list_add(
+ struct axutil_array_list * array_list,
+ const axutil_env_t * env,
+ const void *e)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
if (array_list->size == array_list->capacity)
- if (axutil_array_list_ensure_capacity(array_list, env, array_list->size + 1) != AXIS2_SUCCESS)
+ if (axutil_array_list_ensure_capacity(array_list, env, array_list->size + 1) !=
+ AXIS2_SUCCESS)
return AXIS2_FAILURE;
- array_list->data[array_list->size++] = (void *)e;
+ array_list->data[array_list->size++] = (void *) e;
return AXIS2_SUCCESS;
}
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_array_list_add_at(struct axutil_array_list *array_list,
- const axutil_env_t *env,
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axutil_array_list_add_at(
+ struct axutil_array_list * array_list,
+ const axutil_env_t * env,
const int index,
- const void* e)
+ const void *e)
{
int i = 0;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -187,7 +200,8 @@
return AXIS2_FAILURE;
if (array_list->size == array_list->capacity)
{
- if (axutil_array_list_ensure_capacity(array_list, env, array_list->size + 1) != AXIS2_SUCCESS)
+ if (axutil_array_list_ensure_capacity(array_list, env, array_list->size + 1) !=
+ AXIS2_SUCCESS)
return AXIS2_FAILURE;
}
if (index != array_list->size)
@@ -195,17 +209,18 @@
for (i = array_list->size; i > index; i--)
array_list->data[i] = array_list->data[i - 1];
}
- array_list->data[index] = (void *)e;
+ array_list->data[index] = (void *) e;
array_list->size++;
return AXIS2_SUCCESS;
}
-AXIS2_EXTERN void* AXIS2_CALL
-axutil_array_list_remove(struct axutil_array_list *array_list,
- const axutil_env_t *env,
+AXIS2_EXTERN void *AXIS2_CALL
+axutil_array_list_remove(
+ struct axutil_array_list *array_list,
+ const axutil_env_t * env,
int index)
{
- void* result = NULL;
+ void *result = NULL;
int i = 0;
AXIS2_ENV_CHECK(env, NULL);
@@ -220,9 +235,10 @@
return result;
}
-AXIS2_EXTERN axis2_bool_t AXIS2_CALL
-axutil_array_list_check_bound_inclusive(struct axutil_array_list *array_list,
- const axutil_env_t *env,
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+axutil_array_list_check_bound_inclusive(
+ struct axutil_array_list * array_list,
+ const axutil_env_t * env,
int index)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -235,9 +251,10 @@
return AXIS2_TRUE;
}
-AXIS2_EXTERN axis2_bool_t AXIS2_CALL
-axutil_array_list_check_bound_exclusive(struct axutil_array_list *array_list,
- const axutil_env_t *env,
+AXIS2_EXTERN axis2_bool_t AXIS2_CALL
+axutil_array_list_check_bound_exclusive(
+ struct axutil_array_list * array_list,
+ const axutil_env_t * env,
int index)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -250,9 +267,10 @@
return AXIS2_TRUE;
}
-AXIS2_EXTERN void AXIS2_CALL
-axutil_array_list_free(struct axutil_array_list *array_list,
- const axutil_env_t *env)
+AXIS2_EXTERN void AXIS2_CALL
+axutil_array_list_free(
+ struct axutil_array_list *array_list,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -265,8 +283,9 @@
}
AXIS2_EXTERN void AXIS2_CALL
-axutil_array_list_free_void_arg(void *array_list,
- const axutil_env_t *env)
+axutil_array_list_free_void_arg(
+ void *array_list,
+ const axutil_env_t * env)
{
axutil_array_list_t *array_list_l = NULL;
Modified: webservices/axis2/trunk/c/util/src/base64.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/base64.c?rev=580200&r1=580199&r2=580200&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/base64.c (original)
+++ webservices/axis2/trunk/c/util/src/base64.c Thu Sep 27 20:12:58 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -15,7 +16,6 @@
* limitations under the License.
*/
-
/* base64 encoder/decoder. Originally part of main/util.c
* but moved here so that support/ab and axis2_sha1.c could
* use it. This meant removing the axis2_palloc()s and adding
@@ -24,73 +24,73 @@
#include <axutil_base64.h>
-static const unsigned char pr2six[256] =
- {
+static const unsigned char pr2six[256] = {
#ifndef __OS400__
- /* ASCII table */
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, 64, 64, 63,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64,
- 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64,
- 64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
-#else /* __OS400__ */
- /* EBCDIC table */
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 63, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 64, 64, 64, 64, 64, 64,
- 64, 35, 36, 37, 38, 39, 40, 41, 42, 43, 64, 64, 64, 64, 64, 64,
- 64, 64, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 64, 64, 64, 64, 64, 64,
- 64, 9, 10, 11, 12, 13, 14, 15, 16, 17, 64, 64, 64, 64, 64, 64,
- 64, 64, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64, 64,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64
-#endif /* AXIS2_CHARSET_EBCDIC */
- };
+ /* ASCII table */
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, 64, 64, 63,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64,
+ 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64,
+ 64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
+#else /* __OS400__ */
+ /* EBCDIC table */
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 63, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 64, 64, 64, 64, 64, 64,
+ 64, 35, 36, 37, 38, 39, 40, 41, 42, 43, 64, 64, 64, 64, 64, 64,
+ 64, 64, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 64, 64, 64, 64, 64, 64,
+ 64, 9, 10, 11, 12, 13, 14, 15, 16, 17, 64, 64, 64, 64, 64, 64,
+ 64, 64, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64, 64,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64
+#endif /* AXIS2_CHARSET_EBCDIC */
+};
#ifdef __OS400__
-static unsigned char os_toascii[256] =
- {
- /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
- 0, 1, 2, 3, 156, 9, 134, 127, 151, 141, 142, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 157, 133, 8, 135, 24, 25, 146, 143, 28, 29, 30, 31,
- 128, 129, 130, 131, 132, 10, 23, 27, 136, 137, 138, 139, 140, 5, 6, 7,
- 144, 145, 22, 147, 148, 149, 150, 4, 152, 153, 154, 155, 20, 21, 158, 26,
- 32, 160, 226, 228, 224, 225, 227, 229, 231, 241, 162, 46, 60, 40, 43, 124,
- 38, 233, 234, 235, 232, 237, 238, 239, 236, 223, 33, 36, 42, 41, 59, 172,
- 45, 47, 194, 196, 192, 193, 195, 197, 199, 209, 166, 44, 37, 95, 62, 63,
- 248, 201, 202, 203, 200, 205, 206, 207, 204, 96, 58, 35, 64, 39, 61, 34,
- 216, 97, 98, 99, 100, 101, 102, 103, 104, 105, 171, 187, 240, 253, 254, 177,
- 176, 106, 107, 108, 109, 110, 111, 112, 113, 114, 170, 186, 230, 184, 198, 164,
- 181, 126, 115, 116, 117, 118, 119, 120, 121, 122, 161, 191, 208, 221, 222, 174,
- 94, 163, 165, 183, 169, 167, 182, 188, 189, 190, 91, 93, 175, 168, 180, 215,
- 123, 65, 66, 67, 68, 69, 70, 71, 72, 73, 173, 244, 246, 242, 243, 245,
- 125, 74, 75, 76, 77, 78, 79, 80, 81, 82, 185, 251, 252, 249, 250, 255,
- 92, 247, 83, 84, 85, 86, 87, 88, 89, 90, 178, 212, 214, 210, 211, 213,
- 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 179, 219, 220, 217, 218, 159
- };
-
-#endif /* __OS400__ */
-
-AXIS2_EXTERN int AXIS2_CALL axutil_base64_decode_len(const char *bufcoded)
+static unsigned char os_toascii[256] = {
+ /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
+ 0, 1, 2, 3, 156, 9, 134, 127, 151, 141, 142, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 157, 133, 8, 135, 24, 25, 146, 143, 28, 29, 30, 31,
+ 128, 129, 130, 131, 132, 10, 23, 27, 136, 137, 138, 139, 140, 5, 6, 7,
+ 144, 145, 22, 147, 148, 149, 150, 4, 152, 153, 154, 155, 20, 21, 158, 26,
+ 32, 160, 226, 228, 224, 225, 227, 229, 231, 241, 162, 46, 60, 40, 43, 124,
+ 38, 233, 234, 235, 232, 237, 238, 239, 236, 223, 33, 36, 42, 41, 59, 172,
+ 45, 47, 194, 196, 192, 193, 195, 197, 199, 209, 166, 44, 37, 95, 62, 63,
+ 248, 201, 202, 203, 200, 205, 206, 207, 204, 96, 58, 35, 64, 39, 61, 34,
+ 216, 97, 98, 99, 100, 101, 102, 103, 104, 105, 171, 187, 240, 253, 254, 177,
+ 176, 106, 107, 108, 109, 110, 111, 112, 113, 114, 170, 186, 230, 184, 198, 164,
+ 181, 126, 115, 116, 117, 118, 119, 120, 121, 122, 161, 191, 208, 221, 222, 174,
+ 94, 163, 165, 183, 169, 167, 182, 188, 189, 190, 91, 93, 175, 168, 180, 215,
+ 123, 65, 66, 67, 68, 69, 70, 71, 72, 73, 173, 244, 246, 242, 243, 245,
+ 125, 74, 75, 76, 77, 78, 79, 80, 81, 82, 185, 251, 252, 249, 250, 255,
+ 92, 247, 83, 84, 85, 86, 87, 88, 89, 90, 178, 212, 214, 210, 211, 213,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 179, 219, 220, 217, 218, 159
+};
+
+#endif /* __OS400__ */
+
+AXIS2_EXTERN int AXIS2_CALL
+axutil_base64_decode_len(
+ const char *bufcoded)
{
int nbytesdecoded;
register const unsigned char *bufin;
@@ -105,7 +105,10 @@
return nbytesdecoded + 1;
}
-AXIS2_EXTERN int AXIS2_CALL axutil_base64_decode(char *bufplain, const char *bufcoded)
+AXIS2_EXTERN int AXIS2_CALL
+axutil_base64_decode(
+ char *bufplain,
+ const char *bufcoded)
{
int len;
len = axutil_base64_decode_binary((unsigned char *) bufplain, bufcoded);
@@ -117,8 +120,10 @@
* the conversion of the output to ebcdic is left out.
*/
-AXIS2_EXTERN int AXIS2_CALL axutil_base64_decode_binary(unsigned char *bufplain,
- const char *bufcoded)
+AXIS2_EXTERN int AXIS2_CALL
+axutil_base64_decode_binary(
+ unsigned char *bufplain,
+ const char *bufcoded)
{
int nbytesdecoded;
register const unsigned char *bufin;
@@ -135,12 +140,9 @@
while (nprbytes > 4)
{
- *(bufout++) =
- (unsigned char)(pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
- *(bufout++) =
- (unsigned char)(pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
- *(bufout++) =
- (unsigned char)(pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
+ *(bufout++) = (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
+ *(bufout++) = (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
+ *(bufout++) = (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
bufin += 4;
nprbytes -= 4;
}
@@ -148,37 +150,39 @@
/* Note: (nprbytes == 1) would be an error, so just ingore that case */
if (nprbytes > 1)
{
- *(bufout++) =
- (unsigned char)(pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
+ *(bufout++) = (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
}
if (nprbytes > 2)
{
- *(bufout++) =
- (unsigned char)(pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
+ *(bufout++) = (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
}
if (nprbytes > 3)
{
- *(bufout++) =
- (unsigned char)(pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
+ *(bufout++) = (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
}
nbytesdecoded -= (4 - nprbytes) & 3;
return nbytesdecoded;
}
-static const char basis_64[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+static const char basis_64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-AXIS2_EXTERN int AXIS2_CALL axutil_base64_encode_len(int len)
+AXIS2_EXTERN int AXIS2_CALL
+axutil_base64_encode_len(
+ int len)
{
return ((len + 2) / 3 * 4) + 1;
}
-AXIS2_EXTERN int AXIS2_CALL axutil_base64_encode(char *encoded, const char *string, int len)
+AXIS2_EXTERN int AXIS2_CALL
+axutil_base64_encode(
+ char *encoded,
+ const char *string,
+ int len)
{
#ifndef __OS400__
return axutil_base64_encode_binary(encoded, (const unsigned char *) string, len);
-#else /* __OS400__ */
+#else /* __OS400__ */
int i;
char *p;
@@ -186,10 +190,12 @@
for (i = 0; i < len - 2; i += 3)
{
*p++ = basis_64[(os_toascii[string[i]] >> 2) & 0x3F];
- *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4) |
- ((int)(os_toascii[string[i + 1]] & 0xF0) >> 4)];
- *p++ = basis_64[((os_toascii[string[i + 1]] & 0xF) << 2) |
- ((int)(os_toascii[string[i + 2]] & 0xC0) >> 6)];
+ *p++ =
+ basis_64[((os_toascii[string[i]] & 0x3) << 4) |
+ ((int) (os_toascii[string[i + 1]] & 0xF0) >> 4)];
+ *p++ =
+ basis_64[((os_toascii[string[i + 1]] & 0xF) << 2) |
+ ((int) (os_toascii[string[i + 2]] & 0xC0) >> 6)];
*p++ = basis_64[os_toascii[string[i + 2]] & 0x3F];
}
if (i < len)
@@ -202,8 +208,9 @@
}
else
{
- *p++ = basis_64[((os_toascii[string[i]] & 0x3) << 4) |
- ((int)(os_toascii[string[i + 1]] & 0xF0) >> 4)];
+ *p++ =
+ basis_64[((os_toascii[string[i]] & 0x3) << 4) |
+ ((int) (os_toascii[string[i + 1]] & 0xF0) >> 4)];
*p++ = basis_64[((os_toascii[string[i + 1]] & 0xF) << 2)];
}
*p++ = '=';
@@ -211,14 +218,17 @@
*p++ = '\0';
return p - encoded;
-#endif /* __OS400__ */
+#endif /* __OS400__ */
}
/* This is the same as axutil_base64_encode() except on EBCDIC machines, where
* the conversion of the input to ascii is left out.
*/
-AXIS2_EXTERN int AXIS2_CALL axutil_base64_encode_binary(char *encoded,
- const unsigned char *string, int len)
+AXIS2_EXTERN int AXIS2_CALL
+axutil_base64_encode_binary(
+ char *encoded,
+ const unsigned char *string,
+ int len)
{
int i;
char *p;
@@ -227,10 +237,8 @@
for (i = 0; i < len - 2; i += 3)
{
*p++ = basis_64[(string[i] >> 2) & 0x3F];
- *p++ = basis_64[((string[i] & 0x3) << 4) |
- ((int)(string[i + 1] & 0xF0) >> 4)];
- *p++ = basis_64[((string[i + 1] & 0xF) << 2) |
- ((int)(string[i + 2] & 0xC0) >> 6)];
+ *p++ = basis_64[((string[i] & 0x3) << 4) | ((int) (string[i + 1] & 0xF0) >> 4)];
+ *p++ = basis_64[((string[i + 1] & 0xF) << 2) | ((int) (string[i + 2] & 0xC0) >> 6)];
*p++ = basis_64[string[i + 2] & 0x3F];
}
if (i < len)
@@ -243,8 +251,7 @@
}
else
{
- *p++ = basis_64[((string[i] & 0x3) << 4) |
- ((int)(string[i + 1] & 0xF0) >> 4)];
+ *p++ = basis_64[((string[i] & 0x3) << 4) | ((int) (string[i + 1] & 0xF0) >> 4)];
*p++ = basis_64[((string[i + 1] & 0xF) << 2)];
}
*p++ = '=';
Modified: webservices/axis2/trunk/c/util/src/base64_binary.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/base64_binary.c?rev=580200&r1=580199&r2=580200&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/base64_binary.c (original)
+++ webservices/axis2/trunk/c/util/src/base64_binary.c Thu Sep 27 20:12:58 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -25,14 +26,15 @@
int plain_binary_len;
};
-AXIS2_EXTERN axutil_base64_binary_t * AXIS2_CALL
-axutil_base64_binary_create(const axutil_env_t *env)
+AXIS2_EXTERN axutil_base64_binary_t *AXIS2_CALL
+axutil_base64_binary_create(
+ const axutil_env_t * env)
{
axutil_base64_binary_t *base64_binary = NULL;
AXIS2_ENV_CHECK(env, NULL);
- base64_binary = (axutil_base64_binary_t *) AXIS2_MALLOC(env->allocator,
- sizeof(axutil_base64_binary_t));
+ base64_binary =
+ (axutil_base64_binary_t *) AXIS2_MALLOC(env->allocator, sizeof(axutil_base64_binary_t));
if (!base64_binary)
{
@@ -43,15 +45,16 @@
return base64_binary;
}
-AXIS2_EXTERN axutil_base64_binary_t * AXIS2_CALL
-axutil_base64_binary_create_with_plain_binary(const axutil_env_t *env,
- const unsigned char* plain_binary,
- int plain_binary_len)
+AXIS2_EXTERN axutil_base64_binary_t *AXIS2_CALL
+axutil_base64_binary_create_with_plain_binary(
+ const axutil_env_t * env,
+ const unsigned char *plain_binary,
+ int plain_binary_len)
{
axutil_base64_binary_t *base64_binary = NULL;
AXIS2_ENV_CHECK(env, NULL);
- AXIS2_PARAM_CHECK(env->error, plain_binary , NULL);
+ AXIS2_PARAM_CHECK(env->error, plain_binary, NULL);
base64_binary = (axutil_base64_binary_t *) axutil_base64_binary_create(env);
if (!base64_binary)
{
@@ -59,8 +62,8 @@
return NULL;
}
- base64_binary->plain_binary = AXIS2_MALLOC(env->allocator,
- sizeof(unsigned char) * plain_binary_len);
+ base64_binary->plain_binary =
+ AXIS2_MALLOC(env->allocator, sizeof(unsigned char) * plain_binary_len);
if (!base64_binary->plain_binary)
{
@@ -68,21 +71,22 @@
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- memcpy(base64_binary ->plain_binary, plain_binary, plain_binary_len);
+ memcpy(base64_binary->plain_binary, plain_binary, plain_binary_len);
base64_binary->plain_binary_len = plain_binary_len;
return base64_binary;
}
-AXIS2_EXTERN axutil_base64_binary_t * AXIS2_CALL
-axutil_base64_binary_create_with_encoded_binary(const axutil_env_t *env,
- const char* encoded_binary)
+AXIS2_EXTERN axutil_base64_binary_t *AXIS2_CALL
+axutil_base64_binary_create_with_encoded_binary(
+ const axutil_env_t * env,
+ const char *encoded_binary)
{
axutil_base64_binary_t *base64_binary = NULL;
int plain_binary_len = 0;
AXIS2_ENV_CHECK(env, NULL);
- AXIS2_PARAM_CHECK(env->error, encoded_binary , NULL);
+ AXIS2_PARAM_CHECK(env->error, encoded_binary, NULL);
base64_binary = (axutil_base64_binary_t *) axutil_base64_binary_create(env);
if (!base64_binary)
@@ -92,8 +96,8 @@
}
plain_binary_len = axutil_base64_decode_len(encoded_binary);
- base64_binary->plain_binary = AXIS2_MALLOC(env->allocator,
- sizeof(unsigned char) * plain_binary_len);
+ base64_binary->plain_binary =
+ AXIS2_MALLOC(env->allocator, sizeof(unsigned char) * plain_binary_len);
if (!base64_binary->plain_binary)
{
@@ -101,16 +105,16 @@
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- axutil_base64_decode_binary(base64_binary-> plain_binary,
- encoded_binary);
- base64_binary-> plain_binary_len = plain_binary_len;
+ axutil_base64_decode_binary(base64_binary->plain_binary, encoded_binary);
+ base64_binary->plain_binary_len = plain_binary_len;
return base64_binary;
}
AXIS2_EXTERN void AXIS2_CALL
-axutil_base64_binary_free(axutil_base64_binary_t *base64_binary,
- const axutil_env_t *env)
+axutil_base64_binary_free(
+ axutil_base64_binary_t * base64_binary,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -128,47 +132,50 @@
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_base64_binary_set_plain_binary(axutil_base64_binary_t *base64_binary,
- const axutil_env_t *env,
- const unsigned char* plain_binary,
- int plain_binary_len)
+axutil_base64_binary_set_plain_binary(
+ axutil_base64_binary_t * base64_binary,
+ const axutil_env_t * env,
+ const unsigned char *plain_binary,
+ int plain_binary_len)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- base64_binary->plain_binary = AXIS2_MALLOC(env->
- allocator, sizeof(unsigned char) * plain_binary_len);
+ base64_binary->plain_binary =
+ AXIS2_MALLOC(env->allocator, sizeof(unsigned char) * plain_binary_len);
if (!base64_binary->plain_binary)
{
axutil_base64_binary_free(base64_binary, env);
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return AXIS2_FAILURE;
}
- memcpy(base64_binary ->plain_binary, plain_binary, base64_binary->plain_binary_len);
+ memcpy(base64_binary->plain_binary, plain_binary, base64_binary->plain_binary_len);
base64_binary->plain_binary_len = plain_binary_len;
return AXIS2_SUCCESS;
}
-AXIS2_EXTERN unsigned char* AXIS2_CALL
-axutil_base64_binary_get_plain_binary(axutil_base64_binary_t *base64_binary,
- const axutil_env_t *env,
- int* plain_binary_len)
+AXIS2_EXTERN unsigned char *AXIS2_CALL
+axutil_base64_binary_get_plain_binary(
+ axutil_base64_binary_t * base64_binary,
+ const axutil_env_t * env,
+ int *plain_binary_len)
{
*plain_binary_len = base64_binary->plain_binary_len;
- return base64_binary -> plain_binary;
+ return base64_binary->plain_binary;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_base64_binary_set_encoded_binary(axutil_base64_binary_t *base64_binary,
- const axutil_env_t *env,
- const char* encoded_binary)
+axutil_base64_binary_set_encoded_binary(
+ axutil_base64_binary_t * base64_binary,
+ const axutil_env_t * env,
+ const char *encoded_binary)
{
int plain_binary_len = 0;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
plain_binary_len = axutil_base64_decode_len(encoded_binary);
- base64_binary->plain_binary = AXIS2_MALLOC(env->
- allocator, sizeof(unsigned char) * plain_binary_len);
+ base64_binary->plain_binary =
+ AXIS2_MALLOC(env->allocator, sizeof(unsigned char) * plain_binary_len);
if (!base64_binary->plain_binary)
{
@@ -176,24 +183,22 @@
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return AXIS2_FAILURE;
}
- axutil_base64_decode_binary(base64_binary-> plain_binary,
- encoded_binary);
- base64_binary-> plain_binary_len = plain_binary_len;
+ axutil_base64_decode_binary(base64_binary->plain_binary, encoded_binary);
+ base64_binary->plain_binary_len = plain_binary_len;
return AXIS2_SUCCESS;
}
-AXIS2_EXTERN char* AXIS2_CALL
-axutil_base64_binary_get_encoded_binary(axutil_base64_binary_t *base64_binary,
- const axutil_env_t *env)
+AXIS2_EXTERN char *AXIS2_CALL
+axutil_base64_binary_get_encoded_binary(
+ axutil_base64_binary_t * base64_binary,
+ const axutil_env_t * env)
{
- char* encoded_binary = NULL;
+ char *encoded_binary = NULL;
int encoded_binary_len = 0;
- encoded_binary_len = axutil_base64_encode_len(
- base64_binary-> plain_binary_len);
- encoded_binary = AXIS2_MALLOC(env-> allocator,
- sizeof(char) * encoded_binary_len);
+ encoded_binary_len = axutil_base64_encode_len(base64_binary->plain_binary_len);
+ encoded_binary = AXIS2_MALLOC(env->allocator, sizeof(char) * encoded_binary_len);
if (!encoded_binary)
{
@@ -201,28 +206,25 @@
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- axutil_base64_encode_binary(encoded_binary,
- base64_binary-> plain_binary,
- base64_binary-> plain_binary_len);
+ axutil_base64_encode_binary(encoded_binary, base64_binary->plain_binary,
+ base64_binary->plain_binary_len);
return encoded_binary;
}
-
AXIS2_EXTERN int AXIS2_CALL
-axutil_base64_binary_get_encoded_binary_len(axutil_base64_binary_t *base64_binary,
- const axutil_env_t *env)
+axutil_base64_binary_get_encoded_binary_len(
+ axutil_base64_binary_t * base64_binary,
+ const axutil_env_t * env)
{
int encoded_binary_len = 0;
- encoded_binary_len = axutil_base64_encode_len(
- base64_binary-> plain_binary_len);
+ encoded_binary_len = axutil_base64_encode_len(base64_binary->plain_binary_len);
return encoded_binary_len;
}
AXIS2_EXTERN int AXIS2_CALL
-axutil_base64_binary_get_decoded_binary_len(axutil_base64_binary_t *base64_binary,
- const axutil_env_t *env)
+axutil_base64_binary_get_decoded_binary_len(
+ axutil_base64_binary_t * base64_binary,
+ const axutil_env_t * env)
{
- return base64_binary -> plain_binary_len;
+ return base64_binary->plain_binary_len;
}
-
-
Modified: webservices/axis2/trunk/c/util/src/class_loader.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/class_loader.c?rev=580200&r1=580199&r2=580200&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/class_loader.c (original)
+++ webservices/axis2/trunk/c/util/src/class_loader.c Thu Sep 27 20:12:58 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -17,40 +18,40 @@
#include <axutil_class_loader.h>
-axis2_status_t
-axutil_class_loader_load_lib(const axutil_env_t *env,
- axutil_dll_desc_t *dll_desc);
-
-axis2_status_t
-axutil_class_loader_unload_lib(const axutil_env_t *env,
- axutil_dll_desc_t *dll_desc);
-
+axis2_status_t axutil_class_loader_load_lib(
+ const axutil_env_t * env,
+ axutil_dll_desc_t * dll_desc);
+
+axis2_status_t axutil_class_loader_unload_lib(
+ const axutil_env_t * env,
+ axutil_dll_desc_t * dll_desc);
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_class_loader_init(const axutil_env_t *env)
+axutil_class_loader_init(
+ const axutil_env_t * env)
{
AXIS2_PLATFORM_LOADLIBINIT();
return AXIS2_SUCCESS;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_class_loader_delete_dll(const axutil_env_t *env,
- axutil_dll_desc_t *dll_desc)
+axutil_class_loader_delete_dll(
+ const axutil_env_t * env,
+ axutil_dll_desc_t * dll_desc)
{
if (!dll_desc)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DLL_CREATE_FAILED,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DLL_CREATE_FAILED, AXIS2_FAILURE);
return AXIS2_FAILURE;
}
axutil_class_loader_unload_lib(env, dll_desc);
- AXIS2_PLATFORM_LOADLIBEXIT()
- return AXIS2_SUCCESS;
+ AXIS2_PLATFORM_LOADLIBEXIT()return AXIS2_SUCCESS;
}
-AXIS2_EXTERN void * AXIS2_CALL
-axutil_class_loader_create_dll(const axutil_env_t *env,
- axutil_param_t *impl_info_param)
+AXIS2_EXTERN void *AXIS2_CALL
+axutil_class_loader_create_dll(
+ const axutil_env_t * env,
+ axutil_param_t * impl_info_param)
{
void *obj = NULL;
CREATE_FUNCT create_funct = NULL;
@@ -63,67 +64,60 @@
dll_desc = axutil_param_get_value(impl_info_param, env);
if (!dll_desc)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DLL_CREATE_FAILED,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DLL_CREATE_FAILED, AXIS2_FAILURE);
return NULL;
}
- dl_handler = axutil_dll_desc_get_dl_handler(dll_desc, env);
- if (! dl_handler)
+ dl_handler = axutil_dll_desc_get_dl_handler(dll_desc, env);
+ if (!dl_handler)
{
status = axutil_class_loader_load_lib(env, dll_desc);
if (AXIS2_SUCCESS != status)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DLL_CREATE_FAILED,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DLL_CREATE_FAILED, AXIS2_FAILURE);
return NULL;
}
- dl_handler = axutil_dll_desc_get_dl_handler(dll_desc, env);
+ dl_handler = axutil_dll_desc_get_dl_handler(dll_desc, env);
if (!dl_handler)
{
return NULL;
}
- create_funct = (CREATE_FUNCT) AXIS2_PLATFORM_GETPROCADDR(dl_handler,
- AXIS2_CREATE_FUNCTION);
+ create_funct = (CREATE_FUNCT) AXIS2_PLATFORM_GETPROCADDR(dl_handler, AXIS2_CREATE_FUNCTION);
if (!create_funct)
{
return NULL;
}
- status = axutil_dll_desc_set_create_funct(dll_desc, env, create_funct);
+ status = axutil_dll_desc_set_create_funct(dll_desc, env, create_funct);
if (AXIS2_FAILURE == status)
{
axutil_class_loader_unload_lib(env, dll_desc);
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DLL_CREATE_FAILED,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DLL_CREATE_FAILED, AXIS2_FAILURE);
return NULL;
}
- delete_funct = (DELETE_FUNCT) AXIS2_PLATFORM_GETPROCADDR(dl_handler,
- AXIS2_DELETE_FUNCTION);
+ delete_funct = (DELETE_FUNCT) AXIS2_PLATFORM_GETPROCADDR(dl_handler, AXIS2_DELETE_FUNCTION);
if (!delete_funct)
{
return NULL;
}
- status = axutil_dll_desc_set_delete_funct(dll_desc, env, delete_funct);
+ status = axutil_dll_desc_set_delete_funct(dll_desc, env, delete_funct);
if (AXIS2_FAILURE == status)
{
axutil_class_loader_unload_lib(env, dll_desc);
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DLL_CREATE_FAILED,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DLL_CREATE_FAILED, AXIS2_FAILURE);
return NULL;
}
}
- create_funct = axutil_dll_desc_get_create_funct(dll_desc, env);
+ create_funct = axutil_dll_desc_get_create_funct(dll_desc, env);
if (!create_funct)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_DLL_DESC,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_STATE_DLL_DESC, AXIS2_FAILURE);
return NULL;
}
- error_code = axutil_dll_desc_get_error_code(dll_desc, env) ;
+ error_code = axutil_dll_desc_get_error_code(dll_desc, env);
create_funct(&obj, env);
- if (! obj)
+ if (!obj)
{
axutil_class_loader_unload_lib(env, dll_desc);
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Object create function returned NULL");
@@ -138,29 +132,28 @@
}
axis2_status_t
-axutil_class_loader_load_lib(const axutil_env_t *env,
- axutil_dll_desc_t *dll_desc)
+axutil_class_loader_load_lib(
+ const axutil_env_t * env,
+ axutil_dll_desc_t * dll_desc)
{
axis2_char_t *dll_name = NULL;
AXIS2_DLHANDLER dl_handler = NULL;
axis2_status_t status = AXIS2_FAILURE;
- dll_name = axutil_dll_desc_get_name(dll_desc, env);
+ dll_name = axutil_dll_desc_get_name(dll_desc, env);
dl_handler = AXIS2_PLATFORM_LOADLIB(dll_name);
- if (! dl_handler)
+ if (!dl_handler)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DLL_LOADING_FAILED,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DLL_LOADING_FAILED, AXIS2_FAILURE);
return AXIS2_FAILURE;
}
- status = axutil_dll_desc_set_dl_handler(dll_desc, env, dl_handler);
+ status = axutil_dll_desc_set_dl_handler(dll_desc, env, dl_handler);
if (AXIS2_SUCCESS != status)
{
AXIS2_PLATFORM_UNLOADLIB(dl_handler);
dl_handler = NULL;
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DLL_LOADING_FAILED,
- AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_DLL_LOADING_FAILED, AXIS2_FAILURE);
return status;
}
@@ -168,10 +161,11 @@
}
axis2_status_t
-axutil_class_loader_unload_lib(const axutil_env_t *env,
- axutil_dll_desc_t *dll_desc)
+axutil_class_loader_unload_lib(
+ const axutil_env_t * env,
+ axutil_dll_desc_t * dll_desc)
{
- AXIS2_DLHANDLER dl_handler = axutil_dll_desc_get_dl_handler(dll_desc, env);
+ AXIS2_DLHANDLER dl_handler = axutil_dll_desc_get_dl_handler(dll_desc, env);
if (dl_handler)
{
AXIS2_PLATFORM_UNLOADLIB(dl_handler);
Modified: webservices/axis2/trunk/c/util/src/date_time.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/date_time.c?rev=580200&r1=580199&r2=580200&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/date_time.c (original)
+++ webservices/axis2/trunk/c/util/src/date_time.c Thu Sep 27 20:12:58 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -34,17 +35,18 @@
int msec;
};
-AXIS2_EXTERN axutil_date_time_t * AXIS2_CALL
-axutil_date_time_create_with_offset(const axutil_env_t *env, int offset)
+AXIS2_EXTERN axutil_date_time_t *AXIS2_CALL
+axutil_date_time_create_with_offset(
+ const axutil_env_t * env,
+ int offset)
{
axutil_date_time_t *date_time = NULL;
time_t t;
- struct tm* utc_time = NULL;
- /*struct tm* utc_time_ret = NULL;*/
+ struct tm *utc_time = NULL;
+ /*struct tm* utc_time_ret = NULL; */
AXIS2_ENV_CHECK(env, NULL);
- date_time = (axutil_date_time_t *) AXIS2_MALLOC(env->
- allocator, sizeof(axutil_date_time_t));
+ date_time = (axutil_date_time_t *) AXIS2_MALLOC(env->allocator, sizeof(axutil_date_time_t));
if (!date_time)
{
@@ -67,17 +69,17 @@
return date_time;
}
-
-AXIS2_EXTERN axutil_date_time_t * AXIS2_CALL
-axutil_date_time_create(const axutil_env_t *env)
+AXIS2_EXTERN axutil_date_time_t *AXIS2_CALL
+axutil_date_time_create(
+ const axutil_env_t * env)
{
return axutil_date_time_create_with_offset(env, 0);
}
-
AXIS2_EXTERN void AXIS2_CALL
-axutil_date_time_free(axutil_date_time_t *date_time,
- const axutil_env_t *env)
+axutil_date_time_free(
+ axutil_date_time_t * date_time,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -89,208 +91,252 @@
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_date_time_deserialize_time(axutil_date_time_t *date_time,
- const axutil_env_t *env,
- const axis2_char_t* time_str)
+axutil_date_time_deserialize_time(
+ axutil_date_time_t * date_time,
+ const axutil_env_t * env,
+ const axis2_char_t * time_str)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- sscanf(time_str, "%d:%d:%d:%dZ" , &date_time->hour, &date_time->min,
- &date_time->sec, &date_time->msec);
+ sscanf(time_str, "%d:%d:%d:%dZ", &date_time->hour, &date_time->min, &date_time->sec,
+ &date_time->msec);
return AXIS2_SUCCESS;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_date_time_deserialize_date(axutil_date_time_t *date_time,
- const axutil_env_t *env,
- const axis2_char_t* date_str)
+axutil_date_time_deserialize_date(
+ axutil_date_time_t * date_time,
+ const axutil_env_t * env,
+ const axis2_char_t * date_str)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- sscanf(date_str, "%d-%d-%d" , &date_time->year, &date_time->mon,
- &date_time->day);
+ sscanf(date_str, "%d-%d-%d", &date_time->year, &date_time->mon, &date_time->day);
date_time->year -= 1900;
return AXIS2_SUCCESS;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_date_time_deserialize_date_time(axutil_date_time_t *date_time,
- const axutil_env_t *env,
- const axis2_char_t* date_time_str)
+axutil_date_time_deserialize_date_time(
+ axutil_date_time_t * date_time,
+ const axutil_env_t * env,
+ const axis2_char_t * date_time_str)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
sscanf(date_time_str, "%d-%d-%dT%d:%d:%d.%dZ", &date_time->year, &date_time->mon,
- &date_time->day, &date_time->hour, &date_time->min,
- &date_time->sec, &date_time->msec);
+ &date_time->day, &date_time->hour, &date_time->min, &date_time->sec, &date_time->msec);
date_time->year -= 1900;
return AXIS2_SUCCESS;
}
/*Check if the @data_time is not expired, compared to @ref*/
AXIS2_EXTERN axutil_date_time_comp_result_t AXIS2_CALL
-axutil_date_time_compare(axutil_date_time_t *date_time,
- const axutil_env_t *env, axutil_date_time_t *ref)
+axutil_date_time_compare(
+ axutil_date_time_t * date_time,
+ const axutil_env_t * env,
+ axutil_date_time_t * ref)
{
-
- AXIS2_ENV_CHECK(env, AXIS2_DATE_TIME_COMP_RES_FAILURE);
-
- if(date_time->year < ref->year){
- return AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED;
- }else if(date_time->year > ref->year){
+
+ AXIS2_ENV_CHECK(env, AXIS2_DATE_TIME_COMP_RES_FAILURE);
+
+ if (date_time->year < ref->year)
+ {
+ return AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED;
+ }
+ else if (date_time->year > ref->year)
+ {
return AXIS2_DATE_TIME_COMP_RES_EXPIRED;
- }
+ }
- if(date_time->mon < ref->mon ){
- return AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED;
- }else if(date_time->mon > ref->mon){
+ if (date_time->mon < ref->mon)
+ {
+ return AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED;
+ }
+ else if (date_time->mon > ref->mon)
+ {
return AXIS2_DATE_TIME_COMP_RES_EXPIRED;
- }
+ }
- if(date_time->day < ref->day ){
- return AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED;
- }else if(date_time->day > ref->day){
+ if (date_time->day < ref->day)
+ {
+ return AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED;
+ }
+ else if (date_time->day > ref->day)
+ {
return AXIS2_DATE_TIME_COMP_RES_EXPIRED;
- }
+ }
- if(date_time->hour < ref->hour ){
- return AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED;
- }else if(date_time->hour > ref->hour){
+ if (date_time->hour < ref->hour)
+ {
+ return AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED;
+ }
+ else if (date_time->hour > ref->hour)
+ {
return AXIS2_DATE_TIME_COMP_RES_EXPIRED;
- }
+ }
- if(date_time->min < ref->min ){
- return AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED;
- }else if(date_time->min > ref->min){
+ if (date_time->min < ref->min)
+ {
+ return AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED;
+ }
+ else if (date_time->min > ref->min)
+ {
return AXIS2_DATE_TIME_COMP_RES_EXPIRED;
- }
+ }
- if(date_time->sec < ref->sec ){
- return AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED;
- }else if(date_time->sec > ref->sec){
+ if (date_time->sec < ref->sec)
+ {
+ return AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED;
+ }
+ else if (date_time->sec > ref->sec)
+ {
return AXIS2_DATE_TIME_COMP_RES_EXPIRED;
- }
+ }
- if(date_time->msec < ref->msec ){
- return AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED;
- }else if(date_time->msec > ref->msec){
+ if (date_time->msec < ref->msec)
+ {
+ return AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED;
+ }
+ else if (date_time->msec > ref->msec)
+ {
return AXIS2_DATE_TIME_COMP_RES_EXPIRED;
- }
-
- return AXIS2_DATE_TIME_COMP_RES_EQUAL;
+ }
+
+ return AXIS2_DATE_TIME_COMP_RES_EQUAL;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_date_time_set_date_time(axutil_date_time_t* date_time,
- const axutil_env_t *env,
- int year, int month, int day,
- int hour, int min, int second, int milliseconds)
+axutil_date_time_set_date_time(
+ axutil_date_time_t * date_time,
+ const axutil_env_t * env,
+ int year,
+ int month,
+ int day,
+ int hour,
+ int min,
+ int second,
+ int milliseconds)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- if (year > -1)date_time->year = year - 1900;
- if (month > -1)date_time->mon = month;
- if (day > -1)date_time->day = day;
- if (hour > -1)date_time->hour = hour;
- if (min > -1)date_time->min = min;
- if (second > -1)date_time->sec = second;
- if (second > -1)date_time->msec = milliseconds;
+ if (year > -1)
+ date_time->year = year - 1900;
+ if (month > -1)
+ date_time->mon = month;
+ if (day > -1)
+ date_time->day = day;
+ if (hour > -1)
+ date_time->hour = hour;
+ if (min > -1)
+ date_time->min = min;
+ if (second > -1)
+ date_time->sec = second;
+ if (second > -1)
+ date_time->msec = milliseconds;
return AXIS2_SUCCESS;
}
-AXIS2_EXTERN axis2_char_t* AXIS2_CALL
-axutil_date_time_serialize_time(axutil_date_time_t *date_time,
- const axutil_env_t *env)
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+axutil_date_time_serialize_time(
+ axutil_date_time_t * date_time,
+ const axutil_env_t * env)
{
- axis2_char_t* time_str = NULL;
+ axis2_char_t *time_str = NULL;
AXIS2_ENV_CHECK(env, NULL);
- time_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * 32);
+ time_str = (axis2_char_t *) AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * 32);
- sprintf(time_str, "%d:%d:%d.%dZ" , date_time->hour, date_time->min, date_time->sec,date_time->msec);
+ sprintf(time_str, "%d:%d:%d.%dZ", date_time->hour, date_time->min, date_time->sec,
+ date_time->msec);
return time_str;
}
-AXIS2_EXTERN axis2_char_t* AXIS2_CALL
-axutil_date_time_serialize_date(axutil_date_time_t *date_time,
- const axutil_env_t *env)
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+axutil_date_time_serialize_date(
+ axutil_date_time_t * date_time,
+ const axutil_env_t * env)
{
- axis2_char_t* date_str = NULL;
+ axis2_char_t *date_str = NULL;
AXIS2_ENV_CHECK(env, NULL);
- date_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * 32);
+ date_str = (axis2_char_t *) AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * 32);
- sprintf(date_str, "%d-%d-%d" , date_time->year + 1900,
- date_time->mon,
- date_time->day);
+ sprintf(date_str, "%d-%d-%d", date_time->year + 1900, date_time->mon, date_time->day);
return date_str;
}
-AXIS2_EXTERN axis2_char_t* AXIS2_CALL
-axutil_date_time_serialize_date_time(axutil_date_time_t *date_time,
- const axutil_env_t *env)
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+axutil_date_time_serialize_date_time(
+ axutil_date_time_t * date_time,
+ const axutil_env_t * env)
{
- axis2_char_t* date_time_str = NULL;
+ axis2_char_t *date_time_str = NULL;
AXIS2_ENV_CHECK(env, NULL);
date_time_str = AXIS2_MALLOC(env->allocator, sizeof(char) * 32);
- sprintf(date_time_str, "%d-%02d-%02dT%02d:%02d:%02d.%03dZ" , date_time->year + 1900,
- date_time->mon + 1, date_time->day, date_time->hour, date_time->min,
- date_time->sec, date_time->msec);
+ sprintf(date_time_str, "%d-%02d-%02dT%02d:%02d:%02d.%03dZ", date_time->year + 1900,
+ date_time->mon + 1, date_time->day, date_time->hour, date_time->min, date_time->sec,
+ date_time->msec);
return date_time_str;
}
AXIS2_EXTERN int AXIS2_CALL
-axutil_date_time_get_year(axutil_date_time_t *date_time,
- const axutil_env_t *env)
+axutil_date_time_get_year(
+ axutil_date_time_t * date_time,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
return (date_time->year + 1900);
}
AXIS2_EXTERN int AXIS2_CALL
-axutil_date_time_get_month(axutil_date_time_t *date_time,
- const axutil_env_t *env)
+axutil_date_time_get_month(
+ axutil_date_time_t * date_time,
+ const axutil_env_t * env)
{
return (date_time->mon);
}
-
AXIS2_EXTERN int AXIS2_CALL
-axutil_date_time_get_date(axutil_date_time_t *date_time,
- const axutil_env_t *env)
+axutil_date_time_get_date(
+ axutil_date_time_t * date_time,
+ const axutil_env_t * env)
{
return (date_time->day);
}
AXIS2_EXTERN int AXIS2_CALL
-axutil_date_time_get_hour(axutil_date_time_t *date_time,
- const axutil_env_t *env)
+axutil_date_time_get_hour(
+ axutil_date_time_t * date_time,
+ const axutil_env_t * env)
{
return (date_time->hour);
}
AXIS2_EXTERN int AXIS2_CALL
-axutil_date_time_get_minute(axutil_date_time_t *date_time,
- const axutil_env_t *env)
+axutil_date_time_get_minute(
+ axutil_date_time_t * date_time,
+ const axutil_env_t * env)
{
return (date_time->min);
}
AXIS2_EXTERN int AXIS2_CALL
-axutil_date_time_get_second(axutil_date_time_t *date_time,
- const axutil_env_t *env)
+axutil_date_time_get_second(
+ axutil_date_time_t * date_time,
+ const axutil_env_t * env)
{
return (date_time->sec);
}
AXIS2_EXTERN int AXIS2_CALL
-axutil_date_time_get_msec(axutil_date_time_t *date_time,
- const axutil_env_t *env)
+axutil_date_time_get_msec(
+ axutil_date_time_t * date_time,
+ const axutil_env_t * env)
{
return (date_time->msec);
}
-
Modified: webservices/axis2/trunk/c/util/src/date_time_util.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/date_time_util.c?rev=580200&r1=580199&r2=580200&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/date_time_util.c (original)
+++ webservices/axis2/trunk/c/util/src/date_time_util.c Thu Sep 27 20:12:58 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -17,10 +18,9 @@
#include <axutil_date_time_util.h>
-
-
AXIS2_EXTERN int AXIS2_CALL
-axutil_get_milliseconds(const axutil_env_t *env)
+axutil_get_milliseconds(
+ const axutil_env_t * env)
{
return axis2_platform_get_milliseconds();
}
Modified: webservices/axis2/trunk/c/util/src/dir_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/dir_handler.c?rev=580200&r1=580199&r2=580200&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/dir_handler.c (original)
+++ webservices/axis2/trunk/c/util/src/dir_handler.c Thu Sep 27 20:12:58 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -25,29 +26,33 @@
#include <minizip/axis2_archive_extract.h>
-extern int AXIS2_ALPHASORT();
+extern int AXIS2_ALPHASORT(
+ );
#ifdef IS_MACOSX
-int dir_select(struct dirent *entry);
+int dir_select(
+ struct dirent *entry);
#else
-int dir_select(const struct dirent *entry);
+int dir_select(
+ const struct dirent *entry);
#endif
-
/**
* List the dll files in the given service or module folder path
* @param pathname path to your service or module directory
* @return array list of dll file names
*/
-AXIS2_EXTERN axutil_array_list_t * AXIS2_CALL
-axutil_dir_handler_list_services_or_modules_in_dir(const axutil_env_t *env,
- const axis2_char_t *pathname)
+AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
+axutil_dir_handler_list_services_or_modules_in_dir(
+ const axutil_env_t * env,
+ const axis2_char_t * pathname)
{
axutil_array_list_t *file_list = NULL;
struct stat *buf = NULL;
int count = 1;
int i = 0;
struct dirent **files = NULL;
- int file_select();
+ int file_select(
+ );
axis2_status_t status = AXIS2_FAILURE;
AXIS2_ENV_CHECK(env, NULL);
@@ -61,14 +66,14 @@
return NULL;
}
- for (i = 1; i < (count + 1) ; ++i)
+ for (i = 1; i < (count + 1); ++i)
{
axis2_char_t *fname = NULL;
axutil_file_t *arch_file = NULL;
axis2_char_t *path = NULL;
axis2_char_t *temp_path = NULL;
- fname = files[i-1]->d_name;
+ fname = files[i - 1]->d_name;
arch_file = (axutil_file_t *) axutil_file_create(env);
if (!arch_file)
{
@@ -86,7 +91,7 @@
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- axutil_file_set_name(arch_file, env, fname);
+ axutil_file_set_name(arch_file, env, fname);
temp_path = axutil_stracat(env, pathname, AXIS2_PATH_SEP_STR);
path = axutil_stracat(env, temp_path, fname);
AXIS2_FREE(env->allocator, temp_path);
@@ -107,7 +112,7 @@
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- axutil_file_set_path(arch_file, env, path);
+ axutil_file_set_path(arch_file, env, path);
buf = AXIS2_MALLOC(env->allocator, sizeof(struct stat));
if (!buf)
{
@@ -128,7 +133,7 @@
return NULL;
}
stat(path, buf);
- axutil_file_set_timestamp(arch_file, env, (time_t) buf->st_ctime);
+ axutil_file_set_timestamp(arch_file, env, (time_t) buf->st_ctime);
status = axutil_array_list_add(file_list, env, arch_file);
if (AXIS2_SUCCESS != status)
{
@@ -161,9 +166,10 @@
* @param pathname path your modules or services folder
* @return array list of contents of services or modules folder
*/
-AXIS2_EXTERN axutil_array_list_t * AXIS2_CALL
-axutil_dir_handler_list_service_or_module_dirs(const axutil_env_t *env,
- const axis2_char_t *pathname)
+AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
+axutil_dir_handler_list_service_or_module_dirs(
+ const axutil_env_t * env,
+ const axis2_char_t * pathname)
{
axutil_array_list_t *file_list = NULL;
struct stat *buf = NULL;
@@ -181,7 +187,8 @@
axis2_status_t status = AXIS2_FAILURE;
AXIS2_ENV_CHECK(env, NULL);
file_list = axutil_array_list_create(env, 0);
- if (!getcwd(cwd, 500)) exit(1);
+ if (!getcwd(cwd, 500))
+ exit(1);
chdir(pathname);
axis2_archive_extract();
@@ -196,14 +203,14 @@
return NULL;
}
- for (i = 1; i < (count + 1) ; ++i)
+ for (i = 1; i < (count + 1); ++i)
{
axis2_char_t *fname = NULL;
axutil_file_t *arch_file = NULL;
axis2_char_t *path = NULL;
axis2_char_t *temp_path = NULL;
- fname = files[i-1]->d_name;
+ fname = files[i - 1]->d_name;
arch_file = (axutil_file_t *) axutil_file_create(env);
if (!arch_file)
{
@@ -221,7 +228,7 @@
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- axutil_file_set_name(arch_file, env, fname);
+ axutil_file_set_name(arch_file, env, fname);
temp_path = axutil_stracat(env, pathname, AXIS2_PATH_SEP_STR);
path = axutil_stracat(env, temp_path, fname);
if (!path)
@@ -241,7 +248,7 @@
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- axutil_file_set_path(arch_file, env, path);
+ axutil_file_set_path(arch_file, env, path);
AXIS2_FREE(env->allocator, temp_path);
buf = AXIS2_MALLOC(env->allocator, sizeof(struct stat));
if (!buf)
@@ -263,7 +270,7 @@
return NULL;
}
stat(path, buf);
- axutil_file_set_timestamp(arch_file, env, (time_t) buf->st_ctime);
+ axutil_file_set_timestamp(arch_file, env, (time_t) buf->st_ctime);
status = axutil_array_list_add(file_list, env, arch_file);
if (AXIS2_SUCCESS != status)
{
@@ -295,36 +302,38 @@
return file_list;
}
-
-int file_select(struct dirent *entry)
-
+int
+file_select(
+ struct dirent *entry)
{
axis2_char_t *ptr;
- if ((strcmp(entry->d_name, ".") == 0) ||
- (strcmp(entry->d_name, "..") == 0))
+ if ((strcmp(entry->d_name, ".") == 0) || (strcmp(entry->d_name, "..") == 0))
return (AXIS2_FALSE);
/* Check for filename extensions */
ptr = axutil_rindex(entry->d_name, '.');
- if ((ptr) &&
- ((strcmp(ptr, AXIS2_LIB_SUFFIX) == 0)))
+ if ((ptr) && ((strcmp(ptr, AXIS2_LIB_SUFFIX) == 0)))
{
return (AXIS2_TRUE);
}
else
- return(AXIS2_FALSE);
+ return (AXIS2_FALSE);
}
#ifdef IS_MACOSX
-int dir_select(struct dirent *entry)
+int
+dir_select(
+ struct dirent *entry)
#else
-int dir_select(const struct dirent *entry)
+int
+dir_select(
+ const struct dirent *entry)
#endif
{
struct stat stat_p;
- if (-1 == stat(entry->d_name, &stat_p))
+ if (-1 == stat(entry->d_name, &stat_p))
return (AXIS2_FALSE);
if ((entry->d_name[0] == '.') || (!S_ISDIR(stat_p.st_mode)))
@@ -334,4 +343,3 @@
return AXIS2_TRUE;
}
-
Modified: webservices/axis2/trunk/c/util/src/dll_desc.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/dll_desc.c?rev=580200&r1=580199&r2=580200&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/dll_desc.c (original)
+++ webservices/axis2/trunk/c/util/src/dll_desc.c Thu Sep 27 20:12:58 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -30,18 +31,17 @@
AXIS2_TIME_T timestamp;
axutil_error_codes_t error_code;
-
};
-AXIS2_EXTERN axutil_dll_desc_t * AXIS2_CALL
-axutil_dll_desc_create(const axutil_env_t *env)
+AXIS2_EXTERN axutil_dll_desc_t *AXIS2_CALL
+axutil_dll_desc_create(
+ const axutil_env_t * env)
{
axutil_dll_desc_t *dll_desc = NULL;
AXIS2_ENV_CHECK(env, NULL);
- dll_desc = (axutil_dll_desc_t *) AXIS2_MALLOC(env->allocator
- , sizeof(axutil_dll_desc_t));
+ dll_desc = (axutil_dll_desc_t *) AXIS2_MALLOC(env->allocator, sizeof(axutil_dll_desc_t));
if (!dll_desc)
{
@@ -63,8 +63,9 @@
}
AXIS2_EXTERN void AXIS2_CALL
-axutil_dll_desc_free(axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env)
+axutil_dll_desc_free(
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -93,8 +94,9 @@
}
AXIS2_EXTERN void AXIS2_CALL
-axutil_dll_desc_free_void_arg(void *dll_desc,
- const axutil_env_t *env)
+axutil_dll_desc_free_void_arg(
+ void *dll_desc,
+ const axutil_env_t * env)
{
axutil_dll_desc_t *dll_desc_l = NULL;
@@ -105,9 +107,10 @@
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_dll_desc_set_name(axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env,
- axis2_char_t *name)
+axutil_dll_desc_set_name(
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env,
+ axis2_char_t * name)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, name, AXIS2_FAILURE);
@@ -127,16 +130,18 @@
}
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
-axutil_dll_desc_get_name(axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env)
+axutil_dll_desc_get_name(
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env)
{
return dll_desc->path_qualified_dll_name;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_dll_desc_set_load_options(axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env,
- int options)
+axutil_dll_desc_set_load_options(
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env,
+ int options)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -145,9 +150,10 @@
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_dll_desc_set_type(axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env,
- axis2_dll_type_t type)
+axutil_dll_desc_set_type(
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env,
+ axis2_dll_type_t type)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -156,23 +162,26 @@
}
AXIS2_EXTERN axis2_dll_type_t AXIS2_CALL
-axutil_dll_desc_get_type(axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env)
+axutil_dll_desc_get_type(
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env)
{
return dll_desc->dll_type;
}
AXIS2_EXTERN int AXIS2_CALL
-axutil_dll_desc_get_load_options(axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env)
+axutil_dll_desc_get_load_options(
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env)
{
return dll_desc->load_options;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_dll_desc_set_dl_handler(axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env,
- AXIS2_DLHANDLER dl_handler)
+axutil_dll_desc_set_dl_handler(
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env,
+ AXIS2_DLHANDLER dl_handler)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, dl_handler, AXIS2_FAILURE);
@@ -186,16 +195,18 @@
}
AXIS2_EXTERN AXIS2_DLHANDLER AXIS2_CALL
-axutil_dll_desc_get_dl_handler(axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env)
+axutil_dll_desc_get_dl_handler(
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env)
{
return dll_desc->dl_handler;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_dll_desc_set_create_funct(axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env,
- CREATE_FUNCT funct)
+axutil_dll_desc_set_create_funct(
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env,
+ CREATE_FUNCT funct)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
dll_desc->create_funct = funct;
@@ -203,16 +214,18 @@
}
AXIS2_EXTERN CREATE_FUNCT AXIS2_CALL
-axutil_dll_desc_get_create_funct(axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env)
+axutil_dll_desc_get_create_funct(
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env)
{
return dll_desc->create_funct;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_dll_desc_set_delete_funct(axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env,
- DELETE_FUNCT funct)
+axutil_dll_desc_set_delete_funct(
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env,
+ DELETE_FUNCT funct)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -221,16 +234,18 @@
}
AXIS2_EXTERN DELETE_FUNCT AXIS2_CALL
-axutil_dll_desc_get_delete_funct(axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env)
+axutil_dll_desc_get_delete_funct(
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env)
{
return dll_desc->delete_funct;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_dll_desc_set_timestamp(axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env,
- AXIS2_TIME_T timestamp)
+axutil_dll_desc_set_timestamp(
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env,
+ AXIS2_TIME_T timestamp)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
dll_desc->timestamp = timestamp;
@@ -238,16 +253,17 @@
}
AXIS2_EXTERN AXIS2_TIME_T AXIS2_CALL
-axutil_dll_desc_get_timestamp(axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env)
+axutil_dll_desc_get_timestamp(
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env)
{
return dll_desc->timestamp;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axutil_dll_desc_set_error_code(
- axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env,
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env,
axutil_error_codes_t error_code)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -259,16 +275,17 @@
AXIS2_EXTERN axutil_error_codes_t AXIS2_CALL
axutil_dll_desc_get_error_code(
- axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env)
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env)
{
return dll_desc->error_code;
}
-AXIS2_EXTERN axis2_char_t* AXIS2_CALL
-axutil_dll_desc_create_platform_specific_dll_name(axutil_dll_desc_t *dll_desc,
- const axutil_env_t *env,
- const axis2_char_t *class_name)
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+axutil_dll_desc_create_platform_specific_dll_name(
+ axutil_dll_desc_t * dll_desc,
+ const axutil_env_t * env,
+ const axis2_char_t * class_name)
{
axis2_char_t *temp_name = NULL;
Modified: webservices/axis2/trunk/c/util/src/duration.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/duration.c?rev=580200&r1=580199&r2=580200&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/duration.c (original)
+++ webservices/axis2/trunk/c/util/src/duration.c Thu Sep 27 20:12:58 2007
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -26,67 +27,72 @@
*/
struct axutil_duration
-{
+{
axis2_bool_t is_negative;
int years;
int months;
int days;
int hours;
int mins;
- double secs;
+ double secs;
};
-
-AXIS2_EXTERN axutil_duration_t * AXIS2_CALL
-axutil_duration_create(axutil_env_t *env)
+AXIS2_EXTERN axutil_duration_t *AXIS2_CALL
+axutil_duration_create(
+ axutil_env_t * env)
{
return axutil_duration_create_from_values(env, 0, 0, 0, 0, 0, 0, 0.0);
}
-AXIS2_EXTERN axutil_duration_t * AXIS2_CALL
-axutil_duration_create_from_values(const axutil_env_t *env,
- axis2_bool_t negative,
- int years, int months, int days, int hours,
- int minutes, double seconds)
+AXIS2_EXTERN axutil_duration_t *AXIS2_CALL
+axutil_duration_create_from_values(
+ const axutil_env_t * env,
+ axis2_bool_t negative,
+ int years,
+ int months,
+ int days,
+ int hours,
+ int minutes,
+ double seconds)
{
axutil_duration_t *duration = NULL;
AXIS2_ENV_CHECK(env, NULL);
-
- duration = (axutil_duration_t *)AXIS2_MALLOC(env->allocator,
- sizeof(axutil_duration_t));
- if (NULL == duration)
- {
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
-
- duration->is_negative = negative;
- duration->years = years;
- duration->months = months;
- duration->days = days;
- duration->hours = hours;
- duration->mins = minutes;
- duration->secs = seconds;
+
+ duration = (axutil_duration_t *) AXIS2_MALLOC(env->allocator, sizeof(axutil_duration_t));
+ if (NULL == duration)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ duration->is_negative = negative;
+ duration->years = years;
+ duration->months = months;
+ duration->days = days;
+ duration->hours = hours;
+ duration->mins = minutes;
+ duration->secs = seconds;
return duration;
}
-AXIS2_EXTERN axutil_duration_t * AXIS2_CALL
-axutil_duration_create_from_string(const axutil_env_t *env,
- axis2_char_t *duration_str)
+AXIS2_EXTERN axutil_duration_t *AXIS2_CALL
+axutil_duration_create_from_string(
+ const axutil_env_t * env,
+ axis2_char_t * duration_str)
{
axutil_duration_t *duration = NULL;
axutil_duration_deserialize_duration(duration, env, duration_str);
return duration;
}
-
/***************************Function implementation****************************/
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_duration_free(axutil_duration_t *duration,
- const axutil_env_t *env)
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axutil_duration_free(
+ axutil_duration_t * duration,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -100,15 +106,16 @@
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_duration_deserialize_duration(axutil_duration_t *duration,
- const axutil_env_t *env,
- const axis2_char_t *duration_str)
+axutil_duration_deserialize_duration(
+ axutil_duration_t * duration,
+ const axutil_env_t * env,
+ const axis2_char_t * duration_str)
{
const axis2_char_t *cur = duration_str;
- double num;
- int num_type = 0;
+ double num;
+ int num_type = 0;
unsigned int seq = 0;
- const char desig[] = {'Y', 'M', 'D', 'H', 'M', 'S'};
+ const char desig[] = { 'Y', 'M', 'D', 'H', 'M', 'S' };
if (duration_str == NULL)
{
@@ -134,17 +141,18 @@
return AXIS2_FAILURE;
}
- while ( *cur != 0 )
+ while (*cur != 0)
{
- if ( seq >= sizeof(desig))
+ if (seq >= sizeof(desig))
{
- AXIS2_ERROR_SET(env->error,AXIS2_ERROR_NONE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NONE, AXIS2_FAILURE);
return AXIS2_FAILURE;
}
if (*cur == 'T')
{
- if (seq < 3) {
+ if (seq < 3)
+ {
seq = 3;
cur++;
}
@@ -159,32 +167,35 @@
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NONE, AXIS2_FAILURE);
return AXIS2_FAILURE;
}
-
+
num = 0;
- if ((*cur < '0') || (*cur > '9'))
- num_type = -1;
- else
- {
- while ((*cur >= '0') && (*cur <= '9')) {
- num = num * 10 + (*cur - '0');
- cur++;
- }
- }
-
- if (!num_type && (*cur == '.')) {
- double mult = 1;
- cur++;
- if ((*cur < '0') || (*cur > '9'))
- num_type = -1;
- else
- num_type = 1;
- while ((*cur >= '0') && (*cur <= '9')) {
- mult /= 10;
- num += (*cur - '0') * mult;
- cur++;
- }
- }
+ if ((*cur < '0') || (*cur > '9'))
+ num_type = -1;
+ else
+ {
+ while ((*cur >= '0') && (*cur <= '9'))
+ {
+ num = num * 10 + (*cur - '0');
+ cur++;
+ }
+ }
+
+ if (!num_type && (*cur == '.'))
+ {
+ double mult = 1;
+ cur++;
+ if ((*cur < '0') || (*cur > '9'))
+ num_type = -1;
+ else
+ num_type = 1;
+ while ((*cur >= '0') && (*cur <= '9'))
+ {
+ mult /= 10;
+ num += (*cur - '0') * mult;
+ cur++;
+ }
+ }
if ((num_type == -1) || (*cur == 0))
{
@@ -192,11 +203,11 @@
return AXIS2_FAILURE;
}
- while ( seq < sizeof(desig) )
+ while (seq < sizeof(desig))
{
if (*cur == desig[seq])
{
- if ((num_type = 0) && (seq < (sizeof(desig)-1)))
+ if ((num_type = 0) && (seq < (sizeof(desig) - 1)))
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NONE, AXIS2_FAILURE);
return AXIS2_FAILURE;
@@ -204,56 +215,57 @@
switch (seq)
{
- case 0:
- duration->years = (int)num;
- seq++;
- break;
- case 1:
- duration->months = (int)num;
- seq++;
- break;
- case 2:
- duration->days = (int)num;
- seq++;
- break;
- case 3:
- duration->hours = (int)num;
- seq++;
- break;
- case 4:
- duration->mins = (int)num;
- seq++;
- break;
- case 5:
- duration->secs = num;
- seq++;
- break;
- }
- break;
- }
- if ((++seq == 3) || (seq == 6))
- return 1;
- }
- cur++;
- }
- return AXIS2_SUCCESS;
+ case 0:
+ duration->years = (int) num;
+ seq++;
+ break;
+ case 1:
+ duration->months = (int) num;
+ seq++;
+ break;
+ case 2:
+ duration->days = (int) num;
+ seq++;
+ break;
+ case 3:
+ duration->hours = (int) num;
+ seq++;
+ break;
+ case 4:
+ duration->mins = (int) num;
+ seq++;
+ break;
+ case 5:
+ duration->secs = num;
+ seq++;
+ break;
+ }
+ break;
+ }
+ if ((++seq == 3) || (seq == 6))
+ return 1;
+ }
+ cur++;
+ }
+ return AXIS2_SUCCESS;
}
-AXIS2_EXTERN char* AXIS2_CALL
-axutil_duration_serialize_duration(axutil_duration_t *duration,
- const axutil_env_t *env )
+AXIS2_EXTERN char *AXIS2_CALL
+axutil_duration_serialize_duration(
+ axutil_duration_t * duration,
+ const axutil_env_t * env)
{
axis2_char_t *duration_str = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- duration_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * 64);
-
+ duration_str = (axis2_char_t *) AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * 64);
+
if (duration->is_negative == 0)
sprintf(duration_str, "P%dY%dM%dDT%dH%dM%fS", duration->years, duration->months,
duration->days, duration->hours, duration->mins, duration->secs);
- else
+ else
sprintf(duration_str, "-P%dY%dM%dDT%dH%dM%fS", duration->years, duration->months,
duration->days, duration->hours, duration->mins, duration->secs);
@@ -261,36 +273,49 @@
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_duration_set_duration(axutil_duration_t* duration,
- const axutil_env_t *env,
- axis2_bool_t negative,
- int years, int months, int days,
- int hours, int mins, double seconds)
+axutil_duration_set_duration(
+ axutil_duration_t * duration,
+ const axutil_env_t * env,
+ axis2_bool_t negative,
+ int years,
+ int months,
+ int days,
+ int hours,
+ int mins,
+ double seconds)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- if(years > -1)duration->years = years;
- if(months > -1)duration->months = months;
- if(days > -1)duration->days = days;
- if(hours > -1)duration->hours = hours;
- if(mins > -1)duration->mins = mins;
- if(seconds > -1)duration->secs = seconds;
+ if (years > -1)
+ duration->years = years;
+ if (months > -1)
+ duration->months = months;
+ if (days > -1)
+ duration->days = days;
+ if (hours > -1)
+ duration->hours = hours;
+ if (mins > -1)
+ duration->mins = mins;
+ if (seconds > -1)
+ duration->secs = seconds;
return AXIS2_SUCCESS;
}
AXIS2_EXTERN int AXIS2_CALL
-axutil_duration_get_years(axutil_duration_t *duration,
- const axutil_env_t *env )
+axutil_duration_get_years(
+ axutil_duration_t * duration,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
return duration->years;
}
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_duration_set_years(axutil_duration_t *duration,
- const axutil_env_t *env,
- int years)
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axutil_duration_set_years(
+ axutil_duration_t * duration,
+ const axutil_env_t * env,
+ int years)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
duration->years = years;
@@ -299,17 +324,19 @@
}
AXIS2_EXTERN int AXIS2_CALL
-axutil_duration_get_months(axutil_duration_t *duration,
- const axutil_env_t *env )
+axutil_duration_get_months(
+ axutil_duration_t * duration,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
return duration->months;
}
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_duration_set_months(axutil_duration_t *duration,
- const axutil_env_t *env,
- int months)
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axutil_duration_set_months(
+ axutil_duration_t * duration,
+ const axutil_env_t * env,
+ int months)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
duration->months = months;
@@ -318,17 +345,19 @@
}
AXIS2_EXTERN int AXIS2_CALL
-axutil_duration_get_days(axutil_duration_t *duration,
- const axutil_env_t *env )
+axutil_duration_get_days(
+ axutil_duration_t * duration,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
return duration->days;
}
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_duration_set_days(axutil_duration_t *duration,
- const axutil_env_t *env,
- int days)
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axutil_duration_set_days(
+ axutil_duration_t * duration,
+ const axutil_env_t * env,
+ int days)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
duration->days = days;
@@ -337,17 +366,19 @@
}
AXIS2_EXTERN int AXIS2_CALL
-axutil_duration_get_hours(axutil_duration_t *duration,
- const axutil_env_t *env )
+axutil_duration_get_hours(
+ axutil_duration_t * duration,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
return duration->hours;
}
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_duration_set_hours(axutil_duration_t *duration,
- const axutil_env_t *env,
- int hours)
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axutil_duration_set_hours(
+ axutil_duration_t * duration,
+ const axutil_env_t * env,
+ int hours)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
duration->hours = hours;
@@ -356,17 +387,19 @@
}
AXIS2_EXTERN int AXIS2_CALL
-axutil_duration_get_mins(axutil_duration_t *duration,
- const axutil_env_t *env )
+axutil_duration_get_mins(
+ axutil_duration_t * duration,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
return duration->mins;
}
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_duration_set_mins(axutil_duration_t *duration,
- const axutil_env_t *env,
- int mins)
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axutil_duration_set_mins(
+ axutil_duration_t * duration,
+ const axutil_env_t * env,
+ int mins)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
duration->mins = mins;
@@ -375,17 +408,19 @@
}
AXIS2_EXTERN double AXIS2_CALL
-axutil_duration_get_seconds(axutil_duration_t *duration,
- const axutil_env_t *env )
+axutil_duration_get_seconds(
+ axutil_duration_t * duration,
+ const axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
return duration->secs;
}
-AXIS2_EXTERN axis2_status_t AXIS2_CALL
-axutil_duration_set_seconds(axutil_duration_t *duration,
- const axutil_env_t *env,
- double seconds)
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axutil_duration_set_seconds(
+ axutil_duration_t * duration,
+ const axutil_env_t * env,
+ double seconds)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
duration->secs = seconds;
@@ -394,9 +429,10 @@
}
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
-axutil_duration_compare(axutil_duration_t *duration_one,
- axutil_duration_t *duration_two,
- axutil_env_t *env)
+axutil_duration_compare(
+ axutil_duration_t * duration_one,
+ axutil_duration_t * duration_two,
+ axutil_env_t * env)
{
AXIS2_ENV_CHECK(env, AXIS2_FALSE);
@@ -406,10 +442,5 @@
return -1;
}
- /*TODO*/
-
- return AXIS2_SUCCESS;
+ /*TODO*/ return AXIS2_SUCCESS;
}
-
-
-
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org