[kaffe] CVS kaffe (robilad): fixed the build on mac os x 10.4.8

Kaffe CVS cvs-commits at kaffe.org
Mon Nov 27 13:48:21 PST 2006


PatchSet 7451 
Date: 2006/11/27 21:47:20
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
fixed the build on mac os x 10.4.8

2006-11-27  Dalibor Topic  <robilad at kaffe.org>

        Fixed the build on Mac OS X 10.4.8.
        Reported by:  Jim Pick  <jim at kaffe.org>

        * libraries/clib/io/File.c: Renamed to
        * libraries/clib/io/java_io_File.c: this one.

        * libraries/clib/native/Object.c: Renamed to
        * libraries/clib/native/java_lang_Object.c: this one.

        * libraries/clib/native/String.c: Renamed to
        * libraries/clib/native/java_lang_String.c: this one.

        * libraries/clib/native/Thread.c: Renamed to
        * libraries/clib/native/java_lang_Thread.c: this one.

        * kaffe/kaffevm/Makefile.am: Updated to use the new names.

Members: 
	ChangeLog:1.4951->1.4952 
	kaffe/kaffevm/Makefile.am:1.95->1.96 
	kaffe/kaffevm/Makefile.in:1.255->1.256 
	libraries/clib/io/File.c:1.28->1.29(DEAD) 
	libraries/clib/io/java_io_File.c:INITIAL->1.1 
	libraries/clib/native/Object.c:1.20->1.21(DEAD) 
	libraries/clib/native/String.c:1.21->1.22(DEAD) 
	libraries/clib/native/Thread.c:1.26->1.27(DEAD) 
	libraries/clib/native/java_lang_Object.c:INITIAL->1.1 
	libraries/clib/native/java_lang_String.c:INITIAL->1.1 
	libraries/clib/native/java_lang_Thread.c:INITIAL->1.1 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4951 kaffe/ChangeLog:1.4952
--- kaffe/ChangeLog:1.4951	Sun Nov 19 21:32:12 2006
+++ kaffe/ChangeLog	Mon Nov 27 21:47:20 2006
@@ -1,3 +1,22 @@
+2006-11-27  Dalibor Topic  <robilad at kaffe.org>
+
+	Fixed the build on Mac OS X 10.4.8.
+	Reported by:  Jim Pick  <jim at kaffe.org>
+
+	* libraries/clib/io/File.c: Renamed to 
+	* libraries/clib/io/java_io_File.c: this one.
+
+	* libraries/clib/native/Object.c: Renamed to
+	* libraries/clib/native/java_lang_Object.c: this one.
+
+	* libraries/clib/native/String.c: Renamed to
+	* libraries/clib/native/java_lang_String.c: this one.
+
+	* libraries/clib/native/Thread.c: Renamed to
+	* libraries/clib/native/java_lang_Thread.c: this one.
+
+	* kaffe/kaffevm/Makefile.am: Updated to use the new names.
+
 2006-11-19  Guilhem Lavaux  <guilhem at kaffe.org>,
 	Riccardo Mottola <riccardo at kaffe.org>
 
Index: kaffe/kaffe/kaffevm/Makefile.am
diff -u kaffe/kaffe/kaffevm/Makefile.am:1.95 kaffe/kaffe/kaffevm/Makefile.am:1.96
--- kaffe/kaffe/kaffevm/Makefile.am:1.95	Sun Sep 24 18:21:12 2006
+++ kaffe/kaffe/kaffevm/Makefile.am	Mon Nov 27 21:47:20 2006
@@ -135,7 +135,7 @@
 	$(top_srcdir)/libraries/clib/net/NetworkInterface.c \
 	$(top_srcdir)/libraries/clib/net/PlainDatagramSocketImpl.c \
 	$(top_srcdir)/libraries/clib/net/PlainSocketImpl.c \
-	$(top_srcdir)/libraries/clib/io/File.c \
+	$(top_srcdir)/libraries/clib/io/java_io_File.c \
 	$(top_srcdir)/libraries/clib/io/java_io_VMFile.c \
 	$(top_srcdir)/libraries/clib/native/AccessController.c \
 	$(top_srcdir)/libraries/clib/native/java_lang_ref_Reference.c \
@@ -146,12 +146,12 @@
         $(top_srcdir)/libraries/clib/native/TimeZone.c \
         $(top_srcdir)/libraries/clib/native/Class.c \
         $(top_srcdir)/libraries/clib/native/ClassLoader.c \
-        $(top_srcdir)/libraries/clib/native/Object.c \
+        $(top_srcdir)/libraries/clib/native/java_lang_Object.c \
         $(top_srcdir)/libraries/clib/native/Runtime.c \
         $(top_srcdir)/libraries/clib/native/VMRuntime.c \
-        $(top_srcdir)/libraries/clib/native/String.c \
+        $(top_srcdir)/libraries/clib/native/java_lang_String.c \
         $(top_srcdir)/libraries/clib/native/System.c \
