(*
    Title:      UnixTermcap - Definitions
    LastEdit:	"Tue Sep 11 11:39:35 1984"
    Author: 	jd
		Cambridge University Computer Laboratory
*)

DEFINITION MODULE UnixTermcap;
(* This module is an interface to the UnixTermcap entry for the current
   terminal. It does not allow general enquiries about any terminal
   in the terminal database, but will tell you everything in the
   entry for the terminal on which you are running.
*)


EXPORT QUALIFIED
    TermCap, CursorUp, CursorDown, CursorLeft, CursorRight;

PROCEDURE TermCap (key: ARRAY OF CHAR; VAR value: ARRAY OF CHAR): CARDINAL;
    (* Returns the value for the key. The current environment variable TERMCAP
       is searched, and if the key is found, its value is copied to value,
       terminated by a null; the length of the value string is returned as
       the result of the procedure call. The string returned to you will have
       had all the UnixTermcap escape conventions removed from it, so that it may
       contain some non-printing characters
    *)

(* These procedures call TermCap on the appropriate keyword, and then
   translate the UnixTermcap control and escape notation into the 
   corresponding characters.
*)

PROCEDURE CursorUp    (VAR value: ARRAY OF CHAR): CARDINAL;
PROCEDURE CursorDown  (VAR value: ARRAY OF CHAR): CARDINAL;
PROCEDURE CursorLeft  (VAR value: ARRAY OF CHAR): CARDINAL;
PROCEDURE CursorRight (VAR value: ARRAY OF CHAR): CARDINAL;

END UnixTermcap.
