8 static void relocate
__P(());
10 #define RELOC(func,returntype,args,proto,types) \
11 static returntype reloc_##func __P(proto); \
12 returntype (*nvi_##func) __P(proto) = reloc_##func; \
13 static returntype reloc_##func args \
17 return nvi_##func args; \
20 RELOC(db_create
,int,(a
,b
,c
),(DB
**, DB_ENV
*, u_int32_t
),
21 DB
**a
;DB_ENV
*b
;u_int32_t c
;)
22 RELOC(db_env_create
,int,(a
,b
),(DB_ENV
**, u_int32_t
),DB_ENV
** a
;u_int32_t b
;);
23 RELOC(db_strerror
,char *,(a
),(int),int a
;)
25 #define LOADSYM(func) \
26 if ((nvi_##func = dlsym(handle, #func)) == NULL) \
32 void *handle
= dlopen(_PATH_DB3
, RTLD_LAZY
);
38 LOADSYM(db_env_create
)
43 fprintf(stderr
, "Relocation error: %s\n", dlerror());