home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / dev / c / curses / src / setupterm.c < prev    next >
C/C++ Source or Header  |  1994-02-21  |  2KB  |  79 lines

  1. /* -*-C-*-
  2.  *
  3.  *
  4.  * Filename : SRC:lib/curses/src/setupterm.c
  5.  *
  6.  * Author   : Simon J Raybould.    (sie@fulcrum.co.uk).
  7.  *
  8.  * Date     : Thu Jun 24 21:20:37 1993
  9.  *
  10.  * Desc     : Initialisation for terminfo support.
  11.  *
  12.  *
  13.  * THIS CODE IS NOT PUBLIC DOMAIN
  14.  * ==============================
  15.  * 
  16.  * This code is copyright Simon J Raybould 1993, all rights are reserved.
  17.  * All code, ideas, data structures and algorithms remain the property of the
  18.  * author. Neither the whole nor sections of this code may be used as part
  19.  * of other code without the authors consent. If you wish to use some of this
  20.  * code then please email me at (sie@fulcrum.bt.co.uk).
  21.  *
  22.  * This source is not public domain, so you do not have any right to alter it
  23.  * or sell it for personal gain. The source is provided purely for reference
  24.  * purposes. You may re-compile the source with any compiler you choose.
  25.  * You must not distribute altered copies without the authors consent. My
  26.  * intention is that the source will help people isolate any bugs much more
  27.  * effectively.
  28.  *
  29.  * Disclaimer
  30.  * ==========
  31.  *
  32.  * No implication is made as to this code being fit for any purpose at all.
  33.  * I (the author) shall not be held responsible for any loss of data or damage 
  34.  * to property that may result from its use or misuse.
  35.  *
  36.  *
  37.  * Revision History
  38.  * ================
  39.  *
  40.  * $Log: setupterm.c,v $
  41.  * Revision 1.1  1994/02/21  22:18:22  sie
  42.  * Initial revision
  43.  *
  44.  *
  45.  */
  46.  
  47. #ifndef lint
  48. static char *rcsid = "$Header: /SRC/lib/curses/src/RCS/setupterm.c,v 1.1 1994/02/21 22:18:22 sie Exp $";
  49. #endif /* lint */
  50.  
  51. #include "acurses.h"
  52.  
  53.  
  54. static char __sut_bp[1024], __sut_area[1024], *aptr = __sut_area;
  55.  
  56.  
  57. void
  58. setupterm(void)
  59. {
  60.   char *lterm;                  /* The terminal type */
  61.   
  62.   if(!(lterm = getenv("TERM"))) {
  63.     fprintf(stderr, "Failed to get terminal type\n");
  64.     return;                     /* don't know term type */
  65.   }  
  66.     
  67.   tgetent(__sut_area, lterm);
  68.  
  69.   /* get clear capability string */
  70.   _clstr = aptr;
  71.   if(!tgetstr("cl", &aptr))
  72.     fprintf(stderr, "Failed to get cl string\n");
  73.  
  74.   /* get cursor motion capability string */
  75.   _cmstr = aptr;
  76.   if(!tgetstr("cm", &aptr))
  77.     fprintf(stderr, "Failed to get cm string\n");
  78. }
  79.