1m4_ignore([dnl
2#include <sys/types.h>
3#include <string.h>
4
5#include <db.h>
6
7void	foo();
8void	handle_error(int);
9
10DB *sdbp;
11DB_TXN *txn;
12int ret;
13
14int
15main()
16{
17	foo();
18	return (0);
19}
20
21void
22handle_error(ret)
23	int ret;
24{}
25
26void
27foo()
28{])
29
30m4_indent([dnl
31DBT data, pkey, skey;
32m4_blank
33memset(&skey, 0, sizeof(DBT));
34memset(&pkey, 0, sizeof(DBT));
35memset(&data, 0, sizeof(DBT));
36skey.data = "Churchill      ";
37skey.size = 15;
38if ((ret = sdbp-__GT__pget(sdbp, txn, &skey, &pkey, &data, 0)) != 0)
39	handle_error(ret);
40/*
41 * Now pkey contains "WC42" and data contains Winston's record.
42 */])
43m4_ignore([}])
44