2006-10-24 04:57:29 +00:00
|
|
|
/*
|
2006-10-24 06:06:16 +00:00
|
|
|
* $Id: Awk.java,v 1.3 2006-10-24 06:05:01 bacon Exp $
|
2006-10-24 04:57:29 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
package ase.awk;
|
|
|
|
|
|
|
|
import java.io.*;
|
|
|
|
|
|
|
|
public abstract class Awk
|
|
|
|
{
|
|
|
|
// mode for open_source & close_source
|
|
|
|
public static final int SOURCE_READ = 1;
|
|
|
|
public static final int SOURCE_WRITE = 2;
|
|
|
|
|
|
|
|
static
|
|
|
|
{
|
|
|
|
System.load ("c://projects//ase/awk/aseawk.dll");
|
|
|
|
}
|
|
|
|
|
|
|
|
private long __awk;
|
|
|
|
|
2006-10-24 06:06:16 +00:00
|
|
|
public Awk () throws Exception
|
2006-10-24 04:57:29 +00:00
|
|
|
{
|
|
|
|
open ();
|
|
|
|
}
|
|
|
|
|
|
|
|
public native void close ();
|
2006-10-24 06:06:16 +00:00
|
|
|
public native void parse () throws Exception;
|
|
|
|
public native void run () throws Exception;
|
|
|
|
private native void open () throws Exception;
|
2006-10-24 04:57:29 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
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 abstract int open_file (Extio extio);
|
|
|
|
protected abstract int close_file (String name);
|
|
|
|
}
|