The Extended Terminal Interface (ETI)

The ETI libraries

ETI consists of

The routines are C functions and macros; many of them resemble routines in the standard C library. For example, there is a routine printw that behaves much like printf (see fprintf(3S)) and another routine getch that behaves like getc(3S). The automatic teller program at your bank might use printw to print its menus and getch to accept your requests for withdrawals (or, better yet, deposits). A visual screen editor like the UNIX system screen editor vi(1) might also use these and other ETI routines.

A major feature of ETI is cursor optimization. Cursor optimization minimizes the amount a cursor has to move around a screen to update it. For example, if you designed a screen editor program with ETI routines and edited the sentence

   ETI is a great package for creating forms and menus.
to read
   ETI is the best package for creating forms and menus.
the program would change only ``the best'' in place of ``a great''. The other characters would be preserved. Because the amount of data transmitted--the output--is minimized, cursor optimization is also referred to as output optimization.

Cursor optimization takes care of updating the screen in a manner appropriate for the terminal on which an ETI program is run. This means that ETI can do whatever is required to update many different terminal types. It searches the terminfo database (described below) to find the correct description for a terminal.

How does cursor optimization help you and those who use your programs? First, it saves you time in describing in a program how you want to update screens. Second, it saves a user's time when the screen is updated. Third, it reduces the load on your UNIX system's communication lines when the updating takes place. Fourth, you do not have to worry about the myriad of terminals on which your program might be run.

Here is a simple ETI program. It uses some of the basic ETI routines to move a cursor to the middle of a terminal screen and print the character string BullsEye. Each of these routines is described in ``Basic ETI programming''. For now, just look at their names and you will get an idea of what each of them does:

   #include <ocurses.h>

main() { initscr();

move( LINES/2 - 1, COLS/2 - 4 ); addstr("Bulls"); refresh(); addstr("Eye"); refresh(); endwin(); }

A simple ETI program

Next topic: The ETI/terminfo connection
Previous topic: What Is ETI?

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004