-        $(top_srcdir)/libraries/clib/native/Thread.c \
+        $(top_srcdir)/libraries/clib/native/java_lang_Thread.c \
         $(top_srcdir)/libraries/clib/native/Throwable.c \
 	$(top_srcdir)/libraries/clib/native/gnu_classpath_VMStackWalker.c \
 	$(top_srcdir)/libraries/clib/native/gnu_classpath_VMSystemProperties.c \
Index: kaffe/kaffe/kaffevm/Makefile.in
diff -u kaffe/kaffe/kaffevm/Makefile.in:1.255 kaffe/kaffe/kaffevm/Makefile.in:1.256
--- kaffe/kaffe/kaffevm/Makefile.in:1.255	Tue Nov  7 03:37:35 2006
+++ kaffe/kaffe/kaffevm/Makefile.in	Mon Nov 27 21:47:20 2006
@@ -118,7 +118,7 @@
 	libkaffevm_la-InetAddressImpl.lo \
 	libkaffevm_la-NetworkInterface.lo \
 	libkaffevm_la-PlainDatagramSocketImpl.lo \
-	libkaffevm_la-PlainSocketImpl.lo libkaffevm_la-File.lo \
+	libkaffevm_la-PlainSocketImpl.lo libkaffevm_la-java_io_File.lo \
 	libkaffevm_la-java_io_VMFile.lo \
 	libkaffevm_la-AccessController.lo \
 	libkaffevm_la-java_lang_ref_Reference.lo \
@@ -126,9 +126,9 @@
 	libkaffevm_la-Constructor.lo libkaffevm_la-Field.lo \
 	libkaffevm_la-Method.lo libkaffevm_la-TimeZone.lo \
 	libkaffevm_la-Class.lo libkaffevm_la-ClassLoader.lo \
-	libkaffevm_la-Object.lo libkaffevm_la-Runtime.lo \
-	libkaffevm_la-VMRuntime.lo libkaffevm_la-String.lo \
-	libkaffevm_la-System.lo libkaffevm_la-Thread.lo \
+	libkaffevm_la-java_lang_Object.lo libkaffevm_la-Runtime.lo \
+	libkaffevm_la-VMRuntime.lo libkaffevm_la-java_lang_String.lo \
+	libkaffevm_la-System.lo libkaffevm_la-java_lang_Thread.lo \
 	libkaffevm_la-Throwable.lo \
 	libkaffevm_la-gnu_classpath_VMStackWalker.lo \
 	libkaffevm_la-gnu_classpath_VMSystemProperties.lo \
@@ -488,7 +488,7 @@
 	$(top_srcdir)/libraries/clib/net/NetworkInterface.c \
 	$(top_srcdir)/libraries/clib/net/PlainDatagramSocketImpl.c \
 	$(top_srcdir)/libraries/clib/net/PlainSocketImpl.c \
-	$(top_srcdir)/libraries/clib/io/File.c \
+	$(top_srcdir)/libraries/clib/io/java_io_File.c \
 	$(top_srcdir)/libraries/clib/io/java_io_VMFile.c \
 	$(top_srcdir)/libraries/clib/native/AccessController.c \
 	$(top_srcdir)/libraries/clib/native/java_lang_ref_Reference.c \
@@ -499,12 +499,12 @@
         $(top_srcdir)/libraries/clib/native/TimeZone.c \
         $(top_srcdir)/libraries/clib/native/Class.c \
         $(top_srcdir)/libraries/clib/native/ClassLoader.c \
-        $(top_srcdir)/libraries/clib/native/Object.c \
+        $(top_srcdir)/libraries/clib/native/java_lang_Object.c \
         $(top_srcdir)/libraries/clib/native/Runtime.c \
         $(top_srcdir)/libraries/clib/native/VMRuntime.c \
-        $(top_srcdir)/libraries/clib/native/String.c \
+        $(top_srcdir)/libraries/clib/native/java_lang_String.c \
         $(top_srcdir)/libraries/clib/native/System.c \
-        $(top_srcdir)/libraries/clib/native/Thread.c \
+        $(top_srcdir)/libraries/clib/native/java_lang_Thread.c \
         $(top_srcdir)/libraries/clib/native/Throwable.c \
 	$(top_srcdir)/libraries/clib/native/gnu_classpath_VMStackWalker.c \
 	$(top_srcdir)/libraries/clib/native/gnu_classpath_VMSystemProperties.c \
