--- tools/dump-python.c.orig Mon May 7 14:41:58 2001 +++ tools/dump-python.c Mon May 7 14:41:39 2001 @@ -450,18 +450,31 @@ } } +static void fprintListElement(FILE *f, int indent, const char *tag, + SmiElement *smiElement) +{ + SmiModule *smiModule; + SmiNode *smiNode; + + for (; smiElement; smiElement = smiGetNextElement(smiElement)) { + smiNode = smiGetElementNode(smiElement); + fprintSegment(f, indent, "", 0); + fprint(f, "\"%s\",\n", smiNode->name); + } +} + static void fprintIndexModule(FILE *f, int indent, const char *modname, const char *nodename, const char *indexkind) { fprintSegment(f, indent + INDENT, "", 0); - fprint(f, "\"%s\" : {\n", modname); + fprint(f, "{ \"%s\" : {\n", modname); fprintSegment(f, indent + (2 * INDENT), "", 0); fprint(f, "\"indexkind\" : \"%s\",\n", indexkind); fprintSegment(f, indent + (2 * INDENT), "", 0); fprint(f, "\"relatedNode\" : \"%s\",\n", nodename); - fprintSegment(f, indent + INDENT, "},\n", 0); + fprintSegment(f, indent + INDENT, "}},\n", 0); } @@ -471,9 +484,9 @@ SmiNode *relatedNode; SmiModule *relatedModule = NULL; - fprintSegment(f, indent, "\"linkage\" : {\n", 0); + fprintSegment(f, indent, "\"linkage\" : [\n", 0); if (smiNode->implied) { - fprintSegment(f, indent + INDENT, "\"implied\" : \"true\",\n", 0); + /* fprintSegment(f, indent + INDENT, "\"implied\" : \"true\",\n", 0); */ } relatedNode = smiGetRelatedNode(smiNode); @@ -482,7 +495,7 @@ } switch (smiNode->indexkind) { case SMI_INDEX_INDEX: - fprintElementList(f, indent + INDENT, "index", + fprintListElement(f, indent + INDENT, "index", smiGetFirstElement(smiNode)); break; case SMI_INDEX_AUGMENT: @@ -514,7 +527,7 @@ case SMI_INDEX_UNKNOWN: break; } - fprintSegment(f, indent, "},\n", 0); + fprintSegment(f, indent, "],\n", 0); }