User guide
E-83
PLI Access Routines
vcsSpWriteString
Syntax
int vcsSpWriteString(vcsSpStateID esp, char *s)
Synopsis
This routine writes a character string to the protected file.
If encoding is enabled (see "vcsSpEncodeOn" on page E-69) the
specified string is encrypted as it is written to the output file.
If encoding is disabled (see "vcsSpEncodeOff" on page E-68) the
specified string will be written as-is to the output file (no encryption.)
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-42 Example of vcsSpWriteString
vcsSpStateID esp = vcsSpInitialize();
FILE *fp = fopen("protected.file", "w");
int write_error = 0;
if (fp == NULL) exit(1);
vcsSpSetFilePtr(esp, fp);
if (vcsSpWriteString(esp, "This text will *not* be
encrypted.\n"))
++write_error;
if (vcsSpEncodeOn(esp)) ++write_error;
if (vcsSpWriteString(esp, "This text *will* be