home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c040 / 1.ddi / SAMPLES / TOOLS.H$ / TOOLS.bin
Encoding:
Text File  |  1990-02-14  |  1.3 KB  |  41 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. /* Include only once */
  6. #ifndef TOOLS_H
  7. #define TOOLS_H
  8.  
  9. #define TRUE 1
  10. #define FALSE 0
  11.  
  12. /* Text output colors. Note that monochrome can only use _TBLACK,
  13.  * _TWHITE, _TBRIGHTWHITE, and _TUNDERLINE. Graphics black-and-white
  14.  * can only use the first three of these. The first eight colors
  15.  * can be used as background colors (although they may need to be
  16.  * cast to long).
  17.  */
  18. enum TEXTCOLORS
  19. {
  20.     _TBLACK,        _TBLUE,         _TGREEN,        _TCYAN,
  21.     _TRED,          _TMAGENTA,      _TBROWN,        _TWHITE,
  22.     _TGREY,         _TLIGHTBLUE,    _TLIGHTGREEN,   _TLIGHTCYAN,
  23.     _TLIGHTRED,     _TLIGHTMAGENTA, _TLIGHTYELLOW,  _TBRIGHTWHITE,
  24. };
  25. #define _TUNDERLINE 1
  26.  
  27. /* Macros to combine background and foreground colors, and to combine
  28.  * starting and ending cursor lines.
  29.  */
  30. #define SETATRIB( fore, back )   ( ((back) << 4) | (fore))
  31. #define SETCURSOR( first, last ) ( ((first) << 8) | (last))
  32.  
  33. /* Action codes for getkey */
  34. enum WAITACTION { NO_WAIT, WAIT, CLEAR_WAIT };
  35.  
  36. /* Prototypes of functions in TOOLS.C */
  37. void delay( clock_t wait );
  38. unsigned getkey( int waitflag );
  39.  
  40. #endif /* TOOLS_H */
  41.