foo
foo

Reputation: 291

Good introduction to the Berkeley db C api installed on OS X?

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.

Upvotes: 1

Views: 682

Answers (2)

dsegleau
dsegleau

Reputation: 1980

I did a quick search on Apple's support site. It looks like there are probably more recent releases of Berkeley DB installed on Mac OS X. I found that Berkeley DB 4.2 is installed on Mac OS X Server v10.5 and used in the Open Directory Server.

Upvotes: 0

Fred Foo
Fred Foo

Reputation: 363807

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.

Upvotes: 1

Related Questions