Published library functions
The module mmsystem publishes its implementation of getenv, setenv and system as well as the functions gettxtsize, getcsttxtbuf, gettxtbuf and txtresize for text access via the service IMCI for use by other modules (see the Mosel Native Interface Reference Manual for more detail about services). The list of published functions is contained in the interface structure mmsystem_imci that is defined in the module header file mmsystem.h.
From another module, the context of mmsystem and its communication interface can be obtained using functions of the Mosel Native Interface as shown in the following example.
static XPRMnifct mm; XPRMcontext mmctx; XPRMdsolib dso; mmsystem_imci mmsys; void **sysctxref; dso=mm->finddso("mmsystem"); /* Retrieve the mmsystem module*/ sysctxref=mm->getdsoctx(mmctx, dso, (void **)(&mmsys)); /* Get the module context and the communication interface of mmsystem */
Typically, a module calling functions that are provided by mmsystem will include this module into its list of dependencies in order to make sure that mmsystem will be loaded by Mosel at the same time as the calling module. The ``dependency'' service of the Mosel Native Interface has to be used to set the list of module dependencies:
static const char *deplist[]={"mmsystem",NULL}; /* Module dependency list */ static XPRMdsoserv tabserv[]= /* Table of services */ { {XPRM_SRV_DEPLST, (void *)deplist} };
Using these functions a module may access and modify the environment of the calling model and execute an external program with automatic redirection of default streams:
mmsys->setenv(ctx,*sysctxref,"MYVAR","A_VALUE"); rts=mmsys->system(ctx,*sysctxref,"myprogram arg1 arg2");
Description of the library functions
Get a reference to the constant character buffer of a text object.
|
|
Get the date of a date object.
|
|
Get the date and time of a datetime object.
|
|
Get the time of a time object.
|
|
Get a reference to the character buffer of a text object.
|
|
Get the size of a text object.
|
|
Set the date of a date object.
|
|
Set the date and time of a datetime object.
|
|
Set the time of a time object.
|
|
Resize a text object.
|
© 2001-2025 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.