Pristine Ack-5.5
[Ack-5.5.git] / lang / m2 / libm2 / Termcap.def
1 (*
2   (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
3   See the copyright notice in the ACK home directory, in the file "Copyright".
4 *)
5  
6 (* 
7   Module:       Interface to termcap database
8   From:         Unix manual chapter 3 
9   Version:      $Id: Termcap.def,v 1.4 1994/06/24 12:50:10 ceriel Exp $ 
10 *)
11
12 (*
13   Use this like the C-version. In this Modula-2 version, some of the buffers,
14   that are explicit in the C-version, are hidden. These buffers are initialized
15   by a call to Tgetent. The "ARRAY OF CHAR" parameters must be null-terminated.
16   You can call them with a constant string argument, as these are always
17   null-terminated in our Modula-2 implementation.
18   Unlike the C version, this version takes care of UP, BC, PC, and ospeed
19   automatically.
20   If Tgetent is not called by the user, it is called by the module itself,
21   using the TERM environment variable, or "dumb" if TERM does not exist.
22 *)
23
24 DEFINITION MODULE Termcap;
25
26   TYPE  STRCAP;
27         PUTPROC = PROCEDURE(CHAR);
28
29   PROCEDURE Tgetent(name: ARRAY OF CHAR) : INTEGER;
30
31   PROCEDURE Tgetnum(id: ARRAY OF CHAR): INTEGER;
32
33   PROCEDURE Tgetflag(id: ARRAY OF CHAR): BOOLEAN;
34
35   PROCEDURE Tgoto(cm: STRCAP; col, line: INTEGER): STRCAP;
36   (* Result exists until next call to Tgoto *)
37
38   PROCEDURE Tgetstr(id: ARRAY OF CHAR; VAR res: STRCAP) : BOOLEAN;
39   (* Returns FALSE if capability does not exist;
40      Result exists until next call to Tgetent.
41   *)
42
43   PROCEDURE Tputs(cp: STRCAP; affcnt: INTEGER; p: PUTPROC);
44
45 END Termcap.