#ifndef lint
static char *RCSid = "$Header: /usr/brule/guest/empire/empire/emprcs/lib/subs/whatitem.c,v 2.0 1995/01/25 19:58:54 empire Exp $";
#endif

/*
 * whatitem.c
 *
 * return pointer to item chr struct given
 * item name.
 *
 * from PSL Empire, 1985
 */

#include "misc.h"
#include "item.h"

struct ichrstr *
whatitem(ptr, prompt)
	s_char	*ptr;
	s_char	*prompt;
{
	register s_char *p;
	register struct ichrstr *ip;
	s_char	buf[1024];

	p = getstarg(ptr, prompt, buf);
	if (p == 0 || *p == 0)
		return 0;
	for (ip = &ichr[1]; ip->i_mnem != 0; ip++) {
		if (*p == ip->i_mnem)
			return ip;
	}
	pr("Unrecognized item \"%c\"\n", *p);
	return 0;
}
