Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83766452 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

kernel-doc: better format typedef function output



A typedef function looks more likely a function and not a
normal typedef. Change the code to use the output_function_*,
in order to properly parse the function prototype parameters.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 3a80a766
Loading
Loading
Loading
Loading
+22 −9
Original line number Original line Diff line number Diff line
@@ -1869,24 +1869,37 @@ sub dump_typedef($$) {
    my $file = shift;
    my $file = shift;


    $x =~ s@/\*.*?\*/@@gos;	# strip comments.
    $x =~ s@/\*.*?\*/@@gos;	# strip comments.
    while (($x =~ /\(*.\)\s*;$/) || ($x =~ /\[*.\]\s*;$/)) {
	$x =~ s/\(*.\)\s*;$/;/;
	$x =~ s/\[*.\]\s*;$/;/;
    }


    if ($x =~ /typedef.*\s+(\w+)\s*;/) {
    # Parse function prototypes
	$declaration_name = $1;
    if ($x =~ /typedef\s+(\w+)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/) {
	# Function typedefs
	$return_type = $1;
	$declaration_name = $2;
	my $args = $3;

	create_parameterlist($args, ',', $file);


	output_declaration($declaration_name,
	output_declaration($declaration_name,
			   'typedef',
			   'function',
			   {'typedef' => $declaration_name,
			   {'function' => $declaration_name,
			    'module' => $modulename,
			    'module' => $modulename,
			    'functiontype' => $return_type,
			    'parameterlist' => \@parameterlist,
			    'parameterdescs' => \%parameterdescs,
			    'parametertypes' => \%parametertypes,
			    'sectionlist' => \@sectionlist,
			    'sectionlist' => \@sectionlist,
			    'sections' => \%sections,
			    'sections' => \%sections,
			    'purpose' => $declaration_purpose
			    'purpose' => $declaration_purpose
			   });
			   });
	return;
    }
    }
    elsif ($x =~ /typedef\s+\w+\s*\(\*\s*(\w\S+)\s*\)\s*\(/) { # functions

    while (($x =~ /\(*.\)\s*;$/) || ($x =~ /\[*.\]\s*;$/)) {
	$x =~ s/\(*.\)\s*;$/;/;
	$x =~ s/\[*.\]\s*;$/;/;
    }

    if ($x =~ /typedef.*\s+(\w+)\s*;/) {
	$declaration_name = $1;
	$declaration_name = $1;


	output_declaration($declaration_name,
	output_declaration($declaration_name,