/*
	str_ccnt(s, list)

	Count the number of letters in list[] that are NOT in string s[]
*/
#include <ncbi.h>
#include <gishlib.h>

size_t _cdecl
str_ccnt(s, list)
	CharPtr	s;
	CharPtr	list;
{
	/* cmap[] is allocated on the stack, in case of interrupt */
	Byte	cmap[1<<(CHAR_BIT*sizeof(Byte))];
	register unsigned char	c;
	register size_t	cnt = 0;
	register BytePtr us = (BytePtr)s;
	register BytePtr ulist = (BytePtr)list;

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

	ulist = (BytePtr)cmap;

	while ((c = *us++) != NULLB)
		cnt += ulist[c];

	return cnt;
}
