home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 419b.lha / TERMLIB / termcap.c < prev    next >
C/C++ Source or Header  |  1990-10-05  |  535b  |  27 lines

  1. /* termcap... print current terminal capabilities.
  2.  *
  3.  * Termcap prints all the termcap capability strings for the terminal `term'.
  4.  * The output is in machine readable form, suitable for use in the construct:
  5.  *
  6.  *    TERMCAP="`termcap`"; export TERMCAP
  7.  *
  8.  * Syntax: termcap [term]
  9.  */
  10. #include <stdio.h>
  11.  
  12. char *tent;
  13. main(ac, av)
  14. int ac;
  15. char **av;
  16. {
  17.     char tbuf[1024];
  18.     if(ac==1) if(tgetent(tbuf, getenv("TERM"))) {
  19.         puts(tbuf);
  20.         exit(0);
  21.     } else exit(-1);
  22.     if(tgetent(tbuf, av[1])) {
  23.         puts(tbuf);
  24.         exit(0);
  25.     } else exit(-1);
  26. }
  27.