docs-rst: improve typedef parser
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 30 Aug 2016 23:20:57 +0000 (20:20 -0300)
committerJonathan Corbet <corbet@lwn.net>
Thu, 1 Sep 2016 14:07:22 +0000 (08:07 -0600)
Improve the parser to handle typedefs like:

typedef bool v4l2_check_dv_timings_fnc(const struct v4l2_dv_timings *t, void *handle);

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
scripts/kernel-doc

index d225e178aa1bb3b7326a57d636ebdefd5c6c3a6a..ad6d4e495f3f3aff6b6e827e9a2282f2889ad5d5 100755 (executable)
@@ -2190,7 +2190,9 @@ sub dump_typedef($$) {
     $x =~ s@/\*.*?\*/@@gos;    # strip comments.
 
     # Parse function prototypes
-    if ($x =~ /typedef\s+(\w+)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/) {
+    if ($x =~ /typedef\s+(\w+)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ ||
+       $x =~ /typedef\s+(\w+)\s*(\w\S+)\s*\s*\((.*)\);/) {
+
        # Function typedefs
        $return_type = $1;
        $declaration_name = $2;