=================================================================== RCS file: /home/cvs/OpenXM/src/util/oxgentexi.c,v retrieving revision 1.3 retrieving revision 1.6 diff -u -p -r1.3 -r1.6 --- OpenXM/src/util/oxgentexi.c 2005/04/04 12:38:32 1.3 +++ OpenXM/src/util/oxgentexi.c 2005/04/06 09:26:29 1.6 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/util/oxgentexi.c,v 1.2 2005/04/04 07:36:44 takayama Exp $ */ +/* $OpenXM: OpenXM/src/util/oxgentexi.c,v 1.5 2005/04/06 05:08:11 takayama Exp $ */ #include int Debug = 0; @@ -41,6 +41,7 @@ int GenExample = 0; int DebugItem = 0; char *Title = NULL; char *Author = NULL; +int NoSorting = 0; main(int argc,char *argv[]) { char *t; @@ -72,6 +73,8 @@ main(int argc,char *argv[]) { i++; Title = str(argv[i]); }else if (strcmp(argv[i],"--author") == 0) { i++; Author = str(argv[i]); + }else if (strcmp(argv[i],"--noSorting") == 0) { + NoSorting = 1; }else { fprintf(stderr,"Unknown option\n"); exit(1); } @@ -108,9 +111,12 @@ main(int argc,char *argv[]) { items[n++] = tt; } } - if (Debug) fprintf(stderr,"Sorting...\n"); - shell(items,n); - if (Debug) fprintf(stderr,"Done.\n"); + + if (!NoSorting) { + if (Debug) fprintf(stderr,"Sorting...\n"); + shell(items,n); + if (Debug) fprintf(stderr,"Done.\n"); + } if (DebugItem) { for (i=0; i= 0); if (strcmp(key2,"description:") == 0) { it->description = str2(&(S[pp]),pOld-pp); @@ -416,7 +426,11 @@ struct item *getItem() { } } }else{ - fprintf(stderr,"Warning: unknown keyword << %s >> at %s. Ignored.\n",key, it->name); + fprintf(stderr,"Error: unknown keyword << %s >> at %s.\n",key, it->name); + fprintf(stderr," The error occurs around "); + for (i=pp ; i < p; i++) fputc(S[i],stderr); + fprintf(stderr,"\n\n"); + exit(1); p = nextToken(key,LIMIT); } }while (p >= 0); @@ -506,7 +520,7 @@ printTexi_common(FILE *fp,struct item *it) { printTexi0(FILE *fp, struct item *it) { int i; - fprintf(fp,"@c DO NOT EDIT THIS FILE. Generated by gentexi0.\n"); + fprintf(fp,"@c DO NOT EDIT THIS FILE. Generated by gentexi for asir function item.\n"); if (it == NULL) { fprintf(fp,"@c item is NULL.\n"); return ; @@ -580,7 +594,7 @@ printTexi1(FILE *fp, struct item *it) { int i; /* For it->type == 1 */ - fprintf(fp,"@c DO NOT EDIT THIS FILE. Generated by gentexi1.\n"); + fprintf(fp,"@c DO NOT EDIT THIS FILE. Generated by gentexi for verbose item.\n"); if (it == NULL) { fprintf(fp,"@c item is NULL.\n"); return ; @@ -606,10 +620,18 @@ printTexi1(FILE *fp, struct item *it) { outputExample(FILE *fp,char *s) { int i; for (i=0; s[i] != 0; i++) { - if (s[i] == '{') fprintf(fp,"%s","@{"); - else if (s[i] == '}') fprintf(fp,"%s","@}"); - else if (s[i] == '@') fprintf(fp,"%s","@@"); - else fputc(s[i],fp); + if (s[i] == '@') { + if (s[i+1] == '{') {fprintf(fp,"%s","@{"); i += 1;} + else if (s[i+1] == '}') {fprintf(fp,"%s","@}"); i += 1;} + else if (s[i+1] == '@') {fprintf(fp,"%s","@@"); i += 1;} + else if (strncmp(&(s[i+1]),"colon",5)==0) { + fprintf(fp,":"); i += 5; + }else fprintf(fp,"@@"); + }else{ + if (s[i] == '{') {fprintf(fp,"%s","@{"); } + else if (s[i] == '}') {fprintf(fp,"%s","@}");} + else fputc(s[i],fp); + } } } @@ -642,7 +664,6 @@ outputOfExample(char *com) { printTitlePage(char *title, char *author) { printf("\\input texinfo\n"); - printf("@def@pi{PI}\n"); printf("@def@colon{:}\n\n"); printf("@iftex\n"); printf("@catcode`@#=6\n");