Next: , Previous: str_tokq, Up: Strings


4.9 str_tokq_restore

restore string passed to str_tokq

Synopsis

     #include <suplib/str.h>
     
     
     
char *str_tokq_restore( char *ptr, char dchar );

Parameters

char *ptr
state information returned by str_tokq
char dchar
state information returned by str_tokq

Description

str_tokq changes the scanned string as it processes it. If the restore flag passed to str_tokq is set then the string will be restored if the str_tokq is called to completion. However, sometimes it's necessary to interrupt the parsing, and repeatedly calling the str_tokq to restore the string is ridiculous.

This function restores the string.

Returns

It returns a pointer to the next character that str_tokq would have returned, except in the case where the end of string was reached, in which case it will return a pointer to the end of string character. This allows one to pass the pointer to another independent invocation of str_tokq, if, for example, continued parsing is to be done in another context.

Author

Diab Jerius