=================================================================== RCS file: /home/cvs/OpenXM/src/asir-contrib/packages/doc/Attic/gentexi.c,v retrieving revision 1.3 retrieving revision 1.7 diff -u -p -r1.3 -r1.7 --- OpenXM/src/asir-contrib/packages/doc/Attic/gentexi.c 2002/02/09 08:50:48 1.3 +++ OpenXM/src/asir-contrib/packages/doc/Attic/gentexi.c 2002/10/23 01:14:16 1.7 @@ -1,4 +1,4 @@ - /* $OpenXM: OpenXM/src/asir-contrib/packages/doc/gentexi.c,v 1.2 2002/01/27 08:18:52 takayama Exp $ */ + /* $OpenXM: OpenXM/src/asir-contrib/packages/doc/gentexi.c,v 1.6 2002/10/23 01:11:41 takayama Exp $ */ #include int Debug = 0; @@ -15,6 +15,7 @@ struct item { char *optv[VMAX]; char *shortDescription; char *description; + char *algorithm; char *examplev[VMAX]; char *exampleDescv[VMAX]; int examplec; @@ -100,6 +101,8 @@ main(int argc,char *argv[]) { shell(items,n); if (Debug) fprintf(stderr,"Done.\n"); + printMenu(stdout,items,n); + for (i=0; iargc = 0; a->optc = 0; a->refc=0; a->examplec = 0; a->category = a->category2 = a->name = a->shortDescription - = a->description = a->author = NULL; + = a->description = a->author = a->algorithm = NULL; return a; } @@ -195,6 +198,8 @@ printItem(struct item *it) { printf("shortDescription=%s\n",it->shortDescription); if (it->description != NULL) printf("description=%s\n",it->description); + if (it->algorithm != NULL) + printf("algorithm=%s\n",it->algorithm); for (i=0; i examplec; i++) printf("examplev[%d]=%s\n",i,it->examplev[i]); for (i=0; i examplec; i++) @@ -271,7 +276,7 @@ struct item *getItem() { if (strcmp(key,"begin:") == 0) break; }while (p >= 0); if (p < 0) { - fprintf(stderr,"gentexi: End of input file.\n"); + /* fprintf(stderr,"gentexi: End of input file.\n"); */ return NULL; } p = nextToken(key,LIMIT); @@ -329,6 +334,7 @@ struct item *getItem() { /* Get Description or Examples */ if (strcmp(key,"end:") == 0) break; if (strcmp(key,"description:") == 0 || + strcmp(key,"algorithm:") == 0 || strcmp(key,"author:") == 0 || strcmp(key,"example:") == 0 || strcmp(key,"example_description:") ==0 ) { @@ -358,6 +364,9 @@ struct item *getItem() { if (strcmp(key2,"author:") == 0) { it->author = str2(&(S[pp]),pOld-pp); } + if (strcmp(key2,"algorithm:") == 0) { + it->algorithm = str2(&(S[pp]),pOld-pp); + } }else if (strcmp(key,"ref:") == 0) { argc = 0; while ((pp=nextToken(key,LIMIT)) >= 0) { @@ -373,8 +382,8 @@ struct item *getItem() { } } }else{ - fprintf(stderr,"Unknown keyword << %s >> at %s\n",key, it->name); - exit(10); + fprintf(stderr,"Warning: unknown keyword << %s >> at %s. Ignored.\n",key, it->name); + p = nextToken(key,LIMIT); } }while (p >= 0); @@ -396,6 +405,15 @@ shell(struct item *v[],int n) { } } +printMenu(FILE *fp, struct item **it, int n) { + int i; + + fprintf(fp,"@menu\n"); + for ( i = 0; i < n; i++ ) + fprintf(fp,"* %s::\n",it[i]->name); + fprintf(fp,"@end menu\n"); +} + printTexi(FILE *fp, struct item *it) { int i; fprintf(fp,"@c DO NOT EDIT THIS FILE. Generated by gentexi.\n"); @@ -408,9 +426,11 @@ printTexi(FILE *fp, struct item *it) { return ; } +#if 0 fprintf(fp,"@menu\n"); - fprintf(fp,"* %s\n",it->name); + fprintf(fp,"* %s::\n",it->name); fprintf(fp,"@end menu\n"); +#endif fprintf(fp,"@node %s,,, %s\n",it->name,Upnode); fprintf(fp,"@subsection @code{%s}\n",it->name); fprintf(fp,"@findex %s\n",it->name); @@ -464,6 +484,11 @@ printTexi(FILE *fp, struct item *it) { if (it->description != NULL) { fprintf(fp,"%s\n\n",it->description); + } + + if (it->algorithm != NULL) { + fprintf(fp,"\n\n@noindent\nAlgorithm: \n"); + fprintf(fp,"%s\n\n",it->algorithm); } if (it->examplec > 0) {