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/01/05 09:15:14 UTC
svn commit: r492936 - in /webservices/axis2/trunk/c/util:
include/axis2_date_time.h src/date_time.c
Author: samisa
Date: Fri Jan 5 00:15:13 2007
New Revision: 492936
URL: http://svn.apache.org/viewvc?view=rev&rev=492936
Log:
Dropped ops
Modified:
webservices/axis2/trunk/c/util/include/axis2_date_time.h
webservices/axis2/trunk/c/util/src/date_time.c
Modified: webservices/axis2/trunk/c/util/include/axis2_date_time.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/include/axis2_date_time.h?view=diff&rev=492936&r1=492935&r2=492936
==============================================================================
--- webservices/axis2/trunk/c/util/include/axis2_date_time.h (original)
+++ webservices/axis2/trunk/c/util/include/axis2_date_time.h Fri Jan 5 00:15:13 2007
@@ -32,182 +32,13 @@
#endif
/**
- * @defgroup axis2_base64
+ * @defgroup axis2_date_time
* @ingroup axis2_util
* @{
*/
-
- typedef struct axis2_date_time_ops axis2_date_time_ops_t;
typedef struct axis2_date_time axis2_date_time_t;
- struct axis2_date_time_ops
- {
- /**
- * free the axis2_date_time.
- * @param date_time represet the type object
- * @param env pointer to environment struct. MUST NOT be NULL
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
- axis2_status_t(AXIS2_CALL *
- free)(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
- /**
- * store the time value from plain text.
- * @param date_time represet the type object
- * @param env pointer to environment struct. MUST NOT be NULL
- * @param time time as a string format HH:MM:TTZ
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
- axis2_status_t(AXIS2_CALL *
- deserialize_time)(axis2_date_time_t *date_time,
- const axis2_env_t *env,
- const axis2_char_t* time_str);
-
- /**
- * store the date value from plain text.
- * @param date_time represet the type object
- * @param env pointer to environment struct. MUST NOT be NULL
- * @param date date as a string format YYYY-MM-DD
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
- axis2_status_t(AXIS2_CALL *
- deserialize_date)(axis2_date_time_t *date_time,
- const axis2_env_t *env,
- const axis2_char_t* date_str);
-
- /**
- * store the date value from plain text.
- * @param date_time represet the type object
- * @param env pointer to environment struct. MUST NOT be NULL
- * @param date_time string format YYYY-MM-DDTHH:MM:SSZ
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
- axis2_status_t(AXIS2_CALL *
- deserialize_date_time)(axis2_date_time_t *date_time,
- const axis2_env_t *env,
- const axis2_char_t* date_time_str);
-
- /**
- * store the date value from set of values
- * @param date_time represet the type object
- * @param env pointer to environment struct. MUST NOT be NULL
- * @param year Integer -1 can be used to ignore
- * @param month Integer -1 can be used to ignore
- * @param date Integer -1 can be used to ignore
- * @param hour Integer -1 can be used to ignore
- * @param min Integer -1 can be used to ignore
- * @param second Integer -1 can be used to ignore
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
- axis2_status_t(AXIS2_CALL*
- set_date_time)(axis2_date_time_t* date_time,
- const axis2_env_t *env,
- int year, int month, int date,
- int hour, int min, int second, int milliseconds);
-
- /**
- * retrive the stored time as a string
- * @param date_time represet the type object
- * @param env pointer to environment struct. MUST NOT be NULL
- * @return time as a string format HH:MM:SSZ
- */
- axis2_char_t*(AXIS2_CALL *
- serialize_time)(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
- /**
- * retrive the stored date as a string
- * @param date_time represet the type object
- * @param env pointer to environment struct. MUST NOT be NULL
- * @return date as a string format YYYY-MM-DD
- */
- axis2_char_t*(AXIS2_CALL *
- serialize_date)(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
- /**
- * retrive the stored date time as a string
- * @param date_time represet the type object
- * @param env pointer to environment struct. MUST NOT be NULL
- * @return time as a string format YYYY-MM-DDTHH:MM:SSZ
- */
- axis2_char_t*(AXIS2_CALL *
- serialize_date_time)(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
- /**
- * retrieve the year of the date time
- * @param date_time represet the type object
- * @param env pointer to environment struct. MUST NOT be NULL
- * @return year as an integer
- */
- int(AXIS2_CALL *
- get_year)(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
- /**
- * retrieve the month of the date time
- * @param date_time represet the type object
- * @param env pointer to environment struct. MUST NOT be NULL
- * @return month as an integer
- */
- int(AXIS2_CALL *
- get_month)(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
- /**
- * retrieve the date of the date time
- * @param date_time represet the type object
- * @param env pointer to environment struct. MUST NOT be NULL
- * @return date as an integer
- */
- int(AXIS2_CALL *
- get_date)(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
- /**
- * retrieve the hour of the date time
- * @param date_time represet the type object
- * @param env pointer to environment struct. MUST NOT be NULL
- * @return hour as an integer
- */
- int(AXIS2_CALL *
- get_hour)(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
- /**
- * retrieve the minute of the date time
- * @param date_time represet the type object
- * @param env pointer to environment struct. MUST NOT be NULL
- * @return minute as an integer
- */
- int(AXIS2_CALL *
- get_minute)(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
- /**
- * retrieve the second of the date time
- * @param date_time represet the type object
- * @param env pointer to environment struct. MUST NOT be NULL
- * @return second as an integer
- */
- int(AXIS2_CALL *
- get_second)(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
- int(AXIS2_CALL *
- get_msec)(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
- } ;
-
- struct axis2_date_time
- {
- axis2_date_time_ops_t *ops;
- };
-
/**
* Creates axis2_date_time struct with current date time
* @param env double pointer to environment struct. MUST NOT be NULL
@@ -228,56 +59,211 @@
AXIS2_EXTERN axis2_date_time_t * AXIS2_CALL
axis2_date_time_create_with_offset(const axis2_env_t *env, int offset);
- /*************************** Function macros **********************************/
+ /**
+ * free the axis2_date_time.
+ * @param date_time represet the type object
+ * @param env pointer to environment struct. MUST NOT be NULL
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+ */
+ AXIS2_EXTERN axis2_status_t AXIS2_CALL
+ axis2_date_time_free(axis2_date_time_t *date_time,
+ const axis2_env_t *env);
+
+ /**
+ * store the time value from plain text.
+ * @param date_time represet the type object
+ * @param env pointer to environment struct. MUST NOT be NULL
+ * @param time time as a string format HH:MM:TTZ
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+ */
+ AXIS2_EXTERN axis2_status_t AXIS2_CALL
+ axis2_date_time_deserialize_time(axis2_date_time_t *date_time,
+ const axis2_env_t *env,
+ const axis2_char_t* time_str);
+
+ /**
+ * store the date value from plain text.
+ * @param date_time represet the type object
+ * @param env pointer to environment struct. MUST NOT be NULL
+ * @param date date as a string format YYYY-MM-DD
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+ */
+ AXIS2_EXTERN axis2_status_t AXIS2_CALL
+ axis2_date_time_deserialize_date(axis2_date_time_t *date_time,
+ const axis2_env_t *env,
+ const axis2_char_t* date_str);
+
+ /**
+ * store the date value from plain text.
+ * @param date_time represet the type object
+ * @param env pointer to environment struct. MUST NOT be NULL
+ * @param date_time string format YYYY-MM-DDTHH:MM:SSZ
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+ */
+ AXIS2_EXTERN axis2_status_t AXIS2_CALL
+ axis2_date_time_deserialize_date_time(axis2_date_time_t *date_time,
+ const axis2_env_t *env,
+ const axis2_char_t* date_time_str);
+
+ /**
+ * store the date value from set of values
+ * @param date_time represet the type object
+ * @param env pointer to environment struct. MUST NOT be NULL
+ * @param year Integer -1 can be used to ignore
+ * @param month Integer -1 can be used to ignore
+ * @param date Integer -1 can be used to ignore
+ * @param hour Integer -1 can be used to ignore
+ * @param min Integer -1 can be used to ignore
+ * @param second Integer -1 can be used to ignore
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+ */
+ AXIS2_EXTERN axis2_status_t AXIS2_CALL
+ axis2_date_time_set_date_time(axis2_date_time_t* date_time,
+ const axis2_env_t *env,
+ int year, int month, int date,
+ int hour, int min, int second, int milliseconds);
+
+ /**
+ * retrive the stored time as a string
+ * @param date_time represet the type object
+ * @param env pointer to environment struct. MUST NOT be NULL
+ * @return time as a string format HH:MM:SSZ
+ */
+ AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+ axis2_date_time_serialize_time(axis2_date_time_t *date_time,
+ const axis2_env_t *env);
+
+ /**
+ * retrive the stored date as a string
+ * @param date_time represet the type object
+ * @param env pointer to environment struct. MUST NOT be NULL
+ * @return date as a string format YYYY-MM-DD
+ */
+ AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+ axis2_date_time_serialize_date(axis2_date_time_t *date_time,
+ const axis2_env_t *env);
+
+ /**
+ * retrive the stored date time as a string
+ * @param date_time represet the type object
+ * @param env pointer to environment struct. MUST NOT be NULL
+ * @return time as a string format YYYY-MM-DDTHH:MM:SSZ
+ */
+ AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+ axis2_date_time_serialize_date_time(axis2_date_time_t *date_time,
+ const axis2_env_t *env);
+
+ /**
+ * retrieve the year of the date time
+ * @param date_time represet the type object
+ * @param env pointer to environment struct. MUST NOT be NULL
+ * @return year as an integer
+ */
+ AXIS2_EXTERN int AXIS2_CALL
+ axis2_date_time_get_year(axis2_date_time_t *date_time,
+ const axis2_env_t *env);
+
+ /**
+ * retrieve the month of the date time
+ * @param date_time represet the type object
+ * @param env pointer to environment struct. MUST NOT be NULL
+ * @return month as an integer
+ */
+ AXIS2_EXTERN int AXIS2_CALL
+ axis2_date_time_get_month(axis2_date_time_t *date_time,
+ const axis2_env_t *env);
+
+ /**
+ * retrieve the date of the date time
+ * @param date_time represet the type object
+ * @param env pointer to environment struct. MUST NOT be NULL
+ * @return date as an integer
+ */
+ AXIS2_EXTERN int AXIS2_CALL
+ axis2_date_time_get_date(axis2_date_time_t *date_time,
+ const axis2_env_t *env);
+
+ /**
+ * retrieve the hour of the date time
+ * @param date_time represet the type object
+ * @param env pointer to environment struct. MUST NOT be NULL
+ * @return hour as an integer
+ */
+ AXIS2_EXTERN int AXIS2_CALL
+ axis2_date_time_get_hour(axis2_date_time_t *date_time,
+ const axis2_env_t *env);
+
+ /**
+ * retrieve the minute of the date time
+ * @param date_time represet the type object
+ * @param env pointer to environment struct. MUST NOT be NULL
+ * @return minute as an integer
+ */
+ AXIS2_EXTERN int AXIS2_CALL
+ axis2_date_time_get_minute(axis2_date_time_t *date_time,
+ const axis2_env_t *env);
+
+ /**
+ * retrieve the second of the date time
+ * @param date_time represet the type object
+ * @param env pointer to environment struct. MUST NOT be NULL
+ * @return second as an integer
+ */
+ AXIS2_EXTERN int AXIS2_CALL
+ axis2_date_time_get_second(axis2_date_time_t *date_time,
+ const axis2_env_t *env);
+
+ AXIS2_EXTERN int AXIS2_CALL
+ axis2_date_time_get_msec(axis2_date_time_t *date_time,
+ const axis2_env_t *env);
+
#define AXIS2_DATE_TIME_FREE(date_time, env) \
- ((date_time)->ops->free (date_time, env))
+ axis2_date_time_free (date_time, env)
-#define AXIS2_DATE_TIME_DESERIALIZE_TIME(date_time, env, time ) \
- ((date_time)->ops->deserialize_time (date_time, env, time))
+#define AXIS2_DATE_TIME_DESERIALIZE_TIME(date_time, env, time) \
+ axis2_date_time_deserialize_time (date_time, env, time)
#define AXIS2_DATE_TIME_DESERIALIZE_DATE(date_time, env, date) \
- ((date_time)->ops->deserialize_date (date_time, env, date_str))
+ axis2_date_time_deserialize_date (date_time, env, date_str)
-#define AXIS2_DATE_TIME_DESERIALIZE_DATE_TIME(date_time, env, date_time_str ) \
- ((date_time)->ops->deserialize_date_time(date_time, env, date_time_str))
+#define AXIS2_DATE_TIME_DESERIALIZE_DATE_TIME(date_time, env, date_time_str) \
+ axis2_date_time_deserialize_date_time(date_time, env, date_time_str)
#define AXIS2_DATE_TIME_SET_DATE_TIME(date_time, env, \
- year, month, date, hour, min, second, milliseconds ) \
- ((date_time)->ops->set_date_time (date_time, env, \
- year, month, date, hour, min, second, milliseconds) )
+ year, month, date, hour, min, second, milliseconds) \
+ axis2_date_time_set_date_time (date_time, env, \
+ year, month, date, hour, min, second, milliseconds)
#define AXIS2_DATE_TIME_SERIALIZE_TIME(date_time, env) \
- ((date_time)->ops->serialize_time (date_time, env ) )
+ axis2_date_time_serialize_time (date_time, env)
#define AXIS2_DATE_TIME_SERIALIZE_DATE(date_time, env) \
- ((date_time)->ops->serialize_date (date_time, env ) )
+ axis2_date_time_serialize_date (date_time, env)
#define AXIS2_DATE_TIME_SERIALIZE_DATE_TIME(date_time, env) \
- ((date_time)->ops->serialize_date_time (date_time, env ) )
+ axis2_date_time_serialize_date_time (date_time, env)
#define AXIS2_DATE_TIME_GET_YEAR(date_time, env) \
- ((date_time)->ops->get_year(date_time, env ) )
+ axis2_date_time_get_year(date_time, env)
#define AXIS2_DATE_TIME_GET_MONTH(date_time, env) \
- ((date_time)->ops->get_month(date_time, env ) )
+ axis2_date_time_get_month(date_time, env)
#define AXIS2_DATE_TIME_GET_DATE(date_time, env) \
- ((date_time)->ops->get_date(date_time, env ) )
+ axis2_date_time_get_date(date_time, env)
#define AXIS2_DATE_TIME_GET_HOUR(date_time, env) \
- ((date_time)->ops->get_hour(date_time, env ) )
+ axis2_date_time_get_hour(date_time, env)
#define AXIS2_DATE_TIME_GET_MINUTE(date_time, env) \
- ((date_time)->ops->get_minute(date_time, env ) )
+ axis2_date_time_get_minute(date_time, env)
#define AXIS2_DATE_TIME_GET_SECOND(date_time, env) \
- ((date_time)->ops->get_second(date_time, env ) )
+ axis2_date_time_get_second(date_time, env)
#define AXIS2_DATE_TIME_GET_MSEC(date_time, env) \
- ((date_time)->ops->get_msec(date_time, env ) )
-
-
+ axis2_date_time_get_msec(date_time, env)
/** @} */
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?view=diff&rev=492936&r1=492935&r2=492936
==============================================================================
--- webservices/axis2/trunk/c/util/src/date_time.c (original)
+++ webservices/axis2/trunk/c/util/src/date_time.c Fri Jan 5 00:15:13 2007
@@ -23,13 +23,8 @@
#include <axis2_utils.h>
#include <axis2_date_time_util.h>
-/**
- * @brief
- */
-typedef struct axis2_date_time_impl
+struct axis2_date_time
{
- axis2_date_time_t date_time;
-
int year;
int mon;
int day;
@@ -37,97 +32,22 @@
int min;
int sec;
int msec;
-}
-axis2_date_time_impl_t;
-
-#define AXIS2_INTF_TO_IMPL(date_time) \
- ((axis2_date_time_impl_t *) date_time)
-
-/************************* Function prototypes ********************************/
-
-axis2_status_t AXIS2_CALL
-axis2_date_time_free(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_date_time_deserialize_time(axis2_date_time_t *date_time,
- const axis2_env_t *env,
- const char* time_str);
-
-axis2_status_t AXIS2_CALL
-axis2_date_time_deserialize_date(axis2_date_time_t *date_time,
- const axis2_env_t *env,
- const char* date_str);
-
-axis2_status_t AXIS2_CALL
-axis2_date_time_deserialize_date_time(axis2_date_time_t *date_time,
- const axis2_env_t *env,
- const char* date_time_str);
-
-axis2_status_t AXIS2_CALL
-axis2_date_time_set_date_time(axis2_date_time_t* date_time,
- const axis2_env_t *env,
- int year, int month, int date,
- int hour, int min, int second, int milliseconds);
-
-char* AXIS2_CALL
-axis2_date_time_serialize_time(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
-char* AXIS2_CALL
-axis2_date_time_serialize_date(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
-char* AXIS2_CALL
-axis2_date_time_serialize_date_time(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
-int AXIS2_CALL
-axis2_date_time_get_year(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
-int AXIS2_CALL
-axis2_date_time_get_month(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
-int AXIS2_CALL
-axis2_date_time_get_date(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
-int AXIS2_CALL
-axis2_date_time_get_hour(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
-int AXIS2_CALL
-axis2_date_time_get_minute(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
-int AXIS2_CALL
-axis2_date_time_get_second(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
-int AXIS2_CALL
-axis2_date_time_get_msec(axis2_date_time_t *date_time,
- const axis2_env_t *env);
-
-
-
-/************************** End of function prototypes ************************/
+};
AXIS2_EXTERN axis2_date_time_t * AXIS2_CALL
axis2_date_time_create_with_offset(const axis2_env_t *env, int offset)
{
- axis2_date_time_impl_t *date_time_impl = NULL;
+ axis2_date_time_t *date_time = NULL;
time_t t;
struct tm* utc_time = NULL;
/*struct tm* utc_time_ret = NULL;*/
AXIS2_ENV_CHECK(env, NULL);
- date_time_impl = (axis2_date_time_impl_t *) AXIS2_MALLOC(env->
- allocator, sizeof(axis2_date_time_impl_t));
+ date_time = (axis2_date_time_t *) AXIS2_MALLOC(env->
+ allocator, sizeof(axis2_date_time_t));
- if (NULL == date_time_impl)
+ if (NULL == date_time)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
@@ -138,39 +58,15 @@
/*utc_time_ret = (struct tm *)axis2_gmtime_r(&t, utc_time);*/
utc_time = gmtime(&t);
- date_time_impl-> year = utc_time-> tm_year;
- date_time_impl-> mon = utc_time-> tm_mon;
- date_time_impl-> day = utc_time-> tm_mday;
- date_time_impl-> hour = utc_time-> tm_hour;
- date_time_impl-> min = utc_time-> tm_min;
- date_time_impl-> sec = utc_time-> tm_sec;
- date_time_impl-> msec = axis2_get_milliseconds(env);
- date_time_impl->date_time.ops =
- AXIS2_MALLOC(env->allocator, sizeof(axis2_date_time_ops_t));
- if (NULL == date_time_impl->date_time.ops)
- {
- axis2_date_time_free(&(date_time_impl->date_time), env);
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
-
- date_time_impl->date_time.ops->free = axis2_date_time_free;
- date_time_impl->date_time.ops->deserialize_time = axis2_date_time_deserialize_time;
- date_time_impl->date_time.ops->deserialize_date = axis2_date_time_deserialize_date;
- date_time_impl->date_time.ops->deserialize_date_time = axis2_date_time_deserialize_date_time;
- date_time_impl->date_time.ops->set_date_time = axis2_date_time_set_date_time;
- date_time_impl->date_time.ops->serialize_time = axis2_date_time_serialize_time;
- date_time_impl->date_time.ops->serialize_date = axis2_date_time_serialize_date;
- date_time_impl->date_time.ops->serialize_date_time = axis2_date_time_serialize_date_time;
- date_time_impl->date_time.ops->get_year = axis2_date_time_get_year;
- date_time_impl->date_time.ops->get_month = axis2_date_time_get_month;
- date_time_impl->date_time.ops->get_date = axis2_date_time_get_date;
- date_time_impl->date_time.ops->get_hour = axis2_date_time_get_hour;
- date_time_impl->date_time.ops->get_minute = axis2_date_time_get_minute;
- date_time_impl->date_time.ops->get_second = axis2_date_time_get_second;
- date_time_impl->date_time.ops->get_msec = axis2_date_time_get_msec;
+ date_time->year = utc_time->tm_year;
+ date_time->mon = utc_time->tm_mon;
+ date_time->day = utc_time->tm_mday;
+ date_time->hour = utc_time->tm_hour;
+ date_time->min = utc_time->tm_min;
+ date_time->sec = utc_time->tm_sec;
+ date_time->msec = axis2_get_milliseconds(env);
- return &(date_time_impl->date_time);
+ return date_time;
}
@@ -183,239 +79,183 @@
/***************************Function implementation****************************/
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_date_time_free(axis2_date_time_t *date_time,
const axis2_env_t *env)
{
- axis2_date_time_impl_t *date_time_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
-
- if (date_time->ops)
+ if (date_time)
{
- AXIS2_FREE(env->allocator, date_time->ops);
- date_time->ops = NULL;
- }
-
- if (date_time_impl)
- {
- AXIS2_FREE(env->allocator, date_time_impl);
- date_time_impl = NULL;
+ AXIS2_FREE(env->allocator, date_time);
+ date_time = NULL;
}
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_date_time_deserialize_time(axis2_date_time_t *date_time,
const axis2_env_t *env,
- const char* time_str)
+ const axis2_char_t* time_str)
{
- axis2_date_time_impl_t *date_time_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
-
- sscanf(time_str, "%d:%d:%d:%dZ" , &date_time_impl-> hour, &date_time_impl-> min,
- &date_time_impl-> sec, &date_time_impl-> msec);
+ sscanf(time_str, "%d:%d:%d:%dZ" , &date_time->hour, &date_time->min,
+ &date_time->sec, &date_time->msec);
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_date_time_deserialize_date(axis2_date_time_t *date_time,
const axis2_env_t *env,
- const char* date_str)
+ const axis2_char_t* date_str)
{
- axis2_date_time_impl_t *date_time_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
-
- sscanf(date_str, "%d-%d-%d" , &date_time_impl-> year, &date_time_impl-> mon,
- &date_time_impl-> day);
- date_time_impl-> year -= 1900;
+ sscanf(date_str, "%d-%d-%d" , &date_time->year, &date_time->mon,
+ &date_time->day);
+ date_time->year -= 1900;
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_date_time_deserialize_date_time(axis2_date_time_t *date_time,
const axis2_env_t *env,
- const char* date_time_str)
+ const axis2_char_t* date_time_str)
{
- axis2_date_time_impl_t *date_time_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
-
- sscanf(date_time_str, "%d-%d-%dT%d:%d:%d.%dZ", &date_time_impl-> year, &date_time_impl-> mon,
- &date_time_impl-> day, &date_time_impl-> hour, &date_time_impl-> min,
- &date_time_impl-> sec, &date_time_impl-> msec);
- date_time_impl-> year -= 1900;
+ 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->year -= 1900;
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_date_time_set_date_time(axis2_date_time_t* date_time,
const axis2_env_t *env,
int year, int month, int day,
int hour, int min, int second, int milliseconds)
{
- axis2_date_time_impl_t *date_time_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
-
- if (year > -1)date_time_impl-> year = year - 1900;
- if (month > -1)date_time_impl-> mon = month;
- if (day > -1)date_time_impl-> day = day;
- if (hour > -1)date_time_impl-> hour = hour;
- if (min > -1)date_time_impl-> min = min;
- if (second > -1)date_time_impl-> sec = second;
- if (second > -1)date_time_impl-> 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;
}
-char* AXIS2_CALL
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axis2_date_time_serialize_time(axis2_date_time_t *date_time,
const axis2_env_t *env)
{
- axis2_date_time_impl_t *date_time_impl = NULL;
- char* time_str = NULL;
+ axis2_char_t* time_str = NULL;
AXIS2_ENV_CHECK(env, NULL);
- date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
+ time_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * 32);
- time_str = (char*)AXIS2_MALLOC(env->allocator, sizeof(char) * 32);
-
- sprintf(time_str, "%d:%d:%d.%dZ" , date_time_impl-> hour, date_time_impl-> min, date_time_impl-> sec,date_time_impl-> msec);
+ sprintf(time_str, "%d:%d:%d.%dZ" , date_time->hour, date_time->min, date_time->sec,date_time->msec);
return time_str;
}
-char* AXIS2_CALL
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axis2_date_time_serialize_date(axis2_date_time_t *date_time,
const axis2_env_t *env)
{
- axis2_date_time_impl_t *date_time_impl = NULL;
- char* date_str = NULL;
+ axis2_char_t* date_str = NULL;
AXIS2_ENV_CHECK(env, NULL);
- date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
-
- date_str = (char*)AXIS2_MALLOC(env-> allocator, sizeof(char) * 32);
+ date_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * 32);
- sprintf(date_str, "%d-%d-%d" , date_time_impl-> year + 1900,
- date_time_impl-> mon,
- date_time_impl-> day);
+ sprintf(date_str, "%d-%d-%d" , date_time->year + 1900,
+ date_time->mon,
+ date_time->day);
return date_str;
}
-char* AXIS2_CALL
+AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axis2_date_time_serialize_date_time(axis2_date_time_t *date_time,
const axis2_env_t *env)
{
- axis2_date_time_impl_t *date_time_impl = NULL;
- char* date_time_str = NULL;
+ axis2_char_t* date_time_str = NULL;
AXIS2_ENV_CHECK(env, NULL);
- date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
-
- date_time_str = AXIS2_MALLOC(env-> allocator, sizeof(char) * 32);
- sprintf(date_time_str, "%d-%02d-%02dT%02d:%02d:%02d.%03dZ" , date_time_impl-> year + 1900,
- date_time_impl-> mon + 1, date_time_impl-> day, date_time_impl-> hour, date_time_impl-> min,
- date_time_impl-> sec, date_time_impl-> msec);
+ 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);
return date_time_str;
}
-int AXIS2_CALL
+AXIS2_EXTERN int AXIS2_CALL
axis2_date_time_get_year(axis2_date_time_t *date_time,
const axis2_env_t *env)
{
- axis2_date_time_impl_t *date_time_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
-
- return (date_time_impl-> year + 1900);
+ return (date_time->year + 1900);
}
-int AXIS2_CALL
+AXIS2_EXTERN int AXIS2_CALL
axis2_date_time_get_month(axis2_date_time_t *date_time,
const axis2_env_t *env)
{
- axis2_date_time_impl_t *date_time_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
-
- return (date_time_impl-> mon);
+ return (date_time->mon);
}
-int AXIS2_CALL
+AXIS2_EXTERN int AXIS2_CALL
axis2_date_time_get_date(axis2_date_time_t *date_time,
const axis2_env_t *env)
{
- axis2_date_time_impl_t *date_time_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
-
- return (date_time_impl-> day);
+ return (date_time->day);
}
-int AXIS2_CALL
+AXIS2_EXTERN int AXIS2_CALL
axis2_date_time_get_hour(axis2_date_time_t *date_time,
const axis2_env_t *env)
{
- axis2_date_time_impl_t *date_time_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
-
- return (date_time_impl-> hour);
+ return (date_time->hour);
}
-int AXIS2_CALL
+AXIS2_EXTERN int AXIS2_CALL
axis2_date_time_get_minute(axis2_date_time_t *date_time,
const axis2_env_t *env)
{
- axis2_date_time_impl_t *date_time_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
-
- return (date_time_impl-> min);
+ return (date_time->min);
}
-int AXIS2_CALL
+AXIS2_EXTERN int AXIS2_CALL
axis2_date_time_get_second(axis2_date_time_t *date_time,
const axis2_env_t *env)
{
- axis2_date_time_impl_t *date_time_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
-
- return (date_time_impl-> sec);
+ return (date_time->sec);
}
-int AXIS2_CALL
+AXIS2_EXTERN int AXIS2_CALL
axis2_date_time_get_msec(axis2_date_time_t *date_time,
const axis2_env_t *env)
{
- axis2_date_time_impl_t *date_time_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
-
- return (date_time_impl-> msec);
+ return (date_time->msec);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org