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

int LIBCALL
str_ncaseprefix(s, pref, n)
	register CharPtr s, pref;
	register size_t	n;
{
	register int	*map = _ucasemap;

	while (n-- > 0 && map[*(BytePtr)pref] == map[*(BytePtr)s++])
		if (*pref++ == NULLB)
			return 0;
	if (n == 0 || *pref == NULLB)
		return 0;
	return map[*pref] - map[*--s];
}
