Commit Graph

19 Commits

Author SHA1 Message Date
Mohan Embar 83c02e38a3 configure.in: Added new MinGW-specific configure flag --with-win32-nlsapi.
* configure.in: Added new MinGW-specific configure flag
	--with-win32-nlsapi.
	Added new AC_DEFINE MINGW_LIBGCJ_UNICODE.
	Add -lunicows to MinGW SYSTEMSPEC if --with-win32-nlsapi
	is set to unicows.
	* configure: Rebuilt.
	* include/config.h.in: Rebuilt.
	* win32.cc (_Jv_Win32NewString): Implemented.
	(nativeToUnicode): New helper function defined only for
	non-UNICODE builds.
	(unicodeToNative): Likewise.
	(_Jv_Win32TempString): Implemented.
	(lots): Refactored using tchar.h macros.
	(WSAEventWrapper): Use _Jv_Win32NewString.
	(_Jv_platform_initialize): Use GetModuleFileNameA instead
	of GetModuleFileName.
	(_Jv_platform_initProperties): Use _Jv_Win32NewString.
	Use temporary stack buffer instead of a heap buffer.
	* include/win32.h
	Added defines for UNICODE and _UNICODE if MINGW_LIBGCJ_UNICODE is
	defined; added tchar.h include.
	(_Jv_Win32TempString): Declared new helper class.
	(JV_TEMP_STRING_WIN32): New helper macro.
	(_Jv_Win32NewString): Declared new helper method.
	* java/io/natFileDescriptorWin32.cc (open): Use
	JV_TEMP_STRING_WIN32 instead of JV_TEMP_UTF_STRING.
	(write): Reformatted slightly.
	* java/io/natFileWin32.cc (lots): Use tchar.h macros;
	use JV_TEMP_STRING_WIN32 instead of JV_TEMP_UTF_STRING.
	(getCanonicalPath): Use _Jv_Win32NewString instead of
	JvNewStringUTF.
	(performList): Likewise.
	* java/lang/natWin32Process.cc (ChildProcessPipe):
	Use tchar.h macros.
	(startProcess): Use tchar.h macros, JV_TEMP_STRING_WIN32,
	and UNICODE environment flag for CreateProcess.
	* java/net/natNetworkInterfaceWin32.cc
	(winsock2GetRealNetworkInterfaces): Use tchar.h macros and
	_Jv_Win32NewString.

From-SVN: r74201
2003-12-02 22:26:50 +00:00
Mohan Embar b82183ab3f re PR libgcj/6652 (new java.io.File("").getCanonicalFile() throws exception)
PR libgcj/6652:
	* java/io/natFileWin32.cc (getCanonicalPath): Treat "" like ".".

