file2-1.1.orig/0040755000175000000620000000000006527445064012352 5ustar kmutostafffile2-1.1.orig/Makefile0100644000175000000620000000010205434711144013767 0ustar kmutostaff# #CFLAGS = -g all : file2 file2 : file2.o cc -o file2 file2.o file2-1.1.orig/file2.c0100644000175000000620000001441505434711116013507 0ustar kmutostaff/*********************************************************************** ** ** ** file2 : ファイルのコードチェック ** ** ** ** 著者 : 伊東 徳和 ** ** ** ** 履歴 : ** ** v1.0 ????/??/?? ** ** 初版 ** ** v1.1 1993/07/23 ** ** DOSの^ZもASCII文字に含める事にした ** ** ** ***********************************************************************/ #include #include #include #define BUFF_SIZE 4096 #define TRUE 1 #define FALSE 0 #define ASCII 1 #define EUC 2 #define SJIS 3 #define JIS 4 #define EMPTY 5 #define UNKOWN 99 /* 漢字インのコード */ #define ESC_DALLER_B 1 /* ESC-$-B */ #define ESC_DALLER_ATMARK 2 /* ESC-$-@ */ /* 漢字アウトのコード */ #define ESC_LEFT_PARA_B 1 /* ESC-(-B */ #define ESC_LEFT_PARA_J 2 /* ESC-(-J */ typedef unsigned char uchar; int kanji_in_type; int kanji_out_type; main(argc,argv) int argc; char *argv[]; { int i; if ( argc<2 ) { printf("Usage : %s file ...\n", argv[0]); exit(1); } for( i=1; i=0x07 && c<=0x0d || c==0x1a || c==0x1b || c>=0x20 && c<=0x7f ? TRUE : FALSE); } int is_sjis_file( buff, size) uchar buff[]; int size; { int i; if ( size<=0 ) return(FALSE); for ( i=0; i=0x0a1 && c<=0xdf ) return(TRUE); return(FALSE); } int is_sjis_char(c1, c2) uchar c1,c2; { if ( (c1>=0x081 && c1<=0x09f) || (c1>=0xe0 && c1<=0x0ee) ) { if ( c2>=0x40 && c2<=0x0fc ) return(TRUE); } return(FALSE); } int is_euc_file( buff, size) uchar buff[]; int size; { int i; if ( size<=0 ) return(FALSE); for ( i=0; i=0x0a1 && c1<=0x0fe ) { if ( c2>=0x0a1 && c2<=0x0fe ) return(TRUE); } return(FALSE); } int is_euc_katakana_char(c1, c2) uchar c1,c2; { if ( c1==0x08e ) { if ( is_katakana_char(c2) ) return(TRUE); } return(FALSE); } file2-1.1.orig/HEADER0100644000175000000620000000206406010402564013205 0ustar kmutostaffFrom: nori@aoba.sendai.nssys.co.jp (Norikazu_Ito) Newsgroups: fj.sources Subject: file2-v1.1 (1/1) Message-ID: <2118@aoba.sendai.nssys.co.jp> Date: 19 Aug 93 15:08:14 GMT Sender: news@aoba.sendai.nssys.co.jp Organization: Nihon Sogo System co,. Sendai Miyagi. 伊東@NSSです。 file2という名前のプログラムを作ってみましたので、よければ使ってみて ください。 機 能:fileコマンドのものすごく小さいサブセットですが。漢字混じりの     テキストファイルの時は、EUC、JIS、SJISを判定します。 JISの場合は、KI(漢字INコード)とKO(漢字OUTコード)を判定して     表示します。 形 式:file2 ファイル名... 使用例:file2 Makefile file2.c file2 fj/ai/1621 Makefile: ascii text file2.c: EUC text file2: UNKOWN fj/ai/1621: JIS text (KI=ESC-$-B,KO=ESC-(-J) メイク:makeするだけ。 著作権:完全に放棄します。 その他:バグがあったら各自修正してください。使用による不都合があった場合     私はいっさい関知しません。 SunOS 4.1.2 でしか、make、実行していません。他の機種では?です。 -- 伊東 徳和 (nori@aoba.sendai.nssys.co.jp) 日本総合システム(株)仙台システム開発センター