home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / cprog / cursesp.zip / SETTERM.C < prev    next >
C/C++ Source or Header  |  1991-12-02  |  3KB  |  105 lines

  1. /****************************************************************/
  2. /* Raw(), noraw(), echo(), noecho(), nl(), nonl(),  cbreak(),   */
  3. /* nocbreak(), crmode(), nocrmode() and refrbrk() routines of   */
  4. /* the PCcurses package.                                        */
  5. /*                                                              */
  6. /****************************************************************/
  7. /* This version of curses is based on ncurses, a curses version */
  8. /* originally written by Pavel Curtis at Cornell University.    */
  9. /* I have made substantial changes to make it run on IBM PC's,  */
  10. /* and therefore consider myself free to make it public domain. */
  11. /*              Bjorn Larsson (...mcvax!enea!infovax!bl)        */
  12. /****************************************************************/
  13. /* 1.0: Release:                                        870515  */
  14. /* 1.2: Rcsid[] string for maintenance:                 881002  */
  15. /* 1.3: MSC -W3, Turbo'C' -w -w-pro checkes:            881005  */
  16. /****************************************************************/
  17.  
  18. #include <curses.h>
  19. #include <curspriv.h>
  20.  
  21. char _curses_setterm_rcsid[] = "@(#)setterm.c v1.3 - 881005";
  22.  
  23. /****************************************************************/
  24. /* Raw() and noraw() sets or clears raw mode.                   */
  25. /****************************************************************/
  26.  
  27. void  raw()
  28.   {
  29.   _cursvar.raw = TRUE;
  30.   _cursesscb(FALSE);                    /* disallow ^BREAK on disk I/O */
  31.   flushinp();
  32.   } /* raw */
  33.  
  34. void  noraw()
  35.   {
  36.   _cursvar.raw = FALSE;
  37.   _cursesscb(_cursvar.orgcbr);          /* restore original ^BREAK status */
  38.   } /* noraw */
  39.  
  40. /****************************************************************/
  41. /* Echo() and noecho() sets or clears echo mode.                */
  42. /****************************************************************/
  43.  
  44. void  echo()
  45.   {
  46.   _cursvar.echo = TRUE;
  47.   } /* echo */
  48.  
  49. void  noecho()
  50.   {
  51.   _cursvar.echo = FALSE;
  52.   } /* noecho */
  53.  
  54. /****************************************************************/
  55. /* Nl() and nonl() sets or clears autocr mapping mode.          */
  56. /****************************************************************/
  57.  
  58. void  nl()
  59.   {
  60.   _cursvar.autocr = TRUE;
  61.   } /* nl */
  62.  
  63. void  nonl()
  64.   {
  65.   _cursvar.autocr = FALSE;
  66.   } /* nonl */
  67.  
  68. /****************************************************************/
  69. /* Cbreak(), nocbreak(), crmode() amd nocrmode()  sets or       */
  70. /* clears cbreak mode.                                          */
  71. /****************************************************************/
  72.  
  73. void  cbreak()
  74.   {
  75.   _cursvar.cbreak = TRUE;
  76.   } /* cbreak */
  77.  
  78. void  nocbreak()
  79.   {
  80.   _cursvar.cbreak = FALSE;
  81.   } /* nocbreak */
  82.  
  83. void  crmode()
  84.   {
  85.   _cursvar.cbreak = TRUE;
  86.   } /* crmode */
  87.  
  88. void  nocrmode()
  89.   {
  90.   _cursvar.cbreak = FALSE;
  91.   } /* nocrmode */
  92.  
  93. /****************************************************************/
  94. /* Refrbrk() sets or unsets the screen refresh break flag. If   */
  95. /* this flag is set, and there is any input available, any      */
  96. /* screen refresh will be prematurely terminated, anticipating  */
  97. /* more screen updates. This flag is FALSE by default.          */
  98. /****************************************************************/
  99.  
  100. void    refrbrk(bf)
  101.   bool  bf;
  102.   {
  103.   _cursvar.refrbrk = bf;
  104.   } /* refrbrk */
  105.