You can try this function, to see if it can makes the work:
It's real simple it contains a static pointer that points to the next token to be getted, if is the last token, it points to the first one again.
void gettoken(char *inbuf, char *outbuf, char delim)
static char *pNext = inbuf; //first points to the string, after to next tokens
for (i=0; (*pNext != delim) && (*pNext != '\0'); pNext++,i++)
outbuf[i] = *pNext;
//check if we are in last token
if (*pNext++ == '\0')
pNext = inbuf;
outbuf[i] = '\0'; //put null to close string
char inbuf = "One|Two|Three";
//get first three tokens and print them
for (i=0; i<3; i++)
gettoken(inbuf, outbuf, '|');
//now check if the function knows how to restart to first token
gettoken(inbuf, outbuf, '|'); //this should put in outbuf 'one'