Class CLibrary


  • public class CLibrary
    extends java.lang.Object
    Interface to access some low level POSIX functions, loaded by HawtJNI Runtime as jansi library.
    See Also:
    JansiLoader
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  CLibrary.Termios
      termios structure for termios functions, describing a general terminal interface that is provided to control asynchronous communications ports
      static class  CLibrary.WinSize
      Window sizes.
    • Constructor Summary

      Constructors 
      Constructor Description
      CLibrary()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static void init()  
      static int ioctl​(int filedes, long request, int[] params)
      Control a STREAMS device.
      static int ioctl​(int filedes, long request, CLibrary.WinSize params)  
      static int isatty​(int fd)
      test whether a file descriptor refers to a terminal
      static int openpty​(int[] amaster, int[] aslave, byte[] name, CLibrary.Termios termios, CLibrary.WinSize winsize)
      The openpty() function finds an available pseudoterminal and returns file descriptors for the master and slave in amaster and aslave.
      static int tcgetattr​(int filedes, CLibrary.Termios termios)  
      static int tcsetattr​(int filedes, int optional_actions, CLibrary.Termios termios)  
      static java.lang.String ttyname​(int filedes)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • STDOUT_FILENO

        public static int STDOUT_FILENO
      • STDERR_FILENO

        public static int STDERR_FILENO
      • HAVE_ISATTY

        public static boolean HAVE_ISATTY
      • HAVE_TTYNAME

        public static boolean HAVE_TTYNAME
      • TCSANOW

        public static int TCSANOW
      • TCSADRAIN

        public static int TCSADRAIN
      • TCSAFLUSH

        public static int TCSAFLUSH
      • TIOCGETA

        public static long TIOCGETA
      • TIOCSETA

        public static long TIOCSETA
      • TIOCGETD

        public static long TIOCGETD
      • TIOCSETD

        public static long TIOCSETD
      • TIOCGWINSZ

        public static long TIOCGWINSZ
      • TIOCSWINSZ

        public static long TIOCSWINSZ
    • Constructor Detail

      • CLibrary

        public CLibrary()
    • Method Detail

      • init

        private static void init()
      • isatty

        public static int isatty​(int fd)
        test whether a file descriptor refers to a terminal
        Parameters:
        fd - file descriptor
        Returns:
        isatty() returns 1 if fd is an open file descriptor referring to a terminal; otherwise 0 is returned, and errno is set to indicate the error
        See Also:
        ISATTY(3) man-page, ISATTY(3P) man-page
      • ttyname

        public static java.lang.String ttyname​(int filedes)
      • openpty

        public static int openpty​(int[] amaster,
                                  int[] aslave,
                                  byte[] name,
                                  CLibrary.Termios termios,
                                  CLibrary.WinSize winsize)
        The openpty() function finds an available pseudoterminal and returns file descriptors for the master and slave in amaster and aslave.
        Parameters:
        amaster - master return value
        aslave - slave return value
        name - filename return value
        termios - optional pty attributes
        winsize - optional size
        Returns:
        0 on success
        See Also:
        OPENPTY(3) man-page
      • tcgetattr

        public static int tcgetattr​(int filedes,
                                    CLibrary.Termios termios)
      • tcsetattr

        public static int tcsetattr​(int filedes,
                                    int optional_actions,
                                    CLibrary.Termios termios)
      • ioctl

        public static int ioctl​(int filedes,
                                long request,
                                int[] params)
        Control a STREAMS device.
        See Also:
        IOCTL(3P) man-page
      • ioctl

        public static int ioctl​(int filedes,
                                long request,
                                CLibrary.WinSize params)