aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kernel-doc
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kernel-doc')
-rwxr-xr-xscripts/kernel-doc174
1 files changed, 87 insertions, 87 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index acd8c4a8e3e0..a193fa3f5272 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -5,7 +5,7 @@ use strict;
5## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## 5## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
6## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ## 6## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ##
7## Copyright (C) 2001 Simon Huggins ## 7## Copyright (C) 2001 Simon Huggins ##
8## Copyright (C) 2005-2008 Randy Dunlap ## 8## Copyright (C) 2005-2009 Randy Dunlap ##
9## ## 9## ##
10## #define enhancements by Armin Kuster <akuster@mvista.com> ## 10## #define enhancements by Armin Kuster <akuster@mvista.com> ##
11## Copyright (c) 2000 MontaVista Software, Inc. ## 11## Copyright (c) 2000 MontaVista Software, Inc. ##
@@ -85,7 +85,7 @@ use strict;
85# 85#
86# /** 86# /**
87# * my_function 87# * my_function
88# **/ 88# */
89# 89#
90# If the Description: header tag is omitted, then there must be a blank line 90# If the Description: header tag is omitted, then there must be a blank line
91# after the last parameter specification. 91# after the last parameter specification.
@@ -105,7 +105,7 @@ use strict;
105# */ 105# */
106# etc. 106# etc.
107# 107#
108# Beside functions you can also write documentation for structs, unions, 108# Besides functions you can also write documentation for structs, unions,
109# enums and typedefs. Instead of the function name you must write the name 109# enums and typedefs. Instead of the function name you must write the name
110# of the declaration; the struct/union/enum/typedef must always precede 110# of the declaration; the struct/union/enum/typedef must always precede
111# the name. Nesting of declarations is not supported. 111# the name. Nesting of declarations is not supported.
@@ -223,7 +223,7 @@ sub usage {
223} 223}
224 224
225# read arguments 225# read arguments
226if ($#ARGV==-1) { 226if ($#ARGV == -1) {
227 usage(); 227 usage();
228} 228}
229 229
@@ -240,12 +240,12 @@ my $man_date = ('January', 'February', 'March', 'April', 'May', 'June',
240 " " . ((localtime)[5]+1900); 240 " " . ((localtime)[5]+1900);
241 241
242# Essentially these are globals 242# Essentially these are globals
243# They probably want to be tidied up made more localised or summat. 243# They probably want to be tidied up, made more localised or something.
244# CAVEAT EMPTOR! Some of the others I localised may not want to be which 244# CAVEAT EMPTOR! Some of the others I localised may not want to be, which
245# could cause "use of undefined value" or other bugs. 245# could cause "use of undefined value" or other bugs.
246my ($function, %function_table,%parametertypes,$declaration_purpose); 246my ($function, %function_table, %parametertypes, $declaration_purpose);
247my ($type,$declaration_name,$return_type); 247my ($type, $declaration_name, $return_type);
248my ($newsection,$newcontents,$prototype,$filelist, $brcount, %source_map); 248my ($newsection, $newcontents, $prototype, $filelist, $brcount, %source_map);
249 249
250if (defined($ENV{'KBUILD_VERBOSE'})) { 250if (defined($ENV{'KBUILD_VERBOSE'})) {
251 $verbose = "$ENV{'KBUILD_VERBOSE'}"; 251 $verbose = "$ENV{'KBUILD_VERBOSE'}";
@@ -279,10 +279,10 @@ my $doc_special = "\@\%\$\&";
279my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start. 279my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start.
280my $doc_end = '\*/'; 280my $doc_end = '\*/';
281my $doc_com = '\s*\*\s*'; 281my $doc_com = '\s*\*\s*';
282my $doc_decl = $doc_com.'(\w+)'; 282my $doc_decl = $doc_com . '(\w+)';
283my $doc_sect = $doc_com.'(['.$doc_special.']?[\w\s]+):(.*)'; 283my $doc_sect = $doc_com . '([' . $doc_special . ']?[\w\s]+):(.*)';
284my $doc_content = $doc_com.'(.*)'; 284my $doc_content = $doc_com . '(.*)';
285my $doc_block = $doc_com.'DOC:\s*(.*)?'; 285my $doc_block = $doc_com . 'DOC:\s*(.*)?';
286 286
287my %constants; 287my %constants;
288my %parameterdescs; 288my %parameterdescs;
@@ -485,12 +485,12 @@ sub output_enum_html(%) {
485 my %args = %{$_[0]}; 485 my %args = %{$_[0]};
486 my ($parameter); 486 my ($parameter);
487 my $count; 487 my $count;
488 print "<h2>enum ".$args{'enum'}."</h2>\n"; 488 print "<h2>enum " . $args{'enum'} . "</h2>\n";
489 489
490 print "<b>enum ".$args{'enum'}."</b> {<br>\n"; 490 print "<b>enum " . $args{'enum'} . "</b> {<br>\n";
491 $count = 0; 491 $count = 0;
492 foreach $parameter (@{$args{'parameterlist'}}) { 492 foreach $parameter (@{$args{'parameterlist'}}) {
493 print " <b>".$parameter."</b>"; 493 print " <b>" . $parameter . "</b>";
494 if ($count != $#{$args{'parameterlist'}}) { 494 if ($count != $#{$args{'parameterlist'}}) {
495 $count++; 495 $count++;
496 print ",\n"; 496 print ",\n";
@@ -502,7 +502,7 @@ sub output_enum_html(%) {
502 print "<h3>Constants</h3>\n"; 502 print "<h3>Constants</h3>\n";
503 print "<dl>\n"; 503 print "<dl>\n";
504 foreach $parameter (@{$args{'parameterlist'}}) { 504 foreach $parameter (@{$args{'parameterlist'}}) {
505 print "<dt><b>".$parameter."</b>\n"; 505 print "<dt><b>" . $parameter . "</b>\n";
506 print "<dd>"; 506 print "<dd>";
507 output_highlight($args{'parameterdescs'}{$parameter}); 507 output_highlight($args{'parameterdescs'}{$parameter});
508 } 508 }
@@ -516,9 +516,9 @@ sub output_typedef_html(%) {
516 my %args = %{$_[0]}; 516 my %args = %{$_[0]};
517 my ($parameter); 517 my ($parameter);
518 my $count; 518 my $count;
519 print "<h2>typedef ".$args{'typedef'}."</h2>\n"; 519 print "<h2>typedef " . $args{'typedef'} . "</h2>\n";
520 520
521 print "<b>typedef ".$args{'typedef'}."</b>\n"; 521 print "<b>typedef " . $args{'typedef'} . "</b>\n";
522 output_section_html(@_); 522 output_section_html(@_);
523 print "<hr>\n"; 523 print "<hr>\n";
524} 524}
@@ -528,8 +528,8 @@ sub output_struct_html(%) {
528 my %args = %{$_[0]}; 528 my %args = %{$_[0]};
529 my ($parameter); 529 my ($parameter);
530 530
531 print "<h2>".$args{'type'}." ".$args{'struct'}. " - " .$args{'purpose'}."</h2>\n"; 531 print "<h2>" . $args{'type'} . " " . $args{'struct'} . " - " . $args{'purpose'} . "</h2>\n";
532 print "<b>".$args{'type'}." ".$args{'struct'}."</b> {<br>\n"; 532 print "<b>" . $args{'type'} . " " . $args{'struct'} . "</b> {<br>\n";
533 foreach $parameter (@{$args{'parameterlist'}}) { 533 foreach $parameter (@{$args{'parameterlist'}}) {
534 if ($parameter =~ /^#/) { 534 if ($parameter =~ /^#/) {
535 print "$parameter<br>\n"; 535 print "$parameter<br>\n";
@@ -561,7 +561,7 @@ sub output_struct_html(%) {
561 $parameter_name =~ s/\[.*//; 561 $parameter_name =~ s/\[.*//;
562 562
563 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 563 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
564 print "<dt><b>".$parameter."</b>\n"; 564 print "<dt><b>" . $parameter . "</b>\n";
565 print "<dd>"; 565 print "<dd>";
566 output_highlight($args{'parameterdescs'}{$parameter_name}); 566 output_highlight($args{'parameterdescs'}{$parameter_name});
567 } 567 }
@@ -576,9 +576,9 @@ sub output_function_html(%) {
576 my ($parameter, $section); 576 my ($parameter, $section);
577 my $count; 577 my $count;
578 578
579 print "<h2>" .$args{'function'}." - ".$args{'purpose'}."</h2>\n"; 579 print "<h2>" . $args{'function'} . " - " . $args{'purpose'} . "</h2>\n";
580 print "<i>".$args{'functiontype'}."</i>\n"; 580 print "<i>" . $args{'functiontype'} . "</i>\n";
581 print "<b>".$args{'function'}."</b>\n"; 581 print "<b>" . $args{'function'} . "</b>\n";
582 print "("; 582 print "(";
583 $count = 0; 583 $count = 0;
584 foreach $parameter (@{$args{'parameterlist'}}) { 584 foreach $parameter (@{$args{'parameterlist'}}) {
@@ -587,7 +587,7 @@ sub output_function_html(%) {
587 # pointer-to-function 587 # pointer-to-function
588 print "<i>$1</i><b>$parameter</b>) <i>($2)</i>"; 588 print "<i>$1</i><b>$parameter</b>) <i>($2)</i>";
589 } else { 589 } else {
590 print "<i>".$type."</i> <b>".$parameter."</b>"; 590 print "<i>" . $type . "</i> <b>" . $parameter . "</b>";
591 } 591 }
592 if ($count != $#{$args{'parameterlist'}}) { 592 if ($count != $#{$args{'parameterlist'}}) {
593 $count++; 593 $count++;
@@ -603,7 +603,7 @@ sub output_function_html(%) {
603 $parameter_name =~ s/\[.*//; 603 $parameter_name =~ s/\[.*//;
604 604
605 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 605 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
606 print "<dt><b>".$parameter."</b>\n"; 606 print "<dt><b>" . $parameter . "</b>\n";
607 print "<dd>"; 607 print "<dd>";
608 output_highlight($args{'parameterdescs'}{$parameter_name}); 608 output_highlight($args{'parameterdescs'}{$parameter_name});
609 } 609 }
@@ -657,7 +657,7 @@ sub output_function_xml(%) {
657 my $count; 657 my $count;
658 my $id; 658 my $id;
659 659
660 $id = "API-".$args{'function'}; 660 $id = "API-" . $args{'function'};
661 $id =~ s/[^A-Za-z0-9]/-/g; 661 $id =~ s/[^A-Za-z0-9]/-/g;
662 662
663 print "<refentry id=\"$id\">\n"; 663 print "<refentry id=\"$id\">\n";
@@ -667,12 +667,12 @@ sub output_function_xml(%) {
667 print " <date>$man_date</date>\n"; 667 print " <date>$man_date</date>\n";
668 print "</refentryinfo>\n"; 668 print "</refentryinfo>\n";
669 print "<refmeta>\n"; 669 print "<refmeta>\n";
670 print " <refentrytitle><phrase>".$args{'function'}."</phrase></refentrytitle>\n"; 670 print " <refentrytitle><phrase>" . $args{'function'} . "</phrase></refentrytitle>\n";
671 print " <manvolnum>9</manvolnum>\n"; 671 print " <manvolnum>9</manvolnum>\n";
672 print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; 672 print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n";
673 print "</refmeta>\n"; 673 print "</refmeta>\n";
674 print "<refnamediv>\n"; 674 print "<refnamediv>\n";
675 print " <refname>".$args{'function'}."</refname>\n"; 675 print " <refname>" . $args{'function'} . "</refname>\n";
676 print " <refpurpose>\n"; 676 print " <refpurpose>\n";
677 print " "; 677 print " ";
678 output_highlight ($args{'purpose'}); 678 output_highlight ($args{'purpose'});
@@ -682,8 +682,8 @@ sub output_function_xml(%) {
682 print "<refsynopsisdiv>\n"; 682 print "<refsynopsisdiv>\n";
683 print " <title>Synopsis</title>\n"; 683 print " <title>Synopsis</title>\n";
684 print " <funcsynopsis><funcprototype>\n"; 684 print " <funcsynopsis><funcprototype>\n";
685 print " <funcdef>".$args{'functiontype'}." "; 685 print " <funcdef>" . $args{'functiontype'} . " ";
686 print "<function>".$args{'function'}." </function></funcdef>\n"; 686 print "<function>" . $args{'function'} . " </function></funcdef>\n";
687 687
688 $count = 0; 688 $count = 0;
689 if ($#{$args{'parameterlist'}} >= 0) { 689 if ($#{$args{'parameterlist'}} >= 0) {
@@ -694,7 +694,7 @@ sub output_function_xml(%) {
694 print " <paramdef>$1<parameter>$parameter</parameter>)\n"; 694 print " <paramdef>$1<parameter>$parameter</parameter>)\n";
695 print " <funcparams>$2</funcparams></paramdef>\n"; 695 print " <funcparams>$2</funcparams></paramdef>\n";
696 } else { 696 } else {
697 print " <paramdef>".$type; 697 print " <paramdef>" . $type;
698 print " <parameter>$parameter</parameter></paramdef>\n"; 698 print " <parameter>$parameter</parameter></paramdef>\n";
699 } 699 }
700 } 700 }
@@ -734,7 +734,7 @@ sub output_struct_xml(%) {
734 my ($parameter, $section); 734 my ($parameter, $section);
735 my $id; 735 my $id;
736 736
737 $id = "API-struct-".$args{'struct'}; 737 $id = "API-struct-" . $args{'struct'};
738 $id =~ s/[^A-Za-z0-9]/-/g; 738 $id =~ s/[^A-Za-z0-9]/-/g;
739 739
740 print "<refentry id=\"$id\">\n"; 740 print "<refentry id=\"$id\">\n";
@@ -744,12 +744,12 @@ sub output_struct_xml(%) {
744 print " <date>$man_date</date>\n"; 744 print " <date>$man_date</date>\n";
745 print "</refentryinfo>\n"; 745 print "</refentryinfo>\n";
746 print "<refmeta>\n"; 746 print "<refmeta>\n";
747 print " <refentrytitle><phrase>".$args{'type'}." ".$args{'struct'}."</phrase></refentrytitle>\n"; 747 print " <refentrytitle><phrase>" . $args{'type'} . " " . $args{'struct'} . "</phrase></refentrytitle>\n";
748 print " <manvolnum>9</manvolnum>\n"; 748 print " <manvolnum>9</manvolnum>\n";
749 print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; 749 print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n";
750 print "</refmeta>\n"; 750 print "</refmeta>\n";
751 print "<refnamediv>\n"; 751 print "<refnamediv>\n";
752 print " <refname>".$args{'type'}." ".$args{'struct'}."</refname>\n"; 752 print " <refname>" . $args{'type'} . " " . $args{'struct'} . "</refname>\n";
753 print " <refpurpose>\n"; 753 print " <refpurpose>\n";
754 print " "; 754 print " ";
755 output_highlight ($args{'purpose'}); 755 output_highlight ($args{'purpose'});
@@ -759,7 +759,7 @@ sub output_struct_xml(%) {
759 print "<refsynopsisdiv>\n"; 759 print "<refsynopsisdiv>\n";
760 print " <title>Synopsis</title>\n"; 760 print " <title>Synopsis</title>\n";
761 print " <programlisting>\n"; 761 print " <programlisting>\n";
762 print $args{'type'}." ".$args{'struct'}." {\n"; 762 print $args{'type'} . " " . $args{'struct'} . " {\n";
763 foreach $parameter (@{$args{'parameterlist'}}) { 763 foreach $parameter (@{$args{'parameterlist'}}) {
764 if ($parameter =~ /^#/) { 764 if ($parameter =~ /^#/) {
765 print "$parameter\n"; 765 print "$parameter\n";
@@ -779,7 +779,7 @@ sub output_struct_xml(%) {
779 # bitfield 779 # bitfield
780 print " $1 $parameter$2;\n"; 780 print " $1 $parameter$2;\n";
781 } else { 781 } else {
782 print " ".$type." ".$parameter.";\n"; 782 print " " . $type . " " . $parameter . ";\n";
783 } 783 }
784 } 784 }
785 print "};"; 785 print "};";
@@ -824,7 +824,7 @@ sub output_enum_xml(%) {
824 my $count; 824 my $count;
825 my $id; 825 my $id;
826 826
827 $id = "API-enum-".$args{'enum'}; 827 $id = "API-enum-" . $args{'enum'};
828 $id =~ s/[^A-Za-z0-9]/-/g; 828 $id =~ s/[^A-Za-z0-9]/-/g;
829 829
830 print "<refentry id=\"$id\">\n"; 830 print "<refentry id=\"$id\">\n";
@@ -834,12 +834,12 @@ sub output_enum_xml(%) {
834 print " <date>$man_date</date>\n"; 834 print " <date>$man_date</date>\n";
835 print "</refentryinfo>\n"; 835 print "</refentryinfo>\n";
836 print "<refmeta>\n"; 836 print "<refmeta>\n";
837 print " <refentrytitle><phrase>enum ".$args{'enum'}."</phrase></refentrytitle>\n"; 837 print " <refentrytitle><phrase>enum " . $args{'enum'} . "</phrase></refentrytitle>\n";
838 print " <manvolnum>9</manvolnum>\n"; 838 print " <manvolnum>9</manvolnum>\n";
839 print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n"; 839 print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n";
840 print "</refmeta>\n"; 840 print "</refmeta>\n";
841 print "<refnamediv>\n"; 841 print "<refnamediv>\n";
842 print " <refname>enum ".$args{'enum'}."</refname>\n"; 842 print " <refname>enum " . $args{'enum'} . "</refname>\n";
843 print " <refpurpose>\n"; 843 print " <refpurpose>\n";
844 print " "; 844 print " ";
845 output_highlight ($args{'purpose'}); 845 output_highlight ($args{'purpose'});
@@ -849,7 +849,7 @@ sub output_enum_xml(%) {
849 print "<refsynopsisdiv>\n"; 849 print "<refsynopsisdiv>\n";
850 print " <title>Synopsis</title>\n"; 850 print " <title>Synopsis</title>\n";
851 print " <programlisting>\n"; 851 print " <programlisting>\n";
852 print "enum ".$args{'enum'}." {\n"; 852 print "enum " . $args{'enum'} . " {\n";
853 $count = 0; 853 $count = 0;
854 foreach $parameter (@{$args{'parameterlist'}}) { 854 foreach $parameter (@{$args{'parameterlist'}}) {
855 print " $parameter"; 855 print " $parameter";
@@ -891,7 +891,7 @@ sub output_typedef_xml(%) {
891 my ($parameter, $section); 891 my ($parameter, $section);
892 my $id; 892 my $id;
893 893
894 $id = "API-typedef-".$args{'typedef'}; 894 $id = "API-typedef-" . $args{'typedef'};
895 $id =~ s/[^A-Za-z0-9]/-/g; 895 $id =~ s/[^A-Za-z0-9]/-/g;
896 896
897 print "<refentry id=\"$id\">\n"; 897 print "<refentry id=\"$id\">\n";
@@ -901,11 +901,11 @@ sub output_typedef_xml(%) {
901 print " <date>$man_date</date>\n"; 901 print " <date>$man_date</date>\n";
902 print "</refentryinfo>\n"; 902 print "</refentryinfo>\n";
903 print "<refmeta>\n"; 903 print "<refmeta>\n";
904 print " <refentrytitle><phrase>typedef ".$args{'typedef'}."</phrase></refentrytitle>\n"; 904 print " <refentrytitle><phrase>typedef " . $args{'typedef'} . "</phrase></refentrytitle>\n";
905 print " <manvolnum>9</manvolnum>\n"; 905 print " <manvolnum>9</manvolnum>\n";
906 print "</refmeta>\n"; 906 print "</refmeta>\n";
907 print "<refnamediv>\n"; 907 print "<refnamediv>\n";
908 print " <refname>typedef ".$args{'typedef'}."</refname>\n"; 908 print " <refname>typedef " . $args{'typedef'} . "</refname>\n";
909 print " <refpurpose>\n"; 909 print " <refpurpose>\n";
910 print " "; 910 print " ";
911 output_highlight ($args{'purpose'}); 911 output_highlight ($args{'purpose'});
@@ -914,7 +914,7 @@ sub output_typedef_xml(%) {
914 914
915 print "<refsynopsisdiv>\n"; 915 print "<refsynopsisdiv>\n";
916 print " <title>Synopsis</title>\n"; 916 print " <title>Synopsis</title>\n";
917 print " <synopsis>typedef ".$args{'typedef'}.";</synopsis>\n"; 917 print " <synopsis>typedef " . $args{'typedef'} . ";</synopsis>\n";
918 print "</refsynopsisdiv>\n"; 918 print "</refsynopsisdiv>\n";
919 919
920 output_section_xml(@_); 920 output_section_xml(@_);
@@ -963,15 +963,15 @@ sub output_function_gnome {
963 my $count; 963 my $count;
964 my $id; 964 my $id;
965 965
966 $id = $args{'module'}."-".$args{'function'}; 966 $id = $args{'module'} . "-" . $args{'function'};
967 $id =~ s/[^A-Za-z0-9]/-/g; 967 $id =~ s/[^A-Za-z0-9]/-/g;
968 968
969 print "<sect2>\n"; 969 print "<sect2>\n";
970 print " <title id=\"$id\">".$args{'function'}."</title>\n"; 970 print " <title id=\"$id\">" . $args{'function'} . "</title>\n";
971 971
972 print " <funcsynopsis>\n"; 972 print " <funcsynopsis>\n";
973 print " <funcdef>".$args{'functiontype'}." "; 973 print " <funcdef>" . $args{'functiontype'} . " ";
974 print "<function>".$args{'function'}." "; 974 print "<function>" . $args{'function'} . " ";
975 print "</function></funcdef>\n"; 975 print "</function></funcdef>\n";
976 976
977 $count = 0; 977 $count = 0;
@@ -983,7 +983,7 @@ sub output_function_gnome {
983 print " <paramdef>$1 <parameter>$parameter</parameter>)\n"; 983 print " <paramdef>$1 <parameter>$parameter</parameter>)\n";
984 print " <funcparams>$2</funcparams></paramdef>\n"; 984 print " <funcparams>$2</funcparams></paramdef>\n";
985 } else { 985 } else {
986 print " <paramdef>".$type; 986 print " <paramdef>" . $type;
987 print " <parameter>$parameter</parameter></paramdef>\n"; 987 print " <parameter>$parameter</parameter></paramdef>\n";
988 } 988 }
989 } 989 }
@@ -1043,13 +1043,13 @@ sub output_function_man(%) {
1043 print ".TH \"$args{'function'}\" 9 \"$args{'function'}\" \"$man_date\" \"Kernel Hacker's Manual\" LINUX\n"; 1043 print ".TH \"$args{'function'}\" 9 \"$args{'function'}\" \"$man_date\" \"Kernel Hacker's Manual\" LINUX\n";
1044 1044
1045 print ".SH NAME\n"; 1045 print ".SH NAME\n";
1046 print $args{'function'}." \\- ".$args{'purpose'}."\n"; 1046 print $args{'function'} . " \\- " . $args{'purpose'} . "\n";
1047 1047
1048 print ".SH SYNOPSIS\n"; 1048 print ".SH SYNOPSIS\n";
1049 if ($args{'functiontype'} ne "") { 1049 if ($args{'functiontype'} ne "") {
1050 print ".B \"".$args{'functiontype'}."\" ".$args{'function'}."\n"; 1050 print ".B \"" . $args{'functiontype'} . "\" " . $args{'function'} . "\n";
1051 } else { 1051 } else {
1052 print ".B \"".$args{'function'}."\n"; 1052 print ".B \"" . $args{'function'} . "\n";
1053 } 1053 }
1054 $count = 0; 1054 $count = 0;
1055 my $parenth = "("; 1055 my $parenth = "(";
@@ -1061,10 +1061,10 @@ sub output_function_man(%) {
1061 $type = $args{'parametertypes'}{$parameter}; 1061 $type = $args{'parametertypes'}{$parameter};
1062 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 1062 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
1063 # pointer-to-function 1063 # pointer-to-function
1064 print ".BI \"".$parenth.$1."\" ".$parameter." \") (".$2.")".$post."\"\n"; 1064 print ".BI \"" . $parenth . $1 . "\" " . $parameter . " \") (" . $2 . ")" . $post . "\"\n";
1065 } else { 1065 } else {
1066 $type =~ s/([^\*])$/$1 /; 1066 $type =~ s/([^\*])$/$1 /;
1067 print ".BI \"".$parenth.$type."\" ".$parameter." \"".$post."\"\n"; 1067 print ".BI \"" . $parenth . $type . "\" " . $parameter . " \"" . $post . "\"\n";
1068 } 1068 }
1069 $count++; 1069 $count++;
1070 $parenth = ""; 1070 $parenth = "";
@@ -1075,7 +1075,7 @@ sub output_function_man(%) {
1075 my $parameter_name = $parameter; 1075 my $parameter_name = $parameter;
1076 $parameter_name =~ s/\[.*//; 1076 $parameter_name =~ s/\[.*//;
1077 1077
1078 print ".IP \"".$parameter."\" 12\n"; 1078 print ".IP \"" . $parameter . "\" 12\n";
1079 output_highlight($args{'parameterdescs'}{$parameter_name}); 1079 output_highlight($args{'parameterdescs'}{$parameter_name});
1080 } 1080 }
1081 foreach $section (@{$args{'sectionlist'}}) { 1081 foreach $section (@{$args{'sectionlist'}}) {
@@ -1094,10 +1094,10 @@ sub output_enum_man(%) {
1094 print ".TH \"$args{'module'}\" 9 \"enum $args{'enum'}\" \"$man_date\" \"API Manual\" LINUX\n"; 1094 print ".TH \"$args{'module'}\" 9 \"enum $args{'enum'}\" \"$man_date\" \"API Manual\" LINUX\n";
1095 1095
1096 print ".SH NAME\n"; 1096 print ".SH NAME\n";
1097 print "enum ".$args{'enum'}." \\- ".$args{'purpose'}."\n"; 1097 print "enum " . $args{'enum'} . " \\- " . $args{'purpose'} . "\n";
1098 1098
1099 print ".SH SYNOPSIS\n"; 1099 print ".SH SYNOPSIS\n";
1100 print "enum ".$args{'enum'}." {\n"; 1100 print "enum " . $args{'enum'} . " {\n";
1101 $count = 0; 1101 $count = 0;
1102 foreach my $parameter (@{$args{'parameterlist'}}) { 1102 foreach my $parameter (@{$args{'parameterlist'}}) {
1103 print ".br\n.BI \" $parameter\"\n"; 1103 print ".br\n.BI \" $parameter\"\n";
@@ -1116,7 +1116,7 @@ sub output_enum_man(%) {
1116 my $parameter_name = $parameter; 1116 my $parameter_name = $parameter;
1117 $parameter_name =~ s/\[.*//; 1117 $parameter_name =~ s/\[.*//;
1118 1118
1119 print ".IP \"".$parameter."\" 12\n"; 1119 print ".IP \"" . $parameter . "\" 12\n";
1120 output_highlight($args{'parameterdescs'}{$parameter_name}); 1120 output_highlight($args{'parameterdescs'}{$parameter_name});
1121 } 1121 }
1122 foreach $section (@{$args{'sectionlist'}}) { 1122 foreach $section (@{$args{'sectionlist'}}) {
@@ -1131,13 +1131,13 @@ sub output_struct_man(%) {
1131 my %args = %{$_[0]}; 1131 my %args = %{$_[0]};
1132 my ($parameter, $section); 1132 my ($parameter, $section);
1133 1133
1134 print ".TH \"$args{'module'}\" 9 \"".$args{'type'}." ".$args{'struct'}."\" \"$man_date\" \"API Manual\" LINUX\n"; 1134 print ".TH \"$args{'module'}\" 9 \"" . $args{'type'} . " " . $args{'struct'} . "\" \"$man_date\" \"API Manual\" LINUX\n";
1135 1135
1136 print ".SH NAME\n"; 1136 print ".SH NAME\n";
1137 print $args{'type'}." ".$args{'struct'}." \\- ".$args{'purpose'}."\n"; 1137 print $args{'type'} . " " . $args{'struct'} . " \\- " . $args{'purpose'} . "\n";
1138 1138
1139 print ".SH SYNOPSIS\n"; 1139 print ".SH SYNOPSIS\n";
1140 print $args{'type'}." ".$args{'struct'}." {\n.br\n"; 1140 print $args{'type'} . " " . $args{'struct'} . " {\n.br\n";
1141 1141
1142 foreach my $parameter (@{$args{'parameterlist'}}) { 1142 foreach my $parameter (@{$args{'parameterlist'}}) {
1143 if ($parameter =~ /^#/) { 1143 if ($parameter =~ /^#/) {
@@ -1151,13 +1151,13 @@ sub output_struct_man(%) {
1151 $type = $args{'parametertypes'}{$parameter}; 1151 $type = $args{'parametertypes'}{$parameter};
1152 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 1152 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
1153 # pointer-to-function 1153 # pointer-to-function
1154 print ".BI \" ".$1."\" ".$parameter." \") (".$2.")"."\"\n;\n"; 1154 print ".BI \" " . $1 . "\" " . $parameter . " \") (" . $2 . ")" . "\"\n;\n";
1155 } elsif ($type =~ m/^(.*?)\s*(:.*)/) { 1155 } elsif ($type =~ m/^(.*?)\s*(:.*)/) {
1156 # bitfield 1156 # bitfield
1157 print ".BI \" ".$1."\ \" ".$parameter.$2." \""."\"\n;\n"; 1157 print ".BI \" " . $1 . "\ \" " . $parameter . $2 . " \"" . "\"\n;\n";
1158 } else { 1158 } else {
1159 $type =~ s/([^\*])$/$1 /; 1159 $type =~ s/([^\*])$/$1 /;
1160 print ".BI \" ".$type."\" ".$parameter." \""."\"\n;\n"; 1160 print ".BI \" " . $type . "\" " . $parameter . " \"" . "\"\n;\n";
1161 } 1161 }
1162 print "\n.br\n"; 1162 print "\n.br\n";
1163 } 1163 }
@@ -1171,7 +1171,7 @@ sub output_struct_man(%) {
1171 $parameter_name =~ s/\[.*//; 1171 $parameter_name =~ s/\[.*//;
1172 1172
1173 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 1173 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
1174 print ".IP \"".$parameter."\" 12\n"; 1174 print ".IP \"" . $parameter . "\" 12\n";
1175 output_highlight($args{'parameterdescs'}{$parameter_name}); 1175 output_highlight($args{'parameterdescs'}{$parameter_name});
1176 } 1176 }
1177 foreach $section (@{$args{'sectionlist'}}) { 1177 foreach $section (@{$args{'sectionlist'}}) {
@@ -1189,7 +1189,7 @@ sub output_typedef_man(%) {
1189 print ".TH \"$args{'module'}\" 9 \"$args{'typedef'}\" \"$man_date\" \"API Manual\" LINUX\n"; 1189 print ".TH \"$args{'module'}\" 9 \"$args{'typedef'}\" \"$man_date\" \"API Manual\" LINUX\n";
1190 1190
1191 print ".SH NAME\n"; 1191 print ".SH NAME\n";
1192 print "typedef ".$args{'typedef'}." \\- ".$args{'purpose'}."\n"; 1192 print "typedef " . $args{'typedef'} . " \\- " . $args{'purpose'} . "\n";
1193 1193
1194 foreach $section (@{$args{'sectionlist'}}) { 1194 foreach $section (@{$args{'sectionlist'}}) {
1195 print ".SH \"$section\"\n"; 1195 print ".SH \"$section\"\n";
@@ -1218,13 +1218,13 @@ sub output_function_text(%) {
1218 my $start; 1218 my $start;
1219 1219
1220 print "Name:\n\n"; 1220 print "Name:\n\n";
1221 print $args{'function'}." - ".$args{'purpose'}."\n"; 1221 print $args{'function'} . " - " . $args{'purpose'} . "\n";
1222 1222
1223 print "\nSynopsis:\n\n"; 1223 print "\nSynopsis:\n\n";
1224 if ($args{'functiontype'} ne "") { 1224 if ($args{'functiontype'} ne "") {
1225 $start = $args{'functiontype'}." ".$args{'function'}." ("; 1225 $start = $args{'functiontype'} . " " . $args{'function'} . " (";
1226 } else { 1226 } else {
1227 $start = $args{'function'}." ("; 1227 $start = $args{'function'} . " (";
1228 } 1228 }
1229 print $start; 1229 print $start;
1230 1230
@@ -1233,9 +1233,9 @@ sub output_function_text(%) {
1233 $type = $args{'parametertypes'}{$parameter}; 1233 $type = $args{'parametertypes'}{$parameter};
1234 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { 1234 if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
1235 # pointer-to-function 1235 # pointer-to-function
1236 print $1.$parameter.") (".$2; 1236 print $1 . $parameter . ") (" . $2;
1237 } else { 1237 } else {
1238 print $type." ".$parameter; 1238 print $type . " " . $parameter;
1239 } 1239 }
1240 if ($count != $#{$args{'parameterlist'}}) { 1240 if ($count != $#{$args{'parameterlist'}}) {
1241 $count++; 1241 $count++;
@@ -1251,7 +1251,7 @@ sub output_function_text(%) {
1251 my $parameter_name = $parameter; 1251 my $parameter_name = $parameter;
1252 $parameter_name =~ s/\[.*//; 1252 $parameter_name =~ s/\[.*//;
1253 1253
1254 print $parameter."\n\t".$args{'parameterdescs'}{$parameter_name}."\n"; 1254 print $parameter . "\n\t" . $args{'parameterdescs'}{$parameter_name} . "\n";
1255 } 1255 }
1256 output_section_text(@_); 1256 output_section_text(@_);
1257} 1257}
@@ -1276,8 +1276,8 @@ sub output_enum_text(%) {
1276 my $count; 1276 my $count;
1277 print "Enum:\n\n"; 1277 print "Enum:\n\n";
1278 1278
1279 print "enum ".$args{'enum'}." - ".$args{'purpose'}."\n\n"; 1279 print "enum " . $args{'enum'} . " - " . $args{'purpose'} . "\n\n";
1280 print "enum ".$args{'enum'}." {\n"; 1280 print "enum " . $args{'enum'} . " {\n";
1281 $count = 0; 1281 $count = 0;
1282 foreach $parameter (@{$args{'parameterlist'}}) { 1282 foreach $parameter (@{$args{'parameterlist'}}) {
1283 print "\t$parameter"; 1283 print "\t$parameter";
@@ -1292,7 +1292,7 @@ sub output_enum_text(%) {
1292 print "Constants:\n\n"; 1292 print "Constants:\n\n";
1293 foreach $parameter (@{$args{'parameterlist'}}) { 1293 foreach $parameter (@{$args{'parameterlist'}}) {
1294 print "$parameter\n\t"; 1294 print "$parameter\n\t";
1295 print $args{'parameterdescs'}{$parameter}."\n"; 1295 print $args{'parameterdescs'}{$parameter} . "\n";
1296 } 1296 }
1297 1297
1298 output_section_text(@_); 1298 output_section_text(@_);
@@ -1305,7 +1305,7 @@ sub output_typedef_text(%) {
1305 my $count; 1305 my $count;
1306 print "Typedef:\n\n"; 1306 print "Typedef:\n\n";
1307 1307
1308 print "typedef ".$args{'typedef'}." - ".$args{'purpose'}."\n"; 1308 print "typedef " . $args{'typedef'} . " - " . $args{'purpose'} . "\n";
1309 output_section_text(@_); 1309 output_section_text(@_);
1310} 1310}
1311 1311
@@ -1314,8 +1314,8 @@ sub output_struct_text(%) {
1314 my %args = %{$_[0]}; 1314 my %args = %{$_[0]};
1315 my ($parameter); 1315 my ($parameter);
1316 1316
1317 print $args{'type'}." ".$args{'struct'}." - ".$args{'purpose'}."\n\n"; 1317 print $args{'type'} . " " . $args{'struct'} . " - " . $args{'purpose'} . "\n\n";
1318 print $args{'type'}." ".$args{'struct'}." {\n"; 1318 print $args{'type'} . " " . $args{'struct'} . " {\n";
1319 foreach $parameter (@{$args{'parameterlist'}}) { 1319 foreach $parameter (@{$args{'parameterlist'}}) {
1320 if ($parameter =~ /^#/) { 1320 if ($parameter =~ /^#/) {
1321 print "$parameter\n"; 1321 print "$parameter\n";
@@ -1334,7 +1334,7 @@ sub output_struct_text(%) {
1334 # bitfield 1334 # bitfield
1335 print "\t$1 $parameter$2;\n"; 1335 print "\t$1 $parameter$2;\n";
1336 } else { 1336 } else {
1337 print "\t".$type." ".$parameter.";\n"; 1337 print "\t" . $type . " " . $parameter . ";\n";
1338 } 1338 }
1339 } 1339 }
1340 print "};\n\n"; 1340 print "};\n\n";
@@ -1348,7 +1348,7 @@ sub output_struct_text(%) {
1348 1348
1349 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 1349 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
1350 print "$parameter\n\t"; 1350 print "$parameter\n\t";
1351 print $args{'parameterdescs'}{$parameter_name}."\n"; 1351 print $args{'parameterdescs'}{$parameter_name} . "\n";
1352 } 1352 }
1353 print "\n"; 1353 print "\n";
1354 output_section_text(@_); 1354 output_section_text(@_);
@@ -1387,7 +1387,7 @@ sub output_declaration {
1387# generic output function - calls the right one based on current output mode. 1387# generic output function - calls the right one based on current output mode.
1388sub output_blockhead { 1388sub output_blockhead {
1389 no strict 'refs'; 1389 no strict 'refs';
1390 my $func = "output_blockhead_".$output_mode; 1390 my $func = "output_blockhead_" . $output_mode;
1391 &$func(@_); 1391 &$func(@_);
1392 $section_counter++; 1392 $section_counter++;
1393} 1393}
@@ -1398,7 +1398,7 @@ sub output_blockhead {
1398sub dump_declaration($$) { 1398sub dump_declaration($$) {
1399 no strict 'refs'; 1399 no strict 'refs';
1400 my ($prototype, $file) = @_; 1400 my ($prototype, $file) = @_;
1401 my $func = "dump_".$decl_type; 1401 my $func = "dump_" . $decl_type;
1402 &$func(@_); 1402 &$func(@_);
1403} 1403}
1404 1404
@@ -1645,7 +1645,7 @@ sub push_parameter($$$) {
1645 "or member '$param' not " . 1645 "or member '$param' not " .
1646 "described in '$declaration_name'\n"; 1646 "described in '$declaration_name'\n";
1647 } 1647 }
1648 print STDERR "Warning(${file}:$.):". 1648 print STDERR "Warning(${file}:$.):" .
1649 " No description found for parameter '$param'\n"; 1649 " No description found for parameter '$param'\n";
1650 ++$warnings; 1650 ++$warnings;
1651 } 1651 }
@@ -1929,7 +1929,7 @@ sub process_state3_type($$) {
1929 ($2 eq '{') && $brcount++; 1929 ($2 eq '{') && $brcount++;
1930 ($2 eq '}') && $brcount--; 1930 ($2 eq '}') && $brcount--;
1931 if (($2 eq ';') && ($brcount == 0)) { 1931 if (($2 eq ';') && ($brcount == 0)) {
1932 dump_declaration($prototype,$file); 1932 dump_declaration($prototype, $file);
1933 reset_state(); 1933 reset_state();
1934 last; 1934 last;
1935 } 1935 }
@@ -2106,7 +2106,7 @@ sub process_file($) {
2106 $section = $section_default; 2106 $section = $section_default;
2107 $contents = ""; 2107 $contents = "";
2108 } else { 2108 } else {
2109 $contents .= $1."\n"; 2109 $contents .= $1 . "\n";
2110 } 2110 }
2111 } else { 2111 } else {
2112 # i dont know - bad line? ignore. 2112 # i dont know - bad line? ignore.