PRODUCT=3/627/1/1
NAME="QEMU QEMU USB Tablet"
PHYS="usb-0000:07:00.0-1/input0"
UNIQ="28754-0000:00:02.5:00.0-1"
PROP=0
EV=1f
KEY=70000 0 0 0 0
REL=900
ABS=3
MSC=10
MODALIAS=input:b0003v0627p0001e0001-e0,1,2,3,4,k110,111,112,r8,B,a0,1,m4,lsfw
  7   	ˆl–ßi~”êi?u4 Aq—î¥1hß�þ]xŽ¬à�h#i²²9_þÇ„d…ÿÆÅÄ ?÷     	#!/usr/bin/perl -w
#
# Copyright (c) 2004 Stefan Moeding <s.moeding@setuid.de>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#       $Id: hsdb,v 1.13 2004/04/01 16:22:43 sm Exp $
#


use strict;
use utf8;
use Getopt::Long;


my $conffile = '/usr/local/etc/hsdb.ini';

##############################################################################
#
# Argumente auswerten:
# --file=...   Filename, der gelesen oder geschrieben werden soll (abhÃ¤ngig
#              vom Kommando)
# --cmd=...    auszufÃ¼hrendes Kommando
# --hive=...   Hive Name
# --opt=...    Kommandospezifische Option
# --arg=...    Argument fÃ¼r das Kommando (z.B. Suchmuster fÃ¼r Paketname)
# --index=...  Index des Ergebnisses
#
my ($file, $cmd, $arg, $hive, $opt, $index);

GetOptions("cmd=s"  => \$cmd,  "arg=s"  => \$arg,
           "hive=s" => \$hive, "file=s" => \$file,
           "index=i" => \$index,
	   "opt=s" => \$opt ) || die;

die "Option cmd is mandatory" if (!defined($cmd));
die "Option arg is mandatory" if (!defined($arg));

$file = '-' if (!defined($file));	# Use stdin
$index = 0 if (!defined($index));
$cmd  = lc($cmd);			# Lowercase the command string
$arg =~ tr/*?/%_/;			# Replace with SQL symbols

#
#
#
my $rc = 0;

if ($cmd eq "addr_get") {
  my $db = new HSAddress;
  $db->init($conffile);
  $rc = $db->addr_get($arg, $file);
}
elsif ($cmd eq "addr_get_by_index") {
  my $db = new HSAddress;
  $db->init($conffile);
  $rc = $db->addr_get_by_index($arg, $file, $index);
}
elsif ($cmd eq "addr_exists") {
  my $db = new HSAddress;
  $db->init($conffile);
  $rc = $db->addr_exists($arg, $file);
}
elsif ($cmd eq "hive_get") {
  my $db = new HSHive;
  $db->init($conffile);
  $rc = $db->hive_get($arg, $file);
}
elsif ($cmd eq "hives_by_name") {
  my $db = new HSHive;
  $db->init($conffile);
  $rc = $db->hives_by_name($arg);
}
elsif ($cmd eq "pac_get") {
  my $db = new HSPacket;
  $db->init($conffile);
  $rc = $db->pac_get($arg, $file);
}
elsif ($cmd eq "pacs_by_name") {
  my $db = new HSPacket;
  $db->init($conffile);
  $rc = $db->pacs_by_name($arg, $hive);
}
elsif ($cmd eq "pacs_by_member") {
  my $db = new HSPacket;
  $db->init($conffile);
  $rc = $db->pacs_by_member($arg);
}
elsif ($cmd eq "pacs_by_type") {
  my $db = new HSPacket;
  $db->init($conffile);
  $rc = $db->pacs_by_type($arg, $hive);
}
elsif ($cmd eq "pac_exists") {
  my $db = new HSPacket;
  $db->init($conffile);
  $rc = $db->pac_exists($arg);
}
elsif ($cmd eq "pac_list") {
  my $db = new HSPacket;
  $db->init($conffile);
  $rc = $db->pac_list($arg);
}
elsif (