X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flanguage%2Futilities%2Fset.q;h=ddc7fc629da3b671a85b25f435999371aee0647c;hb=3b03678858485b01277d7488323613fb28691834;hp=8b06448fe474fd9f2540d7036fe5aabb5e8d556f;hpb=5cab4cf3322f29c0ed7134d23740e07382914f20;p=pspp diff --git a/src/language/utilities/set.q b/src/language/utilities/set.q index 8b06448fe4..ddc7fc629d 100644 --- a/src/language/utilities/set.q +++ b/src/language/utilities/set.q @@ -48,6 +48,7 @@ #include "math/random.h" #include "output/driver.h" #include "output/journal.h" +#include "output/pivot-table.h" #if HAVE_LIBTERMCAP #if HAVE_TERMCAP_H @@ -113,6 +114,7 @@ int tgetnum (const char *); tvars=custom; tb1=string; tbfonts=string; + tlook=custom; undefined=undef:warn/nowarn; wib=wib:msbfirst/lsbfirst/vax/native; wrb=wrb:native/isl/isb/idl/idb/vf/vd/vg/zs/zl; @@ -353,7 +355,7 @@ stc_custom_tnumbers (struct lexer *lexer, settings_set_show_values (SETTINGS_VALUE_SHOW_BOTH); else { - lex_error_expecting (lexer, "VALUES", "LABELS", "BOTH", NULL_SENTINEL); + lex_error_expecting (lexer, "VALUES", "LABELS", "BOTH"); return 0; } @@ -376,13 +378,41 @@ stc_custom_tvars (struct lexer *lexer, settings_set_show_variables (SETTINGS_VALUE_SHOW_BOTH); else { - lex_error_expecting (lexer, "NAMES", "LABELS", "BOTH", NULL_SENTINEL); + lex_error_expecting (lexer, "NAMES", "LABELS", "BOTH"); return 0; } return 1; } +static int +stc_custom_tlook (struct lexer *lexer, + struct dataset *ds UNUSED, + struct cmd_set *cmd UNUSED, void *aux UNUSED) +{ + lex_match (lexer, T_EQUALS); + + if (lex_match_id (lexer, "NONE")) + pivot_table_look_set_default (pivot_table_look_builtin_default ()); + else if (lex_is_string (lexer)) + { + struct pivot_table_look *look; + char *error = pivot_table_look_read (lex_tokcstr (lexer), &look); + lex_get (lexer); + + if (error) + { + msg (SE, "%s", error); + free (error); + return 0; + } + + pivot_table_look_set_default (look); + pivot_table_look_unref (look); + } + + return 1; +} /* Parses the EPOCH subcommand, which controls the epoch used for parsing 2-digit years. */