Move var_set and variable parsing declarations into new header.
[pspp-builds.git] / src / language / lexer / q2c.c
index 72ce7addc9f6ebcdf9d2a047e66c9c0c22347cb0..d66dcc01ca00e602331565926e94d83fbf56315e 100644 (file)
 #include <unistd.h>
 #include <libpspp/compiler.h>
 #include <libpspp/str.h>
-
-
-/* Brokenness. */
-#ifndef EXIT_SUCCESS
-#define EXIT_SUCCESS 0
-#endif
-
-#ifndef EXIT_FAILURE
-#define EXIT_FAILURE 1
-#endif
+#include "exit.h"
 
      
-#include <libpspp/debug-print.h>
-
 /* Max length of an input line. */
 #define MAX_LINE_LEN 1024
 
@@ -1635,7 +1624,7 @@ dump_subcommand (const subcommand *sbc)
          outdent ();
        }
       dump (0, "free(p->s_%s);", st_lower(sbc->name) );
-      dump (0, "p->s_%s = xstrdup (ds_c_str (&tokstr));",
+      dump (0, "p->s_%s = ds_xstrdup (&tokstr);",
            st_lower (sbc->name));
       dump (0, "lex_get ();");
       if (sbc->restriction)
@@ -1942,9 +1931,11 @@ dump_free (int persistent)
              dump (0, "free (p->s_%s);", st_lower (sbc->name));
              break;
            case SBC_DBL_LIST:
-             dump (0, "int i;");
-             dump (1, "for(i = 0; i < MAXLISTS ; ++i)");
-             dump (0, "subc_list_double_destroy(&p->dl_%s[i]);", st_lower (sbc->name));
+              dump (0, "{");
+             dump (1, "int i;");
+             dump (2, "for(i = 0; i < MAXLISTS ; ++i)");
+             dump (1, "subc_list_double_destroy(&p->dl_%s[i]);", st_lower (sbc->name));
+              dump (0, "}");
              outdent();
              break;
            default:
@@ -2041,6 +2032,7 @@ main (int argc, char *argv[])
          dump (0, "#include <libpspp/alloc.h>");
          dump (0, "#include <libpspp/message.h>");
          dump (0, "#include <language/lexer/lexer.h>");
+         dump (0, "#include <language/lexer/variable-parser.h>");
           dump (0, "#include <data/settings.h>");
          dump (0, "#include <libpspp/str.h>");
           dump (0, "#include <language/lexer/subcommand-list.h>");