From-SVN: r73115
2003-10-31 03:02:47 +00:00
Mohan Embar 5c14415811 win32.cc: fixed tab...
* win32.cc: fixed tab, indentation and whitespace
	inconsistencies
	removed jvm.h include
	added includes java/lang/UnsupportedOperationException.h,
	java/io/IOException.h, java/net/SocketException.h
	(WSAEventWrapper): class implementation
	(_Jv_WinStrError): implemented both overloads
	(_Jv_ThrowIOException): implemented both overloads
	(_Jv_ThrowSocketException): implemented both overloads
	(_Jv_select): implemented
	* include/win32.h: fixed tab, indentation and whitespace
	inconsistencies
	wrapped <windows.h> include with  #define WIN32_LEAN_AND_MEAN
	added jvm.h include
	(WSAEventWrapper): added class declaration
	(_Jv_WinStrError): added both overload declarations
	(_Jv_ThrowIOException): added both overload declarations
	(_Jv_ThrowSocketException): added both overload declarations
	removed ENOTCONN, ECONNRESET and ENOPROTOOPT defines
	(_Jv_select): added declaration
	(_Jv_socket): removed
	(_Jv_connect): removed
	(_Jv_close): removed
	(_Jv_bind): removed
	(_Jv_accept): removed
	(_Jv_listen): removed
	(_Jv_write): removed
	(_Jv_read): removed
	* java/io/natFileDescriptorWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	replaced <windows.h> #include with <platform.h>
	removed jvm.h include
	(testCanUseGetHandleInfo): new function which tests whether Win32
	GetHandleInformation() call can be used with console buffer handles
	(only supported on >=WinNT 5.0)
	(winerr): removed (superseded by _Jv_WinStrError in include/win32.h)
	(valid): rewrote implementation using GetHandleInformation()
	(sync): 	changed exception throwing to use error string and exception
	helper methods declared in include/win32.h
	(open): likewise
	(write): likewise
	(setLength): likewise
	(close): likewise
	(seek): likewise
	(getFilePointer): likewise
	(read): likewise
	* java/io/natFileWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	replaced <windows.h> #include with <platform.h>
	removed jvm.h include
	(_access): use JV_TEMP_UTF_STRING
	(_stat): likewise
	(performMkDir): use JV_TEMP_UTF_STRING
	(performRenameTo): likewise
	(performDelete): likewise
	(performCreate): likewise
	(performSetReadOnly): likewise
	(performSetLastModified): likewise
	* java/lang/natWin32Process.cc: fixed tab, indentation and
	whitespace inconsistencies
	replaced <windows.h> #include with <platform.h>
	removed includes gcj/cni.h, jvm.h
	(new_string): removed
	(startProcess): use JV_TEMP_UTF_STRING,
	changed exception throwing to use error string and exception
	helper methods declared in include/win32.h
	* java/net/natInetAddressWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	replaced <windows.h> #include with <platform.h>
	removed jvm.h include
	removed DISABLE_JAVA_NET conditional code
	removed POSIX conditional code not relevant to Win32
	(aton): use JV_TEMP_UTF_STRING
	removed POSIX conditional code not relevant to Win32
	(lookup): likewise
	(getLocalHostName): likewise
	* java/net/natNetworkInterfaceWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	removed unnecessary windows.h, winsock.h and gcj/cni.h includes
	removed DISABLE_JAVA_NET conditional code
	removed POSIX conditional code not relevant to Win32
	(winsock2GetRealNetworkInterfaces): new function to compute network
	interfaces via Winsock2 API
	(determineGetRealNetworkInterfacesFN): new function for returning
	a function pointer to the function used to compute network interfaces.
	(getRealNetworkInterfaces): implemented
	* java/net/natPlainDatagramSocketImplWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	removed gcj/cni.h include
	removed DISABLE_JAVA_NET conditional code
	removed POSIX conditional code not relevant to Win32
	changed net POSIXisms to Win32isms
	replaced _Jv socket-related calls with their real Win32 equivalents
	changed exception throwing to use error string and exception
	helper methods declared in include/win32.h
	(peekData): implemented timeout support
	(receive): likewise
	* java/net/natPlainSocketImplWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	removed gcj/cni.h and gcj/javaprims.h includes
	removed DISABLE_JAVA_NET conditional code
	removed POSIX conditional code not relevant to Win32
	changed net POSIXisms to Win32isms
	replaced _Jv socket-related calls with their real Win32
	equivalents
	changed exception throwing to use error string and exception
	helper methods declared in include/win32.h
	(throwConnectException): helper function for connect()
	(connect): implemented timeout support
	(accept): likewise
	(doRead): new helper function common to both read() method overloads,
	includes timeout support
	(read): implemented both overloads in terms of doRead()
	(available): implemented using ioctlsocket()

From-SVN: r70904
2003-08-29 04:21:01 +00:00
Ranjit Mathew f1a1591b9e File.java (getAbsolutePath): On Windows, take care of paths like "C:", "G:foo\bar", etc.
2003-04-19  Ranjit Mathew  <rmathew@hotmail.com>

	* java/io/File.java (getAbsolutePath): On Windows, take care
	of paths like "C:", "G:foo\bar", etc.
	(getName): Make it work correctly on Windows.
	(getParent): Make it work correctly on Windows. For UNIX,
	fix bug that causes "/" to be returned as the parent of "/",
	instead of null as returned by Sun's JRE.

	* java/io/natFileWin32.cc: Change copyright owner to FSF.

From-SVN: r65823
2003-04-19 19:08:49 +00:00
Ranjit Mathew 3ccd3d7041 File.java (normalizePath): Remove trailing separator on Windows only if path is not of the form "x:\".
2003-03-01  Ranjit Mathew  <rmathew@hotmail.com>

	* java/io/File.java (normalizePath): Remove trailing separator
	on Windows only if path is not of the form "x:\".

	* java/io/natFileWin32.cc (WIN32_EPOCH_MILLIS): New constant.
	(java::io::File::attr): Change formatting a bit and use
	WIN32_EPOCH_MILLIS instead of magic numbers.
	(java::io::File::isAbsolute): Path must have at least 3
	characters for a UNC network path.
	(java::io::File::init_native): Define.
	(java::io::File::performCreate): Likewise.
	(java::io::File::performSetReadOnly): Likewise.
	(java::io::File::performSetLastModified): Likewise.
	(java::io::File::performListRoots): Likewise.

