beta-0.89.2
[luatex.git] / source / texk / web2c / ctiedir / ctie.c
blob840c7800144aa189e6a2039c3b312e0d48ca8c5e
1 #define version_number "1.1"
2 #define banner "This is CTIE, Version 1.1"
3 #define copyright \
4 "Copyright 2002,2003 Julian Gilbey. All rights reserved. There is no warranty.\n\
5 Run with the --version option for other important information." \
8 #define false 0
9 #define true 1 \
11 #define buf_size 1024
12 #define max_file_index 32 \
14 #define xisupper(c) (isupper(c) &&((unsigned char) c<0200) ) \
17 #define spotless 0
18 #define troublesome 1
19 #define fatal 2 \
21 #define max_include_files 20 \
23 #define max_file_name_length 60 \
25 #define too_long() {total_include_files--;free(new_inc) ; \
26 err_print(i,"! Include file name too long") ;goto restart;} \
28 #define fatal_error(i,s,t) { \
29 fprintf(stderr,"\n%s",s) ; \
30 err_print(i,t) ; \
31 history= fatal; \
32 exit(wrap_up() ) ; \
33 } \
36 #define none (-1) \
38 /*2:*/
39 #line 89 "./ctie.w"
41 /*8:*/
42 #line 172 "./ctie.w"
44 #include <stdio.h>
47 /*:8*//*9:*/
48 #line 180 "./ctie.w"
50 #ifdef __STDC__
51 #include <stdlib.h>
52 #else
53 #include <malloc.h>
54 #endif
57 /*:9*//*37:*/
58 #line 715 "./ctie.w"
60 #include <errno.h>
63 /*:37*/
64 #line 90 "./ctie.w"
66 /*4:*/
67 #line 124 "./ctie.w"
69 typedef int boolean;
70 typedef char*string;
73 /*:4*//*10:*/
74 #line 211 "./ctie.w"
76 #define search 0
77 #define test 1
78 #define reading 2
79 #define ignore 3
80 typedef int in_file_modes;
81 #define unknown 0
82 #define master 1
83 #define chf 2
84 typedef int file_types;
87 /*:10*//*11:*/
88 #line 229 "./ctie.w"
90 #define normal 0
91 #define pre 1
92 #define post 2
93 typedef int out_md_type;
96 /*:11*//*12:*/
97 #line 239 "./ctie.w"
99 typedef int file_index;
102 /*:12*//*13:*/
103 #line 246 "./ctie.w"
105 typedef struct _indsc{
106 char file_name[max_file_name_length];
107 long line;
108 FILE*the_file;
109 struct _indsc*parent;
110 }include_description;
113 /*:13*//*14:*/
114 #line 259 "./ctie.w"
116 typedef struct _idsc{
117 string file_name;
118 char buffer[buf_size];
119 in_file_modes mode;
120 long line;
121 file_types type_of_file;
122 include_description*current_include;
123 char*buffer_end;
124 char*limit;
125 char*loc;
126 FILE*the_file;
127 int dont_match;
128 }input_description;
131 /*:14*/
132 #line 91 "./ctie.w"
134 /*5:*/
135 #line 134 "./ctie.w"
137 extern int strlen();
138 extern char*strcpy();
139 extern int strncmp();
140 extern char*strncpy();
141 extern char*strerror();
144 /*:5*//*28:*/
145 #line 584 "./ctie.w"
147 void err_print();
149 /*:28*//*33:*/
150 #line 673 "./ctie.w"
152 int wrap_up();
154 /*:33*//*35:*/
155 #line 696 "./ctie.w"
157 void pfatal_error();
159 /*:35*//*67:*/
160 #line 1232 "./ctie.w"
162 void usage_help();
163 void print_version_and_exit();
166 /*:67*/
167 #line 92 "./ctie.w"
169 /*7:*/
170 #line 162 "./ctie.w"
172 int history= spotless;
175 /*:7*//*15:*/
176 #line 286 "./ctie.w"
178 int total_include_files= 0;
180 /*:15*//*16:*/
181 #line 292 "./ctie.w"
183 file_index actual_input,test_input,no_ch;
184 file_types prod_chf= unknown;
185 out_md_type out_mode;
187 /*:16*//*18:*/
188 #line 309 "./ctie.w"
190 input_description*input_organisation[max_file_index+1];
193 /*:18*//*22:*/
194 #line 406 "./ctie.w"
196 boolean input_has_ended= false;
199 /*:22*//*39:*/
200 #line 742 "./ctie.w"
202 FILE*out_file;
203 string out_name;
206 /*:39*//*66:*/
207 #line 1217 "./ctie.w"
209 string CTIEHELP[]= {
210 "Usage: ctie -[mc] outfile master changefile(s)",
211 " Create a new master file or change file from the given",
212 " master (C)WEB file and changefiles.",
213 " All filenames are taken literally; no suffixes are added.",
215 "-m create a new master file from original (C)WEB and change file(s)",
216 "-c create a master change file for original (C)WEB file from changefile(s)",
217 "--help display this help and exit",
218 "--version display version information and exit",
219 NULL
223 /*:66*/
224 #line 93 "./ctie.w"
226 /*29:*/
227 #line 589 "./ctie.w"
229 void err_print(i,s)
230 file_index i;char*s;
232 char*k,*l;
233 fprintf(stderr,*s=='!'?"\n%s":"%s",s);
234 if(i>=0)/*30:*/
235 #line 611 "./ctie.w"
238 register input_description*inp_desc= input_organisation[i];
239 register include_description*inc_desc= inp_desc->current_include;
241 if(inc_desc!=NULL){
242 fprintf(stderr,". (l. %ld of include file %s",inc_desc->line,
243 inc_desc->file_name);
244 fprintf(stderr," included from l. %ld of %s file %s)\n",
245 inp_desc->line,
246 inp_desc->type_of_file==master?"master":"change",
247 inp_desc->file_name);
249 else
250 fprintf(stderr,". (l. %ld of %s file %s)\n",inp_desc->line,
251 inp_desc->type_of_file==master?"master":"change",
252 inp_desc->file_name);
253 l= (inp_desc->loc>=inp_desc->limit?inp_desc->limit:inp_desc->loc);
254 if(l> inp_desc->buffer){
255 for(k= inp_desc->buffer;k<l;k++)
256 if(*k=='\t')putc(' ',stderr);
257 else putc(*k,stderr);
258 putc('\n',stderr);
259 for(k= inp_desc->buffer;k<l;k++)
260 putc(' ',stderr);
262 for(k= l;k<inp_desc->limit;k++)
263 putc(*k,stderr);
264 putc('\n',stderr);
268 /*:30*/
269 #line 595 "./ctie.w"
271 else putc('\n',stderr);
272 fflush(stderr);
273 history= troublesome;
276 /*:29*//*36:*/
277 #line 699 "./ctie.w"
279 void pfatal_error(s,t)
280 char*s,*t;
282 char*strerr= strerror(errno);
284 fprintf(stderr,"\n%s%s",s,t);
285 if(strerr)fprintf(stderr," (%s)\n",strerr);
286 else fprintf(stderr,"\n");
287 history= fatal;
288 exit(wrap_up());
292 /*:36*/
293 #line 94 "./ctie.w"
295 /*19:*/
296 #line 328 "./ctie.w"
298 boolean get_line(i,do_includes)
299 file_index i;boolean do_includes;
301 register input_description*inp_desc= input_organisation[i];
302 register FILE*fp;
304 if(inp_desc->mode==ignore)return false;
306 restart:
307 if(inp_desc->current_include!=NULL){
308 register include_description*inc_desc= inp_desc->current_include;
310 fp= inc_desc->the_file;
311 /*24:*/
312 #line 426 "./ctie.w"
315 register int c;
316 register char*k;
318 if(feof(fp))
319 /*25:*/
320 #line 452 "./ctie.w"
323 include_description*temp= inc_desc->parent;
325 fclose(fp);
326 free(inc_desc);
327 total_include_files--;
328 inp_desc->current_include= temp;
329 goto restart;
333 /*:25*/
334 #line 432 "./ctie.w"
337 inp_desc->limit= k= inp_desc->buffer;
338 while(k<=inp_desc->buffer_end&&(c= getc(fp))!=EOF&&c!='\n')
339 if((*(k++)= c)!=' ')inp_desc->limit= k;
340 if(k> inp_desc->buffer_end)
341 if((c= getc(fp))!=EOF&&c!='\n'){
342 ungetc(c,fp);inp_desc->loc= inp_desc->buffer;
343 err_print(i,"! Input line too long");
346 if(c==EOF&&inp_desc->limit==inp_desc->buffer)
347 /*25:*/
348 #line 452 "./ctie.w"
351 include_description*temp= inc_desc->parent;
353 fclose(fp);
354 free(inc_desc);
355 total_include_files--;
356 inp_desc->current_include= temp;
357 goto restart;
361 /*:25*/
362 #line 444 "./ctie.w"
365 inc_desc->line++;
368 /*:24*/
369 #line 342 "./ctie.w"
372 else{
373 fp= inp_desc->the_file;
374 /*20:*/
375 #line 366 "./ctie.w"
378 register int c;
379 register char*k;
381 if(feof(fp))
382 /*21:*/
383 #line 394 "./ctie.w"
386 inp_desc->mode= ignore;
387 inp_desc->limit= NULL;
388 if(inp_desc->type_of_file==master)input_has_ended= true;
389 fclose(fp);
390 return false;
394 /*:21*/
395 #line 372 "./ctie.w"
398 inp_desc->limit= k= inp_desc->buffer;
399 while(k<=inp_desc->buffer_end&&(c= getc(fp))!=EOF&&c!='\n')
400 if((*(k++)= c)!=' ')inp_desc->limit= k;
401 if(k> inp_desc->buffer_end)
402 if((c= getc(fp))!=EOF&&c!='\n'){
403 ungetc(c,fp);inp_desc->loc= inp_desc->buffer;
404 err_print(i,"! Input line too long");
407 if(c==EOF&&inp_desc->limit==inp_desc->buffer)
408 /*21:*/
409 #line 394 "./ctie.w"
412 inp_desc->mode= ignore;
413 inp_desc->limit= NULL;
414 if(inp_desc->type_of_file==master)input_has_ended= true;
415 fclose(fp);
416 return false;
420 /*:21*/
421 #line 384 "./ctie.w"
424 /*23:*/
425 #line 414 "./ctie.w"
427 inp_desc->line++;
428 if(inp_desc->type_of_file==master&&inp_desc->line%100==0){
429 if(inp_desc->line%500==0)printf("%ld",inp_desc->line);
430 else putchar('.');
431 fflush(stdout);
435 /*:23*/
436 #line 387 "./ctie.w"
441 /*:20*/
442 #line 346 "./ctie.w"
446 if(do_includes)
447 /*26:*/
448 #line 467 "./ctie.w"
451 inp_desc->loc= inp_desc->buffer;
452 *inp_desc->limit= ' ';
453 if(*inp_desc->buffer=='@'&&
454 (inp_desc->buffer[1]=='i'||inp_desc->buffer[1]=='I')){
455 inp_desc->loc= inp_desc->buffer+2;
456 *inp_desc->limit= '"';
457 while(*inp_desc->loc==' '||*inp_desc->loc=='\t')
458 inp_desc->loc++;
459 if(inp_desc->loc>=inp_desc->limit){
460 err_print(i,"! Include file name not given");
462 goto restart;
464 if(total_include_files>=max_include_files){
465 err_print(i,"! Too many nested includes");
467 goto restart;
469 total_include_files++;
470 /*27:*/
471 #line 507 "./ctie.w"
474 include_description*new_inc;
475 char temp_file_name[max_file_name_length];
476 char*file_name_end;
477 char*k,*kk;
478 int l;
480 new_inc= (include_description*)malloc(sizeof(include_description));
481 if(new_inc==NULL)
482 fatal_error(i,"! No memory for new include descriptor","");
483 new_inc->line= 0;
484 k= new_inc->file_name;
485 file_name_end= k+max_file_name_length-1;
487 if(*inp_desc->loc=='"'){
488 inp_desc->loc++;
489 while(*inp_desc->loc!='"'&&k<=file_name_end)
490 *k++= *inp_desc->loc++;
491 if(inp_desc->loc==inp_desc->limit)
492 k= file_name_end+1;
493 }else
494 while(*inp_desc->loc!=' '&&*inp_desc->loc!='\t'&&
495 *inp_desc->loc!='"'&&k<=file_name_end)*k++= *inp_desc->loc++;
496 if(k> file_name_end)too_long();
498 *k= '\0';
499 if((new_inc->the_file= fopen(new_inc->file_name,"r"))!=NULL){
500 new_inc->parent= inp_desc->current_include;
501 inp_desc->current_include= new_inc;
502 goto restart;
504 kk= getenv("CWEBINPUTS");
505 if(kk!=NULL){
506 if((l= strlen(kk))> max_file_name_length-2)too_long();
507 strcpy(temp_file_name,kk);
509 else{
510 #ifdef CWEBINPUTS
511 if((l= strlen(CWEBINPUTS))> max_file_name_length-2)too_long();
512 strcpy(temp_file_name,CWEBINPUTS);
513 #else
514 l= 0;
515 #endif
517 if(l> 0){
518 if(k+l+2>=file_name_end)too_long();
519 for(;k>=new_inc->file_name;k--)*(k+l+1)= *k;
520 strcpy(new_inc->file_name,temp_file_name);
521 new_inc->file_name[l]= '/';
522 if((new_inc->the_file= fopen(new_inc->file_name,"r"))!=NULL){
523 new_inc->parent= inp_desc->current_include;
524 inp_desc->current_include= new_inc;
525 goto restart;
528 total_include_files--;
529 free(new_inc);
530 err_print(i,"! Cannot open include file");
532 goto restart;
537 /*:27*/
538 #line 488 "./ctie.w"
544 /*:26*/
545 #line 351 "./ctie.w"
547 return true;
551 /*:19*//*32:*/
552 #line 663 "./ctie.w"
554 int wrap_up()
556 /*34:*/
557 #line 682 "./ctie.w"
559 switch(history){
560 case spotless:
561 printf("\n(No errors were found.)\n");break;
562 case troublesome:
563 printf("\n(Pardon me, but I think I spotted something wrong.)\n");break;
564 case fatal:printf("(That was a fatal error, my friend.)\n");
568 /*:34*/
569 #line 666 "./ctie.w"
571 if(history> spotless)return 1;
572 else return 0;
575 /*:32*//*42:*/
576 #line 791 "./ctie.w"
578 boolean lines_dont_match(i,j)
579 file_index i,j;
581 register input_description*iptr= input_organisation[i],
582 *jptr= input_organisation[j];
584 if(iptr->limit-iptr->buffer!=jptr->limit-jptr->buffer)
585 return true;
586 return strncmp(iptr->buffer,jptr->buffer,iptr->limit-iptr->buffer);
590 /*:42*//*43:*/
591 #line 808 "./ctie.w"
593 void init_change_file(i)
594 file_index i;
596 register input_description*inp_desc= input_organisation[i];
597 char ccode;
599 inp_desc->limit= inp_desc->buffer;
600 /*44:*/
601 #line 827 "./ctie.w"
603 while(1){
604 if(!get_line(i,false))return;
605 if(inp_desc->limit<inp_desc->buffer+2)continue;
606 if(inp_desc->buffer[0]!='@')continue;
607 ccode= inp_desc->buffer[1];
608 if(xisupper(ccode))ccode= tolower(ccode);
609 if(ccode=='x')break;
610 if(ccode=='y'||ccode=='z'||ccode=='i'){
611 inp_desc->loc= inp_desc->buffer+2;
612 err_print(i,"! Missing @x in change file");
617 /*:44*/
618 #line 816 "./ctie.w"
620 /*45:*/
621 #line 844 "./ctie.w"
624 if(!get_line(i,true)){
625 err_print(i,"! Change file ended after @x");
627 return;
629 }while(inp_desc->limit==inp_desc->buffer);
632 /*:45*/
633 #line 817 "./ctie.w"
635 inp_desc->dont_match= 0;
639 /*:43*//*46:*/
640 #line 857 "./ctie.w"
642 void put_line(j)
643 file_index j;
645 char*ptr= input_organisation[j]->buffer;
646 char*lmt= input_organisation[j]->limit;
648 while(ptr<lmt)putc(*ptr++,out_file);
649 putc('\n',out_file);
653 /*:46*//*47:*/
654 #line 872 "./ctie.w"
656 boolean e_of_ch_module(i)
657 file_index i;
659 register input_description*inp_desc= input_organisation[i];
661 if(inp_desc->limit==NULL){
662 err_print(i,"! Change file ended without @z");
664 return true;
665 }else if(inp_desc->limit>=inp_desc->buffer+2)
666 if(inp_desc->buffer[0]=='@'&&
667 (inp_desc->buffer[1]=='Z'||inp_desc->buffer[1]=='z'))
668 return true;
669 return false;
673 /*:47*//*48:*/
674 #line 893 "./ctie.w"
676 boolean e_of_ch_preamble(i)
677 file_index i;
679 register input_description*inp_desc= input_organisation[i];
681 if(inp_desc->limit>=inp_desc->buffer+2&&inp_desc->buffer[0]=='@')
682 if(inp_desc->buffer[1]=='Y'||inp_desc->buffer[1]=='y'){
683 if(inp_desc->dont_match> 0){
684 inp_desc->loc= inp_desc->buffer+2;
685 fprintf(stderr,"\n! Hmm... %d ",inp_desc->dont_match);
686 err_print(i,"of the preceding lines failed to match");
688 return true;
690 return false;
695 /*:48*//*59:*/
696 #line 1105 "./ctie.w"
698 void usage_error()
700 /*60:*/
701 #line 1118 "./ctie.w"
703 printf("%s\n",banner);
704 printf("%s\n",copyright);
707 /*:60*/
708 #line 1108 "./ctie.w"
710 fprintf(stderr,"Usage: ctie -[mc] outfile master changefile(s)\n");
711 fprintf(stderr,"Type ctie --help for more information\n");
712 exit(1);
716 /*:59*/
717 #line 95 "./ctie.w"
719 /*3:*/
720 #line 101 "./ctie.w"
722 main(argc,argv)
723 int argc;string*argv;
725 /*17:*/
726 #line 300 "./ctie.w"
728 actual_input= 0;
729 out_mode= normal;
731 /*:17*/
732 #line 105 "./ctie.w"
734 /*61:*/
735 #line 1135 "./ctie.w"
738 if(argc> max_file_index+5-1)usage_error();
739 no_ch= -1;
740 while(--argc> 0){
741 argv++;
742 if(strcmp("-help",*argv)==0||strcmp("--help",*argv)==0)
743 /*64:*/
744 #line 1202 "./ctie.w"
746 usage_help();
750 /*:64*/
751 #line 1142 "./ctie.w"
753 if(strcmp("-version",*argv)==0||strcmp("--version",*argv)==0)
754 /*65:*/
755 #line 1208 "./ctie.w"
758 print_version_and_exit("CTIE",version_number);
763 /*:65*/
764 #line 1144 "./ctie.w"
766 if(**argv=='-')/*62:*/
767 #line 1158 "./ctie.w"
769 if(prod_chf!=unknown)usage_error();
770 else
771 switch(*(*argv+1)){
772 case'c':case'C':prod_chf= chf;break;
773 case'm':case'M':prod_chf= master;break;
774 default:usage_error();
778 /*:62*/
779 #line 1145 "./ctie.w"
781 else/*63:*/
782 #line 1172 "./ctie.w"
785 if(no_ch==(-1)){
786 out_name= *argv;
787 }else{
788 register input_description*inp_desc;
790 inp_desc= (input_description*)malloc(sizeof(input_description));
791 if(inp_desc==NULL)
792 fatal_error(-1,"! No memory for input descriptor","");
794 inp_desc->mode= search;
795 inp_desc->line= 0;
796 inp_desc->type_of_file= chf;
797 inp_desc->limit= inp_desc->buffer;
798 inp_desc->buffer[0]= ' ';
799 inp_desc->loc= inp_desc->buffer+1;
800 inp_desc->buffer_end= inp_desc->buffer+buf_size-2;
801 inp_desc->file_name= *argv;
802 inp_desc->current_include= NULL;
803 input_organisation[no_ch]= inp_desc;
805 no_ch++;
809 /*:63*/
810 #line 1146 "./ctie.w"
813 if(no_ch<=0||prod_chf==unknown)usage_error();
817 /*:61*/
818 #line 106 "./ctie.w"
820 /*60:*/
821 #line 1118 "./ctie.w"
823 printf("%s\n",banner);
824 printf("%s\n",copyright);
827 /*:60*/
828 #line 107 "./ctie.w"
830 /*40:*/
831 #line 750 "./ctie.w"
834 input_organisation[0]->the_file=
835 fopen(input_organisation[0]->file_name,"r");
837 if(input_organisation[0]->the_file==NULL)
838 pfatal_error("! Cannot open master file ",
839 input_organisation[0]->file_name);
841 printf("(%s)\n",input_organisation[0]->file_name);
842 input_organisation[0]->type_of_file= master;
843 get_line(0,true);
847 /*:40*/
848 #line 108 "./ctie.w"
850 /*41:*/
851 #line 768 "./ctie.w"
854 file_index i;
856 i= 1;
857 while(i<no_ch){
858 input_organisation[i]->the_file=
859 fopen(input_organisation[i]->file_name,"r");
860 if(input_organisation[i]->the_file==NULL)
861 pfatal_error("! Cannot open change file ",
862 input_organisation[i]->file_name);
864 printf("(%s)\n",input_organisation[i]->file_name);
865 init_change_file(i);
866 i++;
871 /*:41*/
872 #line 109 "./ctie.w"
874 /*38:*/
875 #line 729 "./ctie.w"
878 out_file= fopen(out_name,"w");
879 if(out_file==NULL){
880 pfatal_error("! Cannot open/create output file","");
886 /*:38*/
887 #line 110 "./ctie.w"
889 /*57:*/
890 #line 1074 "./ctie.w"
892 actual_input= 0;
893 input_has_ended= false;
894 while(input_has_ended==false||actual_input!=0)
895 /*49:*/
896 #line 917 "./ctie.w"
899 file_index test_file;
901 /*50:*/
902 #line 934 "./ctie.w"
905 register input_description*inp_desc;
906 while(actual_input> 0&&e_of_ch_module(actual_input)){
907 inp_desc= input_organisation[actual_input];
908 if(inp_desc->type_of_file==master){
910 fatal_error(-1,"! This can't happen: change file is master file","");
913 inp_desc->mode= search;
914 init_change_file(actual_input);
915 while((input_organisation[actual_input]->mode!=reading
916 &&actual_input> 0))
917 actual_input--;
922 /*:50*/
923 #line 921 "./ctie.w"
925 if(input_has_ended&&actual_input==0)break;
926 /*51:*/
927 #line 960 "./ctie.w"
929 test_input= none;
930 test_file= actual_input;
931 while(test_input==none&&test_file<no_ch-1){
932 test_file++;
933 switch(input_organisation[test_file]->mode){
934 case search:
935 if(lines_dont_match(actual_input,test_file)==false){
936 input_organisation[test_file]->mode= test;
937 test_input= test_file;
939 break;
940 case test:
941 if(lines_dont_match(actual_input,test_file)){
943 input_organisation[test_file]->dont_match++;
945 test_input= test_file;
946 break;
947 case reading:
948 break;
949 case ignore:
950 break;
955 /*:51*/
956 #line 923 "./ctie.w"
958 /*52:*/
959 #line 993 "./ctie.w"
961 if(prod_chf==chf){
962 while(1){
963 /*53:*/
964 #line 1007 "./ctie.w"
966 if(out_mode==normal){
967 if(test_input!=none){
968 fprintf(out_file,"@x\n");
969 out_mode= pre;
970 }else break;
974 /*:53*/
975 #line 996 "./ctie.w"
977 /*54:*/
978 #line 1021 "./ctie.w"
980 if(out_mode==pre){
981 if(test_input==none){
982 fprintf(out_file,"@y\n");
983 out_mode= post;
984 }else{
985 if(input_organisation[actual_input]->type_of_file==master)
986 put_line(actual_input);
987 break;
992 /*:54*/
993 #line 997 "./ctie.w"
995 /*55:*/
996 #line 1040 "./ctie.w"
998 if(out_mode==post){
999 if(input_organisation[actual_input]->type_of_file==chf){
1000 if(test_input==none)put_line(actual_input);
1001 break;
1002 }else{
1003 fprintf(out_file,"@z\n\n");
1004 out_mode= normal;
1009 /*:55*/
1010 #line 998 "./ctie.w"
1013 }else
1014 if(test_input==none)put_line(actual_input);
1017 /*:52*/
1018 #line 924 "./ctie.w"
1020 /*56:*/
1021 #line 1055 "./ctie.w"
1023 get_line(actual_input,true);
1024 if(test_input!=none){
1025 get_line(test_input,true);
1026 if(e_of_ch_preamble(test_input)==true){
1027 get_line(test_input,true);
1028 input_organisation[test_input]->mode= reading;
1029 actual_input= test_input;
1030 test_input= none;
1035 /*:56*/
1036 #line 925 "./ctie.w"
1041 /*:49*/
1042 #line 1078 "./ctie.w"
1044 if(out_mode==post)
1045 fprintf(out_file,"@z\n");
1048 /*:57*/
1049 #line 111 "./ctie.w"
1051 /*58:*/
1052 #line 1087 "./ctie.w"
1055 file_index i;
1057 for(i= 1;i<no_ch;i++){
1058 if(input_organisation[i]->mode!=ignore){
1059 input_organisation[i]->loc= input_organisation[i]->buffer;
1060 err_print(i,"! Change file entry did not match");
1067 /*:58*/
1068 #line 112 "./ctie.w"
1070 exit(wrap_up());
1073 /*:3*/
1074 #line 96 "./ctie.w"
1077 /*:2*//*68:*/
1078 #line 1237 "./ctie.w"
1080 void usage_help()
1082 string*message= CTIEHELP;
1084 while(*message){
1085 fputs(*message,stdout);
1086 putchar('\n');
1087 ++message;
1089 putchar('\n');
1090 exit(0);
1094 /*:68*//*69:*/
1095 #line 1252 "./ctie.w"
1097 void print_version_and_exit(name,version)
1098 string name,version;
1100 printf("%s %s\n",name,version);
1102 puts("Copyright (C) 2002,2003 Julian Gilbey.");
1104 puts("There is NO warranty. This is free software. See the source");
1105 puts("code of CTIE for redistribution conditions.");
1107 exit(0);
1111 /*:69*/