Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: misc.c util.h Log Message: Loadable module support bits. =================================================================== RCS file: /cvs/e/e16/e/src/misc.c,v retrieving revision 1.77 retrieving revision 1.78 diff -u -3 -r1.77 -r1.78 --- misc.c 28 Aug 2007 18:52:45 -0000 1.77 +++ misc.c 3 Sep 2007 19:37:57 -0000 1.78 @@ -326,28 +326,24 @@ */ #include <dlfcn.h> -void * -ModLoad(const char *name) +const void * +ModLoadSym(const char *lib, const char *sym, const char *name) { char buf[1024]; void *h; - Esnprintf(buf, sizeof(buf), "%s/e16/%s.so", ENLIGHTENMENT_LIB, name); + Esnprintf(buf, sizeof(buf), "%s/e16/lib%s_%s.so", + ENLIGHTENMENT_LIB, lib, name); if (EDebug(1)) Eprintf("ModLoad %s\n", buf); h = dlopen(buf, RTLD_NOW | RTLD_LOCAL); if (!h) Eprintf("*** ModLoad %s: %s\n", buf, dlerror()); + if (!h) + return NULL; - return h; -} - -void * -ModSym(void *handle, const char *sym) -{ - void *h; - - h = dlsym(handle, sym); + Esnprintf(buf, sizeof(buf), "%s_%s", sym, name); + h = dlsym(h, buf); return h; } =================================================================== RCS file: /cvs/e/e16/e/src/util.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- util.h 28 Aug 2007 18:52:45 -0000 1.11 +++ util.h 3 Sep 2007 19:37:58 -0000 1.12 @@ -92,8 +92,8 @@ #if USE_MODULES /* Dynamic loading */ -void *ModLoad(const char *name); -void *ModSym(void *handle, const char *sym); +const void *ModLoadSym(const char *lib, const char *sym, + const char *name); #endif #endif /* _UTIL_H_ */ ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs