// 
// Decompiled by Procyon v0.6.0
// 

package org.fusesource.jansi.internal;

public class CLibrary
{
    public static final boolean LOADED;
    public static int STDOUT_FILENO;
    public static int STDERR_FILENO;
    public static boolean HAVE_ISATTY;
    public static boolean HAVE_TTYNAME;
    public static int TCSANOW;
    public static int TCSADRAIN;
    public static int TCSAFLUSH;
    public static long TIOCGETA;
    public static long TIOCSETA;
    public static long TIOCGETD;
    public static long TIOCSETD;
    public static long TIOCGWINSZ;
    public static long TIOCSWINSZ;
    
    private static native void init();
    
    public static native int isatty(final int p0);
    
    public static native String ttyname(final int p0);
    
    public static native int openpty(final int[] p0, final int[] p1, final byte[] p2, final Termios p3, final WinSize p4);
    
    public static native int tcgetattr(final int p0, final Termios p1);
    
    public static native int tcsetattr(final int p0, final int p1, final Termios p2);
    
    public static native int ioctl(final int p0, final long p1, final int[] p2);
    
    public static native int ioctl(final int p0, final long p1, final WinSize p2);
    
    static {
        LOADED = JansiLoader.initialize();
        if (CLibrary.LOADED) {
            init();
        }
        CLibrary.STDOUT_FILENO = 1;
        CLibrary.STDERR_FILENO = 2;
    }
    
    public static class WinSize
    {
        public static int SIZEOF;
        public short ws_row;
        public short ws_col;
        public short ws_xpixel;
        public short ws_ypixel;
        
        private static native void init();
        
        public WinSize() {
        }
        
        public WinSize(final short ws_row, final short ws_col) {
            this.ws_row = ws_row;
            this.ws_col = ws_col;
        }
        
        static {
            JansiLoader.initialize();
            init();
        }
    }
    
    public static class Termios
    {
        public static int SIZEOF;
        public long c_iflag;
        public long c_oflag;
        public long c_cflag;
        public long c_lflag;
        public byte[] c_cc;
        public long c_ispeed;
        public long c_ospeed;
        
        public Termios() {
            this.c_cc = new byte[32];
        }
        
        private static native void init();
        
        static {
            JansiLoader.initialize();
            init();
        }
    }
}
