User guide
E-82
PLI Access Routines
Returns
Non-zero if the file pointer has not been set (see "vcsSpSetFilePtr" on
page E-78) or if there was an error writing to the output file
(out-of-disk-space, etc.)
Returns 0 if the write was successful.
Example D-41 Example of vcsSpWriteChar
vcsSpStateID esp = vcsSpInitialize();
FILE *fp = fopen("protected.file", "w");
int write_error = 0;
if (fp == NULL) exit(1);
vcsSpSetFilePtr(esp, fp);
if (vcsSpWriteChar(esp, ’a’)) /* This char will *not* be
encrypted.*/
++write_error;
if (vcsSpEncodeOn(esp))
++write_error;
if (vcsSpWriteChar(esp, ’b’)) /* This char *will* be
encrypted. */
++write_error;
if (vcsSpEncodeOff(esp))
++write_error;
fclose(fp);
vcsSpClose(esp);
Caution
vcsSpInitialize() and vcsSpSetFilePtr() must be called
prior to calling this routine.