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

Subversion Repositories socgen

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 131 jt_eaton
eval 'exec `which perl` -S $0 ${1+"$@"}'
2
   if 0;
3 135 jt_eaton
#/****************************************************************************/
4
#/*                                                                          */
5
#/*   SOCGEN Design for Reuse toolset                                        */
6
#/*                                                                          */
7
#/*   Version 1.0.0                                                          */
8
#/*                                                                          */
9
#/*   Author(s):                                                             */
10
#/*      - John Eaton, z3qmtr45@gmail.com                                    */
11
#/*                                                                          */
12
#/****************************************************************************/
13
#/*                                                                          */
14
#/*                                                                          */
15
#/*             Copyright 2016 John T Eaton                                  */
16
#/*                                                                          */
17
#/* Licensed under the Apache License, Version 2.0 (the "License");          */
18
#/* you may not use this file except in compliance with the License.         */
19
#/* You may obtain a copy of the License at                                  */
20
#/*                                                                          */
21
#/*    http://www.apache.org/licenses/LICENSE-2.0                            */
22
#/*                                                                          */
23
#/* Unless required by applicable law or agreed to in writing, software      */
24
#/* distributed under the License is distributed on an "AS IS" BASIS,        */
25
#/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
26
#/* See the License for the specific language governing permissions and      */
27
#/* limitations under the License.                                           */
28
#/*                                                                          */
29
#/*                                                                          */
30
#/****************************************************************************/
31 131 jt_eaton
 
32
 
33
############################################################################
34
# General PERL config
35
############################################################################
36
use Getopt::Long;
37
use English;
38
use File::Basename;
39
use Cwd;
40
use Scalar::Util qw(looks_like_number);
41
use BerkeleyDB;
42
 
43
 
44
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
45
 
46
 
47
############################################################################
48
### Process the options
49
############################################################################
50
Getopt::Long::config("require_order", "prefix=-");
51
GetOptions("h","help",
52
           "vendor=s" => \$vendor,
53
           "library=s" => \$library,
54
           "version=s" => \$version,
55
           "component=s" => \$component,
56
           "debug","verbose"
57
) || die "(use '$program_name -h' for help)";
58
 
59
 
60
##############################################################################
61
## Help option
62
##############################################################################
63
if ( $opt_h  or $opt_help  )
64
  { print "\n read_db    database_filename    ";
65
    print "\n";
66
    exit 1;
67
  }
68
 
69
 
70
 
71
 
72
 
73
 
74
#############################################################################
75
##
76
##
77
#############################################################################
78
 
79
 
80
$home = cwd();
81
 
82
 
83
 
84
 
85
 
86
 
87
 
88
 
89
   my $data_db_file_name = $ARGV[0];
90
 
91
   print " READ_db  $data_db_file_name       \n";
92
 
93
   $data_db   = new BerkeleyDB::Hash( -Filename => $data_db_file_name, -Flags => DB_CREATE ) or die "Cannot open ${data_db_file_name}: $!";
94
 
95
 
96
   my $key;
97
   my $value;
98
 
99
 
100
 
101
 
102
   my $cursor = $data_db ->db_cursor() ;
103
   while ($cursor->c_get($key, $value, DB_NEXT) == 0)
104
   {
105
   print "INPUT  $key,   $value  \n";
106
   }
107
 
108
   my $status = $cursor->c_close() ;
109
 
110
   $data_db   -> db_close();
111
 
112
 
113
 
114
 
115
1

powered by: WebSVN 2.1.0

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