home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / CURS13_2.ZIP / ATTRIB.C next >
Text File  |  1989-12-08  |  4KB  |  122 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 (...mcvax!enea!infovax!bl)    */
  10. /****************************************************************/
  11. /* 1.0:    Release:                    870515    */
  12. /* 1.2:    Rcsid[] string for maintenance:            881002    */
  13. /* 1.3:    MSC -W3, Turbo'C' -w -w-pro checkes:        881005    */
  14. /****************************************************************/
  15.  
  16. #include <curses.h>
  17. #include <curspriv.h>
  18.  
  19. char _curses_attrib_rcsid[] = "@(#)attrib.c v1.3 - 881005";
  20.  
  21. /****************************************************************/
  22. /* Wattrset() sets the attributes as specified in window 'win'.    */
  23. /****************************************************************/
  24.  
  25. void wattrset(win,attrs)
  26.   WINDOW    *win;
  27.   int         attrs;
  28.   {
  29.   win->_attrs = attrs & ATR_MSK;
  30.   } /* wattrset */
  31.  
  32. /****************************************************************/
  33. /* Wattron() sets the specified attribute(s) in window 'win'.    */
  34. /****************************************************************/
  35.  
  36. void    wattron(win,attrs)
  37.   WINDOW    *win;
  38.   int         attrs;
  39.   {
  40.   win->_attrs |= (attrs & ATR_MSK);
  41.   } /* wattron */
  42.  
  43. /****************************************************************/
  44. /* Wattroff() clears the specified attribute(s) in window    */
  45. /* 'win'.                            */
  46. /****************************************************************/
  47.  
  48. void    wattroff(win,attrs)
  49.   WINDOW    *win;
  50.   int         attrs;
  51.   {
  52.   win->_attrs &= (~attrs & ATR_MSK);
  53.   } /* wattroff */
  54.  
  55. /****************************************************************/
  56. /* Wstandout() starts standout mode in window 'win'.        */
  57. /****************************************************************/
  58.  
  59. void    wstandout(win)
  60.   WINDOW    *win;
  61.   {
  62.   win->_attrs = A_STANDOUT;
  63.   } /* wstandout */
  64.  
  65. /****************************************************************/
  66. /* Wstandend() clears all special attributes in window 'win'.    */
  67. /****************************************************************/
  68.  
  69. void    wstandend(win)
  70.   WINDOW    *win;
  71.   {
  72.   win->_attrs = ATR_NRM;
  73.   } /* wstandend */
  74.  
  75. /****************************************************************/
  76. /* Attrset() sets the attributes as specified in stdscr.    */
  77. /****************************************************************/
  78.  
  79. void    attrset(attrs)
  80.   int attrs;
  81.   {
  82.   stdscr->_attrs = attrs & ATR_MSK;
  83.   } /* attrset */
  84.  
  85. /****************************************************************/
  86. /* Attron() sets the specified attribute(s) in stdscr.        */
  87. /****************************************************************/
  88.  
  89. void    attron(attrs)
  90.   int         attrs;
  91.   {
  92.   stdscr->_attrs |= (attrs & ATR_MSK);
  93.   } /* attron */
  94.  
  95. /****************************************************************/
  96. /* Attroff() clears the specified attribute(s) in stdscr.    */
  97. /****************************************************************/
  98.  
  99. void    attroff(attrs)
  100.   int         attrs;
  101.   {
  102.   stdscr->_attrs &= (~attrs & ATR_MSK);
  103.   } /* attroff */
  104.  
  105. /****************************************************************/
  106. /* Standout() starts standout mode in stdscr.            */
  107. /****************************************************************/
  108.  
  109. void    standout()
  110.   {
  111.   stdscr->_attrs = A_STANDOUT;
  112.   } /* standout */
  113.  
  114. /****************************************************************/
  115. /* Standend() clears all special attributes in stdscr.        */
  116. /****************************************************************/
  117.  
  118. void    standend()
  119.   {
  120.   stdscr->_attrs = ATR_NRM;
  121.   } /* standend */
  122.