From 251d93ecd077b29e3c8662a637300fc2a88a3164 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 26 Nov 2005 16:32:14 +0000 Subject: Included tuner.pl Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/tuner.pl | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 v4l/scripts/tuner.pl (limited to 'v4l/scripts') 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 () { + # defines in header file + if (/#define\s+(TUNER_\w+)\s+(\d+)/) { + $data{$1}->{nr} = $2; + next; + } +} +close IN; + +open IN, "<$C"; +while () { + # 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"; +} -- cgit v1.2.3