home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / bbbsr2.zip / scripts / conio.bzh < prev    next >
Text File  |  1997-06-26  |  1KB  |  91 lines

  1. /******************************************************************************
  2.  
  3.              Console Input/Output routines for BZ language
  4.  
  5.            Copyright 1993-1997, Kim Heino and Tapani T. Salmi
  6.  
  7. ******************************************************************************/
  8.  
  9. int clreol() {
  10.   printf("\e[K");
  11. }
  12.  
  13. int clrscr() {
  14.   printf("\e[1;1H\e[2J");
  15. }
  16.  
  17. int delline() {
  18.   printf("\e[1M");
  19. }
  20.  
  21. int gotoxy(int x, int y) {
  22.   printf("\e[%u;%uH",y,x);
  23. }
  24.  
  25. int textattr(int a) {
  26.   printf("\e[%sm",a);
  27. }
  28.  
  29. int highvideo() {
  30.   textattr("1");
  31. }
  32.  
  33. int insline() {
  34.   printf("\e[1L");
  35. }
  36.  
  37. int lowvideo() {
  38.   textattr("0");
  39. }
  40.  
  41. int movetext() {
  42. // requires VT320
  43. }
  44.  
  45. int normvideo() {
  46.   textattr("0");
  47. }
  48.  
  49. int textbackground(char a) {
  50.   printf("\e[4%sm",a);
  51. }
  52.  
  53. int textcolor(char a) {
  54.   printf("\e[3%sm",a);
  55. }
  56.  
  57. int wherex() {
  58. // requires VT320, or you can ask it with \e[6n and parse result
  59. }
  60.  
  61. int wherey() {
  62. // requires VT320, or you can ask it with \e[6n and parse result
  63. }
  64.  
  65. int window() {
  66. // requires VT320
  67. }
  68.  
  69. int cgets() {
  70.   return(input("",79,0));
  71. }
  72.  
  73. #define cprintf printf
  74.  
  75. int cputs(char s) {
  76.   printf("%s\n",s);
  77. }
  78.  
  79. int putch(char e) {
  80.   printf("%c",e);
  81. }
  82.  
  83. int getche() {
  84.   int e;
  85.  
  86.   e=getch();
  87.   putch(e);
  88.   return(e);
  89. }
  90.  
  91.