Next: , Previous: , Up: The basic curses library   [Contents][Index]


5.2.32 Print data to a terminal-attached ports

Some old-school hardware terminals had serial or parallel ports attached to them. There is a procedure to send data to those ports. Usually those ports were used for old serial dot-matrix printers. This function is likely obsolete.

Procedure: mcprint str

This procedure takes the given str, converts it into a byte stream using the current locale, and then sends the data to a terminal’s printer port. A terminal that has a printer port must terminfo information that describes it, such as mc5p or mc4 capabilities. Explaining this is beyond the scope of this library.

Those hardware terminal ports and the printers that used them were slow, and the application must take the responsibility to not flood the port.

The procedure returns #f if the write fails. Otherwise, it returns the number of bytes actually printed.