HPlogo MPE/iX Developer's Kit Reference Manual Volume 2: HP 3000 MPE/iX Computer Systems > Chapter 4 CURSES

setupterm setterm

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

The setupterm and setterm routines are used to define a set of terminal-dependent variables (terminfo interface).

Syntax

   #include <curses.h>



   int setupterm (char *term, int fildes, int *errret);

   int setterm (char *term);

Parameters

term

The terminal type for which variables are set.

fildes

A file descriptor initialized for output.

errret

A pointer to an integer in which the status value is stored.

Return Values

OK

Successful completion.

ERR

An error occurred.

Description

Within CURSES, setupterm() is automatically called by initscr() and newterm(). This routine can be also be used outside of CURSES when the program has to deal directly with the TERMINFO database to handle certain terminal capabilities. The use of appropriate CURSES routines is recommended in all other situations.

The setupterm() routine defines terminal-dependent variables for the terminfo layer of CURSES. The setupterm() routine initializes the terminfo variables lines and columns such that if use_env(FALSE) has been called, the TERMINFO values are used regardless of the environmental variables LINES and COLUMNS or the program's window dimensions. When use_env(TRUE) has been called, which is the default, the environment variables LINES and COLUMNS are used, if they exist. If the environment variables do not exist and the program is running in a window, the current window size is used.

The term parameter of setupterm() specifies the terminal; if null, terminal type is taken from the TERM environment variable. All output is sent to fildes which is initialized for output. If errret is not null, OK or ERR is returned and a status value is stored in the integer pointed to by errret. The status values that may be returned are shown in Table 4-7 “Status Values”.

Table 4-7 Status Values

ValueDescription
1Normal
0Terminal could not be found
-1TERMINFO database could not be found

 

If erret is null, an error message is printed, and setupterm() exits. The setterm() routine is an older version of setupterm(). It is included for compatibility with previous versions of CURSES. New programs should use setupterm().

Implementation Considerations

HP-UX and UNIX System V implementations.

See Also

use_env()

Portability

HP-UX, UNIX System V

Feedback to webmaster