Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scripts: kernel-doc: get rid of unused output formats

Since there isn't any docbook code anymore upstream,
we can get rid of several output formats:

- docbook/xml, html, html5 and list formats were used by
the old build system;
- As ReST is text, there's not much sense on outputting
on a different text format.

After this patch, only man and rst output formats are
supported.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
b0514267 857af3b7

+4 -1179
+4 -1179
scripts/kernel-doc
··· 51 51 Documentation/doc-guide/kernel-doc.rst for the documentation comment syntax. 52 52 53 53 Output format selection (mutually exclusive): 54 - -docbook Output DocBook format. 55 - -html Output HTML format. 56 - -html5 Output HTML5 format. 57 - -list Output symbol list format. This is for use by docproc. 58 54 -man Output troff manual page format. This is the default. 59 55 -rst Output reStructuredText format. 60 - -text Output plain text format. 61 56 -none Do not output documentation, only warnings. 62 57 63 58 Output selection (mutually exclusive): ··· 220 225 my $type_union = '\&(union\s*([_\w]+))'; 221 226 my $type_member = '\&([_\w]+)(\.|->)([_\w]+)'; 222 227 my $type_fallback = '\&([_\w]+)'; 223 - my $type_enum_xml = '\&amp;(enum\s*([_\w]+))'; 224 - my $type_struct_xml = '\&amp;(struct\s*([_\w]+))'; 225 - my $type_typedef_xml = '\&amp;(typedef\s*([_\w]+))'; 226 - my $type_union_xml = '\&amp;(union\s*([_\w]+))'; 227 - my $type_member_xml = '\&amp;([_\w]+)(\.|-\&gt;)([_\w]+)'; 228 - my $type_fallback_xml = '\&amp([_\w]+)'; 229 228 my $type_member_func = $type_member . '\(\)'; 230 229 231 230 # Output conversion substitutions. 232 231 # One for each output format 233 - 234 - # these work fairly well 235 - my @highlights_html = ( 236 - [$type_constant, "<i>\$1</i>"], 237 - [$type_constant2, "<i>\$1</i>"], 238 - [$type_func, "<b>\$1</b>"], 239 - [$type_enum_xml, "<i>\$1</i>"], 240 - [$type_struct_xml, "<i>\$1</i>"], 241 - [$type_typedef_xml, "<i>\$1</i>"], 242 - [$type_union_xml, "<i>\$1</i>"], 243 - [$type_env, "<b><i>\$1</i></b>"], 244 - [$type_param, "<tt><b>\$1</b></tt>"], 245 - [$type_member_xml, "<tt><i>\$1</i>\$2\$3</tt>"], 246 - [$type_fallback_xml, "<i>\$1</i>"] 247 - ); 248 - my $local_lt = "\\\\\\\\lt:"; 249 - my $local_gt = "\\\\\\\\gt:"; 250 - my $blankline_html = $local_lt . "p" . $local_gt; # was "<p>" 251 - 252 - # html version 5 253 - my @highlights_html5 = ( 254 - [$type_constant, "<span class=\"const\">\$1</span>"], 255 - [$type_constant2, "<span class=\"const\">\$1</span>"], 256 - [$type_func, "<span class=\"func\">\$1</span>"], 257 - [$type_enum_xml, "<span class=\"enum\">\$1</span>"], 258 - [$type_struct_xml, "<span class=\"struct\">\$1</span>"], 259 - [$type_typedef_xml, "<span class=\"typedef\">\$1</span>"], 260 - [$type_union_xml, "<span class=\"union\">\$1</span>"], 261 - [$type_env, "<span class=\"env\">\$1</span>"], 262 - [$type_param, "<span class=\"param\">\$1</span>]"], 263 - [$type_member_xml, "<span class=\"literal\"><span class=\"struct\">\$1</span>\$2<span class=\"member\">\$3</span></span>"], 264 - [$type_fallback_xml, "<span class=\"struct\">\$1</span>"] 265 - ); 266 - my $blankline_html5 = $local_lt . "br /" . $local_gt; 267 - 268 - # XML, docbook format 269 - my @highlights_xml = ( 270 - ["([^=])\\\"([^\\\"<]+)\\\"", "\$1<quote>\$2</quote>"], 271 - [$type_constant, "<constant>\$1</constant>"], 272 - [$type_constant2, "<constant>\$1</constant>"], 273 - [$type_enum_xml, "<type>\$1</type>"], 274 - [$type_struct_xml, "<structname>\$1</structname>"], 275 - [$type_typedef_xml, "<type>\$1</type>"], 276 - [$type_union_xml, "<structname>\$1</structname>"], 277 - [$type_param, "<parameter>\$1</parameter>"], 278 - [$type_func, "<function>\$1</function>"], 279 - [$type_env, "<envar>\$1</envar>"], 280 - [$type_member_xml, "<literal><structname>\$1</structname>\$2<structfield>\$3</structfield></literal>"], 281 - [$type_fallback_xml, "<structname>\$1</structname>"] 282 - ); 283 - my $blankline_xml = $local_lt . "/para" . $local_gt . $local_lt . "para" . $local_gt . "\n"; 284 - 285 - # gnome, docbook format 286 - my @highlights_gnome = ( 287 - [$type_constant, "<replaceable class=\"option\">\$1</replaceable>"], 288 - [$type_constant2, "<replaceable class=\"option\">\$1</replaceable>"], 289 - [$type_func, "<function>\$1</function>"], 290 - [$type_enum, "<type>\$1</type>"], 291 - [$type_struct, "<structname>\$1</structname>"], 292 - [$type_typedef, "<type>\$1</type>"], 293 - [$type_union, "<structname>\$1</structname>"], 294 - [$type_env, "<envar>\$1</envar>"], 295 - [$type_param, "<parameter>\$1</parameter>" ], 296 - [$type_member, "<literal><structname>\$1</structname>\$2<structfield>\$3</structfield></literal>"], 297 - [$type_fallback, "<structname>\$1</structname>"] 298 - ); 299 - my $blankline_gnome = "</para><para>\n"; 300 232 301 233 # these are pretty rough 302 234 my @highlights_man = ( ··· 239 317 [$type_fallback, "\\\\fI\$1\\\\fP"] 240 318 ); 241 319 my $blankline_man = ""; 242 - 243 - # text-mode 244 - my @highlights_text = ( 245 - [$type_constant, "\$1"], 246 - [$type_constant2, "\$1"], 247 - [$type_func, "\$1"], 248 - [$type_enum, "\$1"], 249 - [$type_struct, "\$1"], 250 - [$type_typedef, "\$1"], 251 - [$type_union, "\$1"], 252 - [$type_param, "\$1"], 253 - [$type_member, "\$1\$2\$3"], 254 - [$type_fallback, "\$1"] 255 - ); 256 - my $blankline_text = ""; 257 320 258 321 # rst-mode 259 322 my @highlights_rst = ( ··· 258 351 [$type_param, "**\$1**"] 259 352 ); 260 353 my $blankline_rst = "\n"; 261 - 262 - # list mode 263 - my @highlights_list = ( 264 - [$type_constant, "\$1"], 265 - [$type_constant2, "\$1"], 266 - [$type_func, "\$1"], 267 - [$type_enum, "\$1"], 268 - [$type_struct, "\$1"], 269 - [$type_typedef, "\$1"], 270 - [$type_union, "\$1"], 271 - [$type_param, "\$1"], 272 - [$type_member, "\$1"], 273 - [$type_fallback, "\$1"] 274 - ); 275 - my $blankline_list = ""; 276 354 277 355 # read arguments 278 356 if ($#ARGV == -1) { ··· 393 501 394 502 while ($ARGV[0] =~ m/^-(.*)/) { 395 503 my $cmd = shift @ARGV; 396 - if ($cmd eq "-html") { 397 - $output_mode = "html"; 398 - @highlights = @highlights_html; 399 - $blankline = $blankline_html; 400 - } elsif ($cmd eq "-html5") { 401 - $output_mode = "html5"; 402 - @highlights = @highlights_html5; 403 - $blankline = $blankline_html5; 404 - } elsif ($cmd eq "-man") { 504 + if ($cmd eq "-man") { 405 505 $output_mode = "man"; 406 506 @highlights = @highlights_man; 407 507 $blankline = $blankline_man; 408 - } elsif ($cmd eq "-text") { 409 - $output_mode = "text"; 410 - @highlights = @highlights_text; 411 - $blankline = $blankline_text; 412 508 } elsif ($cmd eq "-rst") { 413 509 $output_mode = "rst"; 414 510 @highlights = @highlights_rst; 415 511 $blankline = $blankline_rst; 416 - } elsif ($cmd eq "-docbook") { 417 - $output_mode = "xml"; 418 - @highlights = @highlights_xml; 419 - $blankline = $blankline_xml; 420 - } elsif ($cmd eq "-list") { 421 - $output_mode = "list"; 422 - @highlights = @highlights_list; 423 - $blankline = $blankline_list; 424 - } elsif ($cmd eq "-gnome") { 425 - $output_mode = "gnome"; 426 - @highlights = @highlights_gnome; 427 - $blankline = $blankline_gnome; 428 512 } elsif ($cmd eq "-none") { 429 513 $output_mode = "none"; 430 514 } elsif ($cmd eq "-module") { # not needed for XML, inherits from calling document ··· 538 670 # confess "output_highlight got called with no args?\n"; 539 671 # } 540 672 541 - if ($output_mode eq "html" || $output_mode eq "html5" || 542 - $output_mode eq "xml") { 543 - $contents = local_unescape($contents); 544 - # convert data read & converted thru xml_escape() into &xyz; format: 545 - $contents =~ s/\\\\\\/\&/g; 546 - } 547 673 # print STDERR "contents b4:$contents\n"; 548 674 eval $dohighlight; 549 675 die $@ if $@; 550 676 # print STDERR "contents af:$contents\n"; 551 677 552 - # strip whitespaces when generating html5 553 - if ($output_mode eq "html5") { 554 - $contents =~ s/^\s+//; 555 - $contents =~ s/\s+$//; 556 - } 557 678 foreach $line (split "\n", $contents) { 558 679 if (! $output_preformatted) { 559 680 $line =~ s/^\s*//; ··· 561 704 } 562 705 print "\n"; 563 706 } 564 - } 565 - 566 - # output sections in html 567 - sub output_section_html(%) { 568 - my %args = %{$_[0]}; 569 - my $section; 570 - 571 - foreach $section (@{$args{'sectionlist'}}) { 572 - print "<h3>$section</h3>\n"; 573 - print "<blockquote>\n"; 574 - output_highlight($args{'sections'}{$section}); 575 - print "</blockquote>\n"; 576 - } 577 - } 578 - 579 - # output enum in html 580 - sub output_enum_html(%) { 581 - my %args = %{$_[0]}; 582 - my ($parameter); 583 - my $count; 584 - print "<h2>enum " . $args{'enum'} . "</h2>\n"; 585 - 586 - print "<b>enum " . $args{'enum'} . "</b> {<br>\n"; 587 - $count = 0; 588 - foreach $parameter (@{$args{'parameterlist'}}) { 589 - print " <b>" . $parameter . "</b>"; 590 - if ($count != $#{$args{'parameterlist'}}) { 591 - $count++; 592 - print ",\n"; 593 - } 594 - print "<br>"; 595 - } 596 - print "};<br>\n"; 597 - 598 - print "<h3>Constants</h3>\n"; 599 - print "<dl>\n"; 600 - foreach $parameter (@{$args{'parameterlist'}}) { 601 - print "<dt><b>" . $parameter . "</b>\n"; 602 - print "<dd>"; 603 - output_highlight($args{'parameterdescs'}{$parameter}); 604 - } 605 - print "</dl>\n"; 606 - output_section_html(@_); 607 - print "<hr>\n"; 608 - } 609 - 610 - # output typedef in html 611 - sub output_typedef_html(%) { 612 - my %args = %{$_[0]}; 613 - my ($parameter); 614 - my $count; 615 - print "<h2>typedef " . $args{'typedef'} . "</h2>\n"; 616 - 617 - print "<b>typedef " . $args{'typedef'} . "</b>\n"; 618 - output_section_html(@_); 619 - print "<hr>\n"; 620 - } 621 - 622 - # output struct in html 623 - sub output_struct_html(%) { 624 - my %args = %{$_[0]}; 625 - my ($parameter); 626 - 627 - print "<h2>" . $args{'type'} . " " . $args{'struct'} . " - " . $args{'purpose'} . "</h2>\n"; 628 - print "<b>" . $args{'type'} . " " . $args{'struct'} . "</b> {<br>\n"; 629 - foreach $parameter (@{$args{'parameterlist'}}) { 630 - if ($parameter =~ /^#/) { 631 - print "$parameter<br>\n"; 632 - next; 633 - } 634 - my $parameter_name = $parameter; 635 - $parameter_name =~ s/\[.*//; 636 - 637 - ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 638 - $type = $args{'parametertypes'}{$parameter}; 639 - if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 640 - # pointer-to-function 641 - print "&nbsp; &nbsp; <i>$1</i><b>$parameter</b>) <i>($2)</i>;<br>\n"; 642 - } elsif ($type =~ m/^(.*?)\s*(:.*)/) { 643 - # bitfield 644 - print "&nbsp; &nbsp; <i>$1</i> <b>$parameter</b>$2;<br>\n"; 645 - } else { 646 - print "&nbsp; &nbsp; <i>$type</i> <b>$parameter</b>;<br>\n"; 647 - } 648 - } 649 - print "};<br>\n"; 650 - 651 - print "<h3>Members</h3>\n"; 652 - print "<dl>\n"; 653 - foreach $parameter (@{$args{'parameterlist'}}) { 654 - ($parameter =~ /^#/) && next; 655 - 656 - my $parameter_name = $parameter; 657 - $parameter_name =~ s/\[.*//; 658 - 659 - ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 660 - print "<dt><b>" . $parameter . "</b>\n"; 661 - print "<dd>"; 662 - output_highlight($args{'parameterdescs'}{$parameter_name}); 663 - } 664 - print "</dl>\n"; 665 - output_section_html(@_); 666 - print "<hr>\n"; 667 - } 668 - 669 - # output function in html 670 - sub output_function_html(%) { 671 - my %args = %{$_[0]}; 672 - my ($parameter, $section); 673 - my $count; 674 - 675 - print "<h2>" . $args{'function'} . " - " . $args{'purpose'} . "</h2>\n"; 676 - print "<i>" . $args{'functiontype'} . "</i>\n"; 677 - print "<b>" . $args{'function'} . "</b>\n"; 678 - print "("; 679 - $count = 0; 680 - foreach $parameter (@{$args{'parameterlist'}}) { 681 - $type = $args{'parametertypes'}{$parameter}; 682 - if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 683 - # pointer-to-function 684 - print "<i>$1</i><b>$parameter</b>) <i>($2)</i>"; 685 - } else { 686 - print "<i>" . $type . "</i> <b>" . $parameter . "</b>"; 687 - } 688 - if ($count != $#{$args{'parameterlist'}}) { 689 - $count++; 690 - print ",\n"; 691 - } 692 - } 693 - print ")\n"; 694 - 695 - print "<h3>Arguments</h3>\n"; 696 - print "<dl>\n"; 697 - foreach $parameter (@{$args{'parameterlist'}}) { 698 - my $parameter_name = $parameter; 699 - $parameter_name =~ s/\[.*//; 700 - 701 - ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 702 - print "<dt><b>" . $parameter . "</b>\n"; 703 - print "<dd>"; 704 - output_highlight($args{'parameterdescs'}{$parameter_name}); 705 - } 706 - print "</dl>\n"; 707 - output_section_html(@_); 708 - print "<hr>\n"; 709 - } 710 - 711 - # output DOC: block header in html 712 - sub output_blockhead_html(%) { 713 - my %args = %{$_[0]}; 714 - my ($parameter, $section); 715 - my $count; 716 - 717 - foreach $section (@{$args{'sectionlist'}}) { 718 - print "<h3>$section</h3>\n"; 719 - print "<ul>\n"; 720 - output_highlight($args{'sections'}{$section}); 721 - print "</ul>\n"; 722 - } 723 - print "<hr>\n"; 724 - } 725 - 726 - # output sections in html5 727 - sub output_section_html5(%) { 728 - my %args = %{$_[0]}; 729 - my $section; 730 - 731 - foreach $section (@{$args{'sectionlist'}}) { 732 - print "<section>\n"; 733 - print "<h1>$section</h1>\n"; 734 - print "<p>\n"; 735 - output_highlight($args{'sections'}{$section}); 736 - print "</p>\n"; 737 - print "</section>\n"; 738 - } 739 - } 740 - 741 - # output enum in html5 742 - sub output_enum_html5(%) { 743 - my %args = %{$_[0]}; 744 - my ($parameter); 745 - my $count; 746 - my $html5id; 747 - 748 - $html5id = $args{'enum'}; 749 - $html5id =~ s/[^a-zA-Z0-9\-]+/_/g; 750 - print "<article class=\"enum\" id=\"enum:". $html5id . "\">"; 751 - print "<h1>enum " . $args{'enum'} . "</h1>\n"; 752 - print "<ol class=\"code\">\n"; 753 - print "<li>"; 754 - print "<span class=\"keyword\">enum</span> "; 755 - print "<span class=\"identifier\">" . $args{'enum'} . "</span> {"; 756 - print "</li>\n"; 757 - $count = 0; 758 - foreach $parameter (@{$args{'parameterlist'}}) { 759 - print "<li class=\"indent\">"; 760 - print "<span class=\"param\">" . $parameter . "</span>"; 761 - if ($count != $#{$args{'parameterlist'}}) { 762 - $count++; 763 - print ","; 764 - } 765 - print "</li>\n"; 766 - } 767 - print "<li>};</li>\n"; 768 - print "</ol>\n"; 769 - 770 - print "<section>\n"; 771 - print "<h1>Constants</h1>\n"; 772 - print "<dl>\n"; 773 - foreach $parameter (@{$args{'parameterlist'}}) { 774 - print "<dt>" . $parameter . "</dt>\n"; 775 - print "<dd>"; 776 - output_highlight($args{'parameterdescs'}{$parameter}); 777 - print "</dd>\n"; 778 - } 779 - print "</dl>\n"; 780 - print "</section>\n"; 781 - output_section_html5(@_); 782 - print "</article>\n"; 783 - } 784 - 785 - # output typedef in html5 786 - sub output_typedef_html5(%) { 787 - my %args = %{$_[0]}; 788 - my ($parameter); 789 - my $count; 790 - my $html5id; 791 - 792 - $html5id = $args{'typedef'}; 793 - $html5id =~ s/[^a-zA-Z0-9\-]+/_/g; 794 - print "<article class=\"typedef\" id=\"typedef:" . $html5id . "\">\n"; 795 - print "<h1>typedef " . $args{'typedef'} . "</h1>\n"; 796 - 797 - print "<ol class=\"code\">\n"; 798 - print "<li>"; 799 - print "<span class=\"keyword\">typedef</span> "; 800 - print "<span class=\"identifier\">" . $args{'typedef'} . "</span>"; 801 - print "</li>\n"; 802 - print "</ol>\n"; 803 - output_section_html5(@_); 804 - print "</article>\n"; 805 - } 806 - 807 - # output struct in html5 808 - sub output_struct_html5(%) { 809 - my %args = %{$_[0]}; 810 - my ($parameter); 811 - my $html5id; 812 - 813 - $html5id = $args{'struct'}; 814 - $html5id =~ s/[^a-zA-Z0-9\-]+/_/g; 815 - print "<article class=\"struct\" id=\"struct:" . $html5id . "\">\n"; 816 - print "<hgroup>\n"; 817 - print "<h1>" . $args{'type'} . " " . $args{'struct'} . "</h1>"; 818 - print "<h2>". $args{'purpose'} . "</h2>\n"; 819 - print "</hgroup>\n"; 820 - print "<ol class=\"code\">\n"; 821 - print "<li>"; 822 - print "<span class=\"type\">" . $args{'type'} . "</span> "; 823 - print "<span class=\"identifier\">" . $args{'struct'} . "</span> {"; 824 - print "</li>\n"; 825 - foreach $parameter (@{$args{'parameterlist'}}) { 826 - print "<li class=\"indent\">"; 827 - if ($parameter =~ /^#/) { 828 - print "<span class=\"param\">" . $parameter ."</span>\n"; 829 - print "</li>\n"; 830 - next; 831 - } 832 - my $parameter_name = $parameter; 833 - $parameter_name =~ s/\[.*//; 834 - 835 - ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 836 - $type = $args{'parametertypes'}{$parameter}; 837 - if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 838 - # pointer-to-function 839 - print "<span class=\"type\">$1</span> "; 840 - print "<span class=\"param\">$parameter</span>"; 841 - print "<span class=\"type\">)</span> "; 842 - print "(<span class=\"args\">$2</span>);"; 843 - } elsif ($type =~ m/^(.*?)\s*(:.*)/) { 844 - # bitfield 845 - print "<span class=\"type\">$1</span> "; 846 - print "<span class=\"param\">$parameter</span>"; 847 - print "<span class=\"bits\">$2</span>;"; 848 - } else { 849 - print "<span class=\"type\">$type</span> "; 850 - print "<span class=\"param\">$parameter</span>;"; 851 - } 852 - print "</li>\n"; 853 - } 854 - print "<li>};</li>\n"; 855 - print "</ol>\n"; 856 - 857 - print "<section>\n"; 858 - print "<h1>Members</h1>\n"; 859 - print "<dl>\n"; 860 - foreach $parameter (@{$args{'parameterlist'}}) { 861 - ($parameter =~ /^#/) && next; 862 - 863 - my $parameter_name = $parameter; 864 - $parameter_name =~ s/\[.*//; 865 - 866 - ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 867 - print "<dt>" . $parameter . "</dt>\n"; 868 - print "<dd>"; 869 - output_highlight($args{'parameterdescs'}{$parameter_name}); 870 - print "</dd>\n"; 871 - } 872 - print "</dl>\n"; 873 - print "</section>\n"; 874 - output_section_html5(@_); 875 - print "</article>\n"; 876 - } 877 - 878 - # output function in html5 879 - sub output_function_html5(%) { 880 - my %args = %{$_[0]}; 881 - my ($parameter, $section); 882 - my $count; 883 - my $html5id; 884 - 885 - $html5id = $args{'function'}; 886 - $html5id =~ s/[^a-zA-Z0-9\-]+/_/g; 887 - print "<article class=\"function\" id=\"func:". $html5id . "\">\n"; 888 - print "<hgroup>\n"; 889 - print "<h1>" . $args{'function'} . "</h1>"; 890 - print "<h2>" . $args{'purpose'} . "</h2>\n"; 891 - print "</hgroup>\n"; 892 - print "<ol class=\"code\">\n"; 893 - print "<li>"; 894 - print "<span class=\"type\">" . $args{'functiontype'} . "</span> "; 895 - print "<span class=\"identifier\">" . $args{'function'} . "</span> ("; 896 - print "</li>"; 897 - $count = 0; 898 - foreach $parameter (@{$args{'parameterlist'}}) { 899 - print "<li class=\"indent\">"; 900 - $type = $args{'parametertypes'}{$parameter}; 901 - if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 902 - # pointer-to-function 903 - print "<span class=\"type\">$1</span> "; 904 - print "<span class=\"param\">$parameter</span>"; 905 - print "<span class=\"type\">)</span> "; 906 - print "(<span class=\"args\">$2</span>)"; 907 - } else { 908 - print "<span class=\"type\">$type</span> "; 909 - print "<span class=\"param\">$parameter</span>"; 910 - } 911 - if ($count != $#{$args{'parameterlist'}}) { 912 - $count++; 913 - print ","; 914 - } 915 - print "</li>\n"; 916 - } 917 - print "<li>)</li>\n"; 918 - print "</ol>\n"; 919 - 920 - print "<section>\n"; 921 - print "<h1>Arguments</h1>\n"; 922 - print "<p>\n"; 923 - print "<dl>\n"; 924 - foreach $parameter (@{$args{'parameterlist'}}) { 925 - my $parameter_name = $parameter; 926 - $parameter_name =~ s/\[.*//; 927 - 928 - ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 929 - print "<dt>" . $parameter . "</dt>\n"; 930 - print "<dd>"; 931 - output_highlight($args{'parameterdescs'}{$parameter_name}); 932 - print "</dd>\n"; 933 - } 934 - print "</dl>\n"; 935 - print "</section>\n"; 936 - output_section_html5(@_); 937 - print "</article>\n"; 938 - } 939 - 940 - # output DOC: block header in html5 941 - sub output_blockhead_html5(%) { 942 - my %args = %{$_[0]}; 943 - my ($parameter, $section); 944 - my $count; 945 - my $html5id; 946 - 947 - foreach $section (@{$args{'sectionlist'}}) { 948 - $html5id = $section; 949 - $html5id =~ s/[^a-zA-Z0-9\-]+/_/g; 950 - print "<article class=\"doc\" id=\"doc:". $html5id . "\">\n"; 951 - print "<h1>$section</h1>\n"; 952 - print "<p>\n"; 953 - output_highlight($args{'sections'}{$section}); 954 - print "</p>\n"; 955 - } 956 - print "</article>\n"; 957 - } 958 - 959 - sub output_section_xml(%) { 960 - my %args = %{$_[0]}; 961 - my $section; 962 - # print out each section 963 - $lineprefix=" "; 964 - foreach $section (@{$args{'sectionlist'}}) { 965 - print "<refsect1>\n"; 966 - print "<title>$section</title>\n"; 967 - if ($section =~ m/EXAMPLE/i) { 968 - print "<informalexample><programlisting>\n"; 969 - $output_preformatted = 1; 970 - } else { 971 - print "<para>\n"; 972 - } 973 - output_highlight($args{'sections'}{$section}); 974 - $output_preformatted = 0; 975 - if ($section =~ m/EXAMPLE/i) { 976 - print "</programlisting></informalexample>\n"; 977 - } else { 978 - print "</para>\n"; 979 - } 980 - print "</refsect1>\n"; 981 - } 982 - } 983 - 984 - # output function in XML DocBook 985 - sub output_function_xml(%) { 986 - my %args = %{$_[0]}; 987 - my ($parameter, $section); 988 - my $count; 989 - my $id; 990 - 991 - $id = "API-" . $args{'function'}; 992 - $id =~ s/[^A-Za-z0-9]/-/g; 993 - 994 - print "<refentry id=\"$id\">\n"; 995 - print "<refentryinfo>\n"; 996 - print " <title>LINUX</title>\n"; 997 - print " <productname>Kernel Hackers Manual</productname>\n"; 998 - print " <date>$man_date</date>\n"; 999 - print "</refentryinfo>\n"; 1000 - print "<refmeta>\n"; 1001 - print " <refentrytitle><phrase>" . $args{'function'} . "</phrase></refentrytitle>\n"; 1002 - print " <manvolnum>9</manvolnum>\n"; 1003 - print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; 1004 - print "</refmeta>\n"; 1005 - print "<refnamediv>\n"; 1006 - print " <refname>" . $args{'function'} . "</refname>\n"; 1007 - print " <refpurpose>\n"; 1008 - print " "; 1009 - output_highlight ($args{'purpose'}); 1010 - print " </refpurpose>\n"; 1011 - print "</refnamediv>\n"; 1012 - 1013 - print "<refsynopsisdiv>\n"; 1014 - print " <title>Synopsis</title>\n"; 1015 - print " <funcsynopsis><funcprototype>\n"; 1016 - print " <funcdef>" . $args{'functiontype'} . " "; 1017 - print "<function>" . $args{'function'} . " </function></funcdef>\n"; 1018 - 1019 - $count = 0; 1020 - if ($#{$args{'parameterlist'}} >= 0) { 1021 - foreach $parameter (@{$args{'parameterlist'}}) { 1022 - $type = $args{'parametertypes'}{$parameter}; 1023 - if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 1024 - # pointer-to-function 1025 - print " <paramdef>$1<parameter>$parameter</parameter>)\n"; 1026 - print " <funcparams>$2</funcparams></paramdef>\n"; 1027 - } else { 1028 - print " <paramdef>" . $type; 1029 - print " <parameter>$parameter</parameter></paramdef>\n"; 1030 - } 1031 - } 1032 - } else { 1033 - print " <void/>\n"; 1034 - } 1035 - print " </funcprototype></funcsynopsis>\n"; 1036 - print "</refsynopsisdiv>\n"; 1037 - 1038 - # print parameters 1039 - print "<refsect1>\n <title>Arguments</title>\n"; 1040 - if ($#{$args{'parameterlist'}} >= 0) { 1041 - print " <variablelist>\n"; 1042 - foreach $parameter (@{$args{'parameterlist'}}) { 1043 - my $parameter_name = $parameter; 1044 - $parameter_name =~ s/\[.*//; 1045 - $type = $args{'parametertypes'}{$parameter}; 1046 - 1047 - print " <varlistentry>\n <term><parameter>$type $parameter</parameter></term>\n"; 1048 - print " <listitem>\n <para>\n"; 1049 - $lineprefix=" "; 1050 - output_highlight($args{'parameterdescs'}{$parameter_name}); 1051 - print " </para>\n </listitem>\n </varlistentry>\n"; 1052 - } 1053 - print " </variablelist>\n"; 1054 - } else { 1055 - print " <para>\n None\n </para>\n"; 1056 - } 1057 - print "</refsect1>\n"; 1058 - 1059 - output_section_xml(@_); 1060 - print "</refentry>\n\n"; 1061 - } 1062 - 1063 - # output struct in XML DocBook 1064 - sub output_struct_xml(%) { 1065 - my %args = %{$_[0]}; 1066 - my ($parameter, $section); 1067 - my $id; 1068 - 1069 - $id = "API-struct-" . $args{'struct'}; 1070 - $id =~ s/[^A-Za-z0-9]/-/g; 1071 - 1072 - print "<refentry id=\"$id\">\n"; 1073 - print "<refentryinfo>\n"; 1074 - print " <title>LINUX</title>\n"; 1075 - print " <productname>Kernel Hackers Manual</productname>\n"; 1076 - print " <date>$man_date</date>\n"; 1077 - print "</refentryinfo>\n"; 1078 - print "<refmeta>\n"; 1079 - print " <refentrytitle><phrase>" . $args{'type'} . " " . $args{'struct'} . "</phrase></refentrytitle>\n"; 1080 - print " <manvolnum>9</manvolnum>\n"; 1081 - print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; 1082 - print "</refmeta>\n"; 1083 - print "<refnamediv>\n"; 1084 - print " <refname>" . $args{'type'} . " " . $args{'struct'} . "</refname>\n"; 1085 - print " <refpurpose>\n"; 1086 - print " "; 1087 - output_highlight ($args{'purpose'}); 1088 - print " </refpurpose>\n"; 1089 - print "</refnamediv>\n"; 1090 - 1091 - print "<refsynopsisdiv>\n"; 1092 - print " <title>Synopsis</title>\n"; 1093 - print " <programlisting>\n"; 1094 - print $args{'type'} . " " . $args{'struct'} . " {\n"; 1095 - foreach $parameter (@{$args{'parameterlist'}}) { 1096 - if ($parameter =~ /^#/) { 1097 - my $prm = $parameter; 1098 - # convert data read & converted thru xml_escape() into &xyz; format: 1099 - # This allows us to have #define macros interspersed in a struct. 1100 - $prm =~ s/\\\\\\/\&/g; 1101 - print "$prm\n"; 1102 - next; 1103 - } 1104 - 1105 - my $parameter_name = $parameter; 1106 - $parameter_name =~ s/\[.*//; 1107 - 1108 - defined($args{'parameterdescs'}{$parameter_name}) || next; 1109 - ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 1110 - $type = $args{'parametertypes'}{$parameter}; 1111 - if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 1112 - # pointer-to-function 1113 - print " $1 $parameter) ($2);\n"; 1114 - } elsif ($type =~ m/^(.*?)\s*(:.*)/) { 1115 - # bitfield 1116 - print " $1 $parameter$2;\n"; 1117 - } else { 1118 - print " " . $type . " " . $parameter . ";\n"; 1119 - } 1120 - } 1121 - print "};"; 1122 - print " </programlisting>\n"; 1123 - print "</refsynopsisdiv>\n"; 1124 - 1125 - print " <refsect1>\n"; 1126 - print " <title>Members</title>\n"; 1127 - 1128 - if ($#{$args{'parameterlist'}} >= 0) { 1129 - print " <variablelist>\n"; 1130 - foreach $parameter (@{$args{'parameterlist'}}) { 1131 - ($parameter =~ /^#/) && next; 1132 - 1133 - my $parameter_name = $parameter; 1134 - $parameter_name =~ s/\[.*//; 1135 - 1136 - defined($args{'parameterdescs'}{$parameter_name}) || next; 1137 - ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 1138 - $type = $args{'parametertypes'}{$parameter}; 1139 - print " <varlistentry>"; 1140 - print " <term><literal>$type $parameter</literal></term>\n"; 1141 - print " <listitem><para>\n"; 1142 - output_highlight($args{'parameterdescs'}{$parameter_name}); 1143 - print " </para></listitem>\n"; 1144 - print " </varlistentry>\n"; 1145 - } 1146 - print " </variablelist>\n"; 1147 - } else { 1148 - print " <para>\n None\n </para>\n"; 1149 - } 1150 - print " </refsect1>\n"; 1151 - 1152 - output_section_xml(@_); 1153 - 1154 - print "</refentry>\n\n"; 1155 - } 1156 - 1157 - # output enum in XML DocBook 1158 - sub output_enum_xml(%) { 1159 - my %args = %{$_[0]}; 1160 - my ($parameter, $section); 1161 - my $count; 1162 - my $id; 1163 - 1164 - $id = "API-enum-" . $args{'enum'}; 1165 - $id =~ s/[^A-Za-z0-9]/-/g; 1166 - 1167 - print "<refentry id=\"$id\">\n"; 1168 - print "<refentryinfo>\n"; 1169 - print " <title>LINUX</title>\n"; 1170 - print " <productname>Kernel Hackers Manual</productname>\n"; 1171 - print " <date>$man_date</date>\n"; 1172 - print "</refentryinfo>\n"; 1173 - print "<refmeta>\n"; 1174 - print " <refentrytitle><phrase>enum " . $args{'enum'} . "</phrase></refentrytitle>\n"; 1175 - print " <manvolnum>9</manvolnum>\n"; 1176 - print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; 1177 - print "</refmeta>\n"; 1178 - print "<refnamediv>\n"; 1179 - print " <refname>enum " . $args{'enum'} . "</refname>\n"; 1180 - print " <refpurpose>\n"; 1181 - print " "; 1182 - output_highlight ($args{'purpose'}); 1183 - print " </refpurpose>\n"; 1184 - print "</refnamediv>\n"; 1185 - 1186 - print "<refsynopsisdiv>\n"; 1187 - print " <title>Synopsis</title>\n"; 1188 - print " <programlisting>\n"; 1189 - print "enum " . $args{'enum'} . " {\n"; 1190 - $count = 0; 1191 - foreach $parameter (@{$args{'parameterlist'}}) { 1192 - print " $parameter"; 1193 - if ($count != $#{$args{'parameterlist'}}) { 1194 - $count++; 1195 - print ","; 1196 - } 1197 - print "\n"; 1198 - } 1199 - print "};"; 1200 - print " </programlisting>\n"; 1201 - print "</refsynopsisdiv>\n"; 1202 - 1203 - print "<refsect1>\n"; 1204 - print " <title>Constants</title>\n"; 1205 - print " <variablelist>\n"; 1206 - foreach $parameter (@{$args{'parameterlist'}}) { 1207 - my $parameter_name = $parameter; 1208 - $parameter_name =~ s/\[.*//; 1209 - 1210 - print " <varlistentry>"; 1211 - print " <term>$parameter</term>\n"; 1212 - print " <listitem><para>\n"; 1213 - output_highlight($args{'parameterdescs'}{$parameter_name}); 1214 - print " </para></listitem>\n"; 1215 - print " </varlistentry>\n"; 1216 - } 1217 - print " </variablelist>\n"; 1218 - print "</refsect1>\n"; 1219 - 1220 - output_section_xml(@_); 1221 - 1222 - print "</refentry>\n\n"; 1223 - } 1224 - 1225 - # output typedef in XML DocBook 1226 - sub output_typedef_xml(%) { 1227 - my %args = %{$_[0]}; 1228 - my ($parameter, $section); 1229 - my $id; 1230 - 1231 - $id = "API-typedef-" . $args{'typedef'}; 1232 - $id =~ s/[^A-Za-z0-9]/-/g; 1233 - 1234 - print "<refentry id=\"$id\">\n"; 1235 - print "<refentryinfo>\n"; 1236 - print " <title>LINUX</title>\n"; 1237 - print " <productname>Kernel Hackers Manual</productname>\n"; 1238 - print " <date>$man_date</date>\n"; 1239 - print "</refentryinfo>\n"; 1240 - print "<refmeta>\n"; 1241 - print " <refentrytitle><phrase>typedef " . $args{'typedef'} . "</phrase></refentrytitle>\n"; 1242 - print " <manvolnum>9</manvolnum>\n"; 1243 - print "</refmeta>\n"; 1244 - print "<refnamediv>\n"; 1245 - print " <refname>typedef " . $args{'typedef'} . "</refname>\n"; 1246 - print " <refpurpose>\n"; 1247 - print " "; 1248 - output_highlight ($args{'purpose'}); 1249 - print " </refpurpose>\n"; 1250 - print "</refnamediv>\n"; 1251 - 1252 - print "<refsynopsisdiv>\n"; 1253 - print " <title>Synopsis</title>\n"; 1254 - print " <synopsis>typedef " . $args{'typedef'} . ";</synopsis>\n"; 1255 - print "</refsynopsisdiv>\n"; 1256 - 1257 - output_section_xml(@_); 1258 - 1259 - print "</refentry>\n\n"; 1260 - } 1261 - 1262 - # output in XML DocBook 1263 - sub output_blockhead_xml(%) { 1264 - my %args = %{$_[0]}; 1265 - my ($parameter, $section); 1266 - my $count; 1267 - 1268 - my $id = $args{'module'}; 1269 - $id =~ s/[^A-Za-z0-9]/-/g; 1270 - 1271 - # print out each section 1272 - $lineprefix=" "; 1273 - foreach $section (@{$args{'sectionlist'}}) { 1274 - if (!$args{'content-only'}) { 1275 - print "<refsect1>\n <title>$section</title>\n"; 1276 - } 1277 - if ($section =~ m/EXAMPLE/i) { 1278 - print "<example><para>\n"; 1279 - $output_preformatted = 1; 1280 - } else { 1281 - print "<para>\n"; 1282 - } 1283 - output_highlight($args{'sections'}{$section}); 1284 - $output_preformatted = 0; 1285 - if ($section =~ m/EXAMPLE/i) { 1286 - print "</para></example>\n"; 1287 - } else { 1288 - print "</para>"; 1289 - } 1290 - if (!$args{'content-only'}) { 1291 - print "\n</refsect1>\n"; 1292 - } 1293 - } 1294 - 1295 - print "\n\n"; 1296 - } 1297 - 1298 - # output in XML DocBook 1299 - sub output_function_gnome { 1300 - my %args = %{$_[0]}; 1301 - my ($parameter, $section); 1302 - my $count; 1303 - my $id; 1304 - 1305 - $id = $args{'module'} . "-" . $args{'function'}; 1306 - $id =~ s/[^A-Za-z0-9]/-/g; 1307 - 1308 - print "<sect2>\n"; 1309 - print " <title id=\"$id\">" . $args{'function'} . "</title>\n"; 1310 - 1311 - print " <funcsynopsis>\n"; 1312 - print " <funcdef>" . $args{'functiontype'} . " "; 1313 - print "<function>" . $args{'function'} . " "; 1314 - print "</function></funcdef>\n"; 1315 - 1316 - $count = 0; 1317 - if ($#{$args{'parameterlist'}} >= 0) { 1318 - foreach $parameter (@{$args{'parameterlist'}}) { 1319 - $type = $args{'parametertypes'}{$parameter}; 1320 - if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 1321 - # pointer-to-function 1322 - print " <paramdef>$1 <parameter>$parameter</parameter>)\n"; 1323 - print " <funcparams>$2</funcparams></paramdef>\n"; 1324 - } else { 1325 - print " <paramdef>" . $type; 1326 - print " <parameter>$parameter</parameter></paramdef>\n"; 1327 - } 1328 - } 1329 - } else { 1330 - print " <void>\n"; 1331 - } 1332 - print " </funcsynopsis>\n"; 1333 - if ($#{$args{'parameterlist'}} >= 0) { 1334 - print " <informaltable pgwide=\"1\" frame=\"none\" role=\"params\">\n"; 1335 - print "<tgroup cols=\"2\">\n"; 1336 - print "<colspec colwidth=\"2*\">\n"; 1337 - print "<colspec colwidth=\"8*\">\n"; 1338 - print "<tbody>\n"; 1339 - foreach $parameter (@{$args{'parameterlist'}}) { 1340 - my $parameter_name = $parameter; 1341 - $parameter_name =~ s/\[.*//; 1342 - 1343 - print " <row><entry align=\"right\"><parameter>$parameter</parameter></entry>\n"; 1344 - print " <entry>\n"; 1345 - $lineprefix=" "; 1346 - output_highlight($args{'parameterdescs'}{$parameter_name}); 1347 - print " </entry></row>\n"; 1348 - } 1349 - print " </tbody></tgroup></informaltable>\n"; 1350 - } else { 1351 - print " <para>\n None\n </para>\n"; 1352 - } 1353 - 1354 - # print out each section 1355 - $lineprefix=" "; 1356 - foreach $section (@{$args{'sectionlist'}}) { 1357 - print "<simplesect>\n <title>$section</title>\n"; 1358 - if ($section =~ m/EXAMPLE/i) { 1359 - print "<example><programlisting>\n"; 1360 - $output_preformatted = 1; 1361 - } else { 1362 - } 1363 - print "<para>\n"; 1364 - output_highlight($args{'sections'}{$section}); 1365 - $output_preformatted = 0; 1366 - print "</para>\n"; 1367 - if ($section =~ m/EXAMPLE/i) { 1368 - print "</programlisting></example>\n"; 1369 - } else { 1370 - } 1371 - print " </simplesect>\n"; 1372 - } 1373 - 1374 - print "</sect2>\n\n"; 1375 707 } 1376 708 1377 709 ## ··· 736 1690 737 1691 foreach $section (@{$args{'sectionlist'}}) { 738 1692 print ".SH \"$section\"\n"; 739 - output_highlight($args{'sections'}{$section}); 740 - } 741 - } 742 - 743 - ## 744 - # output in text 745 - sub output_function_text(%) { 746 - my %args = %{$_[0]}; 747 - my ($parameter, $section); 748 - my $start; 749 - 750 - print "Name:\n\n"; 751 - print $args{'function'} . " - " . $args{'purpose'} . "\n"; 752 - 753 - print "\nSynopsis:\n\n"; 754 - if ($args{'functiontype'} ne "") { 755 - $start = $args{'functiontype'} . " " . $args{'function'} . " ("; 756 - } else { 757 - $start = $args{'function'} . " ("; 758 - } 759 - print $start; 760 - 761 - my $count = 0; 762 - foreach my $parameter (@{$args{'parameterlist'}}) { 763 - $type = $args{'parametertypes'}{$parameter}; 764 - if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 765 - # pointer-to-function 766 - print $1 . $parameter . ") (" . $2; 767 - } else { 768 - print $type . " " . $parameter; 769 - } 770 - if ($count != $#{$args{'parameterlist'}}) { 771 - $count++; 772 - print ",\n"; 773 - print " " x length($start); 774 - } else { 775 - print ");\n\n"; 776 - } 777 - } 778 - 779 - print "Arguments:\n\n"; 780 - foreach $parameter (@{$args{'parameterlist'}}) { 781 - my $parameter_name = $parameter; 782 - $parameter_name =~ s/\[.*//; 783 - 784 - print $parameter . "\n\t" . $args{'parameterdescs'}{$parameter_name} . "\n"; 785 - } 786 - output_section_text(@_); 787 - } 788 - 789 - #output sections in text 790 - sub output_section_text(%) { 791 - my %args = %{$_[0]}; 792 - my $section; 793 - 794 - print "\n"; 795 - foreach $section (@{$args{'sectionlist'}}) { 796 - print "$section:\n\n"; 797 - output_highlight($args{'sections'}{$section}); 798 - } 799 - print "\n\n"; 800 - } 801 - 802 - # output enum in text 803 - sub output_enum_text(%) { 804 - my %args = %{$_[0]}; 805 - my ($parameter); 806 - my $count; 807 - print "Enum:\n\n"; 808 - 809 - print "enum " . $args{'enum'} . " - " . $args{'purpose'} . "\n\n"; 810 - print "enum " . $args{'enum'} . " {\n"; 811 - $count = 0; 812 - foreach $parameter (@{$args{'parameterlist'}}) { 813 - print "\t$parameter"; 814 - if ($count != $#{$args{'parameterlist'}}) { 815 - $count++; 816 - print ","; 817 - } 818 - print "\n"; 819 - } 820 - print "};\n\n"; 821 - 822 - print "Constants:\n\n"; 823 - foreach $parameter (@{$args{'parameterlist'}}) { 824 - print "$parameter\n\t"; 825 - print $args{'parameterdescs'}{$parameter} . "\n"; 826 - } 827 - 828 - output_section_text(@_); 829 - } 830 - 831 - # output typedef in text 832 - sub output_typedef_text(%) { 833 - my %args = %{$_[0]}; 834 - my ($parameter); 835 - my $count; 836 - print "Typedef:\n\n"; 837 - 838 - print "typedef " . $args{'typedef'} . " - " . $args{'purpose'} . "\n"; 839 - output_section_text(@_); 840 - } 841 - 842 - # output struct as text 843 - sub output_struct_text(%) { 844 - my %args = %{$_[0]}; 845 - my ($parameter); 846 - 847 - print $args{'type'} . " " . $args{'struct'} . " - " . $args{'purpose'} . "\n\n"; 848 - print $args{'type'} . " " . $args{'struct'} . " {\n"; 849 - foreach $parameter (@{$args{'parameterlist'}}) { 850 - if ($parameter =~ /^#/) { 851 - print "$parameter\n"; 852 - next; 853 - } 854 - 855 - my $parameter_name = $parameter; 856 - $parameter_name =~ s/\[.*//; 857 - 858 - ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 859 - $type = $args{'parametertypes'}{$parameter}; 860 - if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 861 - # pointer-to-function 862 - print "\t$1 $parameter) ($2);\n"; 863 - } elsif ($type =~ m/^(.*?)\s*(:.*)/) { 864 - # bitfield 865 - print "\t$1 $parameter$2;\n"; 866 - } else { 867 - print "\t" . $type . " " . $parameter . ";\n"; 868 - } 869 - } 870 - print "};\n\n"; 871 - 872 - print "Members:\n\n"; 873 - foreach $parameter (@{$args{'parameterlist'}}) { 874 - ($parameter =~ /^#/) && next; 875 - 876 - my $parameter_name = $parameter; 877 - $parameter_name =~ s/\[.*//; 878 - 879 - ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 880 - print "$parameter\n\t"; 881 - print $args{'parameterdescs'}{$parameter_name} . "\n"; 882 - } 883 - print "\n"; 884 - output_section_text(@_); 885 - } 886 - 887 - sub output_blockhead_text(%) { 888 - my %args = %{$_[0]}; 889 - my ($parameter, $section); 890 - 891 - foreach $section (@{$args{'sectionlist'}}) { 892 - print " $section:\n"; 893 - print " -> "; 894 1693 output_highlight($args{'sections'}{$section}); 895 1694 } 896 1695 } ··· 973 2082 $lineprefix = $oldprefix; 974 2083 output_section_rst(@_); 975 2084 } 976 - 977 - 978 - ## list mode output functions 979 - 980 - sub output_function_list(%) { 981 - my %args = %{$_[0]}; 982 - 983 - print $args{'function'} . "\n"; 984 - } 985 - 986 - # output enum in list 987 - sub output_enum_list(%) { 988 - my %args = %{$_[0]}; 989 - print $args{'enum'} . "\n"; 990 - } 991 - 992 - # output typedef in list 993 - sub output_typedef_list(%) { 994 - my %args = %{$_[0]}; 995 - print $args{'typedef'} . "\n"; 996 - } 997 - 998 - # output struct as list 999 - sub output_struct_list(%) { 1000 - my %args = %{$_[0]}; 1001 - 1002 - print $args{'struct'} . "\n"; 1003 - } 1004 - 1005 - sub output_blockhead_list(%) { 1006 - my %args = %{$_[0]}; 1007 - my ($parameter, $section); 1008 - 1009 - foreach $section (@{$args{'sectionlist'}}) { 1010 - print "DOC: $section\n"; 1011 - } 1012 - } 1013 - 1014 2085 1015 2086 ## none mode output functions 1016 2087 ··· 1680 2827 # just before actual output; (this is done by local_unescape()) 1681 2828 sub xml_escape($) { 1682 2829 my $text = shift; 1683 - if (($output_mode eq "text") || ($output_mode eq "man")) { 2830 + if ($output_mode eq "man") { 1684 2831 return $text; 1685 2832 } 1686 2833 $text =~ s/\&/\\\\\\amp;/g; ··· 1692 2839 # xml_unescape: reverse the effects of xml_escape 1693 2840 sub xml_unescape($) { 1694 2841 my $text = shift; 1695 - if (($output_mode eq "text") || ($output_mode eq "man")) { 2842 + if ($output_mode eq "man") { 1696 2843 return $text; 1697 2844 } 1698 2845 $text =~ s/\\\\\\amp;/\&/g; ··· 1705 2852 # local escape strings look like: '\\\\menmonic:' (that's 4 backslashes) 1706 2853 sub local_unescape($) { 1707 2854 my $text = shift; 1708 - if (($output_mode eq "text") || ($output_mode eq "man")) { 2855 + if ($output_mode eq "man") { 1709 2856 return $text; 1710 2857 } 1711 2858 $text =~ s/\\\\\\\\lt:/</g; ··· 2026 3173 } 2027 3174 if (($output_selection == OUTPUT_INCLUDE) && ($show_not_found == 1)) { 2028 3175 print STDERR " Was looking for '$_'.\n" for keys %function_table; 2029 - } 2030 - if ($output_mode eq "xml") { 2031 - # The template wants at least one RefEntry here; make one. 2032 - print "<refentry>\n"; 2033 - print " <refnamediv>\n"; 2034 - print " <refname>\n"; 2035 - print " ${orig_file}\n"; 2036 - print " </refname>\n"; 2037 - print " <refpurpose>\n"; 2038 - print " Document generation inconsistency\n"; 2039 - print " </refpurpose>\n"; 2040 - print " </refnamediv>\n"; 2041 - print " <refsect1>\n"; 2042 - print " <title>\n"; 2043 - print " Oops\n"; 2044 - print " </title>\n"; 2045 - print " <warning>\n"; 2046 - print " <para>\n"; 2047 - print " The template for this document tried to insert\n"; 2048 - print " the structured comment from the file\n"; 2049 - print " <filename>${orig_file}</filename> at this point,\n"; 2050 - print " but none was found.\n"; 2051 - print " This dummy section is inserted to allow\n"; 2052 - print " generation to continue.\n"; 2053 - print " </para>\n"; 2054 - print " </warning>\n"; 2055 - print " </refsect1>\n"; 2056 - print "</refentry>\n"; 2057 3176 } 2058 3177 } 2059 3178 }