blob: 794f9668b2225927fbde2a1d65e26bed95e3cff8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#!/usr/bin/env perl
$comment="";
print "#ifndef _PLUG_INTF\n";
print "#define _PLUG_INTF\n";
print "\n#include <stdint.h>\n";
print "\n#include <plugin_types.h>\n";
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/) {
my $line = "$_";
while (not ($line =~ /;$/)) {
my $nextline = <STDIN>;
last unless defined $nextline;
$line="$line$nextline";
}
if ($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";
|