static char *rcsid = "$Header: /plaid/homes/zeus/Blind-2.47/cmds/RCS/c.c,v 2.46 1997/04/18 12:13:15 zeus Exp $";

/*

 * $Log: c.c,v $
 * Revision 2.46  1997/04/18 12:13:15  zeus
 * *** empty log message ***
 *
 * Revision 2.45  1996/12/31  23:55:28  zeus
 * Revision 2.44  1995/12/31  19:45:18  zeus
 * Revision 2.43  1995/03/20  01:43:09  zeus
 *
 */

#define NOTIMEB

#include "common.h"
#include "prototypes.h"
#include "enterturn-g.h"
#include "cmds.h"
#include "cmds-g.h"

extern player *players;
extern tmppname *tmpname;
extern char err_tmp[];

void c_cmd_rcsid (void);

void
c_cmd_rcsid (void)
{
  printf ("%s\n", rcsid);
}


void
c_cmd (char *buf, player * P)
{
  char t[MAXTEXT];
  player *P2;
  tmppname *tp;

  cmd_init(buf);
  hstrncpy (t, next_token (), MAXTEXT);
  if (t[0])
  {
    P2 = nametop (players, t);
    if (P2 && (P2 != P))
    {
      sprintf (err_tmp, "Race name \"%s\" is already in use.\n", t);
      error (err_tmp);
    }
    else
    {
      if (!legal_name (t, EMPIRE))
      {
        error (err_tmp);
        return;
      }
      tp = alloc (sizeof (tmppname));
      hstrncpy (tp->nname, t, MAXTEXT);
      hstrncpy (tp->oname, P->name, MAXTEXT);
      addlist (&tmpname, tp);
    }
  }
  else
  {
    error ("No new name specified!\n");
    return;
  }
  extra_token ();
}
