3 #define INTERNAL_CNAME_PATTERN "%s"
4 #define INTERNAL_FNAME_PATTERN "%s_" /**** check this */
7 LOCAL VOID link_and_load
_((char *fname
, char *libs
, int fort
));
8 LOCAL
char *get_caddress
_((char *name
));
12 /**** This code ought to cache the addresses found, but I won't bother
13 until I revise the way dynamic loading works */
15 LOCAL VOID
link_and_load(fname
, libs
, fort
)
19 static initialized
= FALSE
;
23 setvalue(s_cfun_table
, NIL
);
27 handle
= dlopen(fname
, RTLD_LAZY
);
29 sprintf(buf
, "can't open %s", fname
);
32 setvalue(s_cfun_table
,
33 cons(cvfixnum((FIXTYPE
) handle
), getvalue(s_cfun_table
)));
36 LOCAL
char *get_caddress(name
)
42 static int initialized
= FALSE
;
43 static void *prog_handle
= NULL
;
45 for (next
= getvalue(s_cfun_table
); consp(next
); next
= cdr(next
)) {
46 handle
= (void *) getfixnum(car(next
));
47 f
= dlsym(handle
, name
);
48 if (f
!= NULL
) return(f
);
51 prog_handle
= dlopen(NULL
, RTLD_LAZY
);
54 f
= dlsym(prog_handle
, name
);