home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / TELECOM / GNU_ATP_1_40.lzh / SRC / ansi.c next >
Text File  |  1993-08-16  |  3KB  |  174 lines

  1. /*
  2.  
  3.      ATP QWK MAIL READER FOR READING AND REPLYING TO QWK MAIL PACKETS.
  4.      Copyright ( C ) 1992  Thomas McWilliams 
  5.      Copyright ( C ) 1990  Rene Cougnenc
  6.      
  7.      This program is free software; you can redistribute it and/or modify
  8.      it under the terms of the GNU General Public License as published by
  9.      the Free Software Foundation; either version 1, or ( at your option )
  10.      any later version.
  11.      
  12.      This program is distributed in the hope that it will be useful,
  13.      but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.      GNU General Public License for more details.
  16.      
  17.      You should have received a copy of the GNU General Public License
  18.      along with this program; ifnot, write to the Free Software
  19.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21. */
  22.  
  23. /* Change Log:
  24. $Log: ansi.c,v $
  25.  * Revision 2.000  1993/08/03 wrh
  26.  * first version for C compiler version 3.2 and OS-9/68000 version 2.4 wrh
  27.  *
  28.  * Revision 1.400  1992/11/28  09:56:28  root
  29.  * second release
  30.  *
  31.  * Revision 1.310  1992/07/08  23:15:14  root
  32.  * first release -- minor bug fix in read.c
  33.  *
  34.  * Revision 1.30  1992/07/05  15:36:19  root
  35.  * first release of ATP
  36.  *
  37.  * Revision 1.2  1992/04/19  12:46:31  root
  38.  * 1st semifunctional UNIX version.
  39.  *
  40.  */
  41.  
  42.  
  43. #include <stdio.h>
  44. #include "ansi.h"
  45.  
  46. extern int ansi; /* Will just return on ansi==0 */
  47.  
  48. #define ESC 27
  49.  
  50. void clear() /* Reset Attributes */
  51. {
  52.     if( ansi )
  53.         printf( "%c[0m",ESC );
  54. }
  55.  
  56. void high() /* HigLitht  ( or BoldFace ) */
  57. {
  58.     if( ansi )
  59.         printf( "%c[1m",ESC );
  60. }
  61.  
  62. void blink() /* blink mode */
  63. {
  64.     if( ansi )
  65.         printf( "%c[5m",ESC );
  66. }
  67.  
  68. void reverse() /* Revers video mode */
  69. {
  70.     if( ansi )
  71.         printf( "%c[7m",ESC );
  72. }
  73.  
  74. /*------------- Foreground colors ---------------------*/
  75.  
  76. void black()
  77. {
  78.     if( ansi )
  79.         printf( "%c[30m",ESC );
  80. }
  81.  
  82. void red()
  83. {
  84.     if( ansi )
  85.         printf( "%c[31m",ESC );
  86. }
  87.  
  88. void green()
  89. {
  90.     if( ansi )
  91.         printf( "%c[32m",ESC );
  92. }
  93.  
  94. void yellow()
  95. {
  96.     if( ansi )
  97.         printf( "%c[33m",ESC );
  98. }
  99.  
  100. void blue()
  101. {
  102.     if( ansi )
  103.         printf( "%c[34m",ESC );
  104. }
  105.  
  106. void magenta()
  107. {
  108.     if( ansi )
  109.         printf( "%c[35m",ESC );
  110. }
  111.  
  112. void cyan()
  113. {
  114.     if( ansi )
  115.         printf( "%c[36m",ESC );
  116. }
  117.  
  118. void white()
  119. {
  120.     if( ansi )
  121.         printf( "%c[37m",ESC );
  122. }
  123.  
  124. /*------------- BackGround colors ---------------------*/
  125.  
  126. void bblack()
  127. {
  128.     if( ansi )
  129.         printf( "%c[40m",ESC );
  130. }
  131.  
  132. void bred()
  133. {
  134.     if( ansi )
  135.         printf( "%c[41m",ESC );
  136. }
  137.  
  138. void bgreen()
  139. {
  140.     if( ansi )
  141.         printf( "%c[42m",ESC );
  142. }
  143.  
  144. void byellow()
  145. {
  146.     if( ansi )
  147.         printf( "%c[43m",ESC );
  148. }
  149.  
  150. void bblue()
  151. {
  152.     if( ansi )
  153.         printf( "%c[44m",ESC );
  154. }
  155.  
  156. void bmagenta()
  157. {
  158.     if( ansi )
  159.         printf( "%c[45m",ESC );
  160. }
  161.  
  162. void bcyan()
  163. {
  164.     if( ansi )
  165.         printf( "%c[46m",ESC );
  166. }
  167.  
  168. void bwhite()
  169. {
  170.     if( ansi )
  171.         printf( "%c[47m",ESC );
  172. }
  173.  
  174.