History

scripts: get_api.pl: Add sub-titles to ABI output

Instead of adding titles just for the files, add titles for each part of the ABI output, in order to make easier to search for a symbol there.

Mauro Carvalho Chehab committed 6 years ago

Commit 9d4fdda1 parent daaaf581 file · +17 −0Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/get_abi.pl+17−0
@@ -287,6 +287,8 @@ my $bondary = qr { (?<![\w\/\`\{])(?=[\w\/\`\{])|(?<=[\w\/\`\{])(?![\w\/\`\{]) } · 286 unmodified lines
287sub output_rest {287sub output_rest {
288 create_labels();288 create_labels();
289 289
290 my $part = "";
291
290 foreach my $what (sort {292 foreach my $what (sort {
291 ($data{$a}->{type} eq "File") cmp ($data{$b}->{type} eq "File") ||293 ($data{$a}->{type} eq "File") cmp ($data{$b}->{type} eq "File") ||
292 $a cmp $b294 $a cmp $b
@@ -306,6 +308,21 @@ sub output_rest { · 13 unmodified lines
306 $w =~ s/([\(\)\_\-\*\=\^\~\\])/\\$1/g;308 $w =~ s/([\(\)\_\-\*\=\^\~\\])/\\$1/g;
307 309
308 if ($type ne "File") {310 if ($type ne "File") {
311 my $cur_part = $what;
312 if ($what =~ '/') {
313 if ($what =~ m#^(\/?(?:[\w\-]+\/?){1,2})#) {
314 $cur_part = "Symbols under $1";
315 $cur_part =~ s,/$,,;
316 }
317 }
318
319 if ($cur_part ne "" && $part ne $cur_part) {
320 $part = $cur_part;
321 my $bar = $part;
322 $bar =~ s/./-/g;
323 print "$part\n$bar\n\n";
324 }
325
309 printf ".. _%s:\n\n", $data{$what}->{label};326 printf ".. _%s:\n\n", $data{$what}->{label};
310 327
311 my @names = split /, /,$w;328 my @names = split /, /,$w;