• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/timemachine/db-4.7.25.NC/docs_src/ref/am_misc/
1m4_ignore([dnl
2#include <sys/types.h>
3
4#include <db.h>
5
6int foo();
7
8int	session_id;
9char   *program_name;
10
11DB *dbp;
12DBT key, data;
13
14int
15main()
16{
17	(void)foo();
18	return (0);
19}
20
21int
22foo()
23{])
24m4_indent([dnl
25#define DATABASE "access.db"
26m4_blank
27int ret;
28m4_blank
29(void)dbp-__GT__set_errpfx(dbp, program_name);
30m4_blank
31if ((ret = dbp-__GT__open(dbp,
32    NULL, DATABASE, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
33	dbp-__GT__err(dbp, ret, "%s", DATABASE);
34	dbp-__GT__errx(dbp,
35		"contact your system administrator: session ID was %d",
36    		session_id);
37	return (1);
38}])
39m4_ignore([dnl
40	return (0);
41}])
42