kernel-doc (f0eef25339f92f7cd4aeea23d9ae97987a5a1e82) kernel-doc (134fe01bfafa74e691d84bf15666fb30e89896ff)
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## ##

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

1464 }
1465 }
1466}
1467
1468sub push_parameter($$$) {
1469 my $param = shift;
1470 my $type = shift;
1471 my $file = shift;
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## ##

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

1464 }
1465 }
1466}
1467
1468sub push_parameter($$$) {
1469 my $param = shift;
1470 my $type = shift;
1471 my $file = shift;
1472 my $anon = 0;
1472
1473 my $param_name = $param;
1474 $param_name =~ s/\[.*//;
1475
1476 if ($type eq "" && $param =~ /\.\.\.$/)
1477 {
1478 $type="";
1479 $parameterdescs{$param} = "variable arguments";
1480 }
1481 elsif ($type eq "" && ($param eq "" or $param eq "void"))
1482 {
1483 $type="";
1484 $param="void";
1485 $parameterdescs{void} = "no arguments";
1486 }
1473
1474 my $param_name = $param;
1475 $param_name =~ s/\[.*//;
1476
1477 if ($type eq "" && $param =~ /\.\.\.$/)
1478 {
1479 $type="";
1480 $parameterdescs{$param} = "variable arguments";
1481 }
1482 elsif ($type eq "" && ($param eq "" or $param eq "void"))
1483 {
1484 $type="";
1485 $param="void";
1486 $parameterdescs{void} = "no arguments";
1487 }
1488 elsif ($type eq "" && ($param eq "struct" or $param eq "union"))
1489 # handle unnamed (anonymous) union or struct:
1490 {
1491 $type = $param;
1492 $param = "{unnamed_" . $param. "}";
1493 $parameterdescs{$param} = "anonymous\n";
1494 $anon = 1;
1495 }
1496
1487 # warn if parameter has no description
1497 # warn if parameter has no description
1488 # (but ignore ones starting with # as these are no parameters
1489 # but inline preprocessor statements
1498 # (but ignore ones starting with # as these are not parameters
1499 # but inline preprocessor statements);
1500 # also ignore unnamed structs/unions;
1501 if (!$anon) {
1490 if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) {
1491
1492 $parameterdescs{$param_name} = $undescribed;
1493
1494 if (($type eq 'function') || ($type eq 'enum')) {
1495 print STDERR "Warning(${file}:$.): Function parameter ".
1496 "or member '$param' not " .
1497 "described in '$declaration_name'\n";
1498 }
1499 print STDERR "Warning(${file}:$.):".
1500 " No description found for parameter '$param'\n";
1501 ++$warnings;
1502 }
1502 if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) {
1503
1504 $parameterdescs{$param_name} = $undescribed;
1505
1506 if (($type eq 'function') || ($type eq 'enum')) {
1507 print STDERR "Warning(${file}:$.): Function parameter ".
1508 "or member '$param' not " .
1509 "described in '$declaration_name'\n";
1510 }
1511 print STDERR "Warning(${file}:$.):".
1512 " No description found for parameter '$param'\n";
1513 ++$warnings;
1514 }
1515 }
1503
1504 push @parameterlist, $param;
1505 $parametertypes{$param} = $type;
1506}
1507
1508##
1509# takes a function prototype and the name of the current file being
1510# processed and spits out all the details stored in the global

--- 397 unchanged lines hidden ---
1516
1517 push @parameterlist, $param;
1518 $parametertypes{$param} = $type;
1519}
1520
1521##
1522# takes a function prototype and the name of the current file being
1523# processed and spits out all the details stored in the global

--- 397 unchanged lines hidden ---