#include "V_s_lc.h"
/*
* Test for the presence of the "token" t at the beginning of the  string  s.
* The match succeeds (returns 1) if t matches s and is followed by a null or
* a char in x.  The match fails (returns 0) if t doesn't match  the  initial
* substring of s, or it is followed by a char not in x
*/
FCT	d_strtok(s,t,x)
	char *s, *t, *x;
{	int   c, i;
	Fenter("d_strtok");
	V7s "Find %s in %s",Dsps(t,-1),Dsps(s,-1) D;
	i = strlen(t);
	if (Streqn(s,t,i)) {
		if (!(c = s[i]) || index(x,c)) {
			V7s "Found %s",Dsps(t,-1) D;
			Fexit;
			return 1;
		}
	}
	V7s "No %s in %s",Dsps(t,-1),Dsps(s,-1) D;
	Fexit;
	return 0;
}
/*
* Some C libraries lack the strtok() routine.  On those systems, the above
* routine should work ok, but it means that you always get the debug version.
*/
#ifndef HAS_strtok
FCT strtok(s,t,x)
	char *s, *t, *x;
{
	return d_strtok(s,t,x);
}
#endif
