You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by na...@apache.org on 2006/12/08 05:58:06 UTC

svn commit: r483832 - in /webservices/axis2/trunk/c/util: include/ include/platforms/ include/platforms/unix/ include/platforms/windows/ src/ src/platforms/unix/ src/platforms/windows/

Author: nandika
Date: Thu Dec  7 20:58:05 2006
New Revision: 483832

URL: http://svn.apache.org/viewvc?view=rev&rev=483832
Log:
files added from jira 451
Thanks to Manjula

Added:
    webservices/axis2/trunk/c/util/include/axis2_date_time_util.h
    webservices/axis2/trunk/c/util/include/platforms/unix/axis2_date_time_util_unix.h
    webservices/axis2/trunk/c/util/include/platforms/windows/axis2_date_time_util_windows.h
    webservices/axis2/trunk/c/util/src/date_time_util.c
    webservices/axis2/trunk/c/util/src/platforms/unix/date_time_util_unix.c
    webservices/axis2/trunk/c/util/src/platforms/windows/date_time_util_windows.c
Modified:
    webservices/axis2/trunk/c/util/include/axis2_date_time.h
    webservices/axis2/trunk/c/util/include/platforms/axis2_platform_auto_sense.h
    webservices/axis2/trunk/c/util/include/platforms/unix/axis2_unix.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=483832&r1=483831&r2=483832
==============================================================================
--- webservices/axis2/trunk/c/util/include/axis2_date_time.h (original)
+++ webservices/axis2/trunk/c/util/include/axis2_date_time.h Thu Dec  7 20:58:05 2006
@@ -197,7 +197,10 @@
     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 
@@ -270,6 +273,10 @@
 
 #define AXIS2_DATE_TIME_GET_SECOND(date_time, env) \
         ((date_time)->ops->get_second(date_time, env ) )
+
+#define AXIS2_DATE_TIME_GET_MSEC(date_time, env) \
+        ((date_time)->ops->get_msec(date_time, env ) )
+
 
 
 /** @} */

Added: webservices/axis2/trunk/c/util/include/axis2_date_time_util.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/include/axis2_date_time_util.h?view=auto&rev=483832
==============================================================================
--- webservices/axis2/trunk/c/util/include/axis2_date_time_util.h (added)
+++ webservices/axis2/trunk/c/util/include/axis2_date_time_util.h Thu Dec  7 20:58:05 2006
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain count copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_DATE_TIME_UTIL_H
+#define AXIS2_DATE_TIME_UTIL_H
+
+#include <axis2_utils.h>
+#include <axis2_utils_defines.h>
+#include <axis2_env.h>
+#include <platforms/axis2_platform_auto_sense.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+/**
+ * @defgroup axis2_uuid_gen UUID generator
+ * @ingroup axis2_util 
+ * @{
+ */
+   
+/**
+ * generate a uuid
+ * @return generated uuid as a string
+ */ 
+AXIS2_EXTERN int AXIS2_CALL
+axis2_get_milliseconds(const axis2_env_t *env);
+
+/** @} */
+    
+#ifdef __cplusplus
+}
+#endif
+
+#endif                          /* AXIS2_DATE_TIME_UTIL_H */

Modified: webservices/axis2/trunk/c/util/include/platforms/axis2_platform_auto_sense.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/include/platforms/axis2_platform_auto_sense.h?view=diff&rev=483832&r1=483831&r2=483832
==============================================================================
--- webservices/axis2/trunk/c/util/include/platforms/axis2_platform_auto_sense.h (original)
+++ webservices/axis2/trunk/c/util/include/platforms/axis2_platform_auto_sense.h Thu Dec  7 20:58:05 2006
@@ -39,6 +39,7 @@
    #include "windows/axis2_dir_windows.h"
    #include "windows/axis2_uuid_gen_windows.h"
    #include "windows/axis2_getopt_windows.h"
+   #include "windows/axis2_date_time_util_windows.h"     
 #elif defined ( __OS400__  )
   #include <os400/axis2_os400.h>
 #elif defined ( AIX )

Added: webservices/axis2/trunk/c/util/include/platforms/unix/axis2_date_time_util_unix.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/include/platforms/unix/axis2_date_time_util_unix.h?view=auto&rev=483832
==============================================================================
--- webservices/axis2/trunk/c/util/include/platforms/unix/axis2_date_time_util_unix.h (added)
+++ webservices/axis2/trunk/c/util/include/platforms/unix/axis2_date_time_util_unix.h Thu Dec  7 20:58:05 2006
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain count copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_DATE_TIME_UTIL_UNIX_H
+#define AXIS2_DATE_TIME_UTIL_UNIX_H
+
+#include <axis2_utils.h>
+#include <axis2_utils_defines.h>
+#include <stdio.h>
+#include <sys/timeb.h>
+#include <time.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+/**
+ * @defgroup axis2_milliseconds
+ * @ingroup axis2_milliseconds 
+ * @{
+ */
+AXIS2_EXTERN int AXIS2_CALL axis2_platform_get_milliseconds();
+   
+#ifdef __cplusplus
+}
+#endif
+
+#endif    

