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 ...

Get Berkeley DB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.