Imported Upstream version 1.8.7
[debian/sudo] / plugins / sudoers / regress / parser / check_fill.c
index e0f39214f869687d4ffc935cb7c751d7856a8e81..5fc96d7264dc86fe70ba51991a788d9f24497dc7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 2011-2013 Todd C. Miller <Todd.Miller@courtesan.com>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
 
 #define SUDO_ERROR_WRAP 0
 
+#include "missing.h"
 #include "list.h"
 #include "parse.h"
 #include "toke.h"
 #include "sudo_plugin.h"
 #include <gram.h>
 
+__dso_public int main(int argc, char *argv[]);
+
 /*
  * TODO: test realloc
  */
 
-sudo_conv_t sudo_conv;         /* NULL in non-plugin */
-
-YYSTYPE yylval;
+YYSTYPE sudoerslval;
 
 struct fill_test {
     const char *input;
@@ -106,8 +107,8 @@ check_fill(const char *input, int len, int addspace, const char *expect, char **
 {
     if (!fill(input, len))
        return -1;
-    *resultp = yylval.string;
-    return !strcmp(yylval.string, expect);
+    *resultp = sudoerslval.string;
+    return !strcmp(sudoerslval.string, expect);
 }
 
 static int
@@ -115,8 +116,8 @@ check_fill_cmnd(const char *input, int len, int addspace, const char *expect, ch
 {
     if (!fill_cmnd(input, len))
        return -1;
-    *resultp = yylval.command.cmnd;
-    return !strcmp(yylval.command.cmnd, expect);
+    *resultp = sudoerslval.command.cmnd;
+    return !strcmp(sudoerslval.command.cmnd, expect);
 }
 
 static int
@@ -124,8 +125,8 @@ check_fill_args(const char *input, int len, int addspace, const char *expect, ch
 {
     if (!fill_args(input, len, addspace))
        return -1;
-    *resultp = yylval.command.args;
-    return !strcmp(yylval.command.args, expect);
+    *resultp = sudoerslval.command.args;
+    return !strcmp(sudoerslval.command.args, expect);
 }
 
 static int
@@ -184,14 +185,7 @@ main(int argc, char *argv[])
 
 /* STUB */
 void
-cleanup(int gotsig)
-{
-    return;
-}
-
-/* STUB */
-void
-yyerror(const char *s)
+sudoerserror(const char *s)
 {
     return;
 }