-/* $NetBSD: input.c,v 1.23 2009/05/26 00:00:56 dholland Exp $ */
+/* $NetBSD: input.c,v 1.24 2009/08/12 04:48:03 dholland Exp $ */
/*-
* Copyright (c) 1990, 1993
#if 0
static char sccsid[] = "@(#)input.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: input.c,v 1.23 2009/05/26 00:00:56 dholland Exp $");
+__RCSID("$NetBSD: input.c,v 1.24 2009/08/12 04:48:03 dholland Exp $");
#endif
#endif /* not lint */
#include "include.h"
#include "pathnames.h"
+static void rezero(void);
+static void noise(void);
+static int gettoken(void);
+static const char *setplane(int);
+static const char *turn(int);
+static const char *circle(int);
+static const char *left(int);
+static const char *right(int);
+static const char *Left(int);
+static const char *Right(int);
+static const char *delayb(int);
+static const char *beacon(int);
+static const char *ex_it(int);
+static const char *airport(int);
+static const char *climb(int);
+static const char *descend(int);
+static const char *setalt(int);
+static const char *setrelalt(int);
+static const char *benum(int);
+static const char *to_dir(int);
+static const char *rel_dir(int);
+static const char *mark(int);
+static const char *unmark(int);
+static const char *ignore(int);
+
+
+
#define MAXRULES 6
#define MAXDEPTH 15
#define NUMSTATES NUMELS(st)
-
+static
RULE state0[] = { { ALPHATOKEN, 1, "%c:", setplane},
{ RETTOKEN, -1, "", NULL },
{ HELPTOKEN, 12, " [a-z]<ret>", NULL }},
#define DEF_STATE(s) { NUMELS(s), (s) }
-STATE st[] = {
+static STATE st[] = {
DEF_STATE(state0), DEF_STATE(state1), DEF_STATE(state2),
DEF_STATE(state3), DEF_STATE(state4), DEF_STATE(state5),
DEF_STATE(state6), DEF_STATE(state7), DEF_STATE(state8),
DEF_STATE(state12)
};
-PLANE p;
-STACK stack[MAXDEPTH];
-int level;
-int tval;
-int dest_type, dest_no, dir;
+static PLANE p;
+static STACK stack[MAXDEPTH];
+static int level;
+static int tval;
+static int dest_type, dest_no, dir;
-int
+static int
pop(void)
{
if (level == 0)
return (0);
}
-void
+static void
rezero(void)
{
iomove(0);
(void)strcpy(T_STR, "");
}
-void
+static void
push(int ruleno, int ch)
{
int newstate, newpos;
return (0);
}
-void
+static void
noise(void)
{
(void)putchar('\07');
(void)fflush(stdout);
}
-int
+static int
gettoken(void)
{
while ((tval = getAChar()) == REDRAWTOKEN || tval == SHELLTOKEN)
return (tval);
}
-const char *
+static const char *
setplane(int c)
{
PLANE *pp;
}
/* ARGSUSED */
-const char *
+static const char *
turn(int c __unused)
{
if (p.altitude == 0)
}
/* ARGSUSED */
-const char *
+static const char *
circle(int c __unused)
{
if (p.altitude == 0)
}
/* ARGSUSED */
-const char *
+static const char *
left(int c __unused)
{
dir = D_LEFT;
}
/* ARGSUSED */
-const char *
+static const char *
right(int c __unused)
{
dir = D_RIGHT;
}
/* ARGSUSED */
-const char *
+static const char *
Left(int c __unused)
{
p.new_dir = p.dir - 2;
}
/* ARGSUSED */
-const char *
+static const char *
Right(int c __unused)
{
p.new_dir = p.dir + 2;
return (NULL);
}
-const char *
+static const char *
delayb(int c)
{
int xdiff, ydiff;
}
/* ARGSUSED */
-const char *
+static const char *
beacon(int c __unused)
{
dest_type = T_BEACON;
}
/* ARGSUSED */
-const char *
+static const char *
ex_it(int c __unused)
{
dest_type = T_EXIT;
}
/* ARGSUSED */
-const char *
+static const char *
airport(int c __unused)
{
dest_type = T_AIRPORT;
}
/* ARGSUSED */
-const char *
+static const char *
climb(int c __unused)
{
dir = D_UP;
}
/* ARGSUSED */
-const char *
+static const char *
descend(int c __unused)
{
dir = D_DOWN;
return (NULL);
}
-const char *
+static const char *
setalt(int c)
{
int newalt = c - '0';
return (NULL);
}
-const char *
+static const char *
setrelalt(int c)
{
int newalt;
return (NULL);
}
-const char *
+static const char *
benum(int c)
{
dest_no = c -= '0';
return (NULL);
}
-const char *
+static const char *
to_dir(int c)
{
p.new_dir = dir_no(c);
return (NULL);
}
-const char *
+static const char *
rel_dir(int c)
{
int angle;
}
/* ARGSUSED */
-const char *
+static const char *
mark(int c __unused)
{
if (p.altitude == 0)
}
/* ARGSUSED */
-const char *
+static const char *
unmark(int c __unused)
{
if (p.altitude == 0)
}
/* ARGSUSED */
-const char *
+static const char *
ignore(int c __unused)
{
if (p.altitude == 0)