ack/lang/m2/libm2/Termcap.def

45 lines
1.3 KiB
Modula-2
Raw Normal View History

1988-11-23 10:59:09 +00:00
(*
(c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
See the copyright notice in the ACK home directory, in the file "Copyright".
*)
(*
Module: Interface to termcap database
From: Unix manual chapter 3
Version: $Header$
*)
(*
Use this like the C-version. In this Modula-2 version, some of the buffers,
that are explicit in the C-version, are hidden. These buffers are initialized
by a call to Tgetent. The "ARRAY OF CHAR" parameters must be null-terminated.
You can call them with a constant string argument, as these are always
1988-11-24 11:46:31 +00:00
null-terminated in our Modula-2 implementation.
Unlike the C version, this version takes care of UP, BC, and PC
automatically. Only ospeed must still be set by the user.
1988-11-23 10:59:09 +00:00
*)
DEFINITION MODULE Termcap;
1988-11-24 11:46:31 +00:00
TYPE STRCAP;
1988-11-23 10:59:09 +00:00
PUTPROC = PROCEDURE(CHAR);
1988-11-24 11:46:31 +00:00
VAR
1988-11-23 10:59:09 +00:00
ospeed: INTEGER; (* see termcap(3), tty(4) *)
PROCEDURE Tgetent(name: ARRAY OF CHAR) : INTEGER;
PROCEDURE Tgetnum(id: ARRAY OF CHAR): INTEGER;
PROCEDURE Tgetflag(id: ARRAY OF CHAR): BOOLEAN;
1988-11-24 11:46:31 +00:00
PROCEDURE Tgoto(cm: STRCAP; col, line: INTEGER): STRCAP;
1988-11-23 10:59:09 +00:00
(* Result exists until next call to Tgoto *)
1988-11-24 11:46:31 +00:00
PROCEDURE Tgetstr(id: ARRAY OF CHAR): STRCAP;
1988-11-23 10:59:09 +00:00
(* Result exists until next call to Tgetent *)
1988-11-24 11:46:31 +00:00
PROCEDURE Tputs(cp: STRCAP; affcnt: INTEGER; p: PUTPROC);
1988-11-23 10:59:09 +00:00
END Termcap.