Fix lack of ->name and ->location in DO REPEAT's getl_interface.
[pspp-builds.git] / src / language / utilities / set.q
index ed7bbbf74fa77a1a2743070ba218083ba5caa95f..e47993e0ec38880104d44882e98ea55f5a8d8627 100644 (file)
@@ -24,6 +24,7 @@
 #include <stdlib.h>
 #include <time.h>
 
+#include <data/data-in.h>
 #include <data/data-out.h>
 #include <data/dictionary.h>
 #include <data/format.h>
@@ -33,7 +34,7 @@
 #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) 
 {
@@ -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},