Static modules
Modules are usually implemented as dynamic libraries: modules are represented as files that Mosel loads when required. It is also possible to embed a module into a program using the Mosel Libraries. In this case, the module must be registered in Mosel before it is used by any model. This registration is performed by a call to the function XPRMregstatdso which receives as parameters the name of the module (this is the name one uses to request the module in a uses directive in the model) and the reference to the initialization function of this module. The registration function initializes immediately the module by calling its initialization function and records the module as a static module (it cannot be unloaded). Note that the type of an initialization function of a static module is int instead of DSO_INIT.
Example:
#include "xprm_mc.h" #include "xprm_ni.h" int mymodule_init(XPRMnifct nifct, int *interver, int *libver, XPRMdsointer **interf); ... int main() { XPRMinit(); XPRMregstatdso("mymodule", mymodule_init); /* Now the module "mymodule" is available */ XPRMcompmod(NULL, "test.mos", NULL, NULL); ... } /* Functions of the module must be included in the program */ ...
© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.