@@ -625,17 +625,13 @@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-ClassLoader.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-Constructor.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-Field.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-File.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-InetAddressImpl.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-Method.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-NetworkInterface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-Object.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-PlainDatagramSocketImpl.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-PlainSocketImpl.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-Runtime.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-String.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-System.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-Thread.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-Throwable.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-TimeZone.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-VMRuntime.Plo at am__quote@
@@ -662,7 +658,11 @@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-hashtab.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-itypes.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-jar.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-java_io_File.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-java_io_VMFile.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-java_lang_Object.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-java_lang_String.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-java_lang_Thread.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-java_lang_VMDouble.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-java_lang_VMProcess.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-java_lang_VMSystem.Plo at am__quote@
@@ -986,12 +986,12 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -c -o libkaffevm_la-PlainSocketImpl.lo `test -f '$(top_srcdir)/libraries/clib/net/PlainSocketImpl.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/net/PlainSocketImpl.c
 
-libkaffevm_la-File.lo: $(top_srcdir)/libraries/clib/io/File.c
- at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -MT libkaffevm_la-File.lo -MD -MP -MF $(DEPDIR)/libkaffevm_la-File.Tpo -c -o libkaffevm_la-File.lo `test -f '$(top_srcdir)/libraries/clib/io/File.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/io/File.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libkaffevm_la-File.Tpo $(DEPDIR)/libkaffevm_la-File.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/libraries/clib/io/File.c' object='libkaffevm_la-File.lo' libtool=yes @AMDEPBACKSLASH@
+libkaffevm_la-java_io_File.lo: $(top_srcdir)/libraries/clib/io/java_io_File.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -MT libkaffevm_la-java_io_File.lo -MD -MP -MF $(DEPDIR)/libkaffevm_la-java_io_File.Tpo -c -o libkaffevm_la-java_io_File.lo `test -f '$(top_srcdir)/libraries/clib/io/java_io_File.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/io/java_io_File.c
+ at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libkaffevm_la-java_io_File.Tpo $(DEPDIR)/libkaffevm_la-java_io_File.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/libraries/clib/io/java_io_File.c' object='libkaffevm_la-java_io_File.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -c -o libkaffevm_la-File.lo `test -f '$(top_srcdir)/libraries/clib/io/File.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/io/File.c
+ at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -c -o libkaffevm_la-java_io_File.lo `test -f '$(top_srcdir)/libraries/clib/io/java_io_File.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/io/java_io_File.c
 
 libkaffevm_la-java_io_VMFile.lo: $(top_srcdir)/libraries/clib/io/java_io_VMFile.c
 @am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -MT libkaffevm_la-java_io_VMFile.lo -MD -MP -MF $(DEPDIR)/libkaffevm_la-java_io_VMFile.Tpo -c -o libkaffevm_la-java_io_VMFile.lo `test -f '$(top_srcdir)/libraries/clib/io/java_io_VMFile.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/io/java_io_VMFile.c
@@ -1063,12 +1063,12 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -c -o libkaffevm_la-ClassLoader.lo `test -f '$(top_srcdir)/libraries/clib/native/ClassLoader.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/ClassLoader.c
 
-libkaffevm_la-Object.lo: $(top_srcdir)/libraries/clib/native/Object.c
- at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -MT libkaffevm_la-Object.lo -MD -MP -MF $(DEPDIR)/libkaffevm_la-Object.Tpo -c -o libkaffevm_la-Object.lo `test -f '$(top_srcdir)/libraries/clib/native/Object.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/Object.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libkaffevm_la-Object.Tpo $(DEPDIR)/libkaffevm_la-Object.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/libraries/clib/native/Object.c' object='libkaffevm_la-Object.lo' libtool=yes @AMDEPBACKSLASH@
+libkaffevm_la-java_lang_Object.lo: $(top_srcdir)/libraries/clib/native/java_lang_Object.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -MT libkaffevm_la-java_lang_Object.lo -MD -MP -MF $(DEPDIR)/libkaffevm_la-java_lang_Object.Tpo -c -o libkaffevm_la-java_lang_Object.lo `test -f '$(top_srcdir)/libraries/clib/native/java_lang_Object.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/java_lang_Object.c
+ at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libkaffevm_la-java_lang_Object.Tpo $(DEPDIR)/libkaffevm_la-java_lang_Object.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/libraries/clib/native/java_lang_Object.c' object='libkaffevm_la-java_lang_Object.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -c -o libkaffevm_la-Object.lo `test -f '$(top_srcdir)/libraries/clib/native/Object.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/Object.c
+ at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -c -o libkaffevm_la-java_lang_Object.lo `test -f '$(top_srcdir)/libraries/clib/native/java_lang_Object.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/java_lang_Object.c
 
 libkaffevm_la-Runtime.lo: $(top_srcdir)/libraries/clib/native/Runtime.c
 @am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -MT libkaffevm_la-Runtime.lo -MD -MP -MF $(DEPDIR)/libkaffevm_la-Runtime.Tpo -c -o libkaffevm_la-Runtime.lo `test -f '$(top_srcdir)/libraries/clib/native/Runtime.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/Runtime.c