Modified: webservices/axis2/trunk/c/util/include/platforms/unix/axis2_unix.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/include/platforms/unix/axis2_unix.h?view=diff&rev=483832&r1=483831&r2=483832
==============================================================================
--- webservices/axis2/trunk/c/util/include/platforms/unix/axis2_unix.h (original)
+++ webservices/axis2/trunk/c/util/include/platforms/unix/axis2_unix.h Thu Dec  7 20:58:05 2006
@@ -115,6 +115,7 @@
 #include <netinet/tcp.h>    /* TCP_NODELAY */
 #include <utime.h>
 #include <getopt.h>
+#include "axis2_date_time_util_unix.h"
 
 
 /* for file access handling */

Added: webservices/axis2/trunk/c/util/include/platforms/windows/axis2_date_time_util_windows.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/include/platforms/windows/axis2_date_time_util_windows.h?view=auto&rev=483832
==============================================================================
--- webservices/axis2/trunk/c/util/include/platforms/windows/axis2_date_time_util_windows.h (added)
+++ webservices/axis2/trunk/c/util/include/platforms/windows/axis2_date_time_util_windows.h Thu Dec  7 20:58:05 2006
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain count copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_DATE_TIME_UTIL_WINDOWS_H
+#define AXIS2_DATE_TIME_UTIL_WINDOWS_H
+
+#include <axis2_utils.h>
+#include <axis2_utils_defines.h>
+#include <stdio.h>
+#include <sys/timeb.h>
+#include <time.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+/**
+ * @defgroup axis2_date_time_util
+ * @ingroup axis2_date_time_util 
+ * @{
+ */
+AXIS2_EXTERN int AXIS2_CALL axis2_platform_get_milliseconds();
+   
+#ifdef __cplusplus
+}
+#endif
+
+#endif    

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=483832&r1=483831&r2=483832
==============================================================================
--- webservices/axis2/trunk/c/util/src/date_time.c (original)
+++ webservices/axis2/trunk/c/util/src/date_time.c Thu Dec  7 20:58:05 2006
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <axis2_error.h>
 #include <axis2_utils.h>
-#include <platforms/axis2_platform_auto_sense.h>
+#include <axis2_date_time_util.h>
 
 /**
  * @brief
@@ -36,7 +36,7 @@
     int hour;
     int min;
     int sec;
-
+    int msec;
 }
 axis2_date_time_impl_t;
 
@@ -106,6 +106,12 @@
 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
@@ -138,7 +144,7 @@
     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)
@@ -162,6 +168,7 @@
     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;
 
     return &(date_time_impl->date_time);
 }
@@ -212,7 +219,7 @@
 
     date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
 
-    sscanf(time_str, "%d:%d:%dZ" , &date_time_impl-> hour, &date_time_impl-> min,
+	sscanf(time_str, "%d:%d:%dZ" , &date_time_impl-> hour, &date_time_impl-> min,
             &date_time_impl-> sec);
     return AXIS2_SUCCESS;
 }
@@ -396,5 +403,17 @@
     date_time_impl = AXIS2_INTF_TO_IMPL(date_time);
 
     return (date_time_impl-> sec);
+}
+
+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);
 }
 

Added: 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?view=auto&rev=483832
==============================================================================
--- webservices/axis2/trunk/c/util/src/date_time_util.c (added)
+++ webservices/axis2/trunk/c/util/src/date_time_util.c Thu Dec  7 20:58:05 2006
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <axis2_date_time_util.h>
+
+
+
+AXIS2_EXTERN int AXIS2_CALL
+axis2_get_milliseconds(const axis2_env_t *env)
+{
+    return axis2_platform_get_milliseconds();
+}

Added: webservices/axis2/trunk/c/util/src/platforms/unix/date_time_util_unix.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/platforms/unix/date_time_util_unix.c?view=auto&rev=483832
==============================================================================
--- webservices/axis2/trunk/c/util/src/platforms/unix/date_time_util_unix.c (added)
+++ webservices/axis2/trunk/c/util/src/platforms/unix/date_time_util_unix.c Thu Dec  7 20:58:05 2006
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <platforms/unix/axis2_date_time_util_unix.h>
+
+AXIS2_EXTERN int AXIS2_CALL axis2_platform_get_milliseconds() 
+{
+   struct timeb t_current;
+   int milliseconds;
+
+   ftime(&t_current);
+   milliseconds = t_current.millitm; 
+ 
+   return milliseconds;
+
+}

Added: webservices/axis2/trunk/c/util/src/platforms/windows/date_time_util_windows.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/platforms/windows/date_time_util_windows.c?view=auto&rev=483832
==============================================================================
--- webservices/axis2/trunk/c/util/src/platforms/windows/date_time_util_windows.c (added)
+++ webservices/axis2/trunk/c/util/src/platforms/windows/date_time_util_windows.c Thu Dec  7 20:58:05 2006
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <platforms/windows/axis2_date_time_util_windows.h>
+
+AXIS2_EXTERN int AXIS2_CALL axis2_platform_get_milliseconds() 
+{
+   struct _timeb timebuffer;
+   char *timeline;
+   int milliseconds = 0; 
+
+   _ftime( &timebuffer );
+   timeline = ctime( & ( timebuffer.time ) );
+   milliseconds = timebuffer.millitm;
+    
+   return milliseconds; 
+
+/* printf( "The time is %.19s.%hu %s", timeline, timebuffer.millitm, &timeline[20] );*/
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org