home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / dtx9203 / ctrick / ansi.c next >
Encoding:
C/C++ Source or Header  |  1992-04-14  |  1.5 KB  |  71 lines

  1. /* ------------------------------------------------------ */
  2. /*                       ANSI.C                           */
  3. /* stellt fest, ob ANSI.SYS geladen ist                   */
  4. /* Returncode:  1 -> ANSI.SYS geladen                     */
  5. /*              2 -> ANSI.SYS nicht geladen               */
  6. /*              3 -> falsche DOS-Version                  */
  7. /*         (c) 1992 Michael Winter & DMV-Verlag           */
  8. /* ------------------------------------------------------ */
  9.  
  10. #include <stdio.h>
  11. #include <dos.h>
  12. #include <stdlib.h>
  13.  
  14. /* --- Funktionsprototypen ------------------------------ */
  15.  
  16. int main(void);
  17. int ansi(void);
  18. int dr_dos();
  19.  
  20. /* --- Programm ----------------------------------------- */
  21.  
  22. int main(void)
  23. {
  24.   printf("\n\n");
  25.   printf("ANSI 1.0 - (c) 1992 Michael Winter & DMV-Verlag");
  26.  
  27.   if ( ( _osmajor < 4 ) || dr_dos() )
  28.   {
  29.     printf("\nMindestens MS-/PC-DOS 4.0 erforderlich!\n\n");
  30.     exit(3);
  31.   }
  32.  
  33.   printf("\n\nANSI.SYS ");
  34.  
  35.   if ( ansi() )
  36.   {
  37.     printf("installiert\n\n");
  38.     exit(1);
  39.   }
  40.   else
  41.   {
  42.     printf("nicht installiert\n\n");
  43.     exit(2);
  44.   }
  45. }
  46.  
  47. int ansi( void )
  48. {
  49.   union REGS regs;
  50.  
  51.   regs.x.ax = 0x1A00;
  52.  
  53.   int86( 0x2F, ®s, ®s );
  54.  
  55.   if ( regs.h.al == 0xFF )
  56.     return(1);
  57.   else
  58.     return(2);
  59. }
  60.  
  61. int dr_dos()
  62. {
  63.   union REGS regs;
  64.  
  65.   regs.x.ax = 0x4452;
  66.   intdos( ®s, ®s );
  67.   return !regs.x.cflag;
  68. }
  69. /* ------------------------------------------------------- */
  70. /*                  Ende von ANSI.C                        */
  71.