| 1 |
sysadm |
1.1 |
/*
|
| 2 |
|
|
* Copyright (C) 1998,1999 Ross Combs (rocombs@cs.nmsu.edu)
|
| 3 |
|
|
*
|
| 4 |
|
|
* This program is free software; you can redistribute it and/or
|
| 5 |
|
|
* modify it under the terms of the GNU General Public License
|
| 6 |
|
|
* as published by the Free Software Foundation; either version 2
|
| 7 |
|
|
* of the License, or (at your option) any later version.
|
| 8 |
|
|
*
|
| 9 |
|
|
* This program is distributed in the hope that it will be useful,
|
| 10 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 11 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 12 |
|
|
* GNU General Public License for more details.
|
| 13 |
|
|
*
|
| 14 |
|
|
* You should have received a copy of the GNU General Public License
|
| 15 |
|
|
* along with this program; if not, write to the Free Software
|
| 16 |
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 17 |
|
|
*/
|
| 18 |
|
|
#ifndef JUST_NEED_TYPES
|
| 19 |
|
|
#ifndef INCLUDED_ANSI_TERM_PROTOS
|
| 20 |
|
|
#define INCLUDED_ANSI_TERM_PROTOS
|
| 21 |
|
|
|
| 22 |
|
|
#define JUST_NEED_TYPES
|
| 23 |
|
|
#include <stdio.h>
|
| 24 |
|
|
#undef JUST_NEED_TYPES
|
| 25 |
|
|
|
| 26 |
|
|
#define ansi_beep()\
|
| 27 |
|
|
printf("\007");
|
| 28 |
|
|
|
| 29 |
|
|
#define ansi_screen_clear()\
|
| 30 |
|
|
printf("\033[2J");
|
| 31 |
|
|
|
| 32 |
|
|
#define ansi_line_clear()\
|
| 33 |
|
|
printf("\033[K");
|
| 34 |
|
|
|
| 35 |
|
|
#define ansi_cursor_move_up(lines)\
|
| 36 |
|
|
printf("\033[%dA",lines);
|
| 37 |
|
|
|
| 38 |
|
|
#define ansi_cursor_move_down(lines)\
|
| 39 |
|
|
printf("\033[%dB",lines);
|
| 40 |
|
|
|
| 41 |
|
|
#define ansi_cursor_move_left(chars)\
|
| 42 |
|
|
printf("\033[%dD",chars);
|
| 43 |
|
|
|
| 44 |
|
|
#define ansi_cursor_move_right(chars)\
|
| 45 |
|
|
printf("\033[%dC",chars);
|
| 46 |
|
|
|
| 47 |
|
|
#define ansi_cursor_move_home()\
|
| 48 |
|
|
printf("\033[1;0H");
|
| 49 |
|
|
|
| 50 |
|
|
#define ansi_cursor_move(y,x)\
|
| 51 |
|
|
printf("\033[%d;%dH",x+1,y);
|
| 52 |
|
|
|
| 53 |
|
|
#define ansi_cursor_save()\
|
| 54 |
|
|
printf("\033[u");
|
| 55 |
|
|
|
| 56 |
|
|
#define ansi_cursor_load()\
|
| 57 |
|
|
printf("\033[s");
|
| 58 |
|
|
|
| 59 |
|
|
#define ansi_text_reset()\
|
| 60 |
|
|
printf("\033[0m");
|
| 61 |
|
|
|
| 62 |
|
|
#define ansi_text_style(style)\
|
| 63 |
|
|
printf("\033[%dm",style);
|
| 64 |
|
|
|
| 65 |
|
|
#define ansi_text_color_fore(color)\
|
| 66 |
|
|
printf("\033[3%dm",color);
|
| 67 |
|
|
|
| 68 |
|
|
#define ansi_text_color_back(color)\
|
| 69 |
|
|
printf("\033[4%dm",color);
|
| 70 |
|
|
|
| 71 |
|
|
#define ansi_text_style_bold 1
|
| 72 |
|
|
#define ansi_text_style_underline 4
|
| 73 |
|
|
#define ansi_text_style_blink 5
|
| 74 |
|
|
#define ansi_text_style_inverse 7
|
| 75 |
|
|
|
| 76 |
|
|
#define ansi_text_color_black 0
|
| 77 |
|
|
#define ansi_text_color_red 1
|
| 78 |
|
|
#define ansi_text_color_green 2
|
| 79 |
|
|
#define ansi_text_color_yellow 3
|
| 80 |
|
|
#define ansi_text_color_blue 4
|
| 81 |
|
|
#define ansi_text_color_magenta 5
|
| 82 |
|
|
#define ansi_text_color_cyan 6
|
| 83 |
|
|
#define ansi_text_color_white 7
|
| 84 |
|
|
|
| 85 |
|
|
#endif
|
| 86 |
|
|
#endif
|