OSSP CVS Repository |
|
Date | Version | Description |
---|---|---|
1.2 | Check-in
[5635]:
Add optional Dynamic Shared Object (DSO) support (see src/jsdso.[ch]).
This comes in two flavors:
1. Provide two public C API functions... JSBool JS_DSOLoad (JSContext *cx, int *id, const char *filename); JSBool JS_DSOUnload (JSContext *cx, int id); ...as an ultra-thin wrapper around the POSIX dlopen(3) API. It especially mimics the BSD RTLD behaviour of calling pre-defined functions (mandatory "js_DSO_load" and optional "js_DSO_unload") inside the DSO after/before the dlopen/dlclose calls. This allows the DSOs to perform their init/shutdown actions. 2. Provide a small JavaScript global object "DSO" which binds the two public DSO C API functions into the JavaScript language as "DSO.load" and "DSO.unload". The "DSO" object can be created by the friend C API function js_InitDSOClass(). This function is used by the command-linne interface "js" by default. As a result the OSSP Mozilla JavaScript engine is now able to dynamically load C extensions similar to what other programming languages provide since a longer time. By rse. |