Class CLibrary

java.lang.Object
org.jline.nativ.CLibrary

public class CLibrary extends Object
Interface to access some low level POSIX functions,.
See Also:
  • Field Details

    • TCSANOW

      public static int TCSANOW
    • TCSADRAIN

      public static int TCSADRAIN
    • TCSAFLUSH

      public static int TCSAFLUSH
    • TIOCGWINSZ

      public static long TIOCGWINSZ
    • TIOCSWINSZ

      public static long TIOCSWINSZ
  • Constructor Details

    • CLibrary

      public CLibrary()
  • Method Details

    • 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:
    • ttyname

      public static 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:
    • 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

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

      public static short getTerminalWidth(int fd)