home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FreeWare Collection 3
/
FreeSoftwareCollection3pd199x-jp.img
/
pao
/
ms_dos
/
wild
/
src
/
i24test.c
next >
Wrap
Text File
|
1980-01-02
|
2KB
|
87 lines
/* << MSC V5.1 >> *************************************************************
**
** 致命的エラー処理テスト for FMRシリーズ
**
** CREATE : 1990.12.17
** FINISH : 1990.12.17
**
** < NOTES >
** TABS = 4
**
** < HISTORY >
** 1990.12.17 : CREATE
**
** All Rights Reserved, Copyright (C) Y.Hirata 1990.
**
** Programed by Y.Hirata ( Nifty ID : NAB03321 )
**
******************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "doserr.h"
/********************************** メイン処理 ********************************/
void main( int ac,char *av[] )
{
FILE *fp ;
char *errmsg ;
unsigned char buf[256];
int c=0 ;
struct DOSERROR doserr ;
if ( ac < 2 ) { /* 引数なし */
printf("データファイル名を指定して下さい!\n") ;
exit( 1 ) ;
}
INT23_init() ;
INT24_init() ;
printf("INT23 & INT24 TEST...!\n\n") ;
INT24errno = -1 ;
if ( (fp = fopen( av[1],"r" )) == NULL ) {
if ( INT24errno == -1 ) { /* 通常エラー */
errmsg = strerror( errno ) ;
dosexterr( &doserr ) ;
printf("OPEN ERROR1 (errno) %d : %s\n",errno,errmsg) ;
printf("dos exterror %02d : %s\n",
doserr.exterror,DOSerr_extcode_msg[doserr.exterror]) ;
printf("エラークラス %02d : %s\n",
doserr.class,DOSerr_class_msg[doserr.class]) ;
printf("エラーアクション %02d : %s\n",
doserr.action,DOSerr_action_msg[doserr.action]) ;
printf("エラーローカス %02d : %s\n",
doserr.locus,DOSerr_locus_msg[doserr.locus]) ;
} else { /* 致命的エラー発生 */
printf("INT24 ERROR %02d : %s\n",
INT24errno,DOSerr_code_msg[INT24errno]) ;
printf("-- dos exterror %02d : %s\n",
INT24err.exterror,DOSerr_extcode_msg[INT24err.exterror]) ;
printf("-- エラークラス %02d : %s\n",
INT24err.class,DOSerr_class_msg[INT24err.class]) ;
printf("-- エラーアクション %02d : %s\n",
INT24err.action,DOSerr_action_msg[INT24err.action]) ;
printf("-- エラーローカス %02d : %s\n",
INT24err.locus,DOSerr_locus_msg[INT24err.locus]) ;
}
} else {
while ( fgets(buf,sizeof(buf),fp) != NULL ) {
printf("%04d :\t%s",++c,buf) ;
}
fclose( fp ) ;
}
INT23_release() ;
INT24_release() ;
printf("\nINT23 & INT24 解除\n") ;
printf("プログラム終了\n") ;
}