- if (is_summary_line(lines[i])) {
- function = talloc_strndup(list, lines[i],
- strcspn(lines[i], " "));
- curr = new_section(list, function, "summary");
- add_line(curr, strstr(lines[i], " - ") + 3);
- curr = new_section(list, function, "description");
- } else if (is_section(lines[i], false)) {
- char *type = talloc_strndup(curr, lines[i],
- strcspn(lines[i], ":"));
- curr = new_section(list, function, type);
- } else if (is_section(lines[i], true)) {
- unsigned int sectlen = strcspn(lines[i], ":");
- char *type = talloc_strndup(curr, lines[i], sectlen);
- curr = new_section(list, function, type);
- add_line(curr, lines[i] + sectlen + 1
- + strspn(lines[i] + sectlen + 1, " \t"));
+ unsigned funclen;
+ char *type, *extra;
+
+ funclen = is_summary_line(lines[i]);
+ if (funclen) {
+ function = talloc_strndup(list, lines[i], funclen);
+ curr = new_section(list, function, "summary",
+ linemap[i]);
+ add_line(curr, lines[i] + funclen + 3);
+ curr = new_section(list, function, "description",
+ linemap[i]);
+ } else if ((type = is_section(list, lines[i], &extra)) != NULL){
+ curr = new_section(list, function, type, linemap[i]);
+ if (!streq(extra, "")) {
+ add_line(curr, extra);
+ curr = NULL;
+ }