Skip to content
clpetersen edited this page Oct 16, 2014 · 2 revisions

Add or replace a key value pair to a constant database. The flag options are CDB_PUT_ADD, CDB_PUT_REPLACE and CDB_PUT_INSERT. See the libcdb documentation for details.

Example:

> (define cdbm (make-cdb "test.cdb"))
> (cdb-make-put cdbm "A" 1 CDB_PUT_ADD)
> (cdb-make-exists cdbm "A")
#t
> (cdb-make-exists cdbm "B")
#f
> (cdb-make-finish cdbm)
> (define cdb (init-cdb "test.cdb"))
> (cdb-find cdb "A")
1
> (cdb-find cdb "B")
#f
> (cdb-finish cdb)
Clone this wiki locally