|
|
The header files menu.h, form.h, and panel.h define several global variables and data structures and defines several ETI routines as macros.
To begin, let us consider the variables and data structures defined. ocurses.h, among other things, defines the integer variables LINES and COLS; when an ETI program is run on a particular terminal, these variables are assigned the vertical and horizontal dimensions of the terminal screen, respectively, by the routine initscr described below.
For more information about these variables, see ``The routines initscr, refresh, endwin'' and ``More about initscr and lines and columns''.
The integer variables COLORS and COLOR_PAIRS are also defined in ocurses.h. These will be assigned, respectively, the maximum number of colors and color-pairs the terminal can support. These variables are initialized by the start_color routine. (See ``Color manipulation''.)
The header files define the integer constants COK, E_OK, ERR (E_OK is in eti.h), and others listed in the following topics. ETI routines that return int values return these constants under the following conditions:
Now let us consider the macro definitions. ocurses.h defines many ETI routines as macros that call other macros or ETI routines. For instance, the simple routine refresh is a macro. The line
#define refresh() wrefresh(stdscr)shows that when refresh is called, it is expanded to call the ETI routine wrefresh. In turn, wrefresh (although it is not a macro) calls the two ETI routines wnoutrefresh and doupdate. Many other routines also group two or three routines together to achieve a particular result.
One final point about ocurses.h: it automatically includes stdio.h and the termio.h tty driver interface file. Including either file again in a program is harmless but wasteful.