home *** CD-ROM | disk | FTP | other *** search
/ FreeWare Collection 3 / FreeSoftwareCollection3pd199x-jp.img / pao / ms_dos / wild / src / i24test.c next >
Text File  |  1980-01-02  |  2KB  |  87 lines

  1. /* << MSC V5.1 >> *************************************************************
  2. **
  3. **    致命的エラー処理テスト  for FMRシリーズ
  4. **
  5. **    CREATE : 1990.12.17
  6. **    FINISH : 1990.12.17
  7. **
  8. **    < NOTES >
  9. **    TABS = 4
  10. **
  11. **    < HISTORY >
  12. **    1990.12.17 : CREATE
  13. **
  14. **    All Rights Reserved, Copyright (C) Y.Hirata 1990.
  15. **
  16. **    Programed by Y.Hirata ( Nifty ID : NAB03321 )
  17. **
  18. ******************************************************************************/
  19.  
  20. #include <stdio.h>
  21. #include <stdlib.h>
  22. #include <string.h>
  23. #include "doserr.h"
  24.  
  25. /**********************************  メイン処理  ********************************/
  26. void main( int ac,char *av[] )
  27. {
  28.     FILE    *fp ;
  29.     char    *errmsg ;
  30.     unsigned char    buf[256];
  31.     int        c=0 ;
  32.     struct DOSERROR        doserr ;
  33.  
  34.     if ( ac < 2 ) {                /*  引数なし    */
  35.         printf("データファイル名を指定して下さい!\n") ;
  36.         exit( 1 ) ;
  37.     }
  38.  
  39.     INT23_init() ;
  40.     INT24_init() ;
  41.  
  42.     printf("INT23 & INT24 TEST...!\n\n") ;
  43.  
  44.     INT24errno = -1 ;
  45.     if ( (fp = fopen( av[1],"r" )) == NULL ) {
  46.         if ( INT24errno == -1 ) {                        /*  通常エラー            */
  47.             errmsg = strerror( errno ) ;
  48.             dosexterr( &doserr ) ;
  49.             printf("OPEN ERROR1 (errno)  %d : %s\n",errno,errmsg) ;
  50.             printf("dos exterror %02d : %s\n",
  51.                 doserr.exterror,DOSerr_extcode_msg[doserr.exterror]) ;
  52.             printf("エラークラス       %02d : %s\n",
  53.                 doserr.class,DOSerr_class_msg[doserr.class]) ;
  54.             printf("エラーアクション     %02d : %s\n",
  55.                 doserr.action,DOSerr_action_msg[doserr.action]) ;
  56.             printf("エラーローカス      %02d : %s\n",
  57.                 doserr.locus,DOSerr_locus_msg[doserr.locus]) ;
  58.         } else {                                        /*  致命的エラー発生    */
  59.             printf("INT24 ERROR     %02d : %s\n",
  60.                 INT24errno,DOSerr_code_msg[INT24errno]) ;
  61.             printf("-- dos exterror %02d : %s\n",
  62.                 INT24err.exterror,DOSerr_extcode_msg[INT24err.exterror]) ;
  63.             printf("-- エラークラス       %02d : %s\n",
  64.                 INT24err.class,DOSerr_class_msg[INT24err.class]) ;
  65.             printf("-- エラーアクション     %02d : %s\n",
  66.                 INT24err.action,DOSerr_action_msg[INT24err.action]) ;
  67.             printf("-- エラーローカス      %02d : %s\n",
  68.                 INT24err.locus,DOSerr_locus_msg[INT24err.locus]) ;
  69.         }
  70.  
  71.     } else {
  72.  
  73.         while ( fgets(buf,sizeof(buf),fp) != NULL ) {
  74.             printf("%04d :\t%s",++c,buf) ;
  75.         }
  76.         fclose( fp ) ;
  77.     }
  78.  
  79.     INT23_release() ;
  80.     INT24_release() ;
  81.  
  82.     printf("\nINT23 & INT24 解除\n") ;
  83.     printf("プログラム終了\n") ;
  84.  
  85. }
  86.  
  87.