package pypy;

/**
 * This interface allows code written in Java to invoke methods
 * generated by the PyPy translator.  An instance of this interface is
 * created in the generated main method and the static variable of the
 * PyPy class is set.  The methods do not involve state, so there are
 * no threading issues with using a global variable; however, we could
 * not use multiple PyPy interpreters simultaneously, as each would
 * require their own version of Interlink.
 */
public interface Interlink {
    public void throwZeroDivisionError();
    public void throwIndexError();
    public void throwOverflowError();
    public void throwRuntimeError();
    public void throwMemoryError();
    public void throwValueError();
    public void throwUnicodeDecodeError();
    public void throwOSError(int errCode);

    public Object recordStringString(String a, String b);
    public Object recordFloatFloat(double a, double b);
    public Object recordFloatSigned(double a, int b);
    public Object recordSignedSigned(int a, int b);
}
