|
| iMatix home page | << | < | > | >> |
SFLVersion 2.11 |
#include "sflstr.h"
char *
eatstr (
char **strBuff,
char *strToEat)
Eats strToEat from strBuff only if it begins with contents of strToEat.
char strBuff[] = { "select * from mytbl;" };
eatstr (&strBuff, "SELECT");
On return here strBuff would be: " * from mytbl;"
If the token is not found, then strBuff will not be affected and
a NULL char * will be returned, but any white spaces on the left
of strBuff would be trimed.
Submitted by Scott Beasley <jscottb@infoave.com>
{
int iWasToken;
ASSERT (strBuff);
ASSERT (strToEat);
ltrim (*strBuff);
istoken (strBuff, strToEat, &iWasToken);
return iWasToken ? *strBuff : (char *)NULL;
}
| | << | < | > | >> |
|