[elephant-devel] Problem with LWW 5.1.2, BDB-backend

Plamen . plamen.usenet at gmail.com
Sat Dec 5 13:31:50 UTC 2009


Sorry if posted twice...


Hello,
I need to use BDB for my current application and from what I see on
the net, elephant seems to be the most mature and functional solution.
After following the installation instructions (I use LispWorks 5.1.2
for Windows - yes - I need that configuration at the moment, with
Berkeley DB 4.5.20, with prebuild DLLs (libberkeley-db.dll and
libmemutil.dll) in the elephant-root and from what I see a correct
my-config.sexp also in the elephant-root directory), after loading
Elephant I get the following error :

ELE-USER 13 > (open-store '(:bdb "/temp/db2/"))

Error: The call (#<Function DB-BDB::%DB-ENV-CREATE 22053092> 0) does
not match definition (#<Function DB-BDB::%DB-ENV-CREATE 22053092>
DB-BDB::FLAGS DB-BDB::ERRNO).

>From what I see in the sources - there are 3 relevant definitions :

1. the BDB one :

db_env_create

________________________________

#include <db.h>

int
db_env_create(DB_ENV **dbenvp, u_int32_t flags);

2. then the libberkeley-db one :

DB_ENV *db_env_cr(u_int32_t flags, int *errno) {
 DB_ENV *envp;
 *errno = db_env_create(&envp, flags);
 return envp;
}

3. and finally the Lisp definitions :

(def-function ("db_env_cr" %db-env-create)
   ((flags :unsigned-int)
    (errno :int :out))
 :returning :pointer-void)

(defun db-env-create ()
 "Create an environment handle."
 (multiple-value-bind (env errno)
     (%db-env-create 0)
   (declare (type fixnum errno))
   (if (= errno 0)
       env
       (error 'db-error :errno errno))))

I have cffi_0.10.5 and uffi-1.6.2 (which are currently the newest
versions of that libraries).

The call (%db-env-create 0) in the db-env-create function looks of
course weird for me, but if people use these lines of source on all
other Lisp-implementations, obviously I miss something. I know the LW
FFI, but I'm not really proficient in the CFFI/UFFI-conversion to see
the missing parts, but if there is someone outside in the WWW who runs
LWW & BDB and/or knows how to help, I would be very gratefull.

Regards
Plamen




More information about the elephant-devel mailing list