home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / pccurs14.zoo / pccurses.2 / attrib.c next >
C/C++ Source or Header  |  1990-01-20  |  4KB  |  123 lines

  1. /****************************************************************/
  2. /* Character attribute routines of the PCcurses package        */
  3. /*                                */
  4. /****************************************************************/
  5. /* This version of curses is based on ncurses, a curses version    */
  6. /* originally written by Pavel Curtis at Cornell University.    */
  7. /* I have made substantial changes to make it run on IBM PC's,    */
  8. /* and therefore consider myself free make it public domain.    */
  9. /*                Bjorn Larsson (bl@infovox.se)    */
  10. /****************************************************************/
  11. /* 1.4:  Portability improvements:            900114    */
  12. /* 1.3:     MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  13. /* 1.2:     Rcsid[] string for maintenance:        881002    */
  14. /* 1.0:     Release:                    870515    */
  15. /****************************************************************/
  16.  
  17. #include <curses.h>
  18. #include <curspriv.h>
  19.  
  20. char _curses_attrib_rcsid[] = "@(#)attrib.c     v.1.4  - 900114";
  21.  
  22. /****************************************************************/
  23. /* Wattrset() sets the attributes as specified in window 'win'.    */
  24. /****************************************************************/
  25.  
  26. void wattrset(win,attrs)
  27.   WINDOW    *win;
  28.   int         attrs;
  29.   {
  30.   win->_attrs = attrs & ATR_MSK;
  31.   } /* wattrset */
  32.  
  33. /****************************************************************/
  34. /* Wattron() sets the specified attribute(s) in window 'win'.    */
  35. /****************************************************************/
  36.  
  37. void    wattron(win,attrs)
  38.   WINDOW    *win;
  39.   int         attrs;
  40.   {
  41.   win->_attrs |= (attrs & ATR_MSK);
  42.   } /* wattron */
  43.  
  44. /****************************************************************/
  45. /* Wattroff() clears the specified attribute(s) in window    */
  46. /* 'win'.                            */
  47. /****************************************************************/
  48.  
  49. void    wattroff(win,attrs)
  50.   WINDOW    *win;
  51.   int         attrs;
  52.   {
  53.   win->_attrs &= (~attrs & ATR_MSK);
  54.   } /* wattroff */
  55.  
  56. /****************************************************************/
  57. /* Wstandout() starts standout mode in window 'win'.        */
  58. /****************************************************************/
  59.  
  60. void    wstandout(win)
  61.   WINDOW    *win;
  62.   {
  63.   win->_attrs = A_STANDOUT;
  64.   } /* wstandout */
  65.  
  66. /****************************************************************/
  67. /* Wstandend() clears all special attributes in window 'win'.    */
  68. /****************************************************************/
  69.  
  70. void    wstandend(win)
  71.   WINDOW    *win;
  72.   {
  73.   win->_attrs = ATR_NRM;
  74.   } /* wstandend */
  75.  
  76. /****************************************************************/
  77. /* Attrset() sets the attributes as specified in stdscr.    */
  78. /****************************************************************/
  79.  
  80. void    attrset(attrs)
  81.   int attrs;
  82.   {
  83.   stdscr->_attrs = attrs & ATR_MSK;
  84.   } /* attrset */
  85.  
  86. /****************************************************************/
  87. /* Attron() sets the specified attribute(s) in stdscr.        */
  88. /****************************************************************/
  89.  
  90. void    attron(attrs)
  91.   int         attrs;
  92.   {
  93.   stdscr->_attrs |= (attrs & ATR_MSK);
  94.   } /* attron */
  95.  
  96. /****************************************************************/
  97. /* Attroff() clears the specified attribute(s) in stdscr.    */
  98. /****************************************************************/
  99.  
  100. void    attroff(attrs)
  101.   int         attrs;
  102.   {
  103.   stdscr->_attrs &= (~attrs & ATR_MSK);
  104.   } /* attroff */
  105.  
  106. /****************************************************************/
  107. /* Standout() starts standout mode in stdscr.            */
  108. /****************************************************************/
  109.  
  110. void    standout()
  111.   {
  112.   stdscr->_attrs = A_STANDOUT;
  113.   } /* standout */
  114.  
  115. /****************************************************************/
  116. /* Standend() clears all special attributes in stdscr.        */
  117. /****************************************************************/
  118.  
  119. void    standend()
  120.   {
  121.   stdscr->_attrs = ATR_NRM;
  122.   } /* standend */
  123.