home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / c / other / utility / tools.h < prev   
Encoding:
C/C++ Source or Header  |  1988-08-10  |  1.2 KB  |  35 lines

  1. /* TOOLS.H - Contains definitions for general constants and macros,
  2.  * as well as constants and prototypes for functions in TOOLS.C
  3.  */
  4.  
  5. #define TRUE 1
  6. #define FALSE 0
  7.  
  8. /* Text output colors. Note that monochrome can only use _TBLACK,
  9.  * _TWHITE, _TBRIGHTWHITE, and _TUNDERLINE. Graphics black-and-white
  10.  * can only use the first three of these. The first eight colors
  11.  * can be used as background colors (although they may need to be
  12.  * cast to long).
  13.  */
  14. enum TEXTCOLORS
  15. {
  16.     _TBLACK,        _TBLUE,         _TGREEN,        _TCYAN,
  17.     _TRED,          _TMAGENTA,      _TBROWN,        _TWHITE,
  18.     _TGREY,         _TLIGHTBLUE,    _TLIGHTGREEN,   _TLIGHTCYAN,
  19.     _TLIGHTRED,     _TLIGHTMAGENTA, _TLIGHTYELLOW,  _TBRIGHTWHITE,
  20. };
  21. #define _TUNDERLINE 1
  22.  
  23. /* Macros to combine background and foreground colors, and to combine
  24.  * starting and ending cursor lines.
  25.  */
  26. #define SETATRIB( fore, back )   ( ((back) << 4) | (fore))
  27. #define SETCURSOR( first, last ) ( ((first) << 8) | (last))
  28.  
  29. /* Action codes for getkey */
  30. enum WAITACTION { NO_WAIT, WAIT, CLEAR_WAIT };
  31.  
  32. /* Prototypes of functions in TOOLS.C */
  33. void delay( clock_t wait );
  34. unsigned getkey( int waitflag );
  35.