diff options
| author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-05-22 22:44:34 +0000 |
|---|---|---|
| committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-05-22 22:44:34 +0000 |
| commit | 0f7e4e36aeb95f3e39a940d6e19748d910d40d92 (patch) | |
| tree | 72df574e93dc33babc1107da581c3b0e30837acc /apps/plugins/lua/action_helper.pl | |
| parent | 475b5dc2bbddd31f4fee8935a0e903147e05fd08 (diff) | |
| download | rockbox-0f7e4e36aeb95f3e39a940d6e19748d910d40d92.zip rockbox-0f7e4e36aeb95f3e39a940d6e19748d910d40d92.tar.gz rockbox-0f7e4e36aeb95f3e39a940d6e19748d910d40d92.tar.bz2 rockbox-0f7e4e36aeb95f3e39a940d6e19748d910d40d92.tar.xz | |
Lua:
* add action_get_touchscreen_press wrapper
* fix kbd_input wrapper
* rework luaL_loadfile
* add rb.contexts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21046 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lua/action_helper.pl')
| -rwxr-xr-x | apps/plugins/lua/action_helper.pl | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/apps/plugins/lua/action_helper.pl b/apps/plugins/lua/action_helper.pl index 8460b6c..f1a1e12 100755 --- a/apps/plugins/lua/action_helper.pl +++ b/apps/plugins/lua/action_helper.pl @@ -22,21 +22,38 @@ $input = $ARGV[0] . "/../../action.h"; open(ACTION, "<$input") or die "Can't open $input!"; -print "-- Don't change this file!\n"; -print "-- It is automatically generated of action.h\n"; -print "rb.actions = {\n"; - $i = 0; +$j = 0; while(my $line = <ACTION>) { chomp($line); - if($line =~ /^\s*(ACTION_[^\s]+)(\s*=.*)?,$/) + if($line =~ /^\s*(ACTION_[^\s]+)(\s*=.*)?,\s*$/) { - printf "\t%s = %d,\n", $1, $i; + $actions[$i] = sprintf("\t%s = %d,\n", $1, $i); $i++; } + elsif($line =~ /^\s*(CONTEXT_[^\s]+)(\s*=.*)?,\s*$/) + { + $contexts[$j] = sprintf("\t%s = %d,\n", $1, $j); + $j++; + } } +close(ACTION); + +print "-- Don't change this file!\n"; +printf "-- It is automatically generated of action.h %s\n", '$Revision'; + +print "rb.actions = {\n"; +foreach $action(@actions) +{ + print $action; +} print "}\n"; -close(ACTION); +print "rb.contexts = {\n"; +foreach $context(@contexts) +{ + print $context; +} +print "}\n"; |