//functions for ANSI standard screen control.  Should work with any ANSI
//standard monitor.

//MS Windows' DOS box needs ansi.sys driver running:
//in C:\config.sys have this line:
// device=c:\windows\command\ansi.sys
//and, like any trivial configuration change in Windows, reboot.

//NTs (i.e. 2000 and XP) aren't going to support no stinking standard.

//  #include "ansiscreen.h"   // at the top of your .cpp file (like in the 
//ansiscreenEx.cpp file) or
//paste this file into your .cpp file.
//or just use selected functions.

//position cursor to row x, column y:
inline void gotoxy(int x,int y) { cout<<"\033["<<(x)<<";"<<(y)<<"H"; }

//clear the screen:
inline void clearsc() { cout<<"\33[H\33[2J"; }

//change foreground color:
inline void color_black() {   cout<<"\33[30m"; }
inline void color_red() {     cout<<"\33[31m"; }
inline void color_green() {   cout<<"\33[32m"; }
inline void color_yellow() {  cout<<"\33[33m"; }
inline void color_blue() {    cout<<"\33[34m"; }
inline void color_magenta() { cout<<"\33[35m"; }
inline void color_cyan() {    cout<<"\33[36m"; }
inline void color_white() {   cout<<"\33[37m"; }

//change background color:
inline void colorback_black() {   cout<<"\33[40m"; }
inline void colorback_red() {     cout<<"\33[41m"; }
inline void colorback_green() {   cout<<"\33[42m"; }
inline void colorback_yellow() {  cout<<"\33[43m"; }
inline void colorback_blue() {    cout<<"\33[44m"; }
inline void colorback_magenta() { cout<<"\33[45m"; }
inline void colorback_cyan() {    cout<<"\33[46m"; }
inline void colorback_white() {   cout<<"\33[47m"; }

//change attribute:
inline void attr_none() {       cout<<"\33[00m"; }
inline void attr_bold() {       cout<<"\33[01m"; }
inline void attr_under() {      cout<<"\33[04m"; }
inline void attr_blink() {      cout<<"\33[05m"; }
inline void attr_reverse() {    cout<<"\33[07m"; }
inline void attr_conceal() {    cout<<"\33[08m"; }

