diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2006-01-24 17:44:40 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2006-01-24 17:44:40 +0000 |
commit | 90dd1056e4dec75159f45596165d495cd6ccb299 (patch) | |
tree | f66ac8c929cb98ad498ec6d945052f9f90e4dda7 /make-arrays-from-input.h.pl | |
parent | ec4303a38f6e509646df8365326a4a293bdc7b33 (diff) |
SYN_MAX is not set in linux/input.h and there are only two event codes listed. But the kernel actually puts out a lot of different SYN events. So this script now generates a ev_syn array with 512 init'ed items in the array. That should stop the sigfaults, but it might be a hack
svn path=/trunk/externals/hcs/hid/; revision=4479
Diffstat (limited to 'make-arrays-from-input.h.pl')
-rwxr-xr-x | make-arrays-from-input.h.pl | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/make-arrays-from-input.h.pl b/make-arrays-from-input.h.pl index a54ffaa..91d1c2d 100755 --- a/make-arrays-from-input.h.pl +++ b/make-arrays-from-input.h.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w use Switch; @@ -37,7 +37,7 @@ sub getDataFromHeaderLine if ( m/#define ([A-Z0-9_]*)\s+(0x)?([0-9a-f]+)/) { if ($2) { $index = hex($3); } else { $index = $3; } - if ($index >=0) + if ($index >= 0) { $returnArray[0] = $index; $returnArray[1] = lc("$1"); @@ -49,6 +49,26 @@ sub getDataFromHeaderLine } #------------------------------------------------------------------------ +# +# this is under construction to make the MAX switch structure cleaner +# donno if it works yet. +sub createNewArray +{ + my $myTypeName = shift; + my $myTypeMaxName = shift; + + my $myIndex; + my $myValue; + my @myNewArray; + + ($myIndex, $myValue) = getDataFromHeaderLine($myTypeMaxName); + @myNewArray = initArrayWithGenericNames( $myTypeName, $myIndex + 1 ); + + return @myNewArray; +} + + +#------------------------------------------------------------------------ # declare each array in the header # sub printCArrayDeclarations @@ -156,9 +176,9 @@ while (<INPUT_H>) @SYN = initArrayWithGenericNames( "SYN", $index + 1 ); } case "KEY" { ($index, $value) = getDataFromHeaderLine($_); @KEY = initArrayWithGenericNames( "KEY", $index + 1 ); } - # BTN codes are actually part of the KEY type - case "BTN" { ($index, $value) = getDataFromHeaderLine($_); - @BTN = initArrayWithGenericNames( "KEY", $index + 1 ); } +# BTN codes are actually part of the KEY type, so this array is unused +# case "BTN" { ($index, $value) = getDataFromHeaderLine($_); +# @BTN = initArrayWithGenericNames( "KEY", $index + 1 ); } case "REL" { ($index, $value) = getDataFromHeaderLine($_); @REL = initArrayWithGenericNames( "REL", $index + 1 ); } case "ABS" { ($index, $value) = getDataFromHeaderLine($_); @@ -182,6 +202,10 @@ while (<INPUT_H>) } } +# there is no SYN_MAX defined in input.h, so we set it here: +@SYN = initArrayWithGenericNames( "SYN", 512 ); + + seek( INPUT_H, 0, 0 ); while (<INPUT_H>) { |