kernel-doc (996a07bcb62c5935248e238a1150089f3d99a6fb) kernel-doc (a21217daae8ce6e841e33d4a2bb24026723cb21d)
1#!/usr/bin/perl -w
2
3use strict;
4
5## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
6## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ##
7## Copyright (C) 2001 Simon Huggins ##
8## ##

--- 351 unchanged lines hidden (view full) ---

360##
361# output function
362#
363# parameterdescs, a hash.
364# function => "function name"
365# parameterlist => @list of parameters
366# parameterdescs => %parameter descriptions
367# sectionlist => @list of sections
1#!/usr/bin/perl -w
2
3use strict;
4
5## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
6## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ##
7## Copyright (C) 2001 Simon Huggins ##
8## ##

--- 351 unchanged lines hidden (view full) ---

360##
361# output function
362#
363# parameterdescs, a hash.
364# function => "function name"
365# parameterlist => @list of parameters
366# parameterdescs => %parameter descriptions
367# sectionlist => @list of sections
368# sections => %descriont descriptions
368# sections => %section descriptions
369#
370
371sub output_highlight {
372 my $contents = join "\n",@_;
373 my $line;
374
375# DEBUG
376# if (!defined $contents) {

--- 571 unchanged lines hidden (view full) ---

948 my $count;
949
950 print ".TH \"$args{'function'}\" 9 \"$args{'function'}\" \"$man_date\" \"Kernel Hacker's Manual\" LINUX\n";
951
952 print ".SH NAME\n";
953 print $args{'function'}." \\- ".$args{'purpose'}."\n";
954
955 print ".SH SYNOPSIS\n";
369#
370
371sub output_highlight {
372 my $contents = join "\n",@_;
373 my $line;
374
375# DEBUG
376# if (!defined $contents) {

--- 571 unchanged lines hidden (view full) ---

948 my $count;
949
950 print ".TH \"$args{'function'}\" 9 \"$args{'function'}\" \"$man_date\" \"Kernel Hacker's Manual\" LINUX\n";
951
952 print ".SH NAME\n";
953 print $args{'function'}." \\- ".$args{'purpose'}."\n";
954
955 print ".SH SYNOPSIS\n";
956 print ".B \"".$args{'functiontype'}."\" ".$args{'function'}."\n";
956 if ($args{'functiontype'} ne "") {
957 print ".B \"".$args{'functiontype'}."\" ".$args{'function'}."\n";
958 } else {
959 print ".B \"".$args{'function'}."\n";
960 }
957 $count = 0;
958 my $parenth = "(";
959 my $post = ",";
960 foreach my $parameter (@{$args{'parameterlist'}}) {
961 if ($count == $#{$args{'parameterlist'}}) {
962 $post = ");";
963 }
964 $type = $args{'parametertypes'}{$parameter};

--- 148 unchanged lines hidden (view full) ---

1113 }
1114}
1115
1116##
1117# output in text
1118sub output_function_text(%) {
1119 my %args = %{$_[0]};
1120 my ($parameter, $section);
961 $count = 0;
962 my $parenth = "(";
963 my $post = ",";
964 foreach my $parameter (@{$args{'parameterlist'}}) {
965 if ($count == $#{$args{'parameterlist'}}) {
966 $post = ");";
967 }
968 $type = $args{'parametertypes'}{$parameter};

--- 148 unchanged lines hidden (view full) ---

1117 }
1118}
1119
1120##
1121# output in text
1122sub output_function_text(%) {
1123 my %args = %{$_[0]};
1124 my ($parameter, $section);
1125 my $start;
1121
1122 print "Name:\n\n";
1123 print $args{'function'}." - ".$args{'purpose'}."\n";
1124
1125 print "\nSynopsis:\n\n";
1126
1127 print "Name:\n\n";
1128 print $args{'function'}." - ".$args{'purpose'}."\n";
1129
1130 print "\nSynopsis:\n\n";
1126 my $start=$args{'functiontype'}." ".$args{'function'}." (";
1131 if ($args{'functiontype'} ne "") {
1132 $start = $args{'functiontype'}." ".$args{'function'}." (";
1133 } else {
1134 $start = $args{'function'}." (";
1135 }
1127 print $start;
1136 print $start;
1137
1128 my $count = 0;
1129 foreach my $parameter (@{$args{'parameterlist'}}) {
1130 $type = $args{'parametertypes'}{$parameter};
1131 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
1132 # pointer-to-function
1133 print $1.$parameter.") (".$2;
1134 } else {
1135 print $type." ".$parameter;

--- 569 unchanged lines hidden (view full) ---

1705 $text =~ s/\>/\\\\\\gt;/g;
1706 return $text;
1707}
1708
1709sub process_file($) {
1710 my $file;
1711 my $identifier;
1712 my $func;
1138 my $count = 0;
1139 foreach my $parameter (@{$args{'parameterlist'}}) {
1140 $type = $args{'parametertypes'}{$parameter};
1141 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
1142 # pointer-to-function
1143 print $1.$parameter.") (".$2;
1144 } else {
1145 print $type." ".$parameter;

--- 569 unchanged lines hidden (view full) ---

1715 $text =~ s/\>/\\\\\\gt;/g;
1716 return $text;
1717}
1718
1719sub process_file($) {
1720 my $file;
1721 my $identifier;
1722 my $func;
1723 my $descr;
1713 my $initial_section_counter = $section_counter;
1714
1715 if (defined($ENV{'SRCTREE'})) {
1716 $file = "$ENV{'SRCTREE'}" . "/" . "@_";
1717 }
1718 else {
1719 $file = "@_";
1720 }

--- 27 unchanged lines hidden (view full) ---

1748 elsif (/$doc_decl/o) {
1749 $identifier = $1;
1750 if (/\s*([\w\s]+?)\s*-/) {
1751 $identifier = $1;
1752 }
1753
1754 $state = 2;
1755 if (/-(.*)/) {
1724 my $initial_section_counter = $section_counter;
1725
1726 if (defined($ENV{'SRCTREE'})) {
1727 $file = "$ENV{'SRCTREE'}" . "/" . "@_";
1728 }
1729 else {
1730 $file = "@_";
1731 }

--- 27 unchanged lines hidden (view full) ---

1759 elsif (/$doc_decl/o) {
1760 $identifier = $1;
1761 if (/\s*([\w\s]+?)\s*-/) {
1762 $identifier = $1;
1763 }
1764
1765 $state = 2;
1766 if (/-(.*)/) {
1756 $declaration_purpose = xml_escape($1);
1767 # strip leading/trailing/multiple spaces #RDD:T:
1768 $descr= $1;
1769 $descr =~ s/^\s*//;
1770 $descr =~ s/\s*$//;
1771 $descr =~ s/\s+/ /;
1772 $declaration_purpose = xml_escape($descr);
1757 } else {
1758 $declaration_purpose = "";
1759 }
1760 if ($identifier =~ m/^struct/) {
1761 $decl_type = 'struct';
1762 } elsif ($identifier =~ m/^union/) {
1763 $decl_type = 'union';
1764 } elsif ($identifier =~ m/^enum/) {

--- 156 unchanged lines hidden ---
1773 } else {
1774 $declaration_purpose = "";
1775 }
1776 if ($identifier =~ m/^struct/) {
1777 $decl_type = 'struct';
1778 } elsif ($identifier =~ m/^union/) {
1779 $decl_type = 'union';
1780 } elsif ($identifier =~ m/^enum/) {

--- 156 unchanged lines hidden ---