From-SVN: r63646
2003-03-02 00:36:03 +00:00
Ranjit Mathew 5bedfc9356 File (getAbsolutePath): Prefix drive specifier on Windows for paths starting with a '\'.
2003-03-01  Ranjit Mathew  <rmathew@hotmail.com>

	* java/io/File (getAbsolutePath): Prefix drive specifier on
	Windows for paths starting with a '\'.
	(toURL): Make URL more consistent with what Sun's JDK returns.

	* java/io/natFileWin32.cc (java::io::File::isAbsolute): Return
	true only if the path is a UNC network path or it starts with a
	drive specifier.

	* java/net/URLStreamHandler.java (parseURL): Correct minor typo.
	Be prepared to handle either '/' or '\\' in the file path for
	Windows if using the "file" protocol.
	Canonicalise the file path if using a relative path in the given
	context and the "file" protocol.

From-SVN: r63635
2003-03-01 23:38:13 +00:00
Ranjit Mathew 0ced43354f re PR java/9253 (on win32, java.io.File.listFiles("C:\\") returns pwd instead of the root content of C:)
2003-01-24  Ranjit Mathew  <rmathew@hotmail.com>

	Fixes PR java/9253:
	* java/io/natFileWin32.cc (performList): Append only "*.*"
	if the canonical file path already has a "\" at the end.

From-SVN: r61736
2003-01-24 21:57:00 +00:00
Vladimir Puskas 691255fb2a natFileWin32.cc (isAbsolute): Check path length before looking at any characters.
2003-01-21  Vladimir Puskas  <vpuskas@eunet.yu>

	* java/io/natFileWin32.cc (isAbsolute): Check path length before
	looking at any characters.
	* java/io/natFilePosix.cc (_stat): Only compute `buf' if it will
	be used.
	(isAbsolute): Check path's length as well.

From-SVN: r61566
2003-01-21 20:45:57 +00:00
Ranjit Mathew 963f08a97f natFileWin32.cc (attr): Use FindFirstFile( ) instead of GetFileAttributesEx( ) to find file length and...
2002-10-23  Ranjit Mathew <rmathew@hotmail.com>

        * java/io/natFileWin32.cc (attr): Use FindFirstFile( ) instead of
        GetFileAttributesEx( ) to find file length and modification times,
        as the latter is not present on Windows 95.

From-SVN: r58466
2002-10-23 20:44:24 +00:00
Adam King 6344da6f57 natFileWin32.cc (performList): Return the correct array type.
2002-04-16  Adam King <aking@dreammechanics.com>
	    Tom Tromey  <tromey@redhat.com>

	* java/io/natFileWin32.cc (performList): Return the correct array
	type.  Don't duplicate the creation of a File since it's already
	done earlier in the method and the existing code would cause a
	ArrayStoreException.  Don't use fixed-size array.
	(_access, _stat, attr, getCanonicalPath, performMkdir,
	performRenameTo): Don't use fixed-size array.
	(getCanonicalPath): Use throw, not _Jv_Throw.

Co-Authored-By: Tom Tromey <tromey@redhat.com>

From-SVN: r52369
2002-04-16 15:37:39 +00:00
Adam Megacz 30529b03fd natFileWin32.cc, [...]: Added #undef STRICT to make windows.h and java/lang/reflect/Modifier.h cooperate.
2002-02-11  Adam Megacz <adam@xwt.org>

    * java/io/natFileWin32.cc, java/io/natFileDescriptorWin32.cc:
    Added #undef STRICT to make windows.h and
    java/lang/reflect/Modifier.h cooperate.

From-SVN: r49692
2002-02-12 02:17:21 +00:00
Adam Megacz 27fa520dc7 natFileWin32.cc: Created a placeholder class with lots of FIXMEs.
2002-02-11  Adam Megacz <adam@xwt.org>

        * java/io/natFileWin32.cc: Created a placeholder class with lots
        of FIXMEs.

From-SVN: r49691
2002-02-12 01:54:18 +00:00
Tom Tromey 85ea93b38f natThrowable.cc: Updated copyright.
* java/lang/natThrowable.cc: Updated copyright.
	* java/io/natFileWin32.cc: Updated copyright.
	* java/io/natFileDescriptorWin32.cc: Updated copyright.
	* win32-threads.cc: Updated copyright.
	* name-finder.cc: Updated copyright.
	* include/name-finder.h: Updated copyright.

From-SVN: r49586
2002-02-07 19:26:06 +00:00
Joseph Myers 18e1f2bd67 HACKING, [...]: Fix spelling errors.
* HACKING, gnu/gcj/xlib/Pixmap.java, gnu/gcj/xlib/XException.java,
	gnu/java/rmi/rmic/RMIC.java, java/awt/Window.java,
	java/awt/AWTEvent.java, java/io/ByteArrayOutputStream.java,
	java/io/CharConversionException.java,
	java/io/PipedInputStream.java, java/io/PipedReader.java,
	java/io/PrintWriter.java, java/io/WriteAbortedException.java,
	java/io/natFileWin32.cc, java/lang/Class.h,
	java/lang/natClassLoader.cc, java/lang/natObject.cc,
	java/lang/Package.java, java/net/BindException.java,
	java/net/ConnectException.java, java/net/ProtocolException.java,
	java/net/SocketException.java,
	java/net/UnknownServiceException.java,
	java/security/cert/X509Certificate.java,
	java/security/interfaces/DSAKey.java,
	java/security/SecureRandom.java, java/security/SignedObject.java,
	java/sql/DatabaseMetaData.java,
	java/text/DecimalFormatSymbols.java,
	java/util/jar/Attributes.java, java/util/jar/JarEntry.java,
	java/util/jar/JarInputStream.java,
	java/util/jar/JarOutputStream.java, java/util/Calendar.java,
	java/util/Collections.java, java/util/GregorianCalendar.java,
	java/util/HashMap.java, java/util/List.java,
	java/util/Properties.java, java/util/Timer.java,
	java/util/Vector.java, java/util/WeakHashMap.java,
	javax/naming/NamingException.java,
	testsuite/libjava.lang/Thread_Wait.java,
	org/xml/sax/helpers/DefaultHandler.java,
	org/xml/sax/HandlerBase.java, org/xml/sax/SAXParseException.java,
	ChangeLog, acinclude.m4, aclocal.m4, posix-threads.cc: Fix
	spelling errors.
	* configure: Regenerate.

From-SVN: r46665
2001-10-31 00:48:17 +00:00
Tom Tromey e5c83273cf natFileWin32.cc (_access): Renamed.
* java/io/natFileWin32.cc (_access): Renamed.
	(_stat): Likewise.
	* java/io/natFile.cc (_access): Renamed.
	(_stat): Likewise.
	* java/io/File.java (access, stat): Add leading `_' to name.
	Updated all callers.

