Package org.fusesource.jansi.internal
Class CLibrary
- java.lang.Object
-
- org.fusesource.jansi.internal.CLibrary
-
@JniClass public class CLibrary extends java.lang.Object
Interface to access some low level POSIX functions.
-
-
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 portsstatic class
CLibrary.WinSize
Window sizes.
-
Field Summary
Fields Modifier and Type Field Description static boolean
HAVE_ISATTY
static boolean
HAVE_TTYNAME
private static org.fusesource.hawtjni.runtime.Library
LIBRARY
static int
STDERR_FILENO
static int
STDIN_FILENO
static int
STDOUT_FILENO
static int
TCSADRAIN
static int
TCSAFLUSH
static int
TCSANOW
static long
TIOCGETA
static long
TIOCGETD
static long
TIOCGWINSZ
ioctl command: Get window size.static long
TIOCSETA
static long
TIOCSETD
static long
TIOCSWINSZ
ioctl command: Set window size.
-
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 terminalstatic 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)
-
-
-
Field Detail
-
LIBRARY
private static final org.fusesource.hawtjni.runtime.Library LIBRARY
-
STDIN_FILENO
@JniField(flags=CONSTANT, conditional="defined(STDIN_FILENO)") public static int STDIN_FILENO
-
STDOUT_FILENO
@JniField(flags=CONSTANT, conditional="defined(STDOUT_FILENO)") public static int STDOUT_FILENO
-
STDERR_FILENO
@JniField(flags=CONSTANT, conditional="defined(STDERR_FILENO)") public static int STDERR_FILENO
-
HAVE_ISATTY
@JniField(flags=CONSTANT, accessor="1", conditional="defined(HAVE_ISATTY)") public static boolean HAVE_ISATTY
-
HAVE_TTYNAME
@JniField(flags=CONSTANT, accessor="1", conditional="defined(HAVE_TTYNAME)") public static boolean HAVE_TTYNAME
-
TCSANOW
@JniField(flags=CONSTANT, conditional="defined(TCSANOW)") public static int TCSANOW
-
TCSADRAIN
@JniField(flags=CONSTANT, conditional="defined(TCSADRAIN)") public static int TCSADRAIN
-
TCSAFLUSH
@JniField(flags=CONSTANT, conditional="defined(TCSAFLUSH)") public static int TCSAFLUSH
-
TIOCGETA
@JniField(flags=CONSTANT, conditional="defined(TIOCGETA)") public static long TIOCGETA
-
TIOCSETA
@JniField(flags=CONSTANT, conditional="defined(TIOCSETA)") public static long TIOCSETA
-
TIOCGETD
@JniField(flags=CONSTANT, conditional="defined(TIOCGETD)") public static long TIOCGETD
-
TIOCSETD
@JniField(flags=CONSTANT, conditional="defined(TIOCSETD)") public static long TIOCSETD
-
TIOCGWINSZ
@JniField(flags=CONSTANT, conditional="defined(TIOCGWINSZ)") public static long TIOCGWINSZ
ioctl command: Get window size.
-
TIOCSWINSZ
@JniField(flags=CONSTANT, conditional="defined(TIOCSWINSZ)") public static long TIOCSWINSZ
ioctl command: Set window size.
-
-
Method Detail
-
init
@JniMethod(flags=CONSTANT_INITIALIZER) private static void init()
-
isatty
@JniMethod(conditional="FALSE") public static int isatty(@JniArg 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
@JniMethod(conditional="FALSE") public static java.lang.String ttyname(@JniArg int filedes)
-
openpty
@JniMethod(conditional="defined(HAVE_OPENPTY)") public static int openpty(@JniArg(cast="int *",flags=NO_IN) int[] amaster, @JniArg(cast="int *",flags=NO_IN) int[] aslave, @JniArg(cast="char *",flags=NO_IN) byte[] name, @JniArg(cast="struct termios *",flags=NO_OUT) CLibrary.Termios termios, @JniArg(cast="struct winsize *",flags=NO_OUT) 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 valueaslave
- slave return valuename
- filename return valuetermios
-winsize
-- Returns:
- 0 on success
- See Also:
- OPENPTY(3) man-page
-
tcgetattr
@JniMethod(conditional="defined(HAVE_TCGETATTR)") public static int tcgetattr(@JniArg int filedes, @JniArg(cast="struct termios *",flags=NO_IN) CLibrary.Termios termios)
-
tcsetattr
@JniMethod(conditional="defined(HAVE_TCSETATTR)") public static int tcsetattr(@JniArg int filedes, @JniArg int optional_actions, @JniArg(cast="struct termios *",flags=NO_OUT) CLibrary.Termios termios)
-
ioctl
@JniMethod(conditional="defined(HAVE_IOCTL)") public static int ioctl(@JniArg int filedes, @JniArg long request, @JniArg int[] params)
Control a STREAMS device.- Parameters:
filedes
-request
-params
-- Returns:
- See Also:
- IOCTL(3P) man-page
-
ioctl
@JniMethod(conditional="defined(HAVE_IOCTL)") public static int ioctl(@JniArg int filedes, @JniArg long request, @JniArg(flags=POINTER_ARG) CLibrary.WinSize params)
-
-