myio.h - Version 1
/* Borland C++ Portability (10/10/98)*/ #ifdef __WIN32__ #define WIN32 #endif /* Add Win32 portability */ #ifdef WIN32 #include <windows.h> #ifdef _MSC_VER #define getch() _getch() #define kbhit() _kbhit() #endif #else #include <dos.h> #endif /*** Some #defines to simplify the handling of color ***/ #define COLOR(f,b) (b*0x10+f) #define BLACK 0 #define BLUE 1 #define GREEN 2 #define CYAN 3 #define RED 4 #define MAGENTA 5 #define BROWN 6 #define WHITE 7 #define LT_GRAY 7 #define DK_GRAY 8 #define HI_BLUE 9 #define HI_GREEN 10 #define HI_CYAN 11 #define HI_RED 12 #define HI_MAGENTA 13 #define HI_BROWN 14 #define YELLOW 14 #define HI_WHITE 15 #define ERR_OK 0 #define ERR_NOMEM 1 #define ERR_OPEN 2 #define ERR_READ 3 #define ERR_WRITE 4 #define ERR_DELETED 5 #define ERR_EMPTY 6 #define ERR_EOF 7 #define ERR_BOF 8 #define ERR_NOFIND 9 #define ERR_LAST 10 /* This needs to change with every new error define added */ /*** SCRNIO.C ***/ #define ENTER 13 #define TAB 9 #define SHFTTAB 0x0F00 #define ESC 27 #define BACKSPACE 8 #define CURUP 0x4800 #define CURDN 0x5000 #define HOME 0x4700 #define END 0x4F00 #define F1 0x3B00 #define F2 0x3C00 #define F3 0x3D00 #define F4 0x3E00 #define F5 0x3F00 #define F6 0x4000 #define F7 0x4100 #define F8 0x4200 #define F9 0x4300 #define F10 0x4400 #define IsFuncKey(x) (x&0xFF00) #define IsGetStrExitKey(x) (x==TAB||x==ESC||x==SHFTTAB||x==F10) #define GS_INIT 0x0001 #define GS_UPPR 0x0002 void CPrintChar( int Char, int Color ); void CPrintStr( char *Str, int Color ); void Locate( int Row, int Col ); void HideCursor(); void CursorOn(void); void GetLocation( int *Row, int *Col ); void Cls( int Color ); void ClearRect( int Row, int Col, int Height, int Width, int Color ); int GetKey( void ); int GetStr(char *Dest, int Len, int EColor, int RColor, int Options); void At( int Row, int Col, char *Str , int Color );