dbm
dbm?
dbm-open
dbm-close!
dbm-remove!
dbm-set!
dbm-ref
Version: 4.2.0.5

dbm

Jay McCarthy <jay at plt-scheme dot org>

 (require (planet jaymccarthy/dbm:1:0))

This package provides an interface to UNIX dbm databases for PLT Scheme.

(dbm? v)  boolean?
  v : any/c

Returns #t if v is a dbm structure, #f otherwise.

A dbm structure is a dictionary.

(dbm-open pth)  dbm?
  pth : path-string?

Opens the dbm file at pth, returning a handle.

(dbm-close! dbm)  void
  dbm : dbm?

Closes the database handled by dbm.

(dbm-remove! dbm key)  void
  dbm : dbm?
  key : string?

Removes key from dbm.

(dbm-set! dbm key val [#:replace? replace?])  void
  dbm : dbm?
  key : string?
  val : string?
  replace? : boolean? = #f

Sets key to val in dbm. Results in an error if key is present in dbm and replace? is not true.

(dbm-ref dbm key fail)  string?
  dbm : dbm?
  key : string?
  fail : (or/c string? (-> string?))

Returns key’s value in dbm, calling or returning fail if key is not present, like dict-ref.