#include <ncbi.h>
#include <gishlib.h>

CharPtr LIBCALL
str_pbrk(s, list)
	register CharPtr s, list;
{
	/* cmap[] is allocated on the stack, in case of interrupt */
	Byte	cmap[1<<(CHAR_BIT*sizeof(Byte))];
	register BytePtr
			us = (BytePtr)s,
			ulist = (BytePtr)list;

	if (*ulist == NULLB)
		return NULL;

	Nlm_MemSet((VoidPtr)cmap, 0, sizeof(cmap));
	cmap[NULLB] = 1;
	while (*ulist != NULLB)
		cmap[*ulist++] = 1;

	while (cmap[*us] == NULLB)
		++us;

	if (*us != NULLB)
		return (CharPtr)us;
	return NULL;
}
