/*****************************************************************************
+** FILE IDENTIFICATION
+**
+** POL - Problem Oriented Language
+**
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ezpol.cpp,v 1.1 2000/06/19 18:05:03 kevin Exp $
+** $Id: ezpol.cpp,v 1.3 2000/07/13 07:03:21 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
******************************************************************************/
-/*----------------------------------------------------------------------*/
-/* POL - Problem Oriented Language */
/* */
/*----------------------------------------------------------------------*/
#include <math.h>
-#include "ascii.h"
-#include "stdio.h"
-#include "kstddef.h"
-#include "ctype.h"
+#include <stdio.h>
+#include <ctype.h>
+#include "ctsupport.h"
#include "pol.h"
-#define HASHSIZE 20
-/* Tables words stored with install() & found with lookup() */
+static const int HASHSIZE=20;
+
+/* Tables words stored with install() & found with lookup() */
static SYMBOL *skiptable[HASHSIZE]; /* words to ignore and skip */
static SYMBOL *cmdtable[HASHSIZE]; /* pol parameter commands */
static SYMBOL *usertable[HASHSIZE]; /* user defined symbols */
#define NUMCMD (sizeof(cmdlist) / sizeof (struct key))
-static int ignorecase = TRUE;
-
static int skiptok(char term[]);
static int pol_tok(struct token_st *token);
static void dumptok(struct token_st *token);
void pol_init (void)
{
- int i;
-
meta.eoc = SEMICOL;
meta.str = DQUOTE;
meta.com = SHARP;
inittable (usertable);
inittable (skiptable);
- for (i = 0; i < NUMCMD; i++)
+ for (unsigned int i = 0; i < NUMCMD; i++)
install (cmdtable, cmdlist[i].keyword, cmdlist[i].code);
token.ready = FALSE; /* no token read yet */
int pol_inchar(void)
{
- int c;
+ int c = 0;
- if (currentf < 0)
- return (EOF);
+ if (currentf < 0)
+ return (EOF);
- while (currentf >= 0 && (c = pol_getch(filep[currentf])) == EOF && filep[currentf] != NULL) {
- pol_closefile ();
- }
+ while (currentf >= 0 && (c = pol_getch(filep[currentf])) == EOF && filep[currentf] != NULL) {
+ pol_closefile ();
+ }
- return (c);
+ return (c);
}
/*--------------------------------------------------------------*/