/***********************************************************************
     "fld_input.o": FieLD INPUT functions.
***********************************************************************/

/***********************************
  (C) Copyright 1992-1993; dit/upm
   Distributed under the conditions stated in the
   EPS General Public License (see file LICENSE)
 ***********************************
 $Log: fld_input.c,v $
 * Revision 1.4  1993/01/12  18:18:52  eps
 * portability issues
 *
 * Revision 1.3  1993/01/12  16:37:13  eps
 * portability issues
 *
 * Revision 1.2  1992/01/14  15:45:51  eps
 * distribution issues
 *
 * Revision 1.1  91/07/11  12:51:24  eps
 * Initial revision
 * 
 ***********************************/

#ifndef lint
static char rcsid[]= "$Id: fld_input.c,v 1.4 1993/01/12 18:18:52 eps Exp $";
#endif

/* LINTLIBRARY */

#define fld_input_IMP
/* KJT 12/02/12: Added */
#include <string.h>
#include <stdio.h>
#include "bsc_dcls.hh"
#include "lnt_pass.hh"
#include "err_handl.hh"
#include "prg_error.hh"
#include "mem_alloc.hh"
#include "fld_input.hh"


PUBLIC int
get_sym ()
{
  char *p;

  p= get_word();
  if (p == NULL)
    return ESYM;
  return new_sym(p);
}

PUBLIC char *
get_str ()
{
  char *p;
  char *r;
  char *strcpy();

  p= get_line();
  if (p == NULL)
    return ESTR;
  talloc(r, strlen(p) + 1);
  (void) strcpy(r, p);
  return r;
}

PUBLIC int
get_int ()
{
  char *p;
  int r;

  p= get_word();
  if (p == NULL)
    return EINT;
  if (is_int(p))
  { r= atoi(p);
    return r;
  }
  else
  { (void) unget();
    return EINT;
  }
}
