Add #include <config.h>.
[pspp-builds.git] / src / language / utilities / set.q
index ed7bbbf74fa77a1a2743070ba218083ba5caa95f..4fdcc578f7dff5bc4dcee7c178f0519bafde5d4e 100644 (file)
@@ -1,6 +1,5 @@
 /* PSPP - computes sample statistics.
    Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
-   Written by Ben Pfaff <blp@gnu.org>.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
 #include <stdlib.h>
 #include <time.h>
 
+#include <data/data-in.h>
 #include <data/data-out.h>
 #include <data/dictionary.h>
 #include <data/format.h>
 #include <data/procedure.h>
 #include <data/settings.h>
+#include <data/value.h>
 #include <data/variable.h>
 #include <language/command.h>
 #include <language/lexer/format-parser.h>
 #include <language/lexer/lexer.h>
-#include <language/line-buffer.h>
+#include <language/prompt.h>
 #include <libpspp/alloc.h>
 #include <libpspp/compiler.h>
 #include <libpspp/copyleft.h>
@@ -102,6 +103,8 @@ int tgetnum (const char *);
      printback=prtbck:on/off;
      prompt=string;
      results=res:on/off/terminal/listing/both/on/none/off;
+     rib=rib:msbfirst/lsbfirst/vax/native;
+     rrb=rrb:native/isl/isb/idl/idb/vf/vd/vg/zs/zl;
      safer=safe:on;
      scompression=scompress:on/off;
      scripttab=string "x==1" "one character long";
@@ -149,11 +152,11 @@ cmd_set (struct lexer *lexer, struct dataset *ds)
     do_cc (cmd.s_cce, FMT_CCE);
 
   if (cmd.sbc_prompt)
-    getl_set_prompt (GETL_PROMPT_FIRST, cmd.s_prompt);
+    prompt_set (PROMPT_FIRST, cmd.s_prompt);
   if (cmd.sbc_cprompt)
-    getl_set_prompt (GETL_PROMPT_LATER, cmd.s_cprompt);
+    prompt_set (PROMPT_LATER, cmd.s_cprompt);
   if (cmd.sbc_dprompt)
-    getl_set_prompt (GETL_PROMPT_DATA, cmd.s_dprompt);
+    prompt_set (PROMPT_DATA, cmd.s_dprompt);
 
   if (cmd.sbc_decimal)
     fmt_set_decimal (cmd.dec == STC_DOT ? '.' : ',');
@@ -177,6 +180,10 @@ cmd_set (struct lexer *lexer, struct dataset *ds)
     set_mxwarns (cmd.n_mxwarns[0]);
   if (cmd.sbc_nulline)
     set_nulline (cmd.null == STC_ON);
+  if (cmd.sbc_rib)
+    data_in_set_integer_format (stc_to_integer_format (cmd.rib));
+  if (cmd.sbc_rrb)
+    data_in_set_float_format (stc_to_float_format (cmd.rrb));
   if (cmd.sbc_safer)
     set_safer_mode ();
   if (cmd.sbc_scompression)
@@ -362,7 +369,7 @@ stc_custom_blanks (struct lexer *lexer,
                   struct cmd_set *cmd UNUSED, void *aux UNUSED)
 {
   lex_match (lexer, '=');
-  if ((lex_token (lexer) == T_ID && lex_id_match ("SYSMIS", lex_tokid (lexer))))
+  if (lex_match_id (lexer, "SYSMIS"))
     {
       lex_get (lexer);
       set_blanks (SYSMIS);
@@ -730,6 +737,18 @@ show_float_format (const char *setting, enum float_format float_format)
        float_format == FLOAT_NATIVE_DOUBLE ? "NATIVE" : "nonnative");
 }
 
+static void
+show_rib (const struct dataset *ds UNUSED) 
+{
+  show_integer_format ("RIB", data_in_get_integer_format ());
+}
+
+static void
+show_rrb (const struct dataset *ds UNUSED) 
+{
+  show_float_format ("RRB", data_in_get_float_format ());
+}
+
 static void
 show_scompression (const struct dataset *ds UNUSED) 
 {
@@ -755,7 +774,7 @@ show_weight (const struct dataset *ds)
   if (var == NULL)
     msg (SN, _("WEIGHT is off."));
   else
-    msg (SN, _("WEIGHT is variable %s."), var->name);
+    msg (SN, _("WEIGHT is variable %s."), var_get_name (var));
 }
 
 static void
@@ -798,6 +817,8 @@ const struct show_sbc show_table[] =
     {"MXERRS", show_mxerrs},
     {"MXLOOPS", show_mxloops},
     {"MXWARNS", show_mxwarns},
+    {"RIB", show_rib},
+    {"RRB", show_rrb},
     {"SCOMPRESSION", show_scompression},
     {"UNDEFINED", show_undefined},
     {"WEIGHT", show_weight},