OpenCores
URL https://opencores.org/ocsvn/socgen/socgen/trunk

Subversion Repositories socgen

[/] [socgen/] [trunk/] [tools/] [bin/] [read_db] - Blame information for rev 135

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 135 jt_eaton
eval 'exec `which perl` -S $0 ${1+"$@"}'
2
   if 0;
3
#/**********************************************************************/
4
#/*                                                                    */
5
#/*             -------                                                */
6
#/*            /   SOC  \                                              */
7
#/*           /    GEN   \                                             */
8
#/*          /    TOOL    \                                            */
9
#/*          ==============                                            */
10
#/*          |            |                                            */
11
#/*          |____________|                                            */
12
#/*                                                                    */
13
#/*                                                                    */
14
#/*                                                                    */
15
#/*                                                                    */
16
#/*  Author(s):                                                        */
17
#/*      - John Eaton, jt_eaton@opencores.org                          */
18
#/*                                                                    */
19
#/**********************************************************************/
20
#/*                                                                    */
21
#/*    Copyright (C) <2010-2011>                */
22
#/*                                                                    */
23
#/*  This source file may be used and distributed without              */
24
#/*  restriction provided that this copyright statement is not         */
25
#/*  removed from the file and that any derivative work contains       */
26
#/*  the original copyright notice and the associated disclaimer.      */
27
#/*                                                                    */
28
#/*  This source file is free software; you can redistribute it        */
29
#/*  and/or modify it under the terms of the GNU Lesser General        */
30
#/*  Public License as published by the Free Software Foundation;      */
31
#/*  either version 2.1 of the License, or (at your option) any        */
32
#/*  later version.                                                    */
33
#/*                                                                    */
34
#/*  This source is distributed in the hope that it will be            */
35
#/*  useful, but WITHOUT ANY WARRANTY; without even the implied        */
36
#/*  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR           */
37
#/*  PURPOSE.  See the GNU Lesser General Public License for more      */
38
#/*  details.                                                          */
39
#/*                                                                    */
40
#/*  You should have received a copy of the GNU Lesser General         */
41
#/*  Public License along with this source; if not, download it        */
42
#/*  from http://www.opencores.org/lgpl.shtml                          */
43
#/*                                                                    */
44
#/**********************************************************************/
45
 
46
 
47
############################################################################
48
# General PERL config
49
############################################################################
50
use Getopt::Long;
51
use English;
52
use File::Basename;
53
use Cwd;
54
use Scalar::Util qw(looks_like_number);
55
use BerkeleyDB;
56
 
57
 
58
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
59
 
60
 
61
############################################################################
62
### Process the options
63
############################################################################
64
Getopt::Long::config("require_order", "prefix=-");
65
GetOptions("h","help",
66
           "vendor=s" => \$vendor,
67
           "library=s" => \$library,
68
           "version=s" => \$version,
69
           "component=s" => \$component,
70
           "debug","verbose"
71
) || die "(use '$program_name -h' for help)";
72
 
73
 
74
##############################################################################
75
## Help option
76
##############################################################################
77
if ( $opt_h  or $opt_help  )
78
  { print "\n read_db    database_filename    ";
79
    print "\n";
80
    exit 1;
81
  }
82
 
83
 
84
 
85
 
86
 
87
 
88
#############################################################################
89
##
90
##
91
#############################################################################
92
 
93
 
94
$home = cwd();
95
 
96
 
97
 
98
 
99
 
100
 
101
 
102
 
103
   my $data_db_file_name = $ARGV[0];
104
 
105
   print " READ_db  $data_db_file_name       \n";
106
 
107
   $data_db   = new BerkeleyDB::Hash( -Filename => $data_db_file_name, -Flags => DB_CREATE ) or die "Cannot open ${data_db_file_name}: $!";
108
 
109
 
110
   my $key;
111
   my $value;
112
 
113
 
114
 
115
 
116
   my $cursor = $data_db ->db_cursor() ;
117
   while ($cursor->c_get($key, $value, DB_NEXT) == 0)
118
   {
119
   print "INPUT  $key,   $value  \n";
120
   }
121
 
122
   my $status = $cursor->c_close() ;
123
 
124
   $data_db   -> db_close();
125
 
126
 
127
 
128
 
129
1

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.