Reform string library.
[pspp-builds.git] / src / language / lexer / q2c.c
index c4bfef6dfc1f03d583aa6d70e0dddd6545f430a9..2919bd5b24d6abd172dca0f6888ba75ece084e40 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
 
@@ -336,7 +325,7 @@ find_symbol (int x)
   return iter;
 }
 
-#if DEBUGGING 
+#if DUMP_TOKENS 
 /* Writes a printable representation of the current token to
    stdout. */
 static void
@@ -354,7 +343,7 @@ dump_token (void)
       printf ("PUNCT\t%c\n", token);
     }
 }
-#endif /* DEBUGGING */
+#endif /* DUMP_TOKENS */
 
 /* Reads a token from the input file. */
 static int
@@ -404,7 +393,7 @@ lex_get (void)
   else
     token = *cp++;
   
-#if DEBUGGING
+#if DUMP_TOKENS
   dump_token ();
 #endif
   
@@ -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)