Next: , Previous: , Up: The termios and miscellaneous library   [Contents][Index]


5.7.3 Termios port interface

The termios functions can be used to modify the behavior of Guile ports. However, not all Guile ports have a terminal line interface.

For a port to have a terminal line interface, it must have an underlying file descriptor upon which termios procedure may operate. To test if a port has a file descriptor the Guile fileno procedure may be used.

Procedure: tcgetattr fd-or-port

Given file port or an integer file descriptor, this procedure returns a #<termios> type containing the terminal line properties of the port or file descriptor.

Procedure: tcsetattr! fd-or-port option termios

Given file port or an integer file descriptor, this procedure sets terminal line properties of the port or file descriptor to those in termios.

If option is TCSANOW, the change shall occur immediately.

If it is TCSADRAIN, the change shall occur after all output written to the the port is transmitted. This function should be used when changing parameters that affect output.

If it is TCSAFLUSH, the change shall occur after all output written to the port is transmitted, and all input so far received but not read shall be discarded before the change is made.

Procedure: tcdrain fd-or-port

The tcdrain procedure blocks until all output written to fd-or-port is transmitted.

Procedure: tcflow fd-or-port action

This procedure suspends transmission or reception of data on the given integer file descriptor or file port depending on the value of action. If action is TCOOFF, output is suspended. If action is TCOON, suspended output is restarted. If it is TCIOFF, it transmits a STOP character, which stops the terminal device from transmitting data to the system. If it is TCION, it transmits a START character, which starts the terminal device transmitting data to the system.

Procedure: tcflush fd-or-port action

This procedure discards data written to the given fd-or-port but not transmitted, or data received but not read, depending on the value of queue_selector: If action is TCIFLUSH, it shall flush data received but not read. If action is TCOFLUSH, it shall flush data written but not transmitted. If action is TCIOFLUSH, it shall flush both data received but not read and data written but not transmitted.


Next: , Previous: , Up: The termios and miscellaneous library   [Contents][Index]