diff options
Diffstat (limited to 'libjava/java/io')
-rw-r--r-- | libjava/java/io/Console.h | 36 | ||||
-rw-r--r-- | libjava/java/io/IOError.h | 22 | ||||
-rw-r--r-- | libjava/java/io/ObjectOutputStream$2.h | 25 | ||||
-rw-r--r-- | libjava/java/io/ObjectOutputStream.h | 1 | ||||
-rw-r--r-- | libjava/java/io/VMConsole.h | 22 | ||||
-rw-r--r-- | libjava/java/io/VMConsole.java | 44 | ||||
-rw-r--r-- | libjava/java/io/natVMConsole.cc | 45 |
7 files changed, 195 insertions, 0 deletions
diff --git a/libjava/java/io/Console.h b/libjava/java/io/Console.h new file mode 100644 index 0000000..65a3072 --- /dev/null +++ b/libjava/java/io/Console.h @@ -0,0 +1,36 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_io_Console__ +#define __java_io_Console__ + +#pragma interface + +#include <java/lang/Object.h> +#include <gcj/array.h> + + +class java::io::Console : public ::java::lang::Object +{ + +public: + static ::java::io::Console * console(); +private: + Console(); +public: + ::java::io::PrintWriter * writer(); + ::java::io::Reader * reader(); + ::java::io::Console * format(::java::lang::String *, JArray< ::java::lang::Object * > *); + ::java::io::Console * printf(::java::lang::String *, JArray< ::java::lang::Object * > *); + ::java::lang::String * readLine(::java::lang::String *, JArray< ::java::lang::Object * > *); + ::java::lang::String * readLine(); + JArray< jchar > * readPassword(::java::lang::String *, JArray< ::java::lang::Object * > *); + JArray< jchar > * readPassword(); + void flush(); +private: + static ::java::io::Console * console__; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_io_Console__ diff --git a/libjava/java/io/IOError.h b/libjava/java/io/IOError.h new file mode 100644 index 0000000..c93c95d --- /dev/null +++ b/libjava/java/io/IOError.h @@ -0,0 +1,22 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_io_IOError__ +#define __java_io_IOError__ + +#pragma interface + +#include <java/lang/Error.h> + +class java::io::IOError : public ::java::lang::Error +{ + +public: + IOError(::java::lang::Throwable *); +private: + static const jlong serialVersionUID = 67100927991680413LL; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_io_IOError__ diff --git a/libjava/java/io/ObjectOutputStream$2.h b/libjava/java/io/ObjectOutputStream$2.h new file mode 100644 index 0000000..1ddf1be --- /dev/null +++ b/libjava/java/io/ObjectOutputStream$2.h @@ -0,0 +1,25 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_io_ObjectOutputStream$2__ +#define __java_io_ObjectOutputStream$2__ + +#pragma interface + +#include <java/lang/Object.h> + +class java::io::ObjectOutputStream$2 : public ::java::lang::Object +{ + +public: // actually package-private + ObjectOutputStream$2(::java::lang::Class *); +public: + virtual ::java::lang::Boolean * ObjectOutputStream$2$run(); + virtual ::java::lang::Object * run(); +private: + ::java::lang::Class * __attribute__((aligned(__alignof__( ::java::lang::Object)))) val$clazz; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_io_ObjectOutputStream$2__ diff --git a/libjava/java/io/ObjectOutputStream.h b/libjava/java/io/ObjectOutputStream.h index fe6f88f..d38f1b2 100644 --- a/libjava/java/io/ObjectOutputStream.h +++ b/libjava/java/io/ObjectOutputStream.h @@ -95,6 +95,7 @@ private: void callWriteMethod(::java::lang::Object *, ::java::io::ObjectStreamClass *); void dumpElementln(::java::lang::String *, ::java::lang::Object *); void dumpElementln(::java::lang::String *); + static jboolean overridesMethods(::java::lang::Class *); static const jint BUFFER_SIZE = 1024; static jint defaultProtocolVersion; ::java::io::DataOutputStream * __attribute__((aligned(__alignof__( ::java::io::OutputStream)))) dataOutput; diff --git a/libjava/java/io/VMConsole.h b/libjava/java/io/VMConsole.h new file mode 100644 index 0000000..a75a123 --- /dev/null +++ b/libjava/java/io/VMConsole.h @@ -0,0 +1,22 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_io_VMConsole__ +#define __java_io_VMConsole__ + +#pragma interface + +#include <java/lang/Object.h> + +class java::io::VMConsole : public ::java::lang::Object +{ + +public: + VMConsole(); +public: // actually package-private + static ::java::lang::String * readPassword(::java::io::Console *); +public: + static ::java::lang::Class class$; +}; + +#endif // __java_io_VMConsole__ diff --git a/libjava/java/io/VMConsole.java b/libjava/java/io/VMConsole.java new file mode 100644 index 0000000..69c9df9 --- /dev/null +++ b/libjava/java/io/VMConsole.java @@ -0,0 +1,44 @@ +/* VMConsole.java -- helper for java.io.Console + Copyright (C) 2012 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.io; + +public final class VMConsole +{ + static native String readPassword(Console con); +} diff --git a/libjava/java/io/natVMConsole.cc b/libjava/java/io/natVMConsole.cc new file mode 100644 index 0000000..7bdc2cf --- /dev/null +++ b/libjava/java/io/natVMConsole.cc @@ -0,0 +1,45 @@ +// natVMConsole.cc - Native part of VMConsole class. + +/* Copyright (C) 2012 + Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the ObjectInputStream "LIBGCJ_LICENSE" for +details. */ + +#include <config.h> + +#include <termios.h> +#include <unistd.h> + +#include <gcj/cni.h> + +#include <java/io/Console.h> +#include <java/io/VMConsole.h> + +#define TERMIOS_ECHO_IFLAGS (IUCLC|IXON|IXOFF|IXANY) +#define TERMIOS_ECHO_LFLAGS (ECHO|ECHOE|ECHOK|ECHONL|TOSTOP) + +jstring +java::io::VMConsole::readPassword(::java::io::Console *con) +{ + struct termios oldt, newt; + jstring result; + + tcgetattr (STDIN_FILENO, &oldt); + + tcgetattr (STDIN_FILENO, &newt); + + newt.c_iflag &= ~TERMIOS_ECHO_IFLAGS; + newt.c_lflag &= ~TERMIOS_ECHO_LFLAGS; + + tcsetattr (STDIN_FILENO, TCSANOW, &newt); + + result = con->readLine (); + + tcsetattr (STDIN_FILENO, TCSANOW, &oldt); + + return result; +} |