You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
966 B
35 lines
966 B
#include <windows.h>
|
|
#include <sdsutils.h>
|
|
|
|
// If the next token in *pszData is delimited by the DeLim char, replace DeLim
|
|
// in *pszData by chEos, set *pszData to point to the char after the chEos and return
|
|
// ptr to the beginning of the token; otherwise, return NULL
|
|
|
|
PSTR GetNextToken( PSTR *pszData, char DeLim)
|
|
{
|
|
PSTR szPos;
|
|
|
|
if ( (pszData == NULL) || (*pszData == NULL) || (**pszData == '\0') )
|
|
return NULL;
|
|
|
|
if ((szPos = ANSIStrChr( *pszData, DeLim ) ) != NULL)
|
|
{
|
|
PSTR szT = *pszData;
|
|
|
|
// replace DeLim with the chEos char
|
|
*szPos = '\0';
|
|
*pszData = szPos + 1;
|
|
szPos = szT;
|
|
}
|
|
else
|
|
{
|
|
// DeLim not found; set *pszData to point to
|
|
// to the end of szData; the next invocation
|
|
// of this function would return NULL
|
|
|
|
szPos = *pszData;
|
|
*pszData = szPos + lstrlen(szPos);
|
|
}
|
|
|
|
return szPos;
|
|
}
|