ack/lang/m2/libm2/Termcap.def

46 lines
1.4 KiB
Modula-2
Raw Permalink 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
1994-06-24 14:02:31 +00:00
Version: $Id$
1988-11-23 10:59:09 +00:00
*)
(*
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.
1988-11-25 13:49:07 +00:00
Unlike the C version, this version takes care of UP, BC, PC, and ospeed
automatically.
If Tgetent is not called by the user, it is called by the module itself,
using the TERM environment variable, or "dumb" if TERM does not exist.
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);
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-25 13:49:07 +00:00
PROCEDURE Tgetstr(id: ARRAY OF CHAR; VAR res: STRCAP) : BOOLEAN;
(* Returns FALSE if capability does not exist;
Result exists until next call to Tgetent.
*)
1988-11-23 10:59:09 +00:00
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.