home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / prof_c / 13ansi / ansi_tst.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-11  |  827 b   |  41 lines

  1. /*
  2.  *    ansi_tst -- verify that the ANSI.SYS driver is loaded
  3.  *    (prints message and exits is ANSI driver not working)
  4.  */
  5.  
  6. #include <stdio.h>
  7. #include <local\ansi.h>
  8. #include <local\video.h>
  9.  
  10. #define TST_ROW    2
  11. #define TST_COL    75
  12.  
  13. void
  14. ansi_tst()
  15. {
  16.     int row, col;
  17.     static char *help[] = {
  18.         "\n",
  19.         "ANSI.SYS device driver not loaded:\n",
  20.         "  1. Copy ANSI.SYS to your system disk.\n",
  21.         "  2. Add the line device=ansi.sys to your\n",
  22.         "     CONFIG.SYS file and reboot your machine.\n",
  23.         NULL
  24.     };
  25.     char **msg;
  26.  
  27.     extern int getstate();
  28.     extern int readcur(int *, int *, int);
  29.  
  30.     getstate();
  31.     ANSI_CUP(TST_ROW, TST_COL);
  32.     readcur(&row, &col, Vpage);
  33.     if (row != TST_ROW - 1 || col != TST_COL - 1) {
  34.         for (msg = help; *msg != NULL; ++msg)
  35.             fputs(*msg, stderr);
  36.         exit(1);
  37.     }
  38.  
  39.     return;
  40. }
  41.