1 |
dpavlin |
237 |
#!/opt/openisis/tcl/bin/isish |
2 |
|
|
# |
3 |
|
|
# openisis - an open implementation of the ISIS database |
4 |
|
|
# Version 0.8.x (microversion see file Version) |
5 |
|
|
# Copyright (C) 2003 by Erik Grziwotz, erik@openisis.org |
6 |
|
|
# |
7 |
|
|
# This library is free software; you can redistribute it and/or |
8 |
|
|
# modify it under the terms of the GNU Lesser General Public |
9 |
|
|
# License as published by the Free Software Foundation; either |
10 |
|
|
# version 2.1 of the License, or (at your option) any later version. |
11 |
|
|
# |
12 |
|
|
# This library is distributed in the hope that it will be useful, |
13 |
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 |
|
|
# Lesser General Public License for more details. |
16 |
|
|
# |
17 |
|
|
# You should have received a copy of the GNU Lesser General Public |
18 |
|
|
# License along with this library; if not, write to the Free Software |
19 |
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 |
|
|
# |
21 |
|
|
# This software is dedicated to the memory of Eckart Dietrich. |
22 |
|
|
# |
23 |
|
|
# This software is inspired by (but contains no code of) the iAPI |
24 |
|
|
# Copyright (C) 2000 by Robert Janusz, rj@jezuici.krakow.pl. |
25 |
|
|
# See iAPI.txt for what it contains. |
26 |
|
|
# |
27 |
|
|
# $Id: readall.tcl,v 1.2 2003/05/07 14:15:53 mawag Exp $ |
28 |
|
|
# print all records from given db |
29 |
|
|
|
30 |
|
|
if {1 > $argc || 2 < $argc} { |
31 |
|
|
puts "usage: $argv0 <db> [<syspath>]" |
32 |
|
|
exit 1 |
33 |
|
|
} |
34 |
|
|
|
35 |
|
|
set stb0 [openIsis] |
36 |
|
|
$stb0 add defaultdb [lindex $argv 0] |
37 |
|
|
if {2 == $argc} { |
38 |
|
|
$stb0 add syspath [lindex $argv 1] |
39 |
|
|
} |
40 |
|
|
$stb0 req type open |
41 |
|
|
$stb0 .req delete |
42 |
|
|
$stb0 req type maxrow |
43 |
|
|
set maxrow [ $stb0 .res get {rowid 0} ] |
44 |
|
|
|
45 |
|
|
for {set r 1} {$maxrow >= $r} {incr r} { |
46 |
|
|
$stb0 .req delete |
47 |
|
|
$stb0 req type read rowid $r |
48 |
|
|
catch {puts "$r: [$stb0 .res .rec get -tags]"} |
49 |
|
|
} |
50 |
|
|
$stb0 .req delete |
51 |
|
|
$stb0 req type close |
52 |
|
|
$stb0 done |
53 |
|
|
|