Guardian C Library Calls Reference Manual
Reference to Library Calls
Guardian TNS C Library Calls Reference Manual—128833 3-191
stptok (supplementary)
stptok (supplementary)
The stptok function scans a source string for a token and copies the token to another
string. The token consists of all characters in the source string up to, but not including,
the first delimiter.
sstr_ptr
points to the string to scan.
tstr_ptr
points to the string where stptok copies the token.
tmax
is the maximum token length, presumably the size of the string *tstr_ptr. Tokens
greater than this length are truncated.
bstr_ptr
points to a string consisting of token delimiter characters; these characters cannot be
part of a token.
Return Value
points to the next character in the source string (the token delimiter that stopped the
scan).
Usage Guidelines
•
The stptok function writes a null character to *tstr_ptr immediately following the
token.
•
Space characters at the beginning of *sstr_ptr are not skipped.
•
This function is nonstandard; see “strtok” on page 3-211 for a similar standard
function.
#include <stringh>
char *stptok(char *sstr_ptr, char *tstr_ptr, int tmax,
char *bstr_ptr);