/* prepare.c -- single out the relevant letters */ #include #include #include "ios.h" /* using the input/output service module */ #define ERR_LONG_WORD 1 static char EncodeTable [256]; static long int BookLength; static int WordLength; static void MakeCodeTables ( char word [] ); void main ( int argc, char * argv [] ) { unsigned char c; int k, n; char * word; char * from; FILE * outfile; if ( argc < 4 ) err_command_line ( "prepare word infile outfile" ); word = argv [1]; for ( n=0; n<16; n++ ) if ( word [n] == 0 ) { WordLength = n; break; } if ( n >= 16 ) { printf ( "word length exceeds 15\n" ); exit ( ERR_LONG_WORD ); } open_input_file ( argv [2] ); outfile = open_output_file ( argv [3] ); MakeCodeTables ( word ); fprintf ( outfile, "[" ); for ( k=0; k