10 static void relocate
__P(());
12 #define RELOC(func,returntype,args,proto,types) \
13 static returntype reloc_##func __P(proto); \
14 returntype (*nvi_##func) __P(proto) = reloc_##func; \
15 static returntype reloc_##func args \
19 return nvi_##func args; \
22 RELOC(db_create
,int,(a
,b
,c
),(DB
**, DB_ENV
*, u_int32_t
),
23 DB
**a
;DB_ENV
*b
;u_int32_t c
;)
24 RELOC(db_env_create
,int,(a
,b
),(DB_ENV
**, u_int32_t
),DB_ENV
** a
;u_int32_t b
;);
25 RELOC(db_strerror
,char *,(a
),(int),int a
;)
27 #define LOADSYM(func) \
28 if ((nvi_##func = dlsym(handle, #func)) == NULL) \
34 void *handle
= dlopen(_PATH_DB3
, RTLD_LAZY
);
40 LOADSYM(db_env_create
)
45 fprintf(stderr
, "Relocation error: %s\n", dlerror());