#include #include #include #include "vtkParse.h" /* print the parsed structures */ void vtkParseOutput(FILE *fp, FileInfo *data) { int i,closed,no_methods; fprintf(fp,"\n"); fprintf(fp,"\n\n"); fprintf(fp,"
\nDocumentation for %s
\n", data->ClassName); fprintf(fp,"\n"); fprintf(fp,"
\n"); if (data->NameComment) { fprintf(fp,"

%s

\n\n",data->NameComment); } else { fprintf(fp,"

%s - no description provided.

\n\n",data->ClassName); } fprintf(fp,"
\n"); if (data->NumberOfSuperClasses > 0) { fprintf(fp,"

Super Class: %s

\n", data->SuperClasses[0], data->SuperClasses[0]); } fprintf(fp,"

Description:

\n\n
\n"); fprintf(fp,"

%s

\n
\n\n", data->Description ? data->Description : "None provided."); if (data->Caveats) { fprintf(fp,"

Caveats:

\n\n
\n"); fprintf(fp,"

%s

\n
\n\n", data->Caveats); } if (data->SeeAlso) { char *dup, *tok; fprintf(fp,"

See Also:

\n\n
\n"); fprintf(fp,"

"); /* change simple see also into html references */ dup = strdup(data->SeeAlso); tok = strtok(dup," "); while (tok) { if (!strncmp("vtk",tok,3)) { fprintf(fp,"%s ",tok, tok); } else { fprintf(fp,"%s ",tok); } tok = strtok(NULL," "); } fprintf(fp,"

\n
\n\n"); free(dup); } fprintf(fp,"

 

\n\n"); fprintf(fp,"
\n"); no_methods = 1; fprintf(fp,"

Public Methods:

\n\n
    \n\n"); for (i = 0; i < data->NumberOfFunctions; i++) { if (data->Functions[i].Name && data->Functions[i].IsPublic) { no_methods = 0; if (data->Functions[i].Comment) { fprintf(fp,"
  • %s
  • ", i, data->Functions[i].Signature); } else { fprintf(fp,"
  • %s
  • ", data->Functions[i].Signature); } } } if (no_methods) { fprintf(fp,"
  • %s
  • ","[no public methods]"); } fprintf(fp,"
\n\n"); fprintf(fp,"

 

\n\n"); no_methods = 1; fprintf(fp,"

Protected Methods:

\n\n
    \n\n"); for (i = 0; i < data->NumberOfFunctions; i++) { if (data->Functions[i].Name && data->Functions[i].IsProtected) { no_methods = 0; if (data->Functions[i].Comment) { fprintf(fp,"
  • %s
  • ", i, data->Functions[i].Signature); } else { fprintf(fp,"
  • %s
  • ", data->Functions[i].Signature); } } } if (no_methods) { fprintf(fp,"
  • %s
  • ","[no protected methods]"); } fprintf(fp,"
\n\n"); fprintf(fp,"

 

\n\n"); no_methods = 1; fprintf(fp,"

Private Methods:

\n\n
    \n\n"); for (i = 0; i < data->NumberOfFunctions; i++) { if (data->Functions[i].Name && !(data->Functions[i].IsProtected || data->Functions[i].IsPublic)) { no_methods = 0; if (data->Functions[i].Comment) { fprintf(fp,"
  • %s
  • ", i, data->Functions[i].Signature); } else { fprintf(fp,"
  • %s
  • ", data->Functions[i].Signature); } } } if (no_methods) { fprintf(fp,"
  • %s
  • ","[no private methods]"); } fprintf(fp,"
\n\n"); fprintf(fp,"

 

\n\n"); fprintf(fp,"
\n"); fprintf(fp,"

Detailed Method Descriptions:


\n"); closed = 1; for (i = 0; i < data->NumberOfFunctions; i++) { if (data->Functions[i].Name && data->Functions[i].Comment) { if (closed) { fprintf(fp,"
    \n"); closed = 0; } fprintf(fp,"
  • %s%s
  • \n", i, data->Functions[i].Signature, ((data->Functions[i].IsPublic) ? "" : (data->Functions[i].IsProtected) ? " [protected]" : " [private]")); /* if we have a comment */ if (data->Functions[i].Comment) { /* and this is the last method */ if (i == (data->NumberOfFunctions - 1) || /* or it isn't the last */ (i < (data->NumberOfFunctions - 1) && /* and the next comment either doesn't exist */ (!data->Functions[i+1].Comment || /* or it does exist but is different */ (data->Functions[i+1].Comment && strcmp(data->Functions[i].Comment, data->Functions[i+1].Comment))))) { closed = 1; fprintf(fp,"
    "); fprintf(fp,"

    %s

    \n

\n\n", data->Functions[i].Comment); } } } } fprintf(fp,"

 

\n\n\n"); }