diff -urN jta20-20001106-2155/Makefile jta20-p3/Makefile --- jta20-20001106-2155/Makefile Thu Nov 9 22:49:38 2000 +++ jta20-p3/Makefile Thu Nov 9 23:49:04 2000 @@ -15,9 +15,14 @@ # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. -JAVA = java -JAR = jar -JAVAC = javac +#JAVA = java +#JAR = jar +#JAVAC = javac +#JAVADOC = javadoc +JAVA = /q/opt/jdk1.2.2/bin/java +JAR = /q/opt/jdk1.2.2/bin/jar +JAVAC = /q/opt/jdk1.2.2/bin/javac +JAVADOC = /q/opt/jdk1.2.2/bin/javadoc #DEBUG = -g -deprecation DEBUG = -g JFLAGS = -classpath $(CLASSPATH):jar/cryptix.jar:. @@ -36,7 +41,8 @@ # # major rules to create files # -all: app cont doc jar tools/mrelayd tools/relayd +#all: app cont doc jar tools/mrelayd tools/relayd +all: app doc jar run: app $(JAVA) $(JFLAGS) de.mud.jta.Main @@ -45,7 +51,7 @@ @echo Creating source documentation ... @if [ ! -d doc ]; then mkdir doc; fi @-rm -r doc/source/*.html doc/source/de - @javadoc -d doc/source -version -author \ + @$(JAVADOC) -d doc/source -version -author \ -sourcepath $(CLASSPATH):.:contrib \ `(find de -name \*.java -printf '%h\n'; \ (cd contrib; find * -name \*.java -printf '%h\n')) | \ @@ -55,7 +61,7 @@ tex: app @echo Creating latex source documentation ... - @javadoc -docletpath ../tex -doclet TexDoclet \ + @$(JAVADOC) -docletpath ../tex -doclet TexDoclet \ -output $(PKGNAME).tex \ -docdir de/mud/jta `find de/mud -type d -print | \ grep -v CVS | grep -v '^de/mud$$' | sed 's/\//./g'`; > /dev/null @@ -158,7 +164,8 @@ clean: -find . -name \*.class -print | xargs rm > /dev/null 2>&1 -find . -name \*~ -print | xargs rm > /dev/null 2>&1 - -rm tools/relayd tools/mrelayd + -rm -f tools/relayd tools/mrelayd realclean: clean -rm -f jar/$(PKGNAME).jar jar/$(PKGNAME)-src.jar + @echo "Please clean manually in jni/ if you built any native classes" diff -urN jta20-20001106-2155/README jta20-p3/README --- jta20-20001106-2155/README Thu Nov 9 22:49:38 2000 +++ jta20-p3/README Thu Nov 9 23:12:56 2000 @@ -39,6 +39,8 @@ Using the make file to compile the source and building jar files will result in the packages to be stored in that directory. +jni/ + Implementation of native methods for different platforms. license/ Contains the license this software is covered by in text format. diff -urN jta20-20001106-2155/TODO jta20-p3/TODO --- jta20-20001106-2155/TODO Wed Dec 31 16:00:00 1969 +++ jta20-p3/TODO Fri Nov 10 00:04:53 2000 @@ -0,0 +1,32 @@ +Shell +===== + +2000/10/07: Got first well working version with PTY. +Why did glibc-2.1.3 move forkpty() into libutil? + +2000/10/21: Fixed Process p = Runtime.getRuntime().exec("/bin/sh") mode. +Good exercise, entirely useless otherwise. + +2000/11/09: Moved C modules into jni/. + + * Without arguments it ends with "localhost". + Make different default arguments for different plugins. +[zaitcev@niphredil jta20-p3]$ find . -name '*.java'| xargs grep localhost| more +./de/mud/jta/Main.java: if(host1 == null) host1 = "localhost"; +./contrib/hc/net/TelnetClient.java: String host = "localhost"; + + * Argument list to start "/bin/sh -i" - is related to host/port "argument". + Currently we pass only one String, so you must use wrappers. Bleah. + + * Need to track if the process ends running (^D, or "exit"), then go "offline". + Or, perhaps, exit the whole program? (this is what xterm does) + + * Selection does now work (jta -> X11). Why? + You *CAN* select visually, so apparently it was designed to work. Or was it? + + * 2000/11/04 Make it so that window resize gets through PTY and does SIGWINCH. + +General +======= + + * 2000/11/09: Something must be done about "^?" diff -urN jta20-20001106-2155/de/mud/jta/default.conf jta20-p3/de/mud/jta/default.conf --- jta20-20001106-2155/de/mud/jta/default.conf Thu Nov 9 22:49:38 2000 +++ jta20-p3/de/mud/jta/default.conf Thu Nov 9 23:05:32 2000 @@ -25,7 +25,8 @@ # ======================================================================= # common program defaults # ======================================================================= -plugins = Status,Socket,Telnet,Terminal +#plugins = Status,Socket,Telnet,Terminal +plugins = Status,Shell,Terminal pluginPath = de.mud.jta.plugin layout = BorderLayout layout.Terminal = Center diff -urN jta20-20001106-2155/de/mud/jta/plugin/HandlerPTY.java jta20-p3/de/mud/jta/plugin/HandlerPTY.java --- jta20-20001106-2155/de/mud/jta/plugin/HandlerPTY.java Wed Dec 31 16:00:00 1969 +++ jta20-p3/de/mud/jta/plugin/HandlerPTY.java Thu Nov 9 22:59:58 2000 @@ -0,0 +1,31 @@ +// JNI interface to slave process. +// This is a part of Shell plugin. +// If not for a static member, we'd have HandlerPTY private to Shell. XXX + +// HandlerPTY is meant to be robust, in a way that you can +// instantiate it and work with it until it throws an exception, +// then forget it. A finalizer takes care of file descriptors. + +package de.mud.jta.plugin; + +public class HandlerPTY { + public native int start(String cmd); // open + fork/exec + public native void close(); + public native int read(byte[] b); + public native int write(byte[] b); + + private int fd; + boolean good = false; + + static { + // System.loadLibrary("libutil"); // forkpty on Linux lives in libutil + System.loadLibrary("jtapty"); + } + + protected void finalize() throws Throwable { + super.finalize(); + if(good) { + close(); + } + } +} diff -urN jta20-20001106-2155/de/mud/jta/plugin/Shell.java jta20-p3/de/mud/jta/plugin/Shell.java --- jta20-20001106-2155/de/mud/jta/plugin/Shell.java Thu Nov 9 22:49:38 2000 +++ jta20-p3/de/mud/jta/plugin/Shell.java Fri Nov 10 00:01:12 2000 @@ -28,30 +28,24 @@ import de.mud.jta.event.ConfigurationListener; import de.mud.jta.event.OnlineStatus; -import java.io.InputStream; -import java.io.OutputStream; +// import java.io.InputStream; +// import java.io.OutputStream; import java.io.IOException; /** * The shell plugin is the backend component for terminal emulation using * a shell. It provides the i/o streams of the shell as data source. *

