home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!timbuk.cray.com!shamash!runyon.cim.cdc.com!pbd
- From: pbd@runyon.cim.cdc.com (Paul Dokas)
- Newsgroups: comp.unix.aix
- Subject: A better dynamic loader???
- Message-ID: <45628@shamash.cdc.com>
- Date: 24 Jul 92 20:21:25 GMT
- Sender: usenet@shamash.cdc.com
- Reply-To: pbd@runyon.cim.cdc.com (Paul Dokas)
- Organization: ICEM Systems, Inc
- Lines: 30
-
- Please forgive if this is an old question, but I just looked through the
- last 300 posts and found no help.
-
- I need to be able to execute dynamically loaded modules from within another
- program, but I can't seem to find the needed functionality anywhere. What I
- have right now is a program that uses load() to pull in a module and then it
- calls the function pointed to by the return value of load(). This works
- fine, but I need to have several entry points in a single module. And to make
- things even more complex, the user creates the modules, so the program has
- no idea where to call within the module. What I really need is a function
- like this:
-
- typedef void (func_t)(int, int);
- func_t *lookup(char *module_name, char *func_name);
-
- The function lookup() returns a pointer to a function given the name of a
- module to look in and a function name to look for.
-
- I really want to avoid writing my own dynamic loader with the ldopen, ldclose,
- etc functions. I had to do this on an SGI and I really don't want to waste
- another 2-3 weeks. Any input is greatly appreciated.
-
- Thanks in advance
- -paul
- --
- #include <std.disclaimer>
- #define FULL_NAME "Paul Dokas"
- #define EMAIL_PRIMARY "pbd@power1.cim.cdc.com"
- #define EMAIL_SECONDARY "pbd@runyon.cim.cdc.com"
- /*** Overpopulation is the leading cause of most environmental problems ***/
-