asn1: JSON output open type IDs
Include open type IDs in JSON output of ASN.1 compiler.
This commit is contained in:

committed by
Nico Williams

parent
6a3604caf1
commit
bc3d9c0115
@@ -1118,6 +1118,7 @@ define_open_type(int level, const char *newbasename, const char *name, const cha
|
|||||||
/* Iterate objects in the object set, gen enum labels */
|
/* Iterate objects in the object set, gen enum labels */
|
||||||
fprintf(headerfile, "enum { choice_%s_iosnumunknown = 0,\n",
|
fprintf(headerfile, "enum { choice_%s_iosnumunknown = 0,\n",
|
||||||
newbasename);
|
newbasename);
|
||||||
|
fprintf(jsonfile, "\"opentypeids\":[");
|
||||||
for (i = 0; i < nobjs; i++) {
|
for (i = 0; i < nobjs; i++) {
|
||||||
HEIM_TAILQ_FOREACH(of, objects[i]->objfields, objfields) {
|
HEIM_TAILQ_FOREACH(of, objects[i]->objfields, objfields) {
|
||||||
if (strcmp(of->name, typeidfield->name) != 0)
|
if (strcmp(of->name, typeidfield->name) != 0)
|
||||||
@@ -1127,8 +1128,11 @@ define_open_type(int level, const char *newbasename, const char *name, const cha
|
|||||||
of->name, objects[i]->symbol->name);
|
of->name, objects[i]->symbol->name);
|
||||||
fprintf(headerfile, "choice_%s_iosnum_%s,\n",
|
fprintf(headerfile, "choice_%s_iosnum_%s,\n",
|
||||||
newbasename, of->value->s->gen_name);
|
newbasename, of->value->s->gen_name);
|
||||||
|
fprintf(jsonfile, "\"%s\"", of->value->s->gen_name);
|
||||||
|
fprintf(jsonfile, "%s", (i + 1) < nobjs ? "," : "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fprintf(jsonfile, "],\n");
|
||||||
fprintf(headerfile, "} element;\n");
|
fprintf(headerfile, "} element;\n");
|
||||||
|
|
||||||
if (is_array_of_open_type)
|
if (is_array_of_open_type)
|
||||||
|
Reference in New Issue
Block a user