Initializing help system before first use

Structures for passing information

The introduction of parameters necessitates several additions to the lists that are passed to Mosel via the interface structure.

List of subroutines

In the list of subroutines, the following two lines are new (they must be added at the beginning of the list and in the order shown here):

 static XPRMdsofct tabfct[]=
    {
     {"", XPRM_FCT_GETPAR, XPRM_TYP_NOT, 0, NULL, task_getpar},
     {"", XPRM_FCT_SETPAR, XPRM_TYP_NOT, 0, NULL, task_setpar},
     ...
    }

These two subroutines do not take any names (first parameter). The macros XPRM_FCT_GETPAR and XPRM_FCT_SETPAR identify them as implementations of Mosel's getparam and setparam subroutines for this module.

List of services

We have also got two new services:

 static XPRMdsoserv tabserv[]=
    {
     {XPRM_SRV_RESET, (void *)task_reset},
     {XPRM_SRV_PARAM, (void *)task_findparam},
     {XPRM_SRV_PARLST, (void *)task_nextparam}
    };

Module context

The user is free to store the control parameters in any way that is convenient for him. There is no predefined format for this list since it is not passed as such to Mosel. In our example we have chosen the following structure for storing parameters (their names — always in lower case only, types and access rights, and descriptions):

static struct
	{
	 char *name;
	 int type;
	 char *desc;
	} taskparams[]={
	 {"taskmaxtime", XPRM_TYP_REAL|XPRM_CPAR_READ|XPRM_CPAR_WRITE,
	  "a time limit value"},
	 {"tasknamelength", XPRM_TYP_INT|XPRM_CPAR_READ|XPRM_CPAR_WRITE,
	  "maximum length of task names"}
	};

The current values of the parameters are stored in the context of the module since they may be modified (these values must be initialized when the context is created):

typedef struct
    {
     s_task *firsttask;
     int maxname;
     double maxtime;
    } s_taskctx;	

© 2001-2020 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.