From-SVN: r44124
2001-07-18 18:35:12 +00:00
Bryce McKinlay 8f58baf480 natSystem.cc (init_properties): Revert yesterday's changes to "file.separator"...
* java/lang/natSystem.cc (init_properties): Revert yesterday's changes
	to "file.separator", "path.separator", and "java.io.tmpdir" property
	initialization.
	* java/io/File.java: Likewise.
	* java/io/natFile.cc (init_native): Likewise.
	* java/io/natFileWin32.cc (init_native): Likewise.

From-SVN: r40994
2001-04-02 06:23:10 +01:00
Bryce McKinlay f404754042 1.3-Compliant Implementation of java.io.File.
* java/lang/natSystem.cc (init_properties): Get "file.separator",
	"path.separator", and "java.io.tmpdir" from the File class, instead
	of setting them explicitly.
	* java/io/File.java: Do not canonicalize paths for security manager
	checks. Call init_native() from static initializer. Do not pass path
	argument to native methods. New native method declarations. Some
	security manager checks moved to checkWrite().
	(equals): Check file system case sensitivity and act appropriatly.
	(hashCode): Likewise.
	(isHidden): New method implemented.
	(performList): Changed prototype. Now takes a class argument specifying
	the class of the returned array: Strings or File objects. Also added
	FileFilter argument.
	(listFiles): New variants with "File" return type implemented.
	(createTempFile): Use createNewFile(). Use maxPathLen.
	(setReadOnly): New method implemented.
	(listRoots): Likewise.
	(compareTo): Likewise.
	(setLastModified): Likewise.
	(checkWrite): New method.
	(setPath): Removed.
	* java/io/natFile.cc: Various functions no longer take canonical path
	argument.
	(stat): Handle ISHIDDEN query.
	(isAbsolute): Remove WIN32 cruft.
	(performList): New arguments. Handle returning either File[] or
	String[] arrays. Check with FileFilter or FilenameFilter arguments as
	appropriate. Use an ArrayList, not a Vector, for the temporary list.
	(performSetReadOnly): New method implemented.
	(performListRoots): Likewise.
	(performSetLastModified): Likewise.
	(performCreate): Likewise.
	(init_native): New initialization function.
	* java/io/natFileWin32.cc: Various functions no longer take canonical
	path argument.
	(stat): Add FIXME about ISHIDDEN query.
	(performList): New arguments. Handle returning either File[] or String[]
	arrays. Check with FileFilter or FilenameFilter arguments as
	appropriate. Use an ArrayList, not a Vector, for the temporary list.
	(performSetReadOnly): New. Stubbed.
	(performListRoots): Likewise.
	(performSetLastModified): Likewise.
	(performCreate): Likewise.
	(init_native) New initialization function.
	* configure.in: Check for utime() and chmod().
	* configure: Rebuilt.
	* include/config.h.in: Rebuilt.

	Resolves PR libgcj/1759.

