/*2:*/ #line 66 "tie.web" #include /*56:*/ #line 72 "character.web" typedef char ASCII; typedef char outer_char; /*:56*//*61:*/ #line 133 "character.web" typedef char ascii_code; typedef FILE *text_file; /*:61*/ #line 68 "tie.web" /*9:*/ #line 28 "datadecl.web" typedef char in_file_modes; typedef char file_types; /*:9*//*10:*/ #line 35 "datadecl.web" typedef char boolean; /*:10*//*11:*/ #line 45 "datadecl.web" typedef char out_md_type; typedef char *name_type; typedef int buffer_index; typedef int file_index; typedef struct{ name_type name_of_file; ascii_code buffer[100+1]; in_file_modes mode; int lineno; file_types type_of_file; int limit; }input_description; /*:11*/ #line 69 "tie.web" /*8:*/ #line 165 "tie.web" int next_available_file= 0; #line 1 "datadecl.web" /*:8*//*12:*/ #line 63 "datadecl.web" int actual_input,test_input; boolean input_has_ended; input_description input_organization[9+1]; text_file input_files[9+1]; int no_ch; boolean prod_chf; out_md_type out_mode; int verbose= 0; #line 168 "tie.web" /*:12*//*14:*/ #line 190 "tie.web" boolean lines_dont_match(); /*:14*//*16:*/ #line 204 "tie.web" boolean e_of_ch_module(); /*:16*//*18:*/ #line 219 "tie.web" boolean e_of_ch_module(); /*:18*//*21:*/ #line 236 "tie.web" boolean file_open(); /*:21*//*40:*/ #line 529 "tie.web" long int lines_processed= 0; /*:40*//*49:*/ #line 11 "history.web" int history; /*:49*//*57:*/ #line 80 "character.web" ASCII xord[0177]; outer_char xchr[0200]; /*:57*/ #line 70 "tie.web" /*52:*/ #line 25 "error.web" print_name_of_file(cur_index) file_index cur_index; { fprintf(stderr,"%s",input_organization[cur_index].name_of_file); } /*:52*//*53:*/ #line 36 "error.web" err_loc(i) int i; { fprintf(stderr, " (file %s, l.%d).\n",input_organization[i].name_of_file, input_organization[i].lineno); } /*:53*//*55:*/ #line 55 "error.web" jump_out(){exit(history==0?0:1);} #line 1 "character.web" /*:55*/ #line 71 "tie.web" main(argc,argv) int argc; char * *argv; { int i,j; /*50:*/ #line 17 "history.web" history= 0; /*:50*/ #line 79 "tie.web" if(verbose) {fprintf(stderr,"This is TIE, C Version 0.1 (ported to C)");putc('\n',stderr);}; /*7:*/ #line 137 "tie.web" while(--argc>0){ if( * *++argv=='-') switch( *++ *argv){ case'm': prod_chf= 0; break; case'c': prod_chf= 1; break; case'v': verbose++; break; default: fprintf(stderr,"Bad option -%c ignored\n", * *argv); break; } else{ if(next_available_file>9) {{putc('\n',stderr);fprintf(stderr,"too many files");};{fprintf(stderr,".");putc('\n',stderr);};history= 2;jump_out();}; input_organization[next_available_file++].name_of_file= *argv; } } /*:7*/ #line 83 "tie.web" ; /*30:*/ #line 374 "tie.web" common_init(); for(i= 0;i=2)&& (input_organization[i].buffer[0]=='@')&& ((input_organization[i].buffer[1]=='Z')|| (input_organization[i].buffer[1]=='z'))); } /*:15*//*17:*/ #line 209 "tie.web" boolean e_of_ch_preamble(i) int i; { return((input_organization[i].limit>=2)&& (input_organization[i].buffer[0]=='@')&& ((input_organization[i].buffer[1]=='Y')|| (input_organization[i].buffer[1]=='y'))); } /*:17*//*20:*/ #line 228 "tie.web" boolean file_open(f,name) text_file *f; name_type name; { return(( *f= fopen(name,"r"))!=NULL); } /*:20*//*22:*/ #line 240 "tie.web" /*25:*/ #line 297 "tie.web" init_change_file(i,b) int i; boolean b; { /*26:*/ #line 312 "tie.web" while(1){ get_ln_from_file(i,input_files[i]);; if(input_organization[i].mode==4)return; if(input_organization[i].limit<2)continue; if(input_organization[i].buffer[0]!='@')continue; if((input_organization[i].buffer[1]>='X') &&(input_organization[i].buffer[1]<='Z')) input_organization[i].buffer[1]+= 'z'-'Z'; if(input_organization[i].buffer[1]=='x')break; if((input_organization[i].buffer[1]=='y')|| (input_organization[i].buffer[1]=='z')) if(b) {{putc('\n',stderr);fprintf(stderr,"! Where is the matching @x?");};err_loc(i);history= 1;}; } /*:26*/ #line 302 "tie.web" ; /*27:*/ #line 333 "tie.web" do{ get_ln_from_file(i,input_files[i]);; if(input_organization[i].mode==4){ {{putc('\n',stderr);fprintf(stderr,"! Change file ended after @x");};err_loc(i);history= 1;}; return; } }while(input_organization[i].limit<=0); /*:27*/ #line 303 "tie.web" ; } /*:25*/ #line 241 "tie.web" open_input() { int i; /*23:*/ #line 271 "tie.web" if(!file_open(&(input_files[0]),input_organization[0].name_of_file)){ {{putc('\n',stderr);fprintf(stderr,"! Master file can\'t be opened");};{fprintf(stderr,".");putc('\n',stderr);};history= 2;jump_out();}; } else{ if(verbose){ fprintf(stderr,"("); print_name_of_file(0); {fprintf(stderr,")");putc('\n',stderr);}; } input_organization[0].type_of_file= 1; get_ln_from_file(0,input_files[0]);; } /*:23*/ #line 245 "tie.web" ; actual_input= 0; no_ch= 0; while(++no_ch0))actual_input--; } if(input_has_ended&&(actual_input==0))return; test_input= (next_available_file); i= actual_input; while((test_input==(next_available_file))&&(i100) if((c= getc(cur_file))!=EOF&&c!='\n'){ ungetc(c,cur_file);{{putc('\n',stderr);fprintf(stderr,"! Input line too long");};err_loc(i);history= 1;}; } /*48:*/ #line 101 "io.web" if(input_organization[i].limit==0&&c==EOF) /*46:*/ #line 67 "io.web" { input_organization[i].mode= 4; if(input_organization[i].type_of_file==1)input_has_ended= 1; return; } /*:46*/ #line 103 "io.web" #line 1 "history.web" /*:48*/ #line 97 "io.web" input_organization[i].limit= final_limit; /*:47*/ #line 63 "io.web" ; } /*:45*//*58:*/ #line 96 "character.web" common_init() { strcpy(xchr," !\"#$%&'()*+,-./0123456789\ :;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ "); /*60:*/ #line 127 "character.web" /*:60*//*64:*/ #line 551 "tie.web" #line 552 "tie.web" xchr['\t']= '\t'; /*:64*/ #line 101 "character.web" ; /*59:*/ #line 108 "character.web" { int i; for(i= 0;i<=0177;i++)xord[i]= '\040'; for(i= 1;i<0177;i++)xord[xchr[i]]= i; } /*:59*/ #line 102 "character.web" ; } /*:58*/