summaryrefslogtreecommitdiff
path: root/v4l/scripts
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2005-11-26 16:32:14 +0000
committerMauro Carvalho Chehab <devnull@localhost>2005-11-26 16:32:14 +0000
commit251d93ecd077b29e3c8662a637300fc2a88a3164 (patch)
tree956845f7cb2be94284f2a66f89f16a02ffa575ec /v4l/scripts
parentd376239fd37a5541b2bb0baad01014f2eda3503e (diff)
downloadmediapointer-dvb-s2-251d93ecd077b29e3c8662a637300fc2a88a3164.tar.gz
mediapointer-dvb-s2-251d93ecd077b29e3c8662a637300fc2a88a3164.tar.bz2
Included tuner.pl
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'v4l/scripts')
-rw-r--r--v4l/scripts/tuner.pl39
1 files changed, 39 insertions, 0 deletions
diff --git a/v4l/scripts/tuner.pl b/v4l/scripts/tuner.pl
new file mode 100644
index 000000000..8cf10da3d
--- /dev/null
+++ b/v4l/scripts/tuner.pl
@@ -0,0 +1,39 @@
+#!/usr/bin/perl -w
+use strict;
+
+my $new_entry = -1;
+my $nr = 0;
+my ($id,$subvendor,$subdevice);
+my %data;
+
+my $H = shift;
+my $C = shift;
+
+open IN, "<$H";
+while (<IN>) {
+ # defines in header file
+ if (/#define\s+(TUNER_\w+)\s+(\d+)/) {
+ $data{$1}->{nr} = $2;
+ next;
+ }
+}
+close IN;
+
+open IN, "<$C";
+while (<IN>) {
+ # tuners
+ if (/\[(TUNER_\w+)\]/) {
+ $id = $1;
+ $data{$id}->{id} = $id;
+ };
+ next unless defined($id);
+
+ if (!defined($data{$id}) || !defined($data{$id}->{name})) {
+ $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/);
+ }
+}
+
+foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) {
+ printf("tuner=%d - %s", $data{$item}->{nr}, $data{$item}->{name});
+ print "\n";
+}