@@ -1084,12 +1084,12 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -c -o libkaffevm_la-VMRuntime.lo `test -f '$(top_srcdir)/libraries/clib/native/VMRuntime.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/VMRuntime.c
 
-libkaffevm_la-String.lo: $(top_srcdir)/libraries/clib/native/String.c
- at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -MT libkaffevm_la-String.lo -MD -MP -MF $(DEPDIR)/libkaffevm_la-String.Tpo -c -o libkaffevm_la-String.lo `test -f '$(top_srcdir)/libraries/clib/native/String.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/String.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libkaffevm_la-String.Tpo $(DEPDIR)/libkaffevm_la-String.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/libraries/clib/native/String.c' object='libkaffevm_la-String.lo' libtool=yes @AMDEPBACKSLASH@
+libkaffevm_la-java_lang_String.lo: $(top_srcdir)/libraries/clib/native/java_lang_String.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -MT libkaffevm_la-java_lang_String.lo -MD -MP -MF $(DEPDIR)/libkaffevm_la-java_lang_String.Tpo -c -o libkaffevm_la-java_lang_String.lo `test -f '$(top_srcdir)/libraries/clib/native/java_lang_String.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/java_lang_String.c
+ at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libkaffevm_la-java_lang_String.Tpo $(DEPDIR)/libkaffevm_la-java_lang_String.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/libraries/clib/native/java_lang_String.c' object='libkaffevm_la-java_lang_String.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -c -o libkaffevm_la-String.lo `test -f '$(top_srcdir)/libraries/clib/native/String.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/String.c
+ at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -c -o libkaffevm_la-java_lang_String.lo `test -f '$(top_srcdir)/libraries/clib/native/java_lang_String.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/java_lang_String.c
 
 libkaffevm_la-System.lo: $(top_srcdir)/libraries/clib/native/System.c
 @am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -MT libkaffevm_la-System.lo -MD -MP -MF $(DEPDIR)/libkaffevm_la-System.Tpo -c -o libkaffevm_la-System.lo `test -f '$(top_srcdir)/libraries/clib/native/System.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/System.c
@@ -1098,12 +1098,12 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -c -o libkaffevm_la-System.lo `test -f '$(top_srcdir)/libraries/clib/native/System.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/System.c
 
-libkaffevm_la-Thread.lo: $(top_srcdir)/libraries/clib/native/Thread.c
- at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -MT libkaffevm_la-Thread.lo -MD -MP -MF $(DEPDIR)/libkaffevm_la-Thread.Tpo -c -o libkaffevm_la-Thread.lo `test -f '$(top_srcdir)/libraries/clib/native/Thread.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/Thread.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libkaffevm_la-Thread.Tpo $(DEPDIR)/libkaffevm_la-Thread.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/libraries/clib/native/Thread.c' object='libkaffevm_la-Thread.lo' libtool=yes @AMDEPBACKSLASH@
+libkaffevm_la-java_lang_Thread.lo: $(top_srcdir)/libraries/clib/native/java_lang_Thread.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -MT libkaffevm_la-java_lang_Thread.lo -MD -MP -MF $(DEPDIR)/libkaffevm_la-java_lang_Thread.Tpo -c -o libkaffevm_la-java_lang_Thread.lo `test -f '$(top_srcdir)/libraries/clib/native/java_lang_Thread.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/java_lang_Thread.c
+ at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libkaffevm_la-java_lang_Thread.Tpo $(DEPDIR)/libkaffevm_la-java_lang_Thread.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/libraries/clib/native/java_lang_Thread.c' object='libkaffevm_la-java_lang_Thread.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -c -o libkaffevm_la-Thread.lo `test -f '$(top_srcdir)/libraries/clib/native/Thread.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/Thread.c
+ at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -c -o libkaffevm_la-java_lang_Thread.lo `test -f '$(top_srcdir)/libraries/clib/native/java_lang_Thread.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/java_lang_Thread.c
 
 libkaffevm_la-Throwable.lo: $(top_srcdir)/libraries/clib/native/Throwable.c
 @am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -MT libkaffevm_la-Throwable.lo -MD -MP -MF $(DEPDIR)/libkaffevm_la-Throwable.Tpo -c -o libkaffevm_la-Throwable.lo `test -f '$(top_srcdir)/libraries/clib/native/Throwable.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/Throwable.c
