User guide
E-66
PLI Access Routines
vcsSpSetPliProtectionFlag
Sets the PLI protection flag. See "vcsSpSetPliProtectionFlag" on
page E-80 for details.
vcsSpWriteChar
Writes one character to the protected file. See
"vcsSpWriteChar" on page E-81 for details.
vcsSpWriteString
Writes a character string to the protected file. See
"vcsSpWriteString" on page E-83 for details.
Example D-27 outlines the basic use of the source protection
routines.
Example D-27 Using the Source Protection Routines
#include <stdio.h>
#include "enclib.h"
void demo_routine()
{
char *filename = "protected.vp";
int write_error = 0;
vcsSpStateID esp;
FILE *fp;
/* Initialization */
if ((fp = fopen(filename, "w")) == NULL) {
printf("Error: opening file %s\n", filename);
exit(1);
}
if ((esp = vcsSpInitialize()) == NULL) {
printf("Error: Initializing src protection routines.\n");
printf(" Out Of Memory.\n");
fclose(fp);
exit(1);
}
vcsSpSetFilePtr(esp, fp); /* tell rtns where to write */
/* Write output */