#ifndef lint
static char *RCSid = "$Header: /usr/brule/guest/empire/empire/emprcs/lib/gen/copy.c,v 2.0 1995/07/27 05:56:17 empire Exp $";
#endif

/*
 * copy.c
 *
 * copy and return pointer to end of copied string.
 *
 * from PSL Empire, 1985
 */

#include "misc.h"
#include "xy.h"
#include "map.h"

s_char *
copy(s1, s2)
	register s_char *s1;
	register s_char *s2;
{
	while (*s2++ = *s1++)
		;
	return s2 - 1;
}

#ifdef hpux
#include <memory.h>

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

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

/*
 * space-fill a map or radar scan;
 * null terminate
 */
blankfill(ptr, range, size)
	s_char	*ptr;
	register struct range *range;
	int	size;
{
	register s_char *p;
	register int row;
	register int col;

	for (row=0; row<range->height; row++) {
		col = (range->width + 1) * (size + 1) / 2 - 1;
		p = ptr;
		while (--col >= 0)
			*p++ = ' ';
		*p++ = 0;
		ptr += MAPWIDTH(size);
	}
}
