#ifndef lint
static char *RCSid = "$Header: hpux.c,v 1.1 89/09/26 22:21:36 mr-frog Exp $";
#endif

/*
 * hpux.c
 *
 * hpux dependencies
 *
 */

#ifdef hpux
#include <memory.h>
#define NULL 0

char *
rindex(sp, c)
	register char *sp;
	register int c;
{
	register char *r;

	r = NULL;
	do {
		if (*sp == c)
			r = sp;
	} while (*sp++);
	return r;
}

char *
index(sp, c)
	register char *sp;
	register int c;
{
	do {
		if (*sp == c)
			return (sp);
	} while (*sp++);
	return NULL;
}

int
ffs(mask)
	register unsigned mask;
{
	register unsigned bit;
	register int i;

	if (mask == 0)
		return 0;
	for (bit=1, i=1; i <= 32; i++, bit <<= 1)
		if (mask & bit)
			return i;
	return 0;
}

bzero(ptr, len)
	char	*ptr;
	int	len;
{
	memset(ptr, 0, len);
}

bcopy(src, dst, len)
	char	*src;
	char	*dst;
	int	len;
{
	memcpy(dst, src, len);
}
#endif
