char *summary;
int since;
struct wl_list link;
+ struct description *description;
};
struct parse_context {
struct interface *interface;
struct message *message;
struct enumeration *enumeration;
+ struct entry *entry;
struct description *description;
char character_data[8192];
unsigned int character_data_length;
free(entry->uppercase_name);
free(entry->value);
free(entry->summary);
+ free_description(entry->description);
free(entry);
}
entry->summary = NULL;
wl_list_insert(ctx->enumeration->entry_list.prev,
&entry->link);
+ ctx->entry = entry;
} else if (strcmp(element_name, "description") == 0) {
if (summary == NULL)
fail(&ctx->loc, "description without summary");
if (ctx->message)
ctx->message->description = description;
+ else if (ctx->entry)
+ ctx->entry->description = description;
else if (ctx->enumeration)
ctx->enumeration->description = description;
else if (ctx->interface)
ctx->enumeration->name);
}
ctx->enumeration = NULL;
+ } else if (strcmp(name, "entry") == 0) {
+ ctx->entry = NULL;
} else if (strcmp(name, "protocol") == 0) {
struct interface *i;
}
printf("enum %s_%s {\n", interface->name, e->name);
wl_list_for_each(entry, &e->entry_list, link) {
- if (entry->summary || entry->since > 1) {
+ desc = entry->description;
+ if (entry->summary || entry->since > 1 || desc) {
printf("\t/**\n");
if (entry->summary)
printf("\t * %s\n", entry->summary);
+ if (desc) {
+ printf("\t * %s\n", desc->summary);
+ printf("\t *\n");
+ if (desc->text)
+ desc_dump(desc->text, "\t * ");
+ }
if (entry->since > 1)
printf("\t * @since %d\n", entry->since);
printf("\t */\n");