home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / pccurs14.zoo / pccurses.2 / setterm.c < prev   
C/C++ Source or Header  |  1990-01-20  |  3KB  |  107 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 (bl@infovox.se)    */
  12. /****************************************************************/
  13. /* 1.4:  Use of short wherever possible. Portability        */
  14. /*     improvements:                    900114    */
  15. /* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  16. /* 1.2:     Rcsid[] string for maintenance:        881002    */
  17. /* 1.0:     Release:                    870515    */
  18. /****************************************************************/
  19.  
  20. #include <curses.h>
  21. #include <curspriv.h>
  22.  
  23. char _curses_setterm_rcsid[] = "@(#)setterm.c    v.1.4  - 900114";
  24.  
  25. /****************************************************************/
  26. /* Raw() and noraw() sets or clears raw mode.            */
  27. /****************************************************************/
  28.  
  29. void  raw()
  30.   {
  31.   _cursvar.raw = TRUE;
  32.   _cursesscb(FALSE);            /* disallow ^BREAK on disk I/O */
  33.   flushinp();
  34.   } /* raw */
  35.  
  36. void  noraw()
  37.   {
  38.   _cursvar.raw = FALSE;
  39.   _cursesscb(_cursvar.orgcbr);        /* restore original ^BREAK status */
  40.   } /* noraw */
  41.  
  42. /****************************************************************/
  43. /* Echo() and noecho() sets or clears echo mode.        */
  44. /****************************************************************/
  45.  
  46. void  echo()
  47.   {
  48.   _cursvar.echo = TRUE;
  49.   } /* echo */
  50.  
  51. void  noecho()
  52.   {
  53.   _cursvar.echo = FALSE;
  54.   } /* noecho */
  55.  
  56. /****************************************************************/
  57. /* Nl() and nonl() sets or clears autocr mapping mode.        */
  58. /****************************************************************/
  59.  
  60. void  nl()
  61.   {
  62.   _cursvar.autocr = TRUE;
  63.   } /* nl */
  64.  
  65. void  nonl()
  66.   {
  67.   _cursvar.autocr = FALSE;
  68.   } /* nonl */
  69.  
  70. /****************************************************************/
  71. /* Cbreak(), nocbreak(), crmode() amd nocrmode()  sets or    */
  72. /* clears cbreak mode.                        */
  73. /****************************************************************/
  74.  
  75. void  cbreak()
  76.   {
  77.   _cursvar.cbreak = TRUE;
  78.   } /* cbreak */
  79.  
  80. void  nocbreak()
  81.   {
  82.   _cursvar.cbreak = FALSE;
  83.   } /* nocbreak */
  84.  
  85. void  crmode()
  86.   {
  87.   _cursvar.cbreak = TRUE;
  88.   } /* crmode */
  89.  
  90. void  nocrmode()
  91.   {
  92.   _cursvar.cbreak = FALSE;
  93.   } /* nocrmode */
  94.  
  95. /****************************************************************/
  96. /* Refrbrk() sets or unsets the screen refresh break flag. If    */
  97. /* this flag is set, and there is any input available, any    */
  98. /* screen refresh will be prematurely terminated, anticipating    */
  99. /* more screen updates. This flag is FALSE by default.        */
  100. /****************************************************************/
  101.  
  102. void    refrbrk(bf)
  103.   bool    bf;
  104.   {
  105.   _cursvar.refrbrk = bf;
  106.   } /* refrbrk */
  107.