*** empty log message ***

This commit is contained in:
2006-11-21 15:06:51 +00:00
parent 7f022d4ec2
commit 81fcbf1c69
10 changed files with 516 additions and 226 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.java,v 1.3 2006-10-24 06:05:01 bacon Exp $
* $Id: Awk.java,v 1.4 2006-11-21 15:06:14 bacon Exp $
*/
package ase.awk;
@ -29,23 +29,68 @@ public abstract class Awk
public native void run () throws Exception;
private native void open () throws Exception;
/*
protected native void set_extio (long extio, Object obj);
protected native Object get_extio (long extio);
*/
/* abstrace methods */
protected abstract int open_source (int mode);
protected abstract int close_source (int mode);
protected abstract int read_source (char[] buf, int len);
protected abstract int write_source (char[] buf, int len);
protected abstract int open_console ();
protected abstract int close_console ();
protected abstract int read_console (char[] buf, int len);
protected abstract int write_console (char[] buf, int len);
protected abstract int next_console (char[] buf, int len);
protected int open_extio (Extio extio)
{
int type = extio.getType ();
if (type == Extio.TYPE_CONSOLE) return open_console (extio);
if (type == Extio.TYPE_FILE) return open_file (extio);
/*if (type == Extio.TYPE_PIPE) return open_pipe (extio);
if (type == Extio.TYPE_COPROC) return open_coproc (extio);*/
return -1;
}
protected int close_extio (Extio extio)
{
int type = extio.getType ();
if (type == Extio.TYPE_CONSOLE) return close_console (extio);
if (type == Extio.TYPE_FILE) return close_file (extio);
/*if (type == Extio.TYPE_PIPE) return close_pipe (extio);
if (type == Extio.TYPE_COPROC) return close_coproc (extio);*/
return -1;
}
protected int read_extio (Extio extio, char[] buf, int len)
{
int type = extio.getType ();
if (type == Extio.TYPE_CONSOLE)
return read_console (extio, buf, len);
if (type == Extio.TYPE_FILE)
return read_file (extio, buf, len);
/*if (type == Extio.TYPE_PIPE)
* return read_pipe (extio, buf, len);
if (type == Extio.TYPE_COPROC)
return read_coproc (extio, buf, len);*/
return -1;
}
protected int write_extio (Extio extio, char[] buf, int len)
{
int type = extio.getType ();
if (type == Extio.TYPE_CONSOLE)
return write_console (extio, buf, len);
if (type == Extio.TYPE_FILE)
return write_file (extio, buf, len);
/*if (type == Extio.TYPE_PIPE)
* return write_pipe (extio, buf, len);
if (type == Extio.TYPE_COPROC)
return write_coproc (extio, buf, len);*/
return -1;
}
protected abstract int open_console (Extio extio);
protected abstract int close_console (Extio extio);
protected abstract int read_console (Extio extio, char[] buf, int len);
protected abstract int write_console (Extio extio, char[] buf, int len);
protected abstract int next_console (Extio extio, char[] buf, int len);
protected abstract int open_file (Extio extio);
protected abstract int close_file (String name);
protected abstract int close_file (Extio name);
protected abstract int read_file (Extio extio, char[] buf, int len);
protected abstract int write_file (Extio extio, char[] buf, int len);
}