home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / aix / 8158 < prev    next >
Encoding:
Text File  |  1992-07-25  |  1.7 KB  |  42 lines

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