Phobos /
Std Loader
Difference (last change) (no other diffs, normal page display)
Deleted: 60,170d59
std.loader - A platform-independent executable module loader
Author/Contact: Matthew Wilson ( http://synsoft.org/d.html, stlsoft ^at^ hotmail ^dot^ com)
Project Page: None at the moment.
Download URL: None. This will be included in the next release of Phobos.
Mailing list: None.
Summary:
Pure D implementation of a free-function API and wrapper auto class for dynamic loading of executable modules, and extraction of functions from them. The API manipulates HXModule handles, and consists of the following functions:
HXModule ExeModule_Load(in char[] moduleName);The auto class ExeModule provides the following methods:HXModule ExeModule_AddRef(in HXModule hModule);
void ExeModule_Release(inout HXModule hModule);
void *ExeModule_GetSymbol(inout HXModule hModule, in char[] symbolName);
char[] ExeModule_Error();
// Construction
this(in HXModule hModule, boolean bTakeOwnership);// Methodsthis(char[] moduleName);
~this(); // Calls close
void close(); // Facilitates early close// Propertiesvoid *getSymbol(in char[] symbolName); // Throws ExeModuleException if symbol not found
void *findSymbol(in char[] symbolName); // Returns NULL if symbol not found
HXModule Handle();Status: Win32 and Linux versions implemented. Waiting for Walter's inclusion in next Phobos.char[] Path();
In need of help?: Not at this stage, although comment on the API / class will be welcome.
Other People Comments:
- As I personally like the coding sytle proposed at Digital Mars, that would start function names with lower-case letters, I'd like to ask: "Why do the ExeModule_ functions not follow that guideline?"
- The ExeModule_ functions are placed in the std.loader module. So why are they prefixed with ExeModule_ like old-style C name-prefixes? I think we don't need them?