|
|
Section Intro: Dynamic Modules
Dynamic ModulesSynopsis:You can write C, C++, or other language code to implement your own built-in Meta-HTML functions. Such functions are first-class objects, and can manipulate the Meta-HTML environment directly, reset the parser pointer, manage hardware devices or talk on proprietery networks, or anything else that you would like to do.
It works by supplying you with the necessary Meta-HTML header files
and a Makefile for building modules on your system. Using the supplied
Makefile provides you with a resultant dynamically loadable module,
which can be loaded into an invocation of the Meta-HTML server, engine,
debugger, or standalone processor with the
Combined with the
See the Commands: Variables:
Loads a module dynamically at runtime, adding the function definitions found therein to the global package of Meta-HTML functions.
MODULE-NAME is searched for by looking in each directory
specified in the array Once a module is loaded, the functions within it can be invoked just as with any standard Meta-HTML command.
See the The keyword argument NOINITIALIZE when set to "true" says not to call the default initialization function of the module (module_initialize). This function is typically used to install the function names of the Meta-HTML callable functions present within the module. When such initialization is not required (perhaps you are planning to do this from within a different module), the use of this argument prevents the attempted call. The keyword argument INITFUNC may be set to the name of the initialization function to call immediately after the module is loaded. If it is not set, or it is empty, the function module_initialize is called. Example:
<set-var loaded? = <load-module /www/lib/example.so>>
Call the function FUNCTION-NAME in the dynamically loaded module MODULE_NAME with character arguments of ARGS. It returns "true" if the function invocation took place. More likely, you will be crashing Meta-HTML without a way to debug it. Up to ten arguments can be passed to the function. It is so unlikely that you need this, that you will have to write me E-mail or read the source to see exactly how this works. If you are calling this function, the called function should not produce any output at all, and, in fact, there isn't a way for you to get output back from the function, since you can't pass the address of a variable, etc. This might be used to re-initialize some internals of your module, but you should really just provide an interface for that instead.
Returns the address of FUNCTION-NAME in MODULE-NAME if MODULE-NAME is an already loaded dynamic module, and FUNCTION-NAME is a function defined within that module. Otherwise, it returns the empty string. <load-module example> ==> /www/lib/example.so <module-function example pf_apropos> ==> 0X0EF8C437C
Unloads a previously loaded dynamic module. You might want this if you are running Meta-HTML as a FastCGI, and the module was temporarily needed for some service, and was inordinately large. Returns "true" if the module was successfully unloaded.
Edit Section
![]() The META-HTML Reference Manual V2.0 Copyright © 1995, 1998, Brian J. Fox Found a bug? Send mail to bug-manual@metahtml.org |