summaryrefslogtreecommitdiff
path: root/contrib/genrpbindings
diff options
context:
space:
mode:
authorsabetts <sabetts>2005-01-15 03:47:16 +0000
committersabetts <sabetts>2005-01-15 03:47:16 +0000
commiteb4f8c1e431d34bfa27a736af0b5d59dde09b200 (patch)
treefd7452f9a799cacb57af4d6a23f644b0385348c5 /contrib/genrpbindings
parent7f6fca323a9a3a05c380e5a3287988ee9de40f8a (diff)
downloadratpoison-eb4f8c1e431d34bfa27a736af0b5d59dde09b200.zip
fix regex to match new actions.c format.
Diffstat (limited to 'contrib/genrpbindings')
-rwxr-xr-xcontrib/genrpbindings23
1 files changed, 16 insertions, 7 deletions
diff --git a/contrib/genrpbindings b/contrib/genrpbindings
index 6c1733b..3cebb56 100755
--- a/contrib/genrpbindings
+++ b/contrib/genrpbindings
@@ -136,15 +136,24 @@ while (<ACTIONS_C>) {
while (<ACTIONS_C>)
{
last if (m!/\*\@end !);
- if (/{\"(.+)\".+},/) {
+ if (/\s*add_command\s*\(\"([^\"]+)\",\s*[^\"]+,\s*([0-9]+),\s*[0-9]+,\s*([0-9]+)/) {
+ my $name = $1;
+ my $numargs = $2;
+ my $optargs = $3;
+
+ # Skip the arguments
+ for (my $i=0; $i<$numargs; $i++) {
+ <ACTIONS_C>;
+ }
+
$nbindings++;
- print PERL "sub $1 { return command (\"$1\", \@_); }";
- print ELISP "(defun-ratpoison $1)";
- print COMMONLISP "(defun-ratpoison $1)";
- print RUBY " def $1 (*args)";
- print RUBY " return command (\"$1\", args)";
+ print PERL "sub $name { return command (\"$name\", \@_); }";
+ print ELISP "(defun-ratpoison $name)";
+ print COMMONLISP "(defun-ratpoison $name)";
+ print RUBY " def $name (*args)";
+ print RUBY " return command (\"$name\", args)";
print RUBY " end";
- print RUBY " module_function :$1\n";
+ print RUBY " module_function :$name\n";
}
}
}