restored docwriteref functionality

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6910 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
sireus
2012-10-06 23:18:20 +00:00
parent b33116712c
commit d335f003b9
+5 -12
View File
@@ -283,7 +283,7 @@ char *xmlstringenc(char *d, const char *s, size_t len)
void docwriteref(int allidents, const char *ref, const char *schemalocation, const char *transformation)
{
/*stream *f = openfile(path(allidents < 0 ? "docs/autogenerated_base_reference.xml" : "docs/autogenerated_todo_reference.xml", true), "w");
stream *f = openfile(path(allidents < 0 ? "docs/autogenerated_base_reference.xml" : "docs/autogenerated_todo_reference.xml", true), "w");
if(!f) return;
char desc[] = "<description>TODO: Description</description>";
@@ -304,7 +304,6 @@ void docwriteref(int allidents, const char *ref, const char *schemalocation, con
f->printf("\t\t\t<identifiers>\n");
}
static const int bases[] = { "i", "s", "i", "i"F, ARG_1EST };
string name;
loopv(inames)
{
@@ -312,18 +311,12 @@ void docwriteref(int allidents, const char *ref, const char *schemalocation, con
if(!id || id->type != ID_COMMAND) continue;
f->printf("\t\t\t\t<command name=\"%s\">\n", xmlstringenc(name, id->name, MAXSTRLEN));
f->printf("\t\t\t\t\t%s\n", desc);
if(id->narg != "" && id->narg != "d" && id->narg != ARG_IVAL && id->narg != ARG_FVAL && id->narg != ARG_SVAL)
if(id->sig && id->sig[0])
{
f->printf("\t\t\t\t\t<arguments>\n");
if(id->narg == "c" || id->narg == "c"W || id->narg == ARG_VARI) f->printf("\t\t\t\t\t\t<variableArgument token=\"...\" description=\"TODO\"/>\n");
else
loopi(strlen(id->sig))
{
int base = -1;
loopj(sizeof(bases)/sizeof(bases[0]))
{
if(id->narg < bases[j]) { if(j) base = bases[j-1]; break; }
}
if(base >= 0) loopj(id->narg-base+1) f->printf("\t\t\t\t\t\t<argument token=\"%c\" description=\"TODO\"/>\n", (char)(*"A")+j);
f->printf("\t\t\t\t\t\t<argument token=\"%c\" description=\"TODO\"/>\n", id->sig[i]);
}
f->printf("\t\t\t\t\t</arguments>\n");
}
@@ -358,7 +351,7 @@ void docwriteref(int allidents, const char *ref, const char *schemalocation, con
}
if(allidents < 0) f->printf("\t\t\t</identifiers>\n\t\t</section>\n\t</sections>\n</cuberef>\n");
delete f;*/
delete f;
}
void docwritebaseref(char *ref, char *schemalocation, char *transformation)