===================================================================
Checking out kaffe/libraries/clib/io/File.c
RCS:  /home/cvs/kaffe/kaffe/libraries/clib/io/Attic/File.c,v
VERS: 1.28
***************
--- kaffe/libraries/clib/io/File.c	Mon Nov 27 21:48:20 2006
+++ /dev/null	Sun Aug  4 19:57:58 2002
@@ -1,497 +0,0 @@
-/*
- * java.io.File.c
- *
- * Copyright (c) 1996, 1997, 1998, 1999
- *	Transvirtual Technologies, Inc.  All rights reserved.
- * Copyright (c) 2003, 2006
- *      Kaffe's team.
- * Copyright (c) 2006
- *      Free Software Foundation, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution 
- * of this file. 
- */
-
-#include "config.h"
-#include "config-std.h"
-#include "config-io.h"
-#include "config-mem.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <native.h>
-#include <jsyscall.h>
-#ifdef HAVE_UTIME_H
-#include <utime.h>
-#endif
-#include "defs.h"
-#include "files.h"
-#include "../../../include/system.h"
-#include "jni.h"
-#include "java_io_VMFile.h"
-#include "support.h"
-#include "stringSupport.h"
-
-/*
- * Is named item a file?
- */
-JNIEXPORT jboolean JNICALL
-Java_java_io_VMFile_isFile (JNIEnv * env,
-			    jobject obj __attribute__ ((__unused__)),
-			    jstring name)
-{
-  const char *filename;
-  int r;
-  struct stat buf;
-  
-  filename = (*env)->GetStringUTFChars (env, name, 0);
-  if (filename == NULL)
-    {
-      return (0);
-    }
-
-  r = KSTAT(filename, &buf);
-  (*env)->ReleaseStringUTFChars (env, name, filename);
-
-  if (r == 0 && S_ISREG(buf.st_mode)) {
-    return (1);
-  }
-  else {
-    return (0);
-  }
-}
-
-/*
- * Is named item a directory?
- */
-JNIEXPORT jboolean JNICALL
-Java_java_io_VMFile_isDirectory (JNIEnv * env,
-				 jobject obj __attribute__ ((__unused__)),
-				 jstring name)
-{
-  const char * filename;
-  int r;
-  struct stat buf;
-
-  filename = (*env)->GetStringUTFChars (env, name, 0);
-  if (filename == NULL)
-    {
-      return (0);
-    }
-  
-  r = KSTAT(filename, &buf);
-  (*env)->ReleaseStringUTFChars (env, name, filename);
-
-  if (r == 0 && S_ISDIR(buf.st_mode)) {
-    return (1);
-  }
-  else {
-    return (0);
-  }
-}
-
-/*
- * Does named file exist?
- */
-JNIEXPORT jboolean JNICALL
-Java_java_io_VMFile_exists (JNIEnv * env,
-			    jobject obj __attribute__ ((__unused__)),
-			    jstring name)
-{
-  const char *filename;
-  int result;
-  struct stat buf;
-  
-  filename = (*env)->GetStringUTFChars (env, name, 0);
-  if (filename == NULL)
-    {
-      return (0);
-    }
-  
-  /* A file exists if I can stat it */
-  result = KSTAT(filename, &buf);
-  (*env)->ReleaseStringUTFChars (env, name, filename);
-
-  return result == 0;
-}
-
-/*
- * Last modified time on file.
- */
-JNIEXPORT jlong JNICALL
-Java_java_io_VMFile_lastModified (JNIEnv * env,
-				  jobject obj __attribute__ ((__unused__)),
-				  jstring name)
-{
-  const char *filename;
-  struct stat buf;
-  int r;
-  
-  filename = (*env)->GetStringUTFChars (env, name, 0);
-  if (filename == NULL)
-    {
-      return (0);
-    }
-
-  
-  r = KSTAT(filename, &buf);
-
-  (*env)->ReleaseStringUTFChars (env, name, filename);
-
-  if (r != 0) {
-    return ((jlong)0);
-  }
-  return ((jlong)buf.st_mtime * (jlong)1000);
-}
-
-/*
- * Can I write to this file?
- */
-JNIEXPORT jboolean JNICALL
-Java_java_io_VMFile_canWrite (JNIEnv * env,
-			      jobject obj __attribute__ ((__unused__)),
-			      jstring name)
-{
-  const char *filename;
-  int r;
-
-  filename = (*env)->GetStringUTFChars (env, name, 0);
-  if (filename == NULL)
-    {
-      return (0);
-    }
-
-  /* XXX make part of jsyscall interface !? */
-  r = access(filename, W_OK);
-
-  (*env)->ReleaseStringUTFChars (env, name, filename);
-
-  return (r < 0 ? 0 : 1);
-}
-
-/*
- * Can I read from this file.
- */
-JNIEXPORT jboolean JNICALL
-Java_java_io_VMFile_canRead (JNIEnv * env,
-			     jobject obj __attribute__ ((__unused__)),
-			     jstring name)
-{
-  const char *filename;
-  int r;
-  
-  filename = (*env)->GetStringUTFChars (env, name, 0);
-  if (filename == NULL)
-    {
-      return (0);
-    }
-
-  /* XXX make part of jsyscall interface !? */
-  r = access(filename, R_OK);
-
-  (*env)->ReleaseStringUTFChars (env, name, filename);
-
-  return (r < 0 ? 0 : 1);
-}
-
-/*
- * Return length of file.
- */
-JNIEXPORT jlong JNICALL
-Java_java_io_VMFile_length (JNIEnv * env,
-			    jobject obj __attribute__ ((__unused__)),
-			    jstring name)
-{
-  const char *filename;
-  struct stat buf;
-  int r;
-  
-  filename = (*env)->GetStringUTFChars (env, name, 0);
-  if (filename == NULL)
-    {
-      return (0);
-    }
-  
-  r = KSTAT(filename, &buf);
-
-  (*env)->ReleaseStringUTFChars (env, name, filename);
-
-  if (r != 0) {
-    return ((jlong)0);
-  }
-  return ((jlong)buf.st_size);
-}
-
-/*
- * Create a directory.
- */
-JNIEXPORT jboolean JNICALL
-Java_java_io_VMFile_mkdir (JNIEnv * env,
-			   jobject obj __attribute__ ((__unused__)),
-			   jstring name)
-{
-  const char *filename;
-  int r;
-  
-  filename = (*env)->GetStringUTFChars (env, name, 0);
-  if (filename == NULL)
-    {
-      return (0);
-    }
- 
-  r = KMKDIR(filename, 0777);
-
-  (*env)->ReleaseStringUTFChars (env, name, filename);
-
-  return (r != 0 ? 0 : 1);
-}
-
-/*
- * Rename a file.
- */
-JNIEXPORT jboolean JNICALL
-Java_java_io_VMFile_renameTo (JNIEnv * env,
-			      jobject obj __attribute__ ((__unused__)),
-			      jstring t, jstring d)
-{
-  const char *old_filename, *new_filename;
-  int r;
-
-  old_filename = (*env)->GetStringUTFChars (env, t, 0);
-  if (old_filename == NULL)
-    {
-      return (0);
-    }
-
-  new_filename = (*env)->GetStringUTFChars (env, d, 0);
-  if (new_filename == NULL)
-    {
-      (*env)->ReleaseStringUTFChars (env, t, old_filename);
-      return (0);
-    }
-
-  r = KRENAME(old_filename, new_filename);
-
-  (*env)->ReleaseStringUTFChars (env, t, old_filename);
-  (*env)->ReleaseStringUTFChars (env, t, new_filename);
-
-  return (r != 0 ? 0 : 1);
-}
-
-/*
- * Delete a file.
- */
-JNIEXPORT jboolean JNICALL
-Java_java_io_VMFile_delete (JNIEnv * env,
-			    jobject obj __attribute__ ((__unused__)),
-			    jstring name)
-{
-  const char *filename;
-  int r;
-	
-  filename = (*env)->GetStringUTFChars (env, name, 0);
-  if (filename == NULL)
-    {
-      return (0);
-    }
-
-  r = KREMOVE(filename);
-
-  (*env)->ReleaseStringUTFChars (env, name, filename);
-
-  return(r != 0 ? 0 : 1);
-}
-
-/*
- * Get a directory listing.
- */
-JNIEXPORT jobjectArray JNICALL
-Java_java_io_VMFile_list (JNIEnv * env, jobject obj
-			  __attribute__ ((__unused__)), jstring name)
-{
-#if defined(HAVE_DIRENT_H)
-  const char *dirname;
-  DIR* dir;
-  struct dirent* entry;
-  struct dentry {
-    struct dentry* next;
-    char name[1];
-  };
-  struct dentry* dirlist;
-  struct dentry* mentry;
-  struct dentry* lastentry;
-  HArrayOfObject* array;
-  int count;
-  int i;
-  int oom = 0;
-
-  dirname = (*env)->GetStringUTFChars (env, name, 0);
-  if (dirname == NULL)
-    {
-      return (0);
-    }
-  
-  /* XXX make part of jsyscall interface !? */
-  dir = opendir(dirname);
-
-  (*env)->ReleaseStringUTFChars (env, name, dirname);
-
-  if (dir == 0) {
-    return (NULL);
-  }
-  
-  dirlist = NULL;
-  lastentry = NULL;
-  count = 0;
-  /* XXX make part of jsyscall interface !? */
-  while ((entry = readdir(dir)) != NULL) {
-    /* We skip '.' and '..' */
-    if (strcmp(".", entry->d_name) == 0 ||
-	strcmp("..", entry->d_name) == 0) {
-      continue;
-    }
-    mentry = KMALLOC(sizeof(struct dentry) + NAMLEN(entry));
-    if (!mentry) {
-      errorInfo info;
-      
-      while (dirlist) {
-	mentry = dirlist;
-	dirlist = dirlist->next;
-	KFREE(mentry);
-      }
-      postOutOfMemory(&info);
-      throwError(&info);
-    }
-    strcpy(mentry->name, entry->d_name);
-    mentry->next = NULL;
-    if (count == 0) {
-        dirlist = mentry;
-    }
-    else {
-        lastentry->next = mentry;
-    }
-    lastentry = mentry;
-    count++;
-  }
-  /* XXX make part of jsyscall interface !? */
-  closedir(dir);
-  
-  array = (HArrayOfObject*)AllocObjectArray(count,
-					    "Ljava/lang/String;", NULL);
-  /* XXX: This assert is a noop.  If AllocObjectArray throws an
-     exception, we leak. */
-  assert(array != NULL);
-  for (i = 0; i < count; i++) {
-    mentry = dirlist;
-    dirlist = mentry->next;
-    unhand_array(array)->body[i] =
-      (Hjava_lang_Object*)checkPtr(stringC2Java(mentry->name));
-    /* if allocation fails, continue freeing mentries in
-       this loop. */
-    oom |= !unhand_array(array)->body[i];
-    KFREE(mentry);
-  }
-  if (oom) {
-    errorInfo info;
-    postOutOfMemory(&info);
-    throwError(&info);
-  }
-  
-  return (array);
-#else
-  return (0);
-#endif
-}
-
-JNIEXPORT jboolean JNICALL
-Java_java_io_VMFile_create (JNIEnv * env,
-			    jclass clazz __attribute__ ((__unused__)),
-			    jstring name)
-{
-  const char *filename;
-  int fd;
-  int rc;
-  
-  filename = (*env)->GetStringUTFChars (env, name, 0);
-  if (filename == NULL)
-    {
-      return (0);
-    }
- 
-  rc = KOPEN(filename, O_EXCL|O_WRONLY|O_BINARY|O_CREAT, 0600, &fd);
-
-  (*env)->ReleaseStringUTFChars (env, name, filename);
-
-  switch (rc) {
-  case 0:
-    break;
-  case EEXIST:
-    return 0;
-  default:
-    SignalError("java.io.IOException", SYS_ERROR(rc));
-  }
-  rc = KCLOSE(fd);
-  if (rc != 0)
-    SignalError("java.io.IOException", SYS_ERROR(rc));
-  return 1;
-}
-
-JNIEXPORT jboolean JNICALL
-Java_java_io_VMFile_setLastModified (JNIEnv * env,
-				     jobject obj __attribute__ ((__unused__)),
-				     jstring name, jlong newtime)
-{
-#ifdef HAVE_UTIME_H
-  const char *filename;
-  int result;
-  struct utimbuf ub;
-#endif
-  
-  if (newtime < 0)
-    SignalError("java.lang.IllegalArgumentException", "time < 0");
-#ifdef HAVE_UTIME_H
-
-  ub.actime = (time_t)(newtime / 1000);
-  ub.modtime = ub.actime;
-
-  filename = (*env)->GetStringUTFChars (env, name, 0);
-  if (filename == NULL)
-    {
-      return (0);
-    }
-
-  result = utime(filename, &ub);
-
-  (*env)->ReleaseStringUTFChars (env, name, filename);
-
-  return result >= 0;
-#else
-  return 0;
-#endif
-}
-
-JNIEXPORT jboolean JNICALL
-Java_java_io_VMFile_setReadOnly (JNIEnv * env,
-				 jobject obj __attribute__ ((__unused__)),
-				 jstring name)
-{
-  const char *filename;
-  struct stat buf;
-  int r;
-  
-  filename = (*env)->GetStringUTFChars (env, name, 0);
-  if (filename == NULL)
-    {
-      return (0);
-    }
-  
-  r = KSTAT(filename, &buf);
-
-  if (r == 0)
-    r = chmod(filename, buf.st_mode & ~(S_IWOTH|S_IWGRP|S_IWUSR));
-
-  (*env)->ReleaseStringUTFChars (env, name, filename);
-
-  return (r == 0);
-}
-
===================================================================
Checking out kaffe/libraries/clib/io/java_io_File.c
RCS:  /home/cvs/kaffe/kaffe/libraries/clib/io/java_io_File.c,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/libraries/clib/io/java_io_File.c	Mon Nov 27 21:48:21 2006
@@ -0,0 +1,497 @@
+/*
+ * java.io.File.c
+ *
+ * Copyright (c) 1996, 1997, 1998, 1999
+ *	Transvirtual Technologies, Inc.  All rights reserved.
+ * Copyright (c) 2003, 2006
+ *      Kaffe's team.
+ * Copyright (c) 2006
+ *      Free Software Foundation, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution 
+ * of this file. 
+ */
+
+#include "config.h"
+#include "config-std.h"
+#include "config-io.h"
+#include "config-mem.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <native.h>
+#include <jsyscall.h>
+#ifdef HAVE_UTIME_H
+#include <utime.h>
+#endif
+#include "defs.h"
+#include "files.h"
+#include "../../../include/system.h"
+#include "jni.h"
+#include "java_io_VMFile.h"
+#include "support.h"
+#include "stringSupport.h"
+
+/*
+ * Is named item a file?
+ */
+JNIEXPORT jboolean JNICALL
+Java_java_io_VMFile_isFile (JNIEnv * env,
+			    jobject obj __attribute__ ((__unused__)),
+			    jstring name)
+{
+  const char *filename;
+  int r;
+  struct stat buf;
+  
+  filename = (*env)->GetStringUTFChars (env, name, 0);
+  if (filename == NULL)
+    {
+      return (0);
+    }
+
+  r = KSTAT(filename, &buf);
+  (*env)->ReleaseStringUTFChars (env, name, filename);
+
+  if (r == 0 && S_ISREG(buf.st_mode)) {
+    return (1);
+  }
+  else {
+    return (0);
+  }
+}
+
+/*
+ * Is named item a directory?
+ */
+JNIEXPORT jboolean JNICALL
+Java_java_io_VMFile_isDirectory (JNIEnv * env,
+				 jobject obj __attribute__ ((__unused__)),
+				 jstring name)
+{
+  const char * filename;
+  int r;
+  struct stat buf;
+
+  filename = (*env)->GetStringUTFChars (env, name, 0);
+  if (filename == NULL)
+    {
+      return (0);
+    }
+  
+  r = KSTAT(filename, &buf);
+  (*env)->ReleaseStringUTFChars (env, name, filename);
+
+  if (r == 0 && S_ISDIR(buf.st_mode)) {
+    return (1);
+  }
+  else {
+    return (0);
+  }
+}
+
+/*
+ * Does named file exist?
+ */
+JNIEXPORT jboolean JNICALL
+Java_java_io_VMFile_exists (JNIEnv * env,
+			    jobject obj __attribute__ ((__unused__)),
+			    jstring name)
+{
+  const char *filename;
+  int result;
+  struct stat buf;
+  
+  filename = (*env)->GetStringUTFChars (env, name, 0);
+  if (filename == NULL)
+    {
+      return (0);
+    }
+  
+  /* A file exists if I can stat it */
+  result = KSTAT(filename, &buf);
+  (*env)->ReleaseStringUTFChars (env, name, filename);
+
+  return result == 0;
+}
+
+/*
+ * Last modified time on file.
+ */
+JNIEXPORT jlong JNICALL
+Java_java_io_VMFile_lastModified (JNIEnv * env,
+				  jobject obj __attribute__ ((__unused__)),
+				  jstring name)
+{
+  const char *filename;
+  struct stat buf;
+  int r;
+  
+  filename = (*env)->GetStringUTFChars (env, name, 0);
+  if (filename == NULL)
+    {
+      return (0);
+    }
+
+  
+  r = KSTAT(filename, &buf);
+
+  (*env)->ReleaseStringUTFChars (env, name, filename);
+
+  if (r != 0) {
+    return ((jlong)0);
+  }
+  return ((jlong)buf.st_mtime * (jlong)1000);
+}
+
+/*
+ * Can I write to this file?
+ */
+JNIEXPORT jboolean JNICALL
+Java_java_io_VMFile_canWrite (JNIEnv * env,
+			      jobject obj __attribute__ ((__unused__)),
+			      jstring name)
+{
+  const char *filename;
+  int r;
+
+  filename = (*env)->GetStringUTFChars (env, name, 0);
+  if (filename == NULL)
+    {
+      return (0);
+    }
+
+  /* XXX make part of jsyscall interface !? */
+  r = access(filename, W_OK);
+
+  (*env)->ReleaseStringUTFChars (env, name, filename);
+
+  return (r < 0 ? 0 : 1);
+}
+
+/*
+ * Can I read from this file.
+ */
+JNIEXPORT jboolean JNICALL
+Java_java_io_VMFile_canRead (JNIEnv * env,
+			     jobject obj __attribute__ ((__unused__)),
+			     jstring name)
+{
+  const char *filename;
+  int r;
+  
+  filename = (*env)->GetStringUTFChars (env, name, 0);
+  if (filename == NULL)
+    {
+      return (0);
+    }
+
+  /* XXX make part of jsyscall interface !? */
+  r = access(filename, R_OK);
+
+  (*env)->ReleaseStringUTFChars (env, name, filename);
+
+  return (r < 0 ? 0 : 1);
+}
+
+/*
+ * Return length of file.
+ */
+JNIEXPORT jlong JNICALL
+Java_java_io_VMFile_length (JNIEnv * env,
+			    jobject obj __attribute__ ((__unused__)),
+			    jstring name)
+{
+  const char *filename;
+  struct stat buf;
+  int r;
+  
+  filename = (*env)->GetStringUTFChars (env, name, 0);
+  if (filename == NULL)
+    {
+      return (0);
+    }
+  
+  r = KSTAT(filename, &buf);
+
+  (*env)->ReleaseStringUTFChars (env, name, filename);
+
+  if (r != 0) {
+    return ((jlong)0);
+  }
+  return ((jlong)buf.st_size);
+}
+
+/*
+ * Create a directory.
+ */
+JNIEXPORT jboolean JNICALL
+Java_java_io_VMFile_mkdir (JNIEnv * env,
+			   jobject obj __attribute__ ((__unused__)),
+			   jstring name)
+{
+  const char *filename;
+  int r;
+  
+  filename = (*env)->GetStringUTFChars (env, name, 0);
+  if (filename == NULL)
+    {

*** Patch too long, truncated ***




More information about the kaffe mailing list