harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r810105 - in /harmony/enhanced/classlib/trunk/modules/portlib: build.xml src/main/native/a2e/unix/atoe.c src/main/native/a2e/unix/headers/utime.h
Date Tue, 01 Sep 2009 15:58:09 GMT
Author: odeakin
Date: Tue Sep  1 15:58:09 2009
New Revision: 810105

URL: http://svn.apache.org/viewvc?rev=810105&view=rev
Log:
Add utime() function to hya2e library.

Added:
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/utime.h
  (with props)
Modified:
    harmony/enhanced/classlib/trunk/modules/portlib/build.xml
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/atoe.c

Modified: harmony/enhanced/classlib/trunk/modules/portlib/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/build.xml?rev=810105&r1=810104&r2=810105&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/build.xml Tue Sep  1 15:58:09 2009
@@ -110,6 +110,7 @@
                 <include name="stdlib.h" />
                 <include name="string.h" />
                 <include name="time.h" />
+                <include name="utime.h" />
                 <include name="unistd.h" />
                 <include name="arpa\inet.h" />
                 <include name="sys\ipc.h" />
@@ -261,6 +262,7 @@
                 <include name="stdlib.h" />
                 <include name="string.h" />
                 <include name="time.h" />
+                <include name="utime.h" />
                 <include name="unistd.h" />
                 <include name="arpa\inet.h" />
                 <include name="sys\ipc.h" />

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/atoe.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/atoe.c?rev=810105&r1=810104&r2=810105&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/atoe.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/atoe.c Tue Sep
 1 15:58:09 2009
@@ -47,6 +47,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <time.h>
+#include <utime.h>
 #include <pwd.h>
 #include <grp.h>
 #include <dirent.h>
@@ -2157,6 +2158,30 @@
 }
 
 /*********************************************************************/
+/* name        - atoe_utime                                          */
+/*                                                                   */
+/* description - provide a version of the utime() system function    */
+/*               that converts the specified path from an ascii to   */
+/*               an ebcdic string.                                   */
+/*                                                                   */
+/* parameters  - path:  ascii string representing the path name      */
+/*               buf: times to be used in setting the modification   */
+/*                      and access times of the specified file       */
+/*                                                                   */
+/* returns     - int: 0 (success) or -1 (failure)                    */
+/*********************************************************************/
+
+int atoe_utime(const char *path, const struct utimebuf *buf)
+
+{
+   char *ep;
+
+   ep = a2e_string(path);
+
+   return utime(ep, buf);
+}
+
+/*********************************************************************/
 /* name        - atoe_chmod                                          */
 /*                                                                   */
 /* description - provide a version of the chmod() system function    */

Added: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/utime.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/utime.h?rev=810105&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/utime.h
(added)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/utime.h
Tue Sep  1 15:58:09 2009
@@ -0,0 +1,60 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.
+ */
+
+/*
+ * DESCRIPTION:
+ * Replace the system header file "utime.h" so that we can redefine
+ * the utime function to take/produce character strings
+ * with our own ATOE functions.
+ *
+ * The compiler will find this header file in preference to the system one.
+ * ===========================================================================
+ */                    
+      
+#if !defined(HY_ATOE_UTIME)
+#define HY_ATOE_UTIME                                      
+
+#include </usr/include/utime.h>                                                   
   
+
+#if defined(HY_ATOE)
+
+      /******************************************************************/
+      /*  Define prototypes for replacement functions.                  */
+      /******************************************************************/
+
+      #ifdef __cplusplus
+         extern "C" {
+      #endif
+
+      int atoe_utime(const char *, const struct utimbuf *);
+
+      #ifdef __cplusplus
+         }
+      #endif
+
+      /******************************************************************/
+      /*  Undefine the functions                                        */
+      /******************************************************************/
+      #undef  utime
+
+      /******************************************************************/
+      /*  Redefine the functions                                        */
+      /******************************************************************/
+      #define utime   atoe_utime
+
+#endif
+#endif

Propchange: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/a2e/unix/headers/utime.h
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message