From-SVN: r40985
2001-04-01 12:16:40 +01:00
Richard Henderson b3208f56cb exception.cc (java_eh_info): Make value type jthrowable.
* exception.cc (java_eh_info): Make value type jthrowable.
	(_Jv_type_matcher): Remove now unneeded cast.
	(_Jv_Throw): Make argument type jthrowable.  Munge name
	for SJLJ_EXCEPTIONS here ...
	* gcj/cni.h: ... not here.
	(JvThrow): Remove.
	* gcj/javaprims.h (_Jv_Throw, _Jv_Sjlj_Throw): Update declarations.

	* defineclass.cc, interpret.cc, jni.cc, posix-threads.cc,
	prims.cc, resolve.cc, gnu/gcj/runtime/natFirstThread.cc,
	gnu/gcj/xlib/natDrawable.cc, gnu/gcj/xlib/natFont.cc,
	gnu/gcj/xlib/natWMSizeHints.cc, gnu/gcj/xlib/natWindowAttributes.cc,
	gnu/gcj/xlib/natXImage.cc, java/io/natFile.cc,
	java/io/natFileDescriptorEcos.cc, java/io/natFileDescriptorPosix.cc,
	java/io/natFileDescriptorWin32.cc, java/io/natFileWin32.cc,
	java/lang/natClass.cc, java/lang/natClassLoader.cc,
	java/lang/natDouble.cc, java/lang/natObject.cc,
	java/lang/natPosixProcess.cc, java/lang/natRuntime.cc,
	java/lang/natString.cc, java/lang/natSystem.cc,
	java/lang/natThread.cc, java/lang/reflect/natArray.cc,
	java/lang/reflect/natConstructor.cc, java/lang/reflect/natField.cc,
	java/lang/reflect/natMethod.cc, java/util/zip/natDeflater.cc,
	java/util/zip/natInflater.cc:
	Use throw, not JvThrow or _Jv_Throw.

From-SVN: r40838
2001-03-25 23:05:32 -08:00
Tom Tromey 878885b411 [multiple changes]
2000-03-15  Tom Tromey  <tromey@cygnus.com>

	* java/io/natFileDescriptorWin32.cc (winerr): Now static.

	* prims.cc (win32_exception_handler): Reformatted.

	* include/win32-threads.h (_Jv_HaveCondDestroy): New define.
	(_Jv_HaveMutexDestroy): Likewise.

2000-03-15 Jon Beniston <jb7216@bristol.ac.uk>

	* java/io/natFileDescriptorWin32.cc: New file.
	* java/io/natFileWin32.cc: New file.
	* java/net/natInetAddress.cc: Added conditional inclusion of
	Windows / Winsock headers.
	* java/net/natPlainDatagramSocketImpl.cc: Added conditional
	inclusion of Windows / Winsock headers.
	* java/net/natPlainSocketImpl.cc: Added conditional inclusion of
	Windows / Winsock headers.
	* include/win32-signal.h: New file.
	* include/win32-threads.h: New file.
	* win32-threads.cc: New file.
	* exception.cc (win32_get_restart_frame): New function.
	* prims.cc (win32_exception_handler): New function.
	(main_init) Performs Winsock initialisation.
	(main_init) Installs exeception handler.

From-SVN: r32567
2000-03-15 22:03:19 +00:00