O'Reilly logo

Berkeley DB by Sleepycat™ Software, Inc.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

DBT

Key/Data Pairs

Storage and retrieval for the Berkeley DB access methods are based on key/data pairs. Both key and data items are represented by the DBT data structure. (DBT is a mnemonic for data base thang, and was used because no one could think of a reasonable name that wasn’t already in use somewhere else.) Key and data byte strings may reference strings of zero length up to strings of essentially unlimited length. See “Database Limits” for more information.

							typedef struct {
							void *data;
							u_int32_t size;
							u_int32_t ulen;
							u_int32_t dlen;
							u_int32_t doff;
							u_int32_t flags;
							} DBT;
						

In order to ensure compatibility with future releases of Berkeley DB, all fields of the DBT structure that are not explicitly set should be initialized to nul bytes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required