XPRDcompmod, XPRDcompmodsec
XPRDcompmod, XPRDcompmodsec |
Purpose
Synopsis
int XPRDcompmod(XPRDmosel mosel, const char *options, const char *srcfile, const char *dstfile, const char *userc);
int XPRDcompmodsec(XPRDmosel mosel, const char *options, const char *srcfile, const char *dstfile, const char *userc, const char *passfile, const char *privkey, const char *kfile);
Arguments
mosel
|
Mosel instance
|
||||||||||||||||||||||
options
|
Compilation options (may be
NULL). Possible values:
|
||||||||||||||||||||||
scrfile
|
Name of the source file
|
||||||||||||||||||||||
dstfile
|
Name of the destination file (may be
NULL)
|
||||||||||||||||||||||
userc
|
|||||||||||||||||||||||
passfile
|
Password or password file (for encryption with a password)
|
||||||||||||||||||||||
privkey
|
Private key file (for bim file signing)
|
||||||||||||||||||||||
kfile
|
File of public keys (for encryption with public keys)
|
Return value
Execution status:
0
|
Function executed sucessfully
|
1
|
Parsing phase has failed (syntax error or file access error)
|
2
|
Error in compilation phase (a semantic error has been detected)
|
3
|
Error writing the output file
|
4
|
License error (compiler not authorized)
|
Example
Ask the Mosel instance
minst to compile the model
"mymod.mos" stored locally. The resulting bim file
"mymod.bim" is saved on the host running this instance:
m=XPRDcompmod(minst, "", "rmt:mymod.mos", "mymod.bim", "");
Further information
1. This function compiles a given model source file into a binary model
file (bim
file) that is required as input to function
XPRDloadmod for executing the model. The second form of the function will be used to generate encrypted and/or signed bim files.
2. The source file name may contain environment variable references using the notation
${varname} (for example, `
${XPRESSDIR}/examples/mymodel') that are expanded to generate the actual name.
3. When sending a compilation request to a separate Mosel instance, it is important to keep in mind that the operation is performed in the environment of this instance (in particular its current working directory) and file names should be specified appropriately (the
rmt: I/O driver can be particularly helpful in this context).
4. The argument
kfile is a list of public key files (
i.e. each line of the file is a key file name): when encrypting a file, the encryption is performed for each of the listed public keys such that the bim file can be decrypted by any of the corresponding private keys.
Related topics