dependencies in .so files

Martyn Plummer
Thu, 28 May 1998 07:41:06 -0000 ()

This modified version of b.c in Guido's example works for me (R-0.61.3,
RedHat Linux 5.0) without modifying the R source.  R keeps an internal
table of symbols which is accessible via the R_FindSymbol function
(defined in src/unix/dynload.c), so you can use this to return a
pointer to a function in a previously loaded library.

Pardon my C if I've done something stupid here.

#include <stdio.h>

typedef int (*DL_FUNC) ();

DL_FUNC R_FindSymbol(char *);

void b(int *i) {
    char afun[] = "a";
    DL_FUNC fun;

    printf("in; calling function a in; i=%d\n",*i);
    fun = R_FindSymbol(afun);
    printf("in; now i=%d\n",*i);
r-devel mailing list -- Read
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: