Top Description Inners Fields Constructors Methods
org.fusesource.jansi.internal

public Class CLibrary

extends Object
Class Inheritance
Annotations
@JniClass
Static Imports
org.fusesource.hawtjni.runtime.FieldFlag.CONSTANT, .MethodFlag.CONSTANT_INITIALIZER, org.fusesource.hawtjni.runtime.ArgFlag.*

Interface to access some low level POSIX functions.
Author
Hiram Chirino

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
CLibrary.Termios

termios structure for termios functions, describing a general terminal interface that is provided to control asynchronous communications ports

public static class
CLibrary.WinSize

Window sizes.

Field Summary

Modifier and TypeField and Description
public static boolean
public static boolean
private static final Library
public static int
public static int
public static int
public static int
public static int
public static int
public static long
public static long
public static long
TIOCGWINSZ

ioctl command: Get window size.

public static long
public static long
public static long
TIOCSWINSZ

ioctl command: Set window size.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static native void
init()

public static native int
ioctl(int filedes, long request, int[] params)

Control a STREAMS device.

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

public static native int

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
isatty
(int
file descriptor
fd
)

test whether a file descriptor refers to a terminal

public static native int

Returns:

0 on success
openpty
(int[]
master return value
amaster
,
int[]
slave return value
aslave
,
byte[]
filename return value
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.

public static native int
tcgetattr(int filedes, CLibrary.Termios termios)

public static native int
tcsetattr(int filedes, int optional_actions, CLibrary.Termios termios)

public static native String
ttyname(int filedes)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

HAVE_ISATTYback to summary
public static boolean HAVE_ISATTY
Annotations
@JniField
flags:CONSTANT
accessor:1
conditional:defined(HAVE_ISATTY)
HAVE_TTYNAMEback to summary
public static boolean HAVE_TTYNAME
Annotations
@JniField
flags:CONSTANT
accessor:1
conditional:defined(HAVE_TTYNAME)
LIBRARYback to summary
private static final Library LIBRARY
STDERR_FILENOback to summary
public static int STDERR_FILENO
Annotations
@JniField
flags:CONSTANT
conditional:defined(STDERR_FILENO)
STDIN_FILENOback to summary
public static int STDIN_FILENO
Annotations
@JniField
flags:CONSTANT
conditional:defined(STDIN_FILENO)
STDOUT_FILENOback to summary
public static int STDOUT_FILENO
Annotations
@JniField
flags:CONSTANT
conditional:defined(STDOUT_FILENO)
TCSADRAINback to summary
public static int TCSADRAIN
Annotations
@JniField
flags:CONSTANT
conditional:defined(TCSADRAIN)
TCSAFLUSHback to summary
public static int TCSAFLUSH
Annotations
@JniField
flags:CONSTANT
conditional:defined(TCSAFLUSH)
TCSANOWback to summary
public static int TCSANOW
Annotations
@JniField
flags:CONSTANT
conditional:defined(TCSANOW)
TIOCGETAback to summary
public static long TIOCGETA
Annotations
@JniField
flags:CONSTANT
conditional:defined(TIOCGETA)
TIOCGETDback to summary
public static long TIOCGETD
Annotations
@JniField
flags:CONSTANT
conditional:defined(TIOCGETD)
TIOCGWINSZback to summary
public static long TIOCGWINSZ

ioctl command: Get window size.

Annotations
@JniField
flags:CONSTANT
conditional:defined(TIOCGWINSZ)
TIOCSETAback to summary
public static long TIOCSETA
Annotations
@JniField
flags:CONSTANT
conditional:defined(TIOCSETA)
TIOCSETDback to summary
public static long TIOCSETD
Annotations
@JniField
flags:CONSTANT
conditional:defined(TIOCSETD)
TIOCSWINSZback to summary
public static long TIOCSWINSZ

ioctl command: Set window size.

Annotations
@JniField
flags:CONSTANT
conditional:defined(TIOCSWINSZ)

Constructor Detail

CLibraryback to summary
public CLibrary()

Method Detail

initback to summary
private static native void init()
Annotations
@JniMethod
flags:CONSTANT_INITIALIZER
ioctlback to summary
public static native int ioctl(int filedes, long request, int[] params)

Control a STREAMS device.

Annotations
@JniMethod
conditional:defined(HAVE_IOCTL)
See Also
IOCTL(3P) man-page
ioctlback to summary
public static native int ioctl(int filedes, long request, CLibrary.WinSize params)
Annotations
@JniMethod
conditional:defined(HAVE_IOCTL)
isattyback to summary
public static native int isatty(int fd)

test whether a file descriptor refers to a terminal

Parameters
fd:int

file descriptor

Returns:int

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

Annotations
@JniMethod
conditional:FALSE
See Also
ISATTY(3) man-page, ISATTY(3P) man-page
openptyback to summary
public static native 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:int[]

master return value

aslave:int[]

slave return value

name:byte[]

filename return value

Returns:int

0 on success

Annotations
@JniMethod
conditional:defined(HAVE_OPENPTY)
See Also
OPENPTY(3) man-page
tcgetattrback to summary
public static native int tcgetattr(int filedes, CLibrary.Termios termios)
Annotations
@JniMethod
conditional:defined(HAVE_TCGETATTR)
tcsetattrback to summary
public static native int tcsetattr(int filedes, int optional_actions, CLibrary.Termios termios)
Annotations
@JniMethod
conditional:defined(HAVE_TCSETATTR)
ttynameback to summary
public static native String ttyname(int filedes)
Annotations
@JniMethod
conditional:FALSE
org.fusesource.jansi.internal back to summary

public Class CLibrary.Termios

extends Object
Class Inheritance
Annotations
@JniClass
flags:STRUCT
name:termios
conditional:defined(HAVE_IOCTL)

termios structure for termios functions, describing a general terminal interface that is provided to control asynchronous communications ports
See Also
TERMIOS(3) man-page

Field Summary

Modifier and TypeField and Description
public byte[]
public long
public long
public long
public long
public long
public long
public static int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static native void
init()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

c_ccback to summary
public byte[] c_cc
Annotations
@JniField
accessor:c_cc
c_cflagback to summary
public long c_cflag
Annotations
@JniField
accessor:c_cflag
c_iflagback to summary
public long c_iflag
Annotations
@JniField
accessor:c_iflag
c_ispeedback to summary
public long c_ispeed
Annotations
@JniField
accessor:c_ispeed
c_lflagback to summary
public long c_lflag
Annotations
@JniField
accessor:c_lflag
c_oflagback to summary
public long c_oflag
Annotations
@JniField
accessor:c_oflag
c_ospeedback to summary
public long c_ospeed
Annotations
@JniField
accessor:c_ospeed
SIZEOFback to summary
public static int SIZEOF
Annotations
@JniField
flags:CONSTANT
accessor:sizeof(struct termios)

Constructor Detail

Termiosback to summary
public Termios()

Method Detail

initback to summary
private static native void init()
Annotations
@JniMethod
flags:CONSTANT_INITIALIZER
org.fusesource.jansi.internal back to summary

public Class CLibrary.WinSize

extends Object
Class Inheritance
Annotations
@JniClass
flags:STRUCT
name:winsize
conditional:defined(HAVE_IOCTL)

Window sizes.
See Also
IOCTL_TTY(2) man-page

Field Summary

Modifier and TypeField and Description
public static int
public short
public short
public short
public short

Constructor Summary

AccessConstructor and Description
public
public
WinSize(short ws_row, short ws_col)

Method Summary

Modifier and TypeMethod and Description
private static native void
init()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

SIZEOFback to summary
public static int SIZEOF
Annotations
@JniField
flags:CONSTANT
accessor:sizeof(struct winsize)
ws_colback to summary
public short ws_col
Annotations
@JniField
accessor:ws_col
ws_rowback to summary
public short ws_row
Annotations
@JniField
accessor:ws_row
ws_xpixelback to summary
public short ws_xpixel
Annotations
@JniField
accessor:ws_xpixel
ws_ypixelback to summary
public short ws_ypixel
Annotations
@JniField
accessor:ws_ypixel

Constructor Detail

WinSizeback to summary
public WinSize()
WinSizeback to summary
public WinSize(short ws_row, short ws_col)

Method Detail

initback to summary
private static native void init()
Annotations
@JniMethod
flags:CONSTANT_INITIALIZER