/* Keywords of the configuration language */
+
#include "tac_plus.h"
+#include "parse.h"
+#include "utils.h"
+#include "report.h"
+#include "hash.h"
+
+
static void *wordtable[HASH_TAB_SIZE]; /* Table of keyword declarations */
struct keyword {
typedef struct keyword KEYWORD;
+static void declare TAC_ARGS((char *name, int value));
+
static void
declare(name, value)
char *name;
/* Declare keywords of the "configuration language". */
-void
+void parser_init TAC_ARGS((void));
+
+void
parser_init()
{
bzero(wordtable, sizeof(wordtable));
declare("group", S_group);
declare("global", S_global);
declare("host", S_host);
- declare("type", S_type);
declare("ip", S_ip);
declare("ipx", S_ipx);
declare("key", S_key);
declare("service", S_svc);
declare("user", S_user);
declare("time", S_time);
+ declare("and", S_and);
+ declare("closeparen", S_closeparen);
+ declare("enlist", S_enlist);
+ declare("first", S_first);
+ declare("not", S_not);
+ declare("openparen", S_openparen);
+ declare("or", S_or);
+ declare("recursive", S_recursive);
+ declare("when", S_when);
}
+int keycode TAC_ARGS((const char *keyword));
+
/* Return a keyword code if a keyword is recognized. 0 otherwise */
int
keycode(keyword)
-char *keyword;
+const char *keyword;
{
KEYWORD *k = hash_lookup(wordtable, keyword);
return (S_unknown);
}
-char *
+const char *codestring TAC_ARGS((int type));
+
+const char *
codestring(type)
int type;
{
return ("group");
case S_host:
return ("host");
- case S_type:
- return ("type");
case S_file:
return ("file");
case S_skey:
#ifdef USE_PAM
case S_pam:
return ("pam");
-#endif /*USE_PAM */
+#endif /*USE_PAM */
case S_nopasswd:
return("nopassword");
case S_des:
return("lcp");
case S_time:
return("time");
+ case S_and:
+ return("and");
+ case S_closeparen:
+ return(")");
+ case S_enlist:
+ return("enlist");
+ case S_first:
+ return("first");
+ case S_not:
+ return("not");
+ case S_openparen:
+ return("(");
+ case S_or:
+ return("or");
+ case S_recursive:
+ return("recursive");
+ case S_when:
+ return("when");
}
}