I'm looking for a good introduction to the Berkeley db api that is installed on OS X. I have looked at this Oracle document: http://download.oracle.com/docs/cd/E17076_02/html/gsg/C/BerkeleyDB-Core-C-GSG.pdf
Which seems to be a newer version. I am not able to compile this and get the following error:
test.c:23: error: ‘DB_CREATE’ undeclared (first use in this function)
test.c:23: error: (Each undeclared identifier is reported only once
test.c:23: error: for each function it appears in.)
test.c:26: error: ‘DB’ has no member named ‘open’
test.c:42: error: too many arguments to function ‘dbp->close’
AFAIK, the version installed on OS X is the old BSD licensed 1.85.
DB 1.85 is only there to support some system configuration files such as /etc/pwd.db
, so it shouldn't really be used.
That being said, it is much simpler than the newer Berkeley DB releases. dbopen(3)
is a good start.