kernel-doc: Add a parser for function typedefs
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 8 Oct 2015 18:21:44 +0000 (15:21 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sat, 10 Oct 2015 13:29:05 +0000 (10:29 -0300)
The current typedef parser only works for non-function typedefs.

As we need to also document some function typedefs, add a
parser for it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
scripts/kernel-doc

index 9a08fb5c1af640f1f65e5ae6a28cb8b95e6f0ad0..55ce47ffa02d98735ca7d8434ddb71c147f3d71b 100755 (executable)
@@ -1886,6 +1886,18 @@ sub dump_typedef($$) {
                            'purpose' => $declaration_purpose
                           });
     }
+    elsif ($x =~ /typedef\s+\w+\s*\(\*\s*(\w\S+)\s*\)\s*\(/) { # functions
+       $declaration_name = $1;
+
+       output_declaration($declaration_name,
+                          'typedef',
+                          {'typedef' => $declaration_name,
+                           'module' => $modulename,
+                           'sectionlist' => \@sectionlist,
+                           'sections' => \%sections,
+                           'purpose' => $declaration_purpose
+                          });
+    }
     else {
        print STDERR "${file}:$.: error: Cannot parse typedef!\n";
        ++$errors;