Contents | < Browse | Browse >
Preparing to Use the Termcap Library
====================================

   To use the termcap library in a program, you need two kinds of
preparation:

   * The compiler needs declarations of the functions and variables in
     the library.

     On GNU systems, it suffices to include the header file `termcap.h'
     in each source file that uses these functions and variables.

     On Unix systems, there is often no such header file.  Then you must
     explictly declare the variables as external.  You can do likewise
     for the functions, or let them be implicitly declared and cast
     their values from type `int' to the appropriate type.

     We illustrate the declarations of the individual termcap library
     functions with ANSI C prototypes because they show how to pass the
     arguments.  If you are not using the GNU C compiler, you probably
     cannot use function prototypes, so omit the argument types and
     names from your declarations.

   * The linker needs to search the library.  Usually either
     `-ltermcap' or `-ltermlib' as an argument when linking will do
     this.