version 1.4, 2005/04/05 13:12:06 |
version 1.6, 2005/04/06 09:26:29 |
|
|
/* $OpenXM: OpenXM/src/util/oxgentexi.c,v 1.3 2005/04/04 12:38:32 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/util/oxgentexi.c,v 1.5 2005/04/06 05:08:11 takayama Exp $ */ |
|
|
#include <stdio.h> |
#include <stdio.h> |
int Debug = 0; |
int Debug = 0; |
Line 300 struct item *getItem() { |
|
Line 300 struct item *getItem() { |
|
int pp,pOld; |
int pp,pOld; |
int argc; |
int argc; |
int examplec = 0; |
int examplec = 0; |
|
int i; |
it = newItem(); |
it = newItem(); |
do { |
do { |
p = nextToken(key,LIMIT); |
p = nextToken(key,LIMIT); |
Line 379 struct item *getItem() { |
|
Line 380 struct item *getItem() { |
|
do { |
do { |
pOld = p; |
pOld = p; |
p = nextToken(key,LIMIT); |
p = nextToken(key,LIMIT); |
/* printf("%s\n",key); */ |
/* printf("key=%s\n",key); */ |
if (key[strlen(key)-1] == ':') break; /* Next keyword. */ |
if (key[strlen(key)-1] == ':') { |
|
pOld = p-strlen(key); |
|
break; /* Next keyword. */ |
|
} |
}while (p >= 0); |
}while (p >= 0); |
if (strcmp(key2,"description:") == 0) { |
if (strcmp(key2,"description:") == 0) { |
it->description = str2(&(S[pp]),pOld-pp); |
it->description = str2(&(S[pp]),pOld-pp); |
Line 422 struct item *getItem() { |
|
Line 426 struct item *getItem() { |
|
} |
} |
} |
} |
}else{ |
}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); |
p = nextToken(key,LIMIT); |
} |
} |
}while (p >= 0); |
}while (p >= 0); |
Line 512 printTexi_common(FILE *fp,struct item *it) { |
|
Line 520 printTexi_common(FILE *fp,struct item *it) { |
|
printTexi0(FILE *fp, struct item *it) { |
printTexi0(FILE *fp, struct item *it) { |
int i; |
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) { |
if (it == NULL) { |
fprintf(fp,"@c item is NULL.\n"); |
fprintf(fp,"@c item is NULL.\n"); |
return ; |
return ; |
Line 586 printTexi1(FILE *fp, struct item *it) { |
|
Line 594 printTexi1(FILE *fp, struct item *it) { |
|
int i; |
int i; |
/* For it->type == 1 */ |
/* 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) { |
if (it == NULL) { |
fprintf(fp,"@c item is NULL.\n"); |
fprintf(fp,"@c item is NULL.\n"); |
return ; |
return ; |
Line 620 outputExample(FILE *fp,char *s) { |
|
Line 628 outputExample(FILE *fp,char *s) { |
|
fprintf(fp,":"); i += 5; |
fprintf(fp,":"); i += 5; |
}else fprintf(fp,"@@"); |
}else fprintf(fp,"@@"); |
}else{ |
}else{ |
fputc(s[i],fp); |
if (s[i] == '{') {fprintf(fp,"%s","@{"); } |
|
else if (s[i] == '}') {fprintf(fp,"%s","@}");} |
|
else fputc(s[i],fp); |
} |
} |
} |
} |
} |
} |