diff options
author | Josh Rahm <rahm@google.com> | 2024-02-16 15:41:49 -0700 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2024-02-21 12:18:46 -0700 |
commit | 22571fc455f50d1774e7abb9a77db3a51182a420 (patch) | |
tree | fbd99182c7ac48ff5dc91e9c29fae5c3da0d1dc3 /harness/tools/genintf.pl | |
parent | 860a75bd4dee36880c9372d1f78ced18d1246988 (diff) | |
download | wetterhorn-22571fc455f50d1774e7abb9a77db3a51182a420.tar.gz wetterhorn-22571fc455f50d1774e7abb9a77db3a51182a420.tar.bz2 wetterhorn-22571fc455f50d1774e7abb9a77db3a51182a420.zip |
Do most of keyboard handling in the plugin now.
Diffstat (limited to 'harness/tools/genintf.pl')
-rw-r--r-- | harness/tools/genintf.pl | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/harness/tools/genintf.pl b/harness/tools/genintf.pl index 6f53951..d446d83 100644 --- a/harness/tools/genintf.pl +++ b/harness/tools/genintf.pl @@ -6,25 +6,38 @@ print "#ifndef _PLUG_INTF\n"; print "#define _PLUG_INTF\n"; print "\n#include <stdint.h>\n"; print "\ntypedef void* opqst_t;\n"; -while (<>) { + +while (<STDIN>) { if (/^\s*\/\*/) { $_ =~ s/^\s*//; $comment="$_"; + next; } if (/^\s*\*/) { $_ =~ s/^\s*/ /; $comment="$comment$_"; + next; } - if (/^\s*EXPORT_INCLUDE\((.*)\)/) { - print "#include $1\n"; - } elsif (/^\s*EXPORT\(\s*((?:\w|\s*\*\s*)+)\s*\(\*(\w+)\)\s*\((.*)\)\);/) { - print "$comment"; - print "$1 $2($3);\n\n"; - $comment=""; - } elsif (/^\s*EXPORT\((.*)\)/) { - print "$1\n"; + if (/^\s*EXPORT/) { + my $line = "$_"; + while (not ($line =~ /;$/)) { + my $nextline = <STDIN>; + last unless defined $nextline; + + $line="$line$nextline"; + } + + if ($line =~ /^\s*EXPORT_INCLUDE\((.*)\)/s) { + print "#include $1\n"; + } elsif ($line =~ /^\s*EXPORT\(\s*((?:\w|\s*\*\s*)+)\s*\(\*(\w+)\)\s*\((.*)\)\);/s) { + print "$comment"; + print "$1 $2($3);\n\n"; + $comment=""; + } elsif ($line =~ /^\s*EXPORT\((.*)\);/s) { + print "$1\n"; + } } } print "#endif /* _PLUG_INTF */\n"; |