- * Thomas Kriegelstein wrote a hack that converted newlines to \r\n which - * was used as an example for improving this plugin. - *

* Maintainer: Matthias L. Jugel * * @version $Id: Shell.java,v 2.3 2000/05/26 06:08:16 leo Exp $ - * @author Matthias L. Jugel, Marcus Meißner + * @author Matthias L. Jugel, Marcus Meißner, Pete Zaitcev */ public class Shell extends Plugin implements FilterPlugin { - private final static int debug = 1; - protected String shellCommand; - protected InputStream in, err; - protected OutputStream out; - protected Process p; + + private HandlerPTY pty; public Shell(final PluginBus bus, final String id) { super(bus, id); @@ -59,103 +53,53 @@ bus.registerPluginListener(new ConfigurationListener() { public void setConfiguration(PluginConfig cfg) { String tmp; - if((tmp = cfg.getProperty("Shell", id, "command")) != null) + if((tmp = cfg.getProperty("Shell", id, "command")) != null) { shellCommand = tmp; + // System.out.println("Shell: Setting config " + tmp); // P3 + } else { + // System.out.println("Shell: Not setting config"); // P3 + } } }); - + bus.registerPluginListener(new SocketListener() { // we do actually ignore these parameters public void connect(String host, int port) { - if(p == null) execute(host); + // XXX Fix this together with window size changes + // String ttype = (String)bus.broadcast(new TerminalTypeRequest()); + // String ttype = getTerminalType(); + // if(ttype == null) ttype = "dumb"; + + // XXX Add try around here to catch missing DLL/.so. + pty = new HandlerPTY(); + + if(pty.start(host) == 0) { + bus.broadcast(new OnlineStatus(true)); + } else { + bus.broadcast(new OnlineStatus(false)); + } } public void disconnect() { - if(p != null) { - p.destroy(); - p = null; in = null; out = null; - } - else execute(null); + bus.broadcast(new OnlineStatus(false)); + pty = null; } }); } - private void execute(String command) { - shellCommand = (command != null) ? command : shellCommand; - if(shellCommand == null) return; - Runtime rt = Runtime.getRuntime(); - try { - p = rt.exec(shellCommand); - in = p.getInputStream(); - out = p.getOutputStream(); - err = p.getErrorStream(); - } catch(Exception e) { - Shell.this.error("error: "+e); - e.printStackTrace(); - } - bus.broadcast(new OnlineStatus(true)); - } - public void setFilterSource(FilterPlugin plugin) { // we do not have a source other than our socket } - private byte[] transpose(byte[] buf) { - byte[] nbuf; - int nbufptr = 0; - nbuf = new byte[buf.length * 2]; - for(int i = 0; i < buf.length; i++) - switch(buf[i]) { - case 10: // \n - nbuf[nbufptr++] = 13; - nbuf[nbufptr++] = 10; - break; - default: - nbuf[nbufptr++] = buf[i]; - } - byte[] xbuf = new byte[nbufptr]; - System.arraycopy(nbuf, 0, xbuf, 0, nbufptr); - return xbuf; - } - - private byte buffer[]; - private int pos; - public int read(byte[] b) throws IOException { - // empty the buffer before reading more data - if(buffer != null) { - int amount = (buffer.length - pos) <= b.length ? - buffer.length - pos : b.length; - System.arraycopy(buffer, pos, b, 0, amount); - if(pos + amount < buffer.length) { - pos += amount; - } else - buffer = null; - return amount; + if(pty == null) return 0; + int ret = pty.read(b); + if(ret <= 0) { + throw new IOException("EOF on PTY"); } - - // now we are sure the buffer is empty and read on - int n = (err.available() > 0) ? err.read(b) : in.read(b); - if(n > 0) { - byte[] tmp = new byte[n]; - System.arraycopy(b, 0, tmp, 0, n); - buffer = transpose(tmp); - if(buffer != null && buffer.length > 0) { - int amount = buffer.length <= b.length ? buffer.length : b.length; - System.arraycopy(buffer, 0, b, 0, amount); - pos = n = amount; - if(amount == buffer.length) { - buffer = null; - pos = 0; - } - } else - return 0; - } - return n; + return ret; } - public void write(byte[] b) throws IOException { - out.write(b); - out.flush(); + if(pty != null) pty.write(b); } } diff -urN jta20-20001106-2155/de/mud/terminal/vt320.java jta20-p3/de/mud/terminal/vt320.java --- jta20-20001106-2155/de/mud/terminal/vt320.java Thu Nov 9 22:49:38 2000 +++ jta20-p3/de/mud/terminal/vt320.java Thu Nov 9 23:31:13 2000 @@ -221,7 +221,7 @@ java.awt.Point pos = mouseGetPos(evt.getPoint()); byte b[] = new byte[6]; - b[0] = 27; b[1] = '['; b[2] = 'M'; + b[0] = 27; b[1] = (byte) '['; b[2] = (byte) 'M'; b[3] = (byte)mousecode; b[4] = (byte) (0x20 + pos.x + 1); b[5] = (byte) (0x20 + pos.y + 1); @@ -249,7 +249,7 @@ mousecode = '#'; byte b[] = new byte[6]; - b[0] = 27; b[1] = '['; b[2] = 'M'; + b[0] = 27; b[1] = (byte) '['; b[2] = (byte) 'M'; b[3] = (byte)mousecode; b[4] = (byte) (0x20 + pos.x + 1); b[5] = (byte) (0x20 + pos.y + 1); diff -urN jta20-20001106-2155/jni/linux/Makefile jta20-p3/jni/linux/Makefile --- jta20-20001106-2155/jni/linux/Makefile Wed Dec 31 16:00:00 1969 +++ jta20-p3/jni/linux/Makefile Thu Nov 9 23:45:43 2000 @@ -0,0 +1,51 @@ +# This file is part of "The Java Telnet Application". +# +# This 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. +# +# "The Java Telnet Application" 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 this software; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +JAVAH = /q/opt/jdk1.2.2/bin/javah +TOPDIR = ../.. +SRCDIR = ../../de +CDIR = ../src + +JNI_INCLUDE = -I/q/opt/jdk1.2.2/include -I/q/opt/jdk1.2.2/include/linux + +# Linux (glibc 2.1.3) +# libutil contains forkpty() +CC = gcc +SOCFLAGS = -fPIC -c -Wall -I. $(JNI_INCLUDE) +SOLFLAGS = -shared -lutil + +# +# major rules to create files +# +all: libjtapty.so + +HandlerPTY.h: $(SRCDIR)/mud/jta/plugin/HandlerPTY.class + $(JAVAH) -force -classpath $(TOPDIR) -o $@ de.mud.jta.plugin.HandlerPTY + +libjtapty.so: HandlerPTY.lo + $(CC) $(SOLFLAGS) -o $@ HandlerPTY.lo + +HandlerPTY.lo: $(CDIR)/HandlerPTY.c HandlerPTY.h + $(CC) $(SOCFLAGS) -o $@ $(CDIR)/HandlerPTY.c + +clean: + -find . -name \*~ -print | xargs rm -f + -rm -f HandlerPTY.h HandlerPTY.lo libjtapty.so + +realclean: clean + +# EOF diff -urN jta20-20001106-2155/jni/solaris/Makefile jta20-p3/jni/solaris/Makefile --- jta20-20001106-2155/jni/solaris/Makefile Wed Dec 31 16:00:00 1969 +++ jta20-p3/jni/solaris/Makefile Thu Nov 9 23:45:02 2000 @@ -0,0 +1,51 @@ +# This file is part of "The Java Telnet Application". +# +# This 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. +# +# "The Java Telnet Application" 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 this software; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +### This makefile is incomplete. Please adjust it to your environment. + +JAVAH = /usr/java/bin/javah +TOPDIR = ../.. +SRCDIR = ../../de +CDIR = ../src + +JNI_INCLUDE = -I/usr/java/include -I/usr/java/include/linux + +CC = /opt/SUNWspro/SC5.0/bin/cc +SOCFLAGS = -c -I. $(JNI_INCLUDE) -G +SOLFLAGS = -G + +# +# major rules to create files +# +all: libjtapty.so + +HandlerPTY.h: $(SRCDIR)/mud/jta/plugin/HandlerPTY.class + $(JAVAH) -force -classpath $(TOPDIR) -o $@ de.mud.jta.plugin.HandlerPTY + +libjtapty.so: HandlerPTY.lo + $(CC) $(SOLFLAGS) -o $@ HandlerPTY.lo + +HandlerPTY.lo: $(CDIR)/HandlerPTY.c HandlerPTY.h + $(CC) $(SOCFLAGS) -o $@ $(CDIR)/HandlerPTY.c + +clean: + -find . -name \*~ -print | xargs rm -f + -rm -f HandlerPTY.h libjtapty.so + +realclean: clean + +# EOF diff -urN jta20-20001106-2155/jni/src/HandlerPTY.c jta20-p3/jni/src/HandlerPTY.c --- jta20-20001106-2155/jni/src/HandlerPTY.c Wed Dec 31 16:00:00 1969 +++ jta20-p3/jni/src/HandlerPTY.c Thu Nov 9 22:59:58 2000 @@ -0,0 +1,243 @@ +/* + * Native methods for HandlerPTY (part of Shell). + */ +#include /* includes */ +#include /* diagnostics */ +#include /* malloc/free on Linux et. al. */ +#include +#include +#include +#include +#include /* most interesting part: openpty, forkpty */ + +static void fill_termios(struct termios *tp); +static void fill_winsize(struct winsize *wp); + +JNIEXPORT jint JNICALL +Java_de_mud_jta_plugin_HandlerPTY_start + (JNIEnv *env, jobject this, jstring jcmd) +{ + jclass cls = (*env)->GetObjectClass(env, this); + jfieldID fid_good, fid_fd; + const char *scmd; + char *ncmd; + jboolean good; + jint fd; + int fd_buf; /* different type from fd */ + struct termios tiob; + struct winsize winb; + int rc; + + scmd = (*env)->GetStringUTFChars(env, jcmd, 0); + ncmd = strdup(scmd); // We are more comfortable with free() + (*env)->ReleaseStringUTFChars(env, jcmd, scmd); + if (ncmd == NULL) { + return -1; + } + + fid_good = (*env)->GetFieldID(env, cls, "good", "Z"); + if (fid_good == 0) { + fprintf(stderr, "HandlerPTY.start: null FID for \"good\"\n"); + free(ncmd); + return -1; + } + fid_fd = (*env)->GetFieldID(env, cls, "fd", "I"); + if (fid_fd == 0) { + fprintf(stderr, "HandlerPTY.start: null FID for \"fd\"\n"); + free(ncmd); + return -1; + } + + good = (*env)->GetBooleanField(env, this, fid_good); + fd = (*env)->GetIntField(env, this, fid_fd); + + if (good) { + /* P3 remove later */ fprintf(stderr, + "HandlerPTY.start: PTY is already open\n"); + free(ncmd); + return -1; + } + + /* + * At least on my system NULL is legal as PTY name. + * We use it because we do not want to use a buffer of unknown size. + */ + fill_termios(&tiob); + fill_winsize(&winb); + + if ((rc = forkpty(&fd_buf, NULL, &tiob, &winb)) < 0) { + fprintf(stderr, "HandlerPTY.start: forkpty() failed\n"); + free(ncmd); + return -1; + } + if (rc == 0) { /* child */ + char *eargv[] = { NULL, NULL }; + char *eenvp[] = { NULL }; + eargv[0] = ncmd; + execve(ncmd, eargv, eenvp); + fprintf(stderr, "HandlerPTY.start: execve(%s) failed: %s\n", + ncmd, strerror(errno)); + exit(1); + } + fd = fd_buf; + good = JNI_TRUE; + + /* Would be nice to linger here until the child is known to be good. */ + + (*env)->SetBooleanField(env, this, fid_good, good); + (*env)->SetIntField(env, this, fid_fd, fd); + + free(ncmd); + return 0; +} + +JNIEXPORT void JNICALL +Java_de_mud_jta_plugin_HandlerPTY_close + (JNIEnv *env, jobject this) +{ + jclass cls = (*env)->GetObjectClass(env, this); + jfieldID fid_good, fid_fd; + jboolean good; + jint fd; + + if ((fid_good = (*env)->GetFieldID(env, cls, "good", "Z")) == 0) { + fprintf(stderr, "HandlerPTY.close: null FID for \"good\"\n"); + return; + } + if ((fid_fd = (*env)->GetFieldID(env, cls, "fd", "I")) == 0) { + fprintf(stderr, "HandlerPTY.close: null FID for \"fd\"\n"); + return; + } + + good = (*env)->GetBooleanField(env, this, fid_good); + fd = (*env)->GetIntField(env, this, fid_fd); + + if (good) { + close(fd); + good = JNI_FALSE; + } + + (*env)->SetBooleanField(env, this, fid_good, good); + (*env)->SetIntField(env, this, fid_fd, fd); +} + +JNIEXPORT jint JNICALL Java_de_mud_jta_plugin_HandlerPTY_read + (JNIEnv *env, jobject this, jbyteArray b) +{ + jclass cls = (*env)->GetObjectClass(env, this); + jfieldID fid_good, fid_fd; + jboolean good; + jint fd; + jsize blen; + jbyte *buf; + int rc; + + if ((fid_good = (*env)->GetFieldID(env, cls, "good", "Z")) == 0) { + fprintf(stderr, "HandlerPTY.read: null FID for \"good\"\n"); + return -1; + } + if ((fid_fd = (*env)->GetFieldID(env, cls, "fd", "I")) == 0) { + fprintf(stderr, "HandlerPTY.read: null FID for \"fd\"\n"); + return -1; + } + + good = (*env)->GetBooleanField(env, this, fid_good); + fd = (*env)->GetIntField(env, this, fid_fd); + + if (!good) { + printf("HandlerPTY.read: no good\n"); + return -1; + } + + blen = (*env)->GetArrayLength(env, b); + buf = (*env)->GetByteArrayElements(env, b, 0); + if (blen > 0) { + rc = read(fd, buf, blen); + } else { + rc = 0; + } + (*env)->ReleaseByteArrayElements(env, b, buf, 0); + + if (rc < 0) { + // Dunno if we want this printout... xterm is silent here. + fprintf(stderr, "HandlerPTY.read: %s\n", strerror(errno)); + return -1; + } + + return rc; +} + +JNIEXPORT jint JNICALL Java_de_mud_jta_plugin_HandlerPTY_write + (JNIEnv *env, jobject this, jbyteArray b) +{ + jclass cls = (*env)->GetObjectClass(env, this); + jfieldID fid_good, fid_fd; + jboolean good; + jint fd; + jsize blen; + jbyte *buf; + int rc; + + if ((fid_good = (*env)->GetFieldID(env, cls, "good", "Z")) == 0) { + fprintf(stderr, "HandlerPTY.write: null FID for \"good\"\n"); + return -1; + } + if ((fid_fd = (*env)->GetFieldID(env, cls, "fd", "I")) == 0) { + fprintf(stderr, "HandlerPTY.write: null FID for \"fd\"\n"); + return -1; + } + + good = (*env)->GetBooleanField(env, this, fid_good); + fd = (*env)->GetIntField(env, this, fid_fd); + + if (!good) { + printf("HandlerPTY.write: no good\n"); + return -1; + } + + blen = (*env)->GetArrayLength(env, b); + buf = (*env)->GetByteArrayElements(env, b, 0); + if (blen > 0) { + rc = write(fd, buf, blen); + } else { + rc = 0; + } + (*env)->ReleaseByteArrayElements(env, b, buf, 0); + + if (rc < 0) { + fprintf(stderr, "HandlerPTY.write: %s\n", strerror(errno)); + return -1; + } + + return rc; +} + +static void +fill_termios(struct termios *tp) +{ + memset(tp, 0, sizeof(struct termios)); + + tp->c_iflag = IXON | IXOFF; /* ICRNL? */ + tp->c_oflag = OPOST | ONLCR; + tp->c_cflag = CS8 | CREAD | CLOCAL | B9600; /* HUPCL? CRTSCTS? */ + tp->c_lflag = ICANON | ISIG | ECHO | ECHOE | ECHOK | ECHOKE | ECHOCTL; + tp->c_cc[VSTART] = 'Q' & 0x1F; + tp->c_cc[VSTOP] = 'S' & 0x1F; + tp->c_cc[VERASE] = 0x7F; + tp->c_cc[VKILL] = 'U' & 0x1F; + tp->c_cc[VINTR] = 'C' & 0x1F; + tp->c_cc[VQUIT] = '\\' & 0x1F; + tp->c_cc[VEOF] = 'D' & 0x1F; + tp->c_cc[VSUSP] = 'Z' & 0x1F; + tp->c_cc[VWERASE] = 'W' & 0x1F; + tp->c_cc[VREPRINT] = 'R' & 0x1F; +} + +static void +fill_winsize(struct winsize *wp) +{ + memset(wp, 0, sizeof(struct winsize)); + + wp->ws_row = 24; + wp->ws_col = 80; +} diff -urN jta20-20001106-2155/jni/win32/Makefile jta20-p3/jni/win32/Makefile --- jta20-20001106-2155/jni/win32/Makefile Wed Dec 31 16:00:00 1969 +++ jta20-p3/jni/win32/Makefile Thu Nov 9 23:43:34 2000 @@ -0,0 +1,45 @@ +# This file is part of "The Java Telnet Application". +# +# This 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. +# +# "The Java Telnet Application" 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 this software; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +#### This makefile is incomplete! Someone please finish it. + +JAVAH = /q/opt/jdk1.2.2/bin/javah +TOPDIR = ../.. +SRCDIR = ../../de +CDIR = ../src + +JNI_INCLUDE = -Ic:\java\include -Ic:\java\include\win32 + +CC = gcc +SOCFLAGS = -fPIC -c -Wall -I. $(JNI_INCLUDE) +SOLFLAGS = -shared -lutil + +all: jtapty.dll + +# +# On Win32, the following command builds a dynamic link library hello.dll using Microsoft Visual C++ 4.0: +# +# cl -Ic:\java\include -Ic:\java\include\win32 +# -LD HelloWorldImp.c -Fehello.dll +# +# On Linux libutil contains forkpty() + +clean: + +realclean: clean + +# EOF