Complete module example
Below follows the complete listing of the program that implements the myconstants module.
#include <stdlib.h> #include "xprm_ni.h" static const double tol=0.00001; /* List of constants */ static XPRMdsoconst tabconst[]= { XPRM_CST_INT("MYCST_BIGM", 10000), /* A large integer value */ XPRM_CST_REAL("MYCST_TOL", tol), /* A tolerance value */ XPRM_CST_STRING("MYCST_LINE", /* String constant */ "----"), XPRM_CST_BOOL("MYCST_FLAG", XPRM_TRUE), /* Constant with value true */ XPRM_CST_BOOL("MYCST_NOFLAG", XPRM_FALSE) /* Constant with value false */ }; /* Interface structure */ static XPRMdsointer dsointer= { sizeof(tabconst)/sizeof(XPRMdsoconst), tabconst, 0, NULL, 0, NULL, 0, NULL }; /* Module initialization function */ DSO_INIT myconstants_init(XPRMnifct nifct, int *interver,int *libver, XPRMdsointer **interf) { *interver=XPRM_NIVERS; /* Mosel NI version */ *libver=XPRM_MKVER(0,0,1); /* Module version */ *interf=&dsointer; /* Pass info about module contents to Mosel */ return 0; }
© 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.