User guide

E-79
PLI Access Routines
Example D-38 Example of vcsSpSetFilePtr
vcsSpStateID esp = vcsSpInitialize();
FILE *fp = fopen("protected.file", "w");
if (fp != NULL)
vcsSpSetFilePtr(esp, fp);
else
/* abort */
vcsSpSetLibLicenseCode
Syntax
void vcsSpSetLibLicenseCode(vcsSpStateID esp, unsigned int
code)
Synopsis
This routine sets the OEM library license code that will be added to
each protected region started by vcsSpEncodeOn().
This code can be used to protect library models from unauthorized
use.
When the VCS parser decrypts the protected region, it verifies that
the end user has the specified license. If the license does not exist
or has expired, VCS exits.
Returns
No return value.
Example D-39 Example of vcsSpSetLibLicenseCode
unsigned int lic_code = MY_LICENSE_CODE;
vcsSpStateID esp = vcsSpInitialize();
...
/* The following text will be encrypted and licensed */
vcsSpSetLibLicenseCode(esp, code); /* set license code */