This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/v4l-utils.git tree:

Subject: keytable: Parse also the IR_TABLE macro
Author:  Mauro Carvalho Chehab <mche...@redhat.com>
Date:    Sat Mar 13 22:16:23 2010 -0300

The IR_TABLE macro provides two useful information: the type
of the IR table, and the table name, as reported by kernel uevent,
at node /sys/class/irrcv/irrcv0/uevent. For example:
        NAME="rc5_hauppauge_new"

This information can be useful to allow userspace to know that
a table needs to be replaced by another.

Signed-off-by: Mauro Carvalho Chehab <mche...@redhat.com>

 utils/keytable/gen_keytables.pl |   38 ++++++++++++++++++++++++++++++--------
 1 files changed, 30 insertions(+), 8 deletions(-)

---

http://git.linuxtv.org/v4l-utils.git?a=commitdiff;h=562123100602f9a21ffb449ba911017286c37618

diff --git a/utils/keytable/gen_keytables.pl b/utils/keytable/gen_keytables.pl
index fad4ccf..625de24 100755
--- a/utils/keytable/gen_keytables.pl
+++ b/utils/keytable/gen_keytables.pl
@@ -3,25 +3,47 @@ use strict;
 
 my $keyname="";
 my $debug=0;
+my $out;
+my $read=0;
+
+sub flush()
+{
+       return if (!$keyname || !$out);
+       open OUT, ">keycodes/$keyname";
+       print OUT $out;
+       close OUT;
+
+       $keyname = "";
+       $out = "";
+}
 
 while (<>) {
        if (m/struct\s+(dvb_usb_rc_key|ir_scancode)\s+(\w[\w\d_]+)/) {
+               flush();
+
                $keyname = $2;
                $keyname =~ s/^ir_codes_//;
-
-               print "Generating keycodes/$keyname\n" if $debug;
-               open OUT, ">keycodes/$keyname";
+               $read = 1;
                next;
        }
-       if ($keyname ne "") {
+       if (m/IR_TABLE\(\s*([^\,\s]+)\s*,\s*([^\,\s]+)\s*,\s*([^\,\s]+)\s*\)/) {
+               my $name = $1;
+               my $type = $2;
+               $type =~ s/IR_TYPE_//;
+               $out = "# table $name, type: $type\n$out";
+               $read = 0;
+
+               flush();
+       }
+       if ($read) {
                if (m/(0x[\dA-Fa-f]+).*(KEY_[^\s\,\}]+)/) {
-                       printf OUT "%s %s\n",$1, $2;
+                       $out .= "$1 $2\n";
                        next;
                }
                if (m/\}/) {
-                       close OUT;
-                       $keyname="";
-                       next;
+                       $read = 0;
                }
        }
 }
+
+flush();

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to