Updated 2017-11-21 18:54:36 by dbohdan

TclGdbmWrapper, by Mario Weilguni, "attaches" a GDBM database to a array variable. There is no need to write any database access command, as this is done by tcl_gdbm_wrapper.tcl.

Attributes  edit

current version

Requirements  edit

A tclsh (itclsh, itkwish, tixwish...) which supports the "gdbm" command or a version of Tcl >= 7.5 and a dynamic library "libtclgdbm-0.1.so" in any appropriate directory are needed.

A slighly-modified "tcl+gdbm" package in the directory tcl+gdbm-0.1. It allows you to create a shared library by typing "make shared". It works under Linux ELF with gcc 2.7.2. I've modified the Makefile and gdbmcmd-shared.c (which is a copy of gdbmcmd.c except for this modification). It should also work with "tcl+ndbm", but then you have to modify the line >> set DBM(DB) "gdbm" to >> set DBM(DB) "ndbm"

You can get the original "tcl+gdbm" package at tcl+gdbm-0.1.tar.gz and a package of "tcl+ndbm" from: tcl+ndbm-0.1.tar.gz.

How it works:

It's really simple. Just take a look into demo.tcl.


This package is published under the GNU GPL (GNU General Public License). See file LICENSE for details. The directory "tcl+gdbm-0.1" (and for all other version numbers) is NOT covered by this license but by the original authors license. See file COPYRIGHT in this directory for details.


I'd appreciate feedback (patches, comments...). Mail to , and please use a subject like "GDBM_WRAPPER: I have a new patch".

Status  edit

AMG: This code does not compile with current Tcl (8.6) due to lack of a global variable called tcl_RcFileName and due to direct access to interp->result. These issues are not hard to work around if you're familiar with Tcl's C API. Additionally, there's no main function. I'm not sure